New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 14072 for NEMO/trunk/src/OCE/LBC – NEMO

Ignore:
Timestamp:
2020-12-04T08:48:38+01:00 (3 years ago)
Author:
laurent
Message:

Merging branch "2020/dev_r13648_ASINTER-04_laurent_bulk_ice", ticket #2369

Location:
NEMO/trunk/src/OCE/LBC
Files:
4 edited
2 copied

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/LBC/lbclnk.F90

    r13982 r14072  
    66   !! History :  OPA  ! 1997-06  (G. Madec)  Original code 
    77   !!   NEMO     1.0  ! 2002-09  (G. Madec)  F90: Free form and module 
    8    !!            3.2  ! 2009-03  (R. Benshila)  External north fold treatment   
     8   !!            3.2  ! 2009-03  (R. Benshila)  External north fold treatment 
    99   !!            3.5  ! 2012     (S.Mocavero, I. Epicoco)  optimization of BDY comm. via lbc_bdy_lnk and lbc_obc_lnk 
    10    !!            3.4  ! 2012-12  (R. Bourdalle-Badie, G. Reffray)  add a C1D case   
    11    !!            3.6  ! 2015-06  (O. Tintó and M. Castrillo)  add lbc_lnk_multi   
     10   !!            3.4  ! 2012-12  (R. Bourdalle-Badie, G. Reffray)  add a C1D case 
     11   !!            3.6  ! 2015-06  (O. Tintó and M. Castrillo)  add lbc_lnk_multi 
    1212   !!            4.0  ! 2017-03  (G. Madec) automatique allocation of array size (use with any 3rd dim size) 
    1313   !!             -   ! 2017-04  (G. Madec) remove duplicated routines (lbc_lnk_2d_9, lbc_lnk_2d_multiple, lbc_lnk_3d_gather) 
     
    5757      MODULE PROCEDURE   mpp_nfd_2d_ptr_sp, mpp_nfd_3d_ptr_sp, mpp_nfd_4d_ptr_sp 
    5858      MODULE PROCEDURE   mpp_nfd_2d_ptr_dp, mpp_nfd_3d_ptr_dp, mpp_nfd_4d_ptr_dp 
    59        
     59 
    6060   END INTERFACE 
    6161 
     
    527527#     include "mpp_lbc_north_icb_generic.h90" 
    528528#     undef ROUTINE_LNK 
    529   
     529 
    530530 
    531531      !!---------------------------------------------------------------------- 
     
    559559#     include "mpp_lnk_icb_generic.h90" 
    560560#     undef ROUTINE_LNK 
    561    
     561 
    562562END MODULE lbclnk 
    563  
  • NEMO/trunk/src/OCE/LBC/lib_mpp.F90

    r13982 r14072  
    2020   !!            4.0  !  2011  (G. Madec)  move ctl_ routines from in_out_manager 
    2121   !!            3.5  !  2012  (S.Mocavero, I. Epicoco) Add mpp_lnk_bdy_3d/2d routines to optimize the BDY comm. 
    22    !!            3.5  !  2013  (C. Ethe, G. Madec)  message passing arrays as local variables  
     22   !!            3.5  !  2013  (C. Ethe, G. Madec)  message passing arrays as local variables 
    2323   !!            3.5  !  2013  (S.Mocavero, I.Epicoco - CMCC) north fold optimizations 
    2424   !!            3.6  !  2015  (O. Tintó and M. Castrillo - BSC) Added '_multiple' case for 2D lbc and max 
     
    7777   PUBLIC MPI_Wtime 
    7878#endif 
    79     
     79 
    8080   !! * Interfaces 
    8181   !! define generic interface for these routine as they are called sometimes 
     
    115115!$AGRIF_END_DO_NOT_TREAT 
    116116   LOGICAL, PUBLIC, PARAMETER ::   lk_mpp = .TRUE.    !: mpp flag 
    117 #else    
     117#else 
    118118   INTEGER, PUBLIC, PARAMETER ::   MPI_STATUS_SIZE = 1 
    119119   INTEGER, PUBLIC, PARAMETER ::   MPI_REAL = 4 
     
    183183   REAL(dp), DIMENSION(2), PUBLIC ::  waiting_time = 0._dp 
    184184   REAL(dp)              , PUBLIC ::  compute_time = 0._dp, elapsed_time = 0._dp 
    185     
     185 
    186186   REAL(wp), DIMENSION(:), ALLOCATABLE, SAVE ::   tampon   ! buffer in case of bsend 
    187187 
    188188   LOGICAL, PUBLIC ::   ln_nnogather                !: namelist control of northfold comms 
    189189   LOGICAL, PUBLIC ::   l_north_nogather = .FALSE.  !: internal control of northfold comms 
    190     
     190 
    191191   !! * Substitutions 
    192192#  include "do_loop_substitute.h90" 
     
    223223         IF( ierr /= MPI_SUCCESS ) CALL ctl_stop( 'STOP', ' lib_mpp: Error in routine mpi_init' ) 
    224224      ENDIF 
    225         
     225 
    226226      IF( PRESENT(localComm) ) THEN 
    227227         IF( Agrif_Root() ) THEN 
     
    473473   END SUBROUTINE mppscatter 
    474474 
    475     
     475 
    476476   SUBROUTINE mpp_delay_sum( cdname, cdelay, y_in, pout, ldlast, kcom ) 
    477477     !!---------------------------------------------------------------------- 
     
    498498 
    499499      isz = SIZE(y_in) 
    500        
     500 
    501501      IF( narea == 1 .AND. numcom == -1 ) CALL mpp_report( cdname, ld_dlg = .TRUE. ) 
    502502 
     
    519519         END IF 
    520520      ENDIF 
    521        
     521 
    522522      IF( ndelayid(idvar) == -1 ) THEN         ! first call without restart: define %y1d and %z1d from y_in with blocking allreduce 
    523523         !                                       -------------------------- 
     
    547547   END SUBROUTINE mpp_delay_sum 
    548548 
    549     
     549 
    550550   SUBROUTINE mpp_delay_max( cdname, cdelay, p_in, pout, ldlast, kcom ) 
    551551      !!---------------------------------------------------------------------- 
     
    557557      CHARACTER(len=*), INTENT(in   )                 ::   cdname  ! name of the calling subroutine 
    558558      CHARACTER(len=*), INTENT(in   )                 ::   cdelay  ! name (used as id) of the delayed operation 
    559       REAL(wp),         INTENT(in   ), DIMENSION(:)   ::   p_in    !  
    560       REAL(wp),         INTENT(  out), DIMENSION(:)   ::   pout    !  
     559      REAL(wp),         INTENT(in   ), DIMENSION(:)   ::   p_in    ! 
     560      REAL(wp),         INTENT(  out), DIMENSION(:)   ::   pout    ! 
    561561      LOGICAL,          INTENT(in   )                 ::   ldlast  ! true if this is the last time we call this routine 
    562562      INTEGER,          INTENT(in   ), OPTIONAL       ::   kcom 
     
    567567      INTEGER ::   MPI_TYPE 
    568568      !!---------------------------------------------------------------------- 
    569        
     569 
    570570#if defined key_mpp_mpi 
    571571      if( wp == dp ) then 
     
    575575      else 
    576576        CALL ctl_stop( "Error defining type, wp is neither dp nor sp" ) 
    577     
     577 
    578578      end if 
    579579 
     
    629629   END SUBROUTINE mpp_delay_max 
    630630 
    631     
     631 
    632632   SUBROUTINE mpp_delay_rcv( kid ) 
    633633      !!---------------------------------------------------------------------- 
    634634      !!                   ***  routine mpp_delay_rcv  *** 
    635635      !! 
    636       !! ** Purpose :  force barrier for delayed mpp (needed for restart)  
    637       !! 
    638       !!---------------------------------------------------------------------- 
    639       INTEGER,INTENT(in   )      ::  kid  
     636      !! ** Purpose :  force barrier for delayed mpp (needed for restart) 
     637      !! 
     638      !!---------------------------------------------------------------------- 
     639      INTEGER,INTENT(in   )      ::  kid 
    640640      INTEGER ::   ierr 
    641641      !!---------------------------------------------------------------------- 
     
    674674   END SUBROUTINE mpp_bcast_nml 
    675675 
    676     
     676 
    677677   !!---------------------------------------------------------------------- 
    678678   !!    ***  mppmax_a_int, mppmax_int, mppmax_a_real, mppmax_real  *** 
    679    !!    
     679   !! 
    680680   !!---------------------------------------------------------------------- 
    681681   !! 
     
    729729   !!---------------------------------------------------------------------- 
    730730   !!    ***  mppmin_a_int, mppmin_int, mppmin_a_real, mppmin_real  *** 
    731    !!    
     731   !! 
    732732   !!---------------------------------------------------------------------- 
    733733   !! 
     
    781781   !!---------------------------------------------------------------------- 
    782782   !!    ***  mppsum_a_int, mppsum_int, mppsum_a_real, mppsum_real  *** 
    783    !!    
     783   !! 
    784784   !!   Global sum of 1D array or a variable (integer, real or complex) 
    785785   !!---------------------------------------------------------------------- 
     
    855855   !!---------------------------------------------------------------------- 
    856856   !!    ***  mpp_minloc2d, mpp_minloc3d, mpp_maxloc2d, mpp_maxloc3d 
    857    !!    
     857   !! 
    858858   !!---------------------------------------------------------------------- 
    859859   !! 
     
    935935 
    936936 
    937    SUBROUTINE mppstop( ld_abort )  
     937   SUBROUTINE mppstop( ld_abort ) 
    938938      !!---------------------------------------------------------------------- 
    939939      !!                  ***  routine mppstop  *** 
     
    10801080      !!                collectives 
    10811081      !! 
    1082       !! ** Method  : - Create graph communicators starting from the processes    
     1082      !! ** Method  : - Create graph communicators starting from the processes 
    10831083      !!                distribution along i and j directions 
    10841084      ! 
     
    14111411                  jj = 0 
    14121412               END IF 
    1413                jj = jj + 1  
     1413               jj = jj + 1 
    14141414            END DO 
    14151415            WRITE(numcom,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname_glb(n_sequence_glb)) 
     
    14271427                  jj = 0 
    14281428               END IF 
    1429                jj = jj + 1  
     1429               jj = jj + 1 
    14301430            END DO 
    14311431            WRITE(numcom,'(A, I4, A, A)') ' - ', jj,' times by subroutine ', TRIM(crname_dlg(n_sequence_dlg)) 
     
    14431443   END SUBROUTINE mpp_report 
    14441444 
    1445     
     1445 
    14461446   SUBROUTINE tic_tac (ld_tic, ld_global) 
    14471447 
     
    14591459       IF( ld_global ) ii = 2 
    14601460    END IF 
    1461      
     1461 
    14621462    IF ( ld_tic ) THEN 
    14631463       tic_wt(ii) = MPI_Wtime()                                                    ! start count tic->tac (waiting time) 
     
    14681468    ENDIF 
    14691469#endif 
    1470      
     1470 
    14711471   END SUBROUTINE tic_tac 
    14721472 
     
    14781478   END SUBROUTINE mpi_wait 
    14791479 
    1480     
     1480 
    14811481   FUNCTION MPI_Wtime() 
    14821482      REAL(wp) ::  MPI_Wtime 
     
    15401540      ! 
    15411541      IF( cd1 == 'STOP' ) THEN 
    1542          WRITE(numout,*)   
     1542         WRITE(numout,*) 
    15431543         WRITE(numout,*)  'huge E-R-R-O-R : immediate stop' 
    1544          WRITE(numout,*)   
     1544         WRITE(numout,*) 
    15451545         CALL FLUSH(numout) 
    15461546         CALL SLEEP(60)   ! make sure that all output and abort files are written by all cores. 60s should be enough... 
     
    16391639      ENDIF 
    16401640      IF( iost /= 0 .AND. TRIM(clfile) == '/dev/null' ) &   ! for windows 
    1641          &  OPEN(UNIT=knum,FILE='NUL', FORM=cdform, ACCESS=cdacce, STATUS=cdstat                      , ERR=100, IOSTAT=iost )    
     1641         &  OPEN(UNIT=knum,FILE='NUL', FORM=cdform, ACCESS=cdacce, STATUS=cdstat                      , ERR=100, IOSTAT=iost ) 
    16421642      IF( iost == 0 ) THEN 
    16431643         IF(ldwp .AND. kout > 0) THEN 
     
    16811681      ! 
    16821682      WRITE (clios, '(I5.0)')   kios 
    1683       IF( kios < 0 ) THEN          
     1683      IF( kios < 0 ) THEN 
    16841684         CALL ctl_warn( 'end of record or file while reading namelist '   & 
    16851685            &           // TRIM(cdnam) // ' iostat = ' // TRIM(clios) ) 
     
    17271727      !csp = NEW_LINE('A') 
    17281728      ! a new line character is the best seperator but some systems (e.g.Cray) 
    1729       ! seem to terminate namelist reads from internal files early if they  
     1729      ! seem to terminate namelist reads from internal files early if they 
    17301730      ! encounter new-lines. Use a single space for safety. 
    17311731      csp = ' ' 
     
    17461746         iltc = LEN_TRIM(chline) 
    17471747         IF ( iltc.GT.0 ) THEN 
    1748           inl = INDEX(chline, '!')  
     1748          inl = INDEX(chline, '!') 
    17491749          IF( inl.eq.0 ) THEN 
    17501750           itot = itot + iltc + 1                                ! +1 for the newline character 
  • NEMO/trunk/src/OCE/LBC/mpp_lnk_generic.h90

    r13982 r14072  
    11#if defined MULTI 
    2 #   define NAT_IN(k)                cd_nat(k)    
     2#   define NAT_IN(k)                cd_nat(k) 
    33#   define SGN_IN(k)                psgn(k) 
    44#   define F_SIZE(ptab)             kfld 
     
    4343#   define SGN_IN(k)                psgn 
    4444#   define F_SIZE(ptab)             1 
    45 #   define OPT_K(k)                  
     45#   define OPT_K(k) 
    4646#   if defined DIM_2d 
    4747#      define ARRAY_IN(i,j,k,l,f)   ptab(i,j) 
     
    9797      REAL(PRECISION), DIMENSION(:,:,:,:,:), ALLOCATABLE ::   zsnd_so, zrcv_so, zsnd_no, zrcv_no   ! north-south & south-north  halos 
    9898      LOGICAL  ::   llsend_we, llsend_ea, llsend_no, llsend_so       ! communication send 
    99       LOGICAL  ::   llrecv_we, llrecv_ea, llrecv_no, llrecv_so       ! communication receive  
     99      LOGICAL  ::   llrecv_we, llrecv_ea, llrecv_no, llrecv_so       ! communication receive 
    100100      LOGICAL  ::   lldo_nfd                                     ! do north pole folding 
    101101      !!---------------------------------------------------------------------- 
     
    133133         llrecv_we = llsend_we   ;   llrecv_ea = llsend_ea   ;   llrecv_so = llsend_so   ;   llrecv_no = llsend_no 
    134134      END IF 
    135           
    136           
     135 
     136 
    137137      lldo_nfd = npolj /= 0                      ! keep for compatibility, should be defined in mppini 
    138138 
     
    178178      ! 
    179179      ! Must exchange the whole column (from 1 to jpj) to get the corners if we have no south/north neighbourg 
    180       isize = nn_hls * jpj * ipk * ipl * ipf       
     180      isize = nn_hls * jpj * ipk * ipl * ipf 
    181181      ! 
    182182      ! Allocate local temporary arrays to be sent/received. Fill arrays to be sent 
     
    220220      ! ishift = 0                         ! fill halo from ji = 1 to nn_hls 
    221221      SELECT CASE ( ifill_we ) 
    222       CASE ( jpfillnothing )               ! no filling  
    223       CASE ( jpfillmpi   )                 ! use data received by MPI  
     222      CASE ( jpfillnothing )               ! no filling 
     223      CASE ( jpfillmpi   )                 ! use data received by MPI 
    224224         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
    225225            ARRAY_IN(ji,jj,jk,jl,jf) = zrcv_we(ji,jj,jk,jl,jf)   ! 1 -> nn_hls 
     
    242242      ! 2.2 fill eastern halo 
    243243      ! --------------------- 
    244       ishift = jpi - nn_hls                ! fill halo from ji = jpi-nn_hls+1 to jpi  
     244      ishift = jpi - nn_hls                ! fill halo from ji = jpi-nn_hls+1 to jpi 
    245245      SELECT CASE ( ifill_ea ) 
    246       CASE ( jpfillnothing )               ! no filling  
    247       CASE ( jpfillmpi   )                 ! use data received by MPI  
     246      CASE ( jpfillnothing )               ! no filling 
     247      CASE ( jpfillmpi   )                 ! use data received by MPI 
    248248         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, jpj   ;   DO ji = 1, nn_hls 
    249249            ARRAY_IN(ishift+ji,jj,jk,jl,jf) = zrcv_ea(ji,jj,jk,jl,jf)   ! jpi - nn_hls + 1 -> jpi 
     
    290290      IF( llrecv_no )   ALLOCATE( zrcv_no(jpi,nn_hls,ipk,ipl,ipf) ) 
    291291      ! 
    292       isize = jpi * nn_hls * ipk * ipl * ipf       
     292      isize = jpi * nn_hls * ipk * ipl * ipf 
    293293 
    294294      ! allocate local temporary arrays to be sent/received. Fill arrays to be sent 
     
    326326      ! ishift = 0                         ! fill halo from jj = 1 to nn_hls 
    327327      SELECT CASE ( ifill_so ) 
    328       CASE ( jpfillnothing )               ! no filling  
    329       CASE ( jpfillmpi   )                 ! use data received by MPI  
     328      CASE ( jpfillnothing )               ! no filling 
     329      CASE ( jpfillmpi   )                 ! use data received by MPI 
    330330         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi 
    331331            ARRAY_IN(ji,jj,jk,jl,jf) = zrcv_so(ji,jj,jk,jl,jf)   ! 1 -> nn_hls 
     
    341341         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO 
    342342      CASE ( jpfillcst   )                 ! filling with constant value 
    343          DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi  
     343         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi 
    344344            ARRAY_IN(ji,jj,jk,jl,jf) = zland 
    345345         END DO   ;   END DO   ;   END DO   ;   END DO   ;   END DO 
     
    348348      ! 5.2 fill northern halo 
    349349      ! ---------------------- 
    350       ishift = jpj - nn_hls                ! fill halo from jj = jpj-nn_hls+1 to jpj  
     350      ishift = jpj - nn_hls                ! fill halo from jj = jpj-nn_hls+1 to jpj 
    351351      SELECT CASE ( ifill_no ) 
    352       CASE ( jpfillnothing )               ! no filling  
    353       CASE ( jpfillmpi   )                 ! use data received by MPI  
     352      CASE ( jpfillnothing )               ! no filling 
     353      CASE ( jpfillmpi   )                 ! use data received by MPI 
    354354         DO jf = 1, ipf   ;   DO jl = 1, ipl   ;   DO jk = 1, ipk   ;   DO jj = 1, nn_hls   ;   DO ji = 1, jpi 
    355355            ARRAY_IN(ji,ishift+jj,jk,jl,jf) = zrcv_no(ji,jj,jk,jl,jf)   ! jpj-nn_hls+1 -> jpj 
  • NEMO/trunk/src/OCE/LBC/mppini.F90

    r14053 r14072  
    99   !!  NEMO      1.0  !  2004-01  (G. Madec, J.M Molines)  F90 : free form , north fold jpni > 1 
    1010   !!            3.4  !  2011-10  (A. C. Coward, NOCS & J. Donners, PRACE)  add init_nfdcom 
    11    !!            3.   !  2013-06  (I. Epicoco, S. Mocavero, CMCC)  init_nfdcom: setup avoiding MPI communication  
     11   !!            3.   !  2013-06  (I. Epicoco, S. Mocavero, CMCC)  init_nfdcom: setup avoiding MPI communication 
    1212   !!            4.0  !  2016-06  (G. Madec)  use domain configuration file instead of bathymetry file 
    1313   !!            4.0  !  2017-06  (J.M. Molines, T. Lovato) merge of mppini and mppini_2 
     
    1616   !!---------------------------------------------------------------------- 
    1717   !!  mpp_init       : Lay out the global domain over processors with/without land processor elimination 
    18    !!      init_ioipsl: IOIPSL initialization in mpp  
     18   !!      init_ioipsl: IOIPSL initialization in mpp 
    1919   !!      init_nfdcom: Setup for north fold exchanges with explicit point-to-point messaging 
    20    !!      init_doloop: set the starting/ending indices of DO-loop used in do_loop_substitute  
     20   !!      init_doloop: set the starting/ending indices of DO-loop used in do_loop_substitute 
    2121   !!---------------------------------------------------------------------- 
    2222   USE dom_oce        ! ocean space and time domain 
    23    USE bdy_oce        ! open BounDarY   
     23   USE bdy_oce        ! open BounDarY 
    2424   ! 
    25    USE lbcnfd  , ONLY : isendto, nsndto ! Setup of north fold exchanges  
     25   USE lbcnfd  , ONLY : isendto, nsndto ! Setup of north fold exchanges 
    2626   USE lib_mpp        ! distribued memory computing library 
    27    USE iom            ! nemo I/O library  
     27   USE iom            ! nemo I/O library 
    2828   USE ioipsl         ! I/O IPSL library 
    2929   USE in_out_manager ! I/O Manager 
     
    3636   PUBLIC   mpp_basesplit  ! called by prtctl 
    3737   PUBLIC   mpp_is_ocean   ! called by prtctl 
    38     
     38 
    3939   INTEGER ::   numbot = -1   ! 'bottom_level' local logical unit 
    4040   INTEGER ::   numbdy = -1   ! 'bdy_msk'      local logical unit 
    41     
     41 
    4242   !!---------------------------------------------------------------------- 
    4343   !! NEMO/OCE 4.0 , NEMO Consortium (2018) 
    44    !! $Id$  
     44   !! $Id$ 
    4545   !! Software governed by the CeCILL license (see ./LICENSE) 
    4646   !!---------------------------------------------------------------------- 
     
    8888      l_Jperio = jpnj == 1 .AND. (jperio == 2 .OR. jperio == 7) 
    8989      ! 
    90       CALL init_doloop                       ! set start/end indices or do-loop depending on the halo width value (nn_hls)  
     90      CALL init_doloop                       ! set start/end indices or do-loop depending on the halo width value (nn_hls) 
    9191      ! 
    9292      IF(lwp) THEN 
     
    9494         WRITE(numout,*) 'mpp_init : NO massively parallel processing' 
    9595         WRITE(numout,*) '~~~~~~~~ ' 
    96          WRITE(numout,*) '   l_Iperio = ', l_Iperio, '    l_Jperio = ', l_Jperio  
     96         WRITE(numout,*) '   l_Iperio = ', l_Iperio, '    l_Jperio = ', l_Jperio 
    9797         WRITE(numout,*) '     npolj  = ',   npolj , '      njmpp  = ', njmpp 
    9898      ENDIF 
     
    114114      !!---------------------------------------------------------------------- 
    115115      !!                  ***  ROUTINE mpp_init  *** 
    116       !!                     
     116      !! 
    117117      !! ** Purpose :   Lay out the global domain over processors. 
    118118      !!      If land processors are to be eliminated, this program requires the 
     
    128128      !! 
    129129      !! ** Action : - set domain parameters 
    130       !!                    nimpp     : longitudinal index  
     130      !!                    nimpp     : longitudinal index 
    131131      !!                    njmpp     : latitudinal  index 
    132132      !!                    narea     : number for local area 
     
    148148      INTEGER ::   iiea, ijea, iiwe, ijwe     !   -       - 
    149149      INTEGER ::   iarea0                     !   -       - 
    150       INTEGER ::   ierr, ios                  !  
     150      INTEGER ::   ierr, ios                  ! 
    151151      INTEGER ::   inbi, inbj, iimax,  ijmax, icnt1, icnt2 
    152152      LOGICAL ::   llbest, llauto 
     
    162162      NAMELIST/nambdy/ ln_bdy, nb_bdy, ln_coords_file, cn_coords_file,           & 
    163163           &             ln_mask_file, cn_mask_file, cn_dyn2d, nn_dyn2d_dta,     & 
    164            &             cn_dyn3d, nn_dyn3d_dta, cn_tra, nn_tra_dta,             &   
     164           &             cn_dyn3d, nn_dyn3d_dta, cn_tra, nn_tra_dta,             & 
    165165           &             ln_tra_dmp, ln_dyn3d_dmp, rn_time_dmp, rn_time_dmp_out, & 
    166166           &             cn_ice, nn_ice_dta,                                     & 
     
    177177901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'nammpp in reference namelist' ) 
    178178      READ  ( numnam_cfg, nammpp, IOSTAT = ios, ERR = 902 ) 
    179 902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist' )    
     179902   IF( ios >  0 )   CALL ctl_nam ( ios , 'nammpp in configuration namelist' ) 
    180180      ! 
    181181      nn_hls = MAX(1, nn_hls)   ! nn_hls must be > 0 
     
    259259         ENDIF 
    260260      ENDIF 
    261        
     261 
    262262      ! look for land mpi subdomains... 
    263263      ALLOCATE( llisoce(jpni,jpnj) ) 
     
    333333      CALL mpp_sum( 'mppini', ierr ) 
    334334      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'mpp_init: unable to allocate standard ocean arrays' ) 
    335        
     335 
    336336#if defined key_agrif 
    337337      IF( .NOT. Agrif_Root() ) THEN       ! AGRIF children: specific setting (cf. agrif_user.F90) 
     
    354354      !   nfjpi (jn) =   ijpi(ii,ij) 
    355355      !END DO 
    356       nfproc(:) = ipproc(:,jpnj)  
    357       nfimpp(:) = iimppt(:,jpnj)  
     356      nfproc(:) = ipproc(:,jpnj) 
     357      nfimpp(:) = iimppt(:,jpnj) 
    358358      nfjpi (:) =   ijpi(:,jpnj) 
    359359      ! 
     
    363363         WRITE(numout,*) 
    364364         WRITE(numout,*) '   defines mpp subdomains' 
    365          WRITE(numout,*) '      jpni = ', jpni   
     365         WRITE(numout,*) '      jpni = ', jpni 
    366366         WRITE(numout,*) '      jpnj = ', jpnj 
    367367         WRITE(numout,*) '     jpnij = ', jpnij 
     
    370370         WRITE(numout,*) '      sum ijpj(1,j) = ', sum(ijpj(1,:)), ' jpjglo = ', jpjglo 
    371371      ENDIF 
    372       
     372 
    373373      ! 3. Subdomain description in the Regular Case 
    374374      ! -------------------------------------------- 
    375375      ! specific cases where there is no communication -> must do the periodicity by itself 
    376       ! Warning: because of potential land-area suppression, do not use nbond[ij] == 2   
     376      ! Warning: because of potential land-area suppression, do not use nbond[ij] == 2 
    377377      l_Iperio = jpni == 1 .AND. (jperio == 1 .OR. jperio == 4 .OR. jperio == 6 .OR. jperio == 7) 
    378378      l_Jperio = jpnj == 1 .AND. (jperio == 2 .OR. jperio == 7) 
    379        
     379 
    380380      DO jarea = 1, jpni*jpnj 
    381381         ! 
     
    450450            ! In case of north fold exchange: I am the n neigbour of my n neigbour!! (#1057) 
    451451            ! --> for northern neighbours of northern row processors (in case of north-fold) 
    452             !     need to reverse the LOGICAL direction of communication  
     452            !     need to reverse the LOGICAL direction of communication 
    453453            idir = 1                                           ! we are indeed the s neigbour of this n neigbour 
    454454            IF( ij == jpnj .AND. ijno == jpnj )   idir = -1    ! both are on the last row, we are in fact the n neigbour 
     
    478478         ENDIF 
    479479      END DO 
    480        
     480 
    481481      ! 5. Subdomain print 
    482482      ! ------------------ 
     
    504504 9404    FORMAT('           *  '   ,20('     ' ,i4,'   *   ') ) 
    505505      ENDIF 
    506           
     506 
    507507      ! just to save nono etc for all proc 
    508508      ! warning ii*ij (zone) /= nproc (processors)! 
     
    511511      ii_nono(:) = -1 
    512512      ii_noea(:) = -1 
    513       ii_nowe(:) = -1  
     513      ii_nowe(:) = -1 
    514514      DO jproc = 1, jpnij 
    515515         ii = iin(jproc) 
     
    536536         ENDIF 
    537537      END DO 
    538      
     538 
    539539      ! 6. Change processor name 
    540540      ! ------------------------ 
     
    542542      ij = ijn(narea) 
    543543      ! 
    544       jpi    = ijpi(ii,ij)   
     544      jpi    = ijpi(ii,ij) 
    545545!!$      Nis0  = iis0(ii,ij) 
    546546!!$      Nie0  = iie0(ii,ij) 
    547       jpj    = ijpj(ii,ij)   
     547      jpj    = ijpj(ii,ij) 
    548548!!$      Njs0  = ijs0(ii,ij) 
    549549!!$      Nje0  = ije0(ii,ij) 
    550550      nbondi = ibondi(ii,ij) 
    551551      nbondj = ibondj(ii,ij) 
    552       nimpp = iimppt(ii,ij)   
     552      nimpp = iimppt(ii,ij) 
    553553      njmpp = ijmppt(ii,ij) 
    554554      jpk = jpkglo                              ! third dim 
     
    564564      noses = -1 
    565565      nosws = -1 
    566        
     566 
    567567      noner = -1 
    568568      nonwr = -1 
     
    613613 
    614614      ! 
    615       CALL init_doloop                          ! set start/end indices of do-loop, depending on the halo width value (nn_hls)  
     615      CALL init_doloop                          ! set start/end indices of do-loop, depending on the halo width value (nn_hls) 
    616616      ! 
    617617      jpim1 = jpi-1                             ! inner domain indices 
     
    630630         ibonit(jproc) = ibondi(ii,ij) 
    631631         ibonjt(jproc) = ibondj(ii,ij) 
    632          nimppt(jproc) = iimppt(ii,ij)   
    633          njmppt(jproc) = ijmppt(ii,ij)  
     632         nimppt(jproc) = iimppt(ii,ij) 
     633         njmppt(jproc) = ijmppt(ii,ij) 
    634634      END DO 
    635635 
     
    647647               &                                nis0all(jproc), njs0all(jproc),   & 
    648648               &                                nie0all(jproc), nje0all(jproc),   & 
    649                &                                nimppt (jproc), njmppt (jproc),   &  
     649               &                                nimppt (jproc), njmppt (jproc),   & 
    650650               &                                ii_nono(jproc), ii_noso(jproc),   & 
    651651               &                                ii_nowe(jproc), ii_noea(jproc),   & 
    652                &                                ibonit (jproc), ibonjt (jproc)  
     652               &                                ibonit (jproc), ibonjt (jproc) 
    653653         END DO 
    654654      END IF 
     
    707707      ! 
    708708      CALL init_ioipsl       ! Prepare NetCDF output file (if necessary) 
    709       !       
     709      ! 
    710710      IF (( jperio >= 3 .AND. jperio <= 6 .AND. jpni > 1 ).AND.( ln_nnogather )) THEN 
    711711         CALL init_nfdcom     ! northfold neighbour lists 
     
    719719      ENDIF 
    720720      ! 
    721       IF (llwrtlay) CLOSE(inum)    
     721      IF (llwrtlay) CLOSE(inum) 
    722722      ! 
    723723      DEALLOCATE(iin, ijn, ii_nono, ii_noea, ii_noso, ii_nowe,    & 
     
    733733      !!---------------------------------------------------------------------- 
    734734      !!                  ***  ROUTINE mpp_basesplit  *** 
    735       !!                     
     735      !! 
    736736      !! ** Purpose :   Lay out the global domain over processors. 
    737737      !! 
     
    752752      ! 
    753753      INTEGER ::   ji, jj 
    754       INTEGER ::   i2hls  
     754      INTEGER ::   i2hls 
    755755      INTEGER ::   iresti, irestj, irm, ijpjmin 
    756756      !!---------------------------------------------------------------------- 
     
    759759#if defined key_nemocice_decomp 
    760760      kimax = ( nx_global+2-i2hls + (knbi-1) ) / knbi + i2hls    ! first  dim. 
    761       kjmax = ( ny_global+2-i2hls + (knbj-1) ) / knbj + i2hls    ! second dim.  
     761      kjmax = ( ny_global+2-i2hls + (knbj-1) ) / knbj + i2hls    ! second dim. 
    762762#else 
    763763      kimax = ( kiglo - i2hls + (knbi-1) ) / knbi + i2hls    ! first  dim. 
     
    797797         irm = knbj - irestj                                       ! total number of lines to be removed 
    798798         klcj(:,knbj) = MAX( ijpjmin, kjmax-irm )                  ! we must have jpj >= ijpjmin in the last row 
    799          irm = irm - ( kjmax - klcj(1,knbj) )                      ! remaining number of lines to remove  
     799         irm = irm - ( kjmax - klcj(1,knbj) )                      ! remaining number of lines to remove 
    800800         irestj = knbj - 1 - irm 
    801801         klcj(:, irestj+1:knbj-1) = kjmax-1 
     
    831831         END DO 
    832832      ENDIF 
    833        
     833 
    834834   END SUBROUTINE mpp_basesplit 
    835835 
     
    890890      ! get the list of knbi that gives a smaller jpimax than knbi-1 
    891891      ! get the list of knbj that gives a smaller jpjmax than knbj-1 
    892       DO ji = 1, inbijmax       
     892      DO ji = 1, inbijmax 
    893893#if defined key_nemocice_decomp 
    894894         iszitst = ( nx_global+2-2*nn_hls + (ji-1) ) / ji + 2*nn_hls    ! first  dim. 
     
    958958      ! extract only the partitions which reduce the subdomain size in comparison with smaller partitions 
    959959      ALLOCATE( indexok(isz1) )                                 ! to store indices of the best partitions 
    960       isz0 = 0                                                  ! number of best partitions      
     960      isz0 = 0                                                  ! number of best partitions 
    961961      inbij = 1                                                 ! start with the min value of inbij1 => 1 
    962962      iszij = jpiglo*jpjglo+1                                   ! default: larger than global domain 
     
    10181018         CALL mppstop( ld_abort = .TRUE. ) 
    10191019      ENDIF 
    1020        
     1020 
    10211021      DEALLOCATE( iszi0, iszj0 ) 
    10221022      inbij = inbijmax + 1        ! default: larger than possible 
    10231023      ii = isz0+1                 ! start from the end of the list (smaller subdomains) 
    10241024      DO WHILE( inbij > knbij )   ! while the number of ocean subdomains exceed the number of procs 
    1025          ii = ii -1  
     1025         ii = ii -1 
    10261026         ALLOCATE( llisoce(inbi0(ii), inbj0(ii)) ) 
    10271027         CALL mpp_is_ocean( llisoce )            ! must be done by all core 
     
    10351035      ! 
    10361036   END SUBROUTINE bestpartition 
    1037     
    1038     
     1037 
     1038 
    10391039   SUBROUTINE mpp_init_landprop( propland ) 
    10401040      !!---------------------------------------------------------------------- 
     
    10591059      ENDIF 
    10601060 
    1061       ! number of processes reading the bathymetry file  
     1061      ! number of processes reading the bathymetry file 
    10621062      iproc = MINVAL( (/mppsize, Nj0glo/2, 100/) )  ! read a least 2 lines, no more that 100 processes reading at the same time 
    1063        
     1063 
    10641064      ! we want to read iproc strips of the land-sea mask. -> pick up iproc processes every idiv processes starting at 1 
    10651065      IF( iproc == 1 ) THEN   ;   idiv = mppsize 
     
    10841084      CALL mpp_sum( 'mppini', inboce )   ! total number of ocean points over the global domain 
    10851085      ! 
    1086       propland = REAL( Ni0glo*Nj0glo - inboce, wp ) / REAL( Ni0glo*Nj0glo, wp )  
     1086      propland = REAL( Ni0glo*Nj0glo - inboce, wp ) / REAL( Ni0glo*Nj0glo, wp ) 
    10871087      ! 
    10881088   END SUBROUTINE mpp_init_landprop 
    1089     
    1090     
     1089 
     1090 
    10911091   SUBROUTINE mpp_is_ocean( ldisoce ) 
    10921092      !!---------------------------------------------------------------------- 
     
    11041104      !! ** Method  : read inbj strips (of length Ni0glo) of the land-sea mask 
    11051105      !!---------------------------------------------------------------------- 
    1106       LOGICAL, DIMENSION(:,:), INTENT(  out) ::   ldisoce        ! .true. if a sub domain constains 1 ocean point  
     1106      LOGICAL, DIMENSION(:,:), INTENT(  out) ::   ldisoce        ! .true. if a sub domain constains 1 ocean point 
    11071107      ! 
    11081108      INTEGER :: idiv, iimax, ijmax, iarea 
     
    11131113      INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   iimppt, ijpi 
    11141114      INTEGER, ALLOCATABLE, DIMENSION(:,:) ::   ijmppt, ijpj 
    1115       LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce            ! lloce(i,j) = .true. if the point (i,j) is ocean  
     1115      LOGICAL, ALLOCATABLE, DIMENSION(:,:) ::   lloce            ! lloce(i,j) = .true. if the point (i,j) is ocean 
    11161116      !!---------------------------------------------------------------------- 
    11171117      ! do nothing if there is no land-sea mask 
     
    11461146            isty = 1 + COUNT( (/ iarea == 1 /) )                       ! read from the first or the second line? 
    11471147            CALL readbot_strip( ijmppt(1,iarea) - 2 + isty, inry, lloce(2:inx-1, isty:inry+isty-1) )   ! read the strip 
    1148             !  
     1148            ! 
    11491149            IF( iarea == 1    ) THEN                                   ! the first line was not read 
    11501150               IF( jperio == 2 .OR. jperio == 7 ) THEN                 !   north-south periodocity 
     
    11571157               IF( jperio == 2 .OR. jperio == 7 ) THEN                 !   north-south periodocity 
    11581158                  CALL readbot_strip( 1, 1, lloce(2:inx-1,iny) )       !      read the first line -> last line of lloce 
    1159                ELSEIF( jperio == 3 .OR. jperio == 4 ) THEN             !   north-pole folding T-pivot, T-point  
     1159               ELSEIF( jperio == 3 .OR. jperio == 4 ) THEN             !   north-pole folding T-pivot, T-point 
    11601160                  lloce(2,iny) = lloce(2,iny-2)                        !      here we have 1 halo (even if nn_hls>1) 
    11611161                  DO ji = 3,inx-1 
     
    11911191         ENDIF 
    11921192      END DO 
    1193     
     1193 
    11941194      inboce_1d = RESHAPE(inboce, (/ inbi*inbj /)) 
    11951195      CALL mpp_sum( 'mppini', inboce_1d ) 
     
    11991199      ! 
    12001200   END SUBROUTINE mpp_is_ocean 
    1201     
    1202     
     1201 
     1202 
    12031203   SUBROUTINE readbot_strip( kjstr, kjcnt, ldoce ) 
    12041204      !!---------------------------------------------------------------------- 
     
    12131213      INTEGER                         , INTENT(in   ) ::   kjstr       ! starting j position of the reading 
    12141214      INTEGER                         , INTENT(in   ) ::   kjcnt       ! number of lines to read 
    1215       LOGICAL, DIMENSION(Ni0glo,kjcnt), INTENT(  out) ::   ldoce       ! ldoce(i,j) = .true. if the point (i,j) is ocean  
     1215      LOGICAL, DIMENSION(Ni0glo,kjcnt), INTENT(  out) ::   ldoce       ! ldoce(i,j) = .true. if the point (i,j) is ocean 
    12161216      ! 
    12171217      INTEGER                           ::   inumsave                ! local logical unit 
    1218       REAL(wp), DIMENSION(Ni0glo,kjcnt) ::   zbot, zbdy  
     1218      REAL(wp), DIMENSION(Ni0glo,kjcnt) ::   zbot, zbdy 
    12191219      !!---------------------------------------------------------------------- 
    12201220      ! 
    12211221      inumsave = numout   ;   numout = numnul   !   redirect all print to /dev/null 
    12221222      ! 
    1223       IF( numbot /= -1 ) THEN    
     1223      IF( numbot /= -1 ) THEN 
    12241224         CALL iom_get( numbot, jpdom_unknown, 'bottom_level', zbot, kstart = (/1,kjstr/), kcount = (/Ni0glo, kjcnt/) ) 
    12251225      ELSE 
     
    12271227      ENDIF 
    12281228      ! 
    1229       IF( numbdy /= -1 ) THEN                   ! Adjust with bdy_msk if it exists     
     1229      IF( numbdy /= -1 ) THEN                   ! Adjust with bdy_msk if it exists 
    12301230         CALL iom_get ( numbdy, jpdom_unknown,     'bdy_msk', zbdy, kstart = (/1,kjstr/), kcount = (/Ni0glo, kjcnt/) ) 
    12311231         zbot(:,:) = zbot(:,:) * zbdy(:,:) 
     
    12951295      !!                  ***  ROUTINE init_ioipsl  *** 
    12961296      !! 
    1297       !! ** Purpose :    
    1298       !! 
    1299       !! ** Method  :    
     1297      !! ** Purpose : 
     1298      !! 
     1299      !! ** Method  : 
    13001300      !! 
    13011301      !! History : 
    1302       !!   9.0  !  04-03  (G. Madec )  MPP-IOIPSL  
     1302      !!   9.0  !  04-03  (G. Madec )  MPP-IOIPSL 
    13031303      !!   " "  !  08-12  (A. Coward)  addition in case of jpni*jpnj < jpnij 
    13041304      !!---------------------------------------------------------------------- 
     
    13281328      CALL flio_dom_set ( jpnij, nproc, idid, iglo, iloc, iabsf, iabsl, ihals, ihale, 'BOX', nidom) 
    13291329      ! 
    1330    END SUBROUTINE init_ioipsl   
     1330   END SUBROUTINE init_ioipsl 
    13311331 
    13321332 
     
    13341334      !!---------------------------------------------------------------------- 
    13351335      !!                     ***  ROUTINE  init_nfdcom  *** 
    1336       !! ** Purpose :   Setup for north fold exchanges with explicit  
     1336      !! ** Purpose :   Setup for north fold exchanges with explicit 
    13371337      !!                point-to-point messaging 
    13381338      !! 
     
    13401340      !!---------------------------------------------------------------------- 
    13411341      !!    1.0  ! 2011-10  (A. C. Coward, NOCS & J. Donners, PRACE) 
    1342       !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC)  
     1342      !!    2.0  ! 2013-06 Setup avoiding MPI communication (I. Epicoco, S. Mocavero, CMCC) 
    13431343      !!---------------------------------------------------------------------- 
    13441344      INTEGER  ::   sxM, dxM, sxT, dxT, jn 
     
    13921392      ! 
    13931393      Nis0 =   1+nn_hls   ;   Nis1 = Nis0-1   ;   Nis2 = MAX(  1, Nis0-2) 
    1394       Njs0 =   1+nn_hls   ;   Njs1 = Njs0-1   ;   Njs2 = MAX(  1, Njs0-2)   
    1395       !                                                  
     1394      Njs0 =   1+nn_hls   ;   Njs1 = Njs0-1   ;   Njs2 = MAX(  1, Njs0-2) 
     1395      ! 
    13961396      Nie0 = jpi-nn_hls   ;   Nie1 = Nie0+1   ;   Nie2 = MIN(jpi, Nie0+2) 
    13971397      Nje0 = jpj-nn_hls   ;   Nje1 = Nje0+1   ;   Nje2 = MIN(jpj, Nje0+2) 
     
    14021402         Nie1nxt2 = Nie0   ;   Nje1nxt2 = Nje0 
    14031403         ! 
    1404       ELSE                            !* larger halo size...  
     1404      ELSE                            !* larger halo size... 
    14051405         ! 
    14061406         Nis1nxt2 = Nis1   ;   Njs1nxt2 = Njs1 
     
    14171417      ! 
    14181418   END SUBROUTINE init_doloop 
    1419     
     1419 
    14201420   !!====================================================================== 
    14211421END MODULE mppini 
Note: See TracChangeset for help on using the changeset viewer.