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 9210 for branches/2017/dev_merge_2017/NEMOGCM/NEMO – NEMO

Ignore:
Timestamp:
2018-01-11T16:41:21+01:00 (6 years ago)
Author:
gm
Message:

dev_merge_2017: merge a 4th mpp_max (stop, see WP2017/HPC03) cleaning in nemo_gcm routine

Location:
branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90

    r9169 r9210  
    154154      !                            !-----------------------! 
    155155      istp = nit000 
     156      ! 
    156157#if defined key_c1d 
    157          DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    158             CALL stp_c1d( istp ) 
     158      DO WHILE ( istp <= nitend .AND. nstop == 0 )    !==  C1D time-stepping  ==! 
     159         CALL stp_c1d( istp ) 
     160         istp = istp + 1 
     161      END DO 
     162#else 
     163 
     164!!gm     This data assimilation calls should be part of the initialisation (i.e. put in asm_inc_init) 
     165      ! 
     166      IF( lk_asminc ) THEN                            !==  data assimilation  ==!   (done prior to time stepping) 
     167         IF( ln_bkgwri )   CALL asm_bkg_wri( nit000 - 1 )      ! Output background fields 
     168         IF( ln_asmdin ) THEN                                  ! Direct initialization 
     169            IF( ln_trainc )   CALL tra_asm_inc( nit000 - 1 )      ! Tracers 
     170            IF( ln_dyninc )   CALL dyn_asm_inc( nit000 - 1 )      ! Dynamics 
     171            IF( ln_sshinc )   CALL ssh_asm_inc( nit000 - 1 )      ! SSH 
     172         ENDIF 
     173      ENDIF 
     174!!gm end 
     175      ! 
     176# if defined key_agrif 
     177      !                                               !==  AGRIF time-stepping  ==! 
     178      CALL Agrif_Regrid() 
     179      DO WHILE( istp <= nitend .AND. nstop == 0 ) 
     180         CALL stp 
     181         istp = istp + 1 
     182      END DO 
     183      ! 
     184      IF( .NOT. Agrif_Root() ) THEN 
     185         CALL Agrif_ParentGrid_To_ChildGrid() 
     186         IF( ln_diaobs )   CALL dia_obs_wri 
     187         IF( ln_timing )   CALL timing_finalize 
     188         CALL Agrif_ChildGrid_To_ParentGrid() 
     189      ENDIF 
     190      ! 
     191# else 
     192      ! 
     193      IF( .NOT.ln_diurnal_only ) THEN                 !==  Standard time-stepping  ==! 
     194         ! 
     195         DO WHILE( istp <= nitend .AND. nstop == 0 ) 
     196            CALL stp        ( istp )  
    159197            istp = istp + 1 
    160198         END DO 
    161 #else 
    162           IF( lk_asminc ) THEN 
    163              IF( ln_bkgwri ) CALL asm_bkg_wri( nit000 - 1 )    ! Output background fields 
    164              IF( ln_asmdin ) THEN                        ! Direct initialization 
    165                 IF( ln_trainc ) CALL tra_asm_inc( nit000 - 1 )    ! Tracers 
    166                 IF( ln_dyninc ) CALL dyn_asm_inc( nit000 - 1 )    ! Dynamics 
    167                 IF( ln_sshinc ) CALL ssh_asm_inc( nit000 - 1 )    ! SSH 
    168              ENDIF 
    169           ENDIF 
    170  
    171 #if defined key_agrif 
    172           CALL Agrif_Regrid() 
    173 #endif 
    174  
    175          DO WHILE ( istp <= nitend .AND. nstop == 0 ) 
    176 #if defined key_agrif 
    177             CALL stp                         ! AGRIF: time stepping 
    178 #else 
    179             IF ( .NOT. ln_diurnal_only ) THEN  
    180                CALL stp( istp )                 ! standard time stepping  
    181             ELSE  
    182                CALL stp_diurnal( istp )        ! time step only the diurnal SST  
    183             ENDIF  
    184 #endif 
     199         ! 
     200      ELSE                                            !==  diurnal SST time-steeping only  ==! 
     201         ! 
     202         DO WHILE( istp <= nitend .AND. nstop == 0 ) 
     203            CALL stp_diurnal( istp )   ! time step only the diurnal SST  
    185204            istp = istp + 1 
    186             IF( lk_mpp )   CALL mpp_max( nstop ) 
    187205         END DO 
    188 #endif 
    189  
     206         ! 
     207      ENDIF 
     208      ! 
     209# endif 
     210      ! 
     211#endif 
     212      ! 
    190213      IF( ln_diaobs   )   CALL dia_obs_wri 
    191214      ! 
     
    199222      IF( nstop /= 0 .AND. lwp ) THEN        ! error print 
    200223         WRITE(numout,cform_err) 
    201          WRITE(numout,*) nstop, ' error have been found' 
    202       ENDIF 
    203       ! 
    204 #if defined key_agrif 
    205       IF( .NOT. Agrif_Root() ) THEN 
    206          CALL Agrif_ParentGrid_To_ChildGrid() 
    207          IF( ln_diaobs )        CALL dia_obs_wri 
    208          IF( ln_timing )   CALL timing_finalize 
    209          CALL Agrif_ChildGrid_To_ParentGrid() 
    210       ENDIF 
    211 #endif 
     224         WRITE(numout,*) 'nemo_gcm: a total of ', nstop, ' errors have been found' 
     225         WRITE(numout,*) 
     226      ENDIF 
     227      ! 
    212228      IF( ln_timing )   CALL timing_finalize 
    213229      ! 
     
    215231      ! 
    216232#if defined key_iomput 
    217       CALL xios_finalize                     ! end mpp communications with xios 
    218       IF( lk_oasis )   CALL cpl_finalize     ! end coupling and mpp communications with OASIS 
     233                                    CALL xios_finalize  ! end mpp communications with xios 
     234      IF( lk_oasis     )            CALL cpl_finalize   ! end coupling and mpp communications with OASIS 
    219235#else 
    220       IF( lk_oasis ) THEN  
    221          CALL cpl_finalize                   ! end coupling and mpp communications with OASIS 
    222       ELSE 
    223          IF( lk_mpp )   CALL mppstop         ! end mpp communications 
     236      IF    ( lk_oasis ) THEN   ;   CALL cpl_finalize   ! end coupling and mpp communications with OASIS 
     237      ELSEIF( lk_mpp   ) THEN   ;   CALL mppstop        ! end mpp communications 
    224238      ENDIF 
    225239#endif 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/step.F90

    r9124 r9210  
    280280      IF(.NOT.ln_linssh) CALL dom_vvl_sf_swp( kstp )  ! swap of vertical scale factors 
    281281      ! 
    282       IF( ln_diahsb        )   CALL dia_hsb( kstp )         ! - ML - global conservation diagnostics 
     282      IF( ln_diahsb  )   CALL dia_hsb       ( kstp )  ! - ML - global conservation diagnostics 
    283283 
    284284!!gm : This does not only concern the dynamics ==>>> add a new title 
     
    287287!!jc: That would be better, but see comment above 
    288288!! 
    289       IF( lrst_oce         )   CALL rst_write    ( kstp )   ! write output ocean restart file 
    290       IF( ln_sto_eos       )   CALL sto_rst_write( kstp )   ! write restart file for stochastic parameters 
     289      IF( lrst_oce   )   CALL rst_write    ( kstp )   ! write output ocean restart file 
     290      IF( ln_sto_eos )   CALL sto_rst_write( kstp )   ! write restart file for stochastic parameters 
    291291 
    292292#if defined key_agrif 
     
    298298      IF( Agrif_NbStepint() == 0 ) THEN               ! AGRIF Update  
    299299!!jc in fact update is useless at last time step, but do it for global diagnostics 
    300                              CALL Agrif_Update_ssh()      ! Update ssh 
    301          IF(.NOT.ln_linssh)  CALL Agrif_Update_vvl()      ! Update vertical scale factors   
    302                              CALL Agrif_Update_Tra()      ! Update active tracers 
    303                              CALL Agrif_Update_Dyn()      ! Update momentum 
    304 #if defined key_top 
    305                              CALL Agrif_Update_Trc()      ! Update passive tracers 
    306 #endif 
    307       ENDIF 
    308 #endif 
    309       IF( ln_diaobs  )   CALL dia_obs( kstp )         ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
     300                              CALL Agrif_Update_ssh()    ! Update ssh 
     301         IF(.NOT.ln_linssh)   CALL Agrif_Update_vvl()    ! Update vertical scale factors   
     302                              CALL Agrif_Update_Tra()    ! Update active tracers 
     303                              CALL Agrif_Update_Dyn()    ! Update momentum 
     304# if defined key_top 
     305                              CALL Agrif_Update_Trc()    ! Update passive tracers 
     306# endif 
     307      ENDIF 
     308#endif 
     309      IF( ln_diaobs  )   CALL dia_obs      ( kstp )      ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 
    310310 
    311311      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 
    312312      ! Control 
    313313      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 
    314                          CALL stp_ctl       ( kstp, indic ) 
    315       IF( indic < 0  ) THEN 
    316                          CALL ctl_stop( 'step: indic < 0' ) 
    317                          CALL dia_wri_state( 'output.abort', kstp ) 
    318       ENDIF 
    319       IF( kstp == nit000 ) THEN 
    320                  CALL iom_close( numror )     ! close input  ocean restart file 
    321          IF(lwm) CALL FLUSH    ( numond )     ! flush output namelist oce 
    322          IF(lwm.AND.numoni /= -1 )   & 
    323             &    CALL FLUSH    ( numoni )     ! flush output namelist ice (if exist) 
     314                         CALL stp_ctl      ( kstp, indic ) 
     315                          
     316      IF( kstp == nit000 ) THEN                          ! 1st time step only 
     317                                        CALL iom_close( numror )   ! close input  ocean restart file 
     318         IF(lwm)                        CALL FLUSH    ( numond )   ! flush output namelist oce 
     319         IF(lwm .AND. numoni /= -1 )    CALL FLUSH    ( numoni )   ! flush output namelist ice (if exist) 
    324320      ENDIF 
    325321 
     
    337333#endif 
    338334      ! 
    339       IF( ln_timing ) THEN 
    340          IF( ln_timing      )   CALL timing_start('stp') 
    341 !!gm avoid the init phase during 1st time step ???  useless now no? 
    342          IF( kstp == nit000 )   CALL timing_reset            
    343       ENDIF 
     335      IF( ln_timing )   CALL timing_stop('stp') 
    344336      ! 
    345337   END SUBROUTINE stp 
  • branches/2017/dev_merge_2017/NEMOGCM/NEMO/OPA_SRC/stpctl.F90

    r9023 r9210  
    1919   USE dom_oce         ! ocean space and time domain variables  
    2020   USE c1d             ! 1D vertical configuration 
     21   USE diawri          ! Standard run outputs       (dia_wri_state routine) 
    2122   ! 
    2223   USE in_out_manager  ! I/O manager 
    2324   USE lbclnk          ! ocean lateral boundary conditions (or mpp link) 
    2425   USE lib_mpp         ! distributed memory computing 
    25    USE wet_dry,    ONLY: ll_wd, ssh_ref    ! reference depth for negative bathy 
     26   USE wet_dry,   ONLY : ll_wd, ssh_ref    ! reference depth for negative bathy 
    2627 
    2728   IMPLICIT NONE 
     
    5152      !! ** Actions :   "time.step" file = last ocean time-step 
    5253      !!                "run.stat"  file = run statistics 
     54      !!                nstop indicator sheared among all local domain (lk_mpp=T) 
    5355      !!---------------------------------------------------------------------- 
    5456      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
     
    6264      INTEGER , DIMENSION(3) ::   ilocu, ilocs 
    6365      INTEGER , DIMENSION(2) ::   iloch 
    64       REAL(wp), DIMENSION(3) ::   zmax 
     66      REAL(wp), DIMENSION(4) ::   zmax 
    6567      !!---------------------------------------------------------------------- 
    6668      ! 
     
    8284      !                                   !==  test of extrema  ==! 
    8385      IF( ll_wd ) THEN 
    84          zmax(1) = MAXVAL(  ABS( sshn(:,:) + ssh_ref*tmask(:,:,1) )  )           ! ssh max  
     86         zmax(1) = MAXVAL(  ABS( sshn(:,:) + ssh_ref*tmask(:,:,1) )  )        ! ssh max  
    8587      ELSE 
    86          zmax(1) = MAXVAL(  ABS( sshn(:,:) )  )                                  ! ssh max 
     88         zmax(1) = MAXVAL(  ABS( sshn(:,:) )  )                               ! ssh max 
    8789      ENDIF 
    8890      zmax(2) = MAXVAL(  ABS( un(:,:,:) )  )                                  ! velocity max (zonal only) 
    8991      zmax(3) = MAXVAL( -tsn(:,:,:,jp_sal) , mask = tmask(:,:,:) == 1._wp )   ! minus salinity max 
     92      zmax(4) = REAL( nstop , wp )                                            ! stop indicator 
    9093      ! 
    91       IF( lk_mpp )   CALL mpp_max_multiple( zmax(:), 3 ) ! max over the global domain 
     94      IF( lk_mpp ) THEN 
     95         CALL mpp_max_multiple( zmax(:), 4 )    ! max over the global domain 
     96         ! 
     97         nstop = INT( zmax(4) )                 ! nstop indicator sheared among all local domains 
     98      ENDIF 
    9299      ! 
    93100      IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN 
     
    114121         IF(lwp) THEN 
    115122            WRITE(numout,cform_err) 
    116             WRITE(numout,*) ' stpctl: |ssh| > 10 m   or   |U| > 10 m/s   or   S < 0   or   NaN encounter in the tests' 
    117             WRITE(numout,*) ' ====== ' 
     123            WRITE(numout,*) ' stp_ctl: |ssh| > 10 m   or   |U| > 10 m/s   or   S < 0   or   NaN encounter in the tests' 
     124            WRITE(numout,*) ' ======= ' 
    118125            WRITE(numout,9100) kt,   zmax(1), iih, ijh 
    119126            WRITE(numout,9200) kt,   zmax(2), iiu, iju, iku 
     
    123130         ENDIF 
    124131         kindic = -3 
     132         ! 
     133         nstop = nstop + 1                            ! increase nstop by 1 (on all local domains) 
     134         CALL dia_wri_state( 'output.abort', kt )     ! create an output.abort file 
     135         ! 
    125136      ENDIF 
    1261379100  FORMAT (' kt=',i8,'   |ssh| max: ',1pg11.4,', at  i j  : ',2i5) 
Note: See TracChangeset for help on using the changeset viewer.