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/lib_mpp.F90 – 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.