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 12249 for NEMO/branches/2019/dev_r11943_MERGE_2019/tests/STATION_ASF/MY_SRC/stpctl.F90 – NEMO

Ignore:
Timestamp:
2019-12-13T19:48:00+01:00 (4 years ago)
Author:
laurent
Message:

Made STATION_ASF testcase fully compliant with new timestepping scheme.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/2019/dev_r11943_MERGE_2019/tests/STATION_ASF/MY_SRC/stpctl.F90

    r11930 r12249  
    1212   !!            3.7  ! 2016-09  (G. Madec)  Remove solver 
    1313   !!            4.0  ! 2017-04  (G. Madec)  regroup global communications 
    14    !!            4.x  ! 2019-10  (L. Brodeau)  adapted for STATION_ASF test-case 
    1514   !!---------------------------------------------------------------------- 
    1615 
     
    1817   !!   stp_ctl      : Control the run 
    1918   !!---------------------------------------------------------------------- 
    20    !USE oce             ! ocean dynamics and tracers variables 
    2119   USE dom_oce         ! ocean space and time domain variables 
    22    !USE ice      , ONLY : vt_i, u_ice, tm_i 
    23    ! 
    2420   USE sbc_oce         ! surface fluxes and stuff 
    25    USE diawri 
     21   USE diawri          ! Standard run outputs       (dia_wri_state routine) 
    2622   ! 
    2723   USE in_out_manager  ! I/O manager 
     
    4238   !! Software governed by the CeCILL license (see ./LICENSE) 
    4339   !!---------------------------------------------------------------------- 
    44  
    4540CONTAINS 
    4641 
    47    SUBROUTINE stp_ctl( kt, kindic ) 
     42   SUBROUTINE stp_ctl( kt, Kbb, Kmm, kindic ) 
    4843      !!---------------------------------------------------------------------- 
    4944      !!                    ***  ROUTINE stp_ctl  *** 
     
    5752      !! ** Actions :   "time.step" file = last ocean time-step 
    5853      !!                "run.stat"  file = run statistics 
     54      !!                nstop indicator sheared among all local domain (lk_mpp=T) 
    5955      !!---------------------------------------------------------------------- 
    6056      INTEGER, INTENT(in   ) ::   kt       ! ocean time-step index 
     57      INTEGER, INTENT(in   ) ::   Kbb, Kmm      ! ocean time level index 
    6158      INTEGER, INTENT(inout) ::   kindic   ! error indicator 
    6259      !! 
     
    6764      ! 
    6865      ll_wrtstp  = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
    69       ll_colruns = ll_wrtstp .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) 
    70       ll_wrtruns = ll_colruns 
     66      ll_colruns = ll_wrtstp .AND. ( sn_cfctl%l_runstat ) 
     67      ll_wrtruns = ll_colruns .AND. lwm 
    7168      IF( kt == nit000 .AND. lwp ) THEN 
    7269         WRITE(numout,*) 
     
    7471         WRITE(numout,*) '~~~~~~~' 
    7572         !                                ! open time.step file 
    76          CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     73         IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    7774         !                                ! open run.stat file(s) at start whatever 
    7875         !                                ! the value of sn_cfctl%ptimincr 
    79          IF( ln_ctl .OR. sn_cfctl%l_runstat ) THEN 
     76         IF( lwm .AND. ( sn_cfctl%l_runstat ) ) THEN 
    8077            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    8178            clname = 'run.stat.nc' 
     
    9188      IF( kt == nit000 )   lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 
    9289      ! 
    93       IF(ll_wrtstp) THEN        !==  current time step  ==!   ("time.step" file) 
     90      IF(lwm .AND. ll_wrtstp) THEN        !==  current time step  ==!   ("time.step" file) 
    9491         WRITE ( numstp, '(1x, i8)' )   kt 
    9592         REWIND( numstp ) 
     
    103100      IF( ll_colruns ) THEN 
    104101         CALL mpp_max( "stpctl", zmax )          ! max over the global domain 
     102         nstop = NINT( zmax(3) )                 ! nstop indicator sheared among all local domains 
    105103      ENDIF 
    106104      !                                   !==  run statistics  ==!   ("run.stat" files) 
     
    114112      END IF 
    115113      !                                   !==  error handling  ==! 
    116       IF( ( ln_ctl .OR. lsomeoce ) .AND. (   &             ! have use mpp_max (because ln_ctl=.T.) or contains some ocean points 
     114      IF( ( sn_cfctl%l_glochk .OR. lsomeoce ) .AND. (   &  ! domain contains some ocean points, check for sensible ranges 
    117115         &  zmax(1) >    5._wp .OR.   &             ! too large wind stress ( > 5 N/m^2 ) 
    118116         &  zmax(2) > 2000._wp .OR.   &             ! too large non-solar heat flux ( > 2000 W/m^2) 
     
    126124         WRITE(ctmp6,*) '      ===> output of last computed fields in output.abort.nc file' 
    127125 
    128          CALL dia_wri_state( 'output.abort' )     ! create an output.abort file 
     126         CALL dia_wri_state( Kmm, 'output.abort' )     ! create an output.abort file 
    129127 
    130          IF( .NOT. ln_ctl ) THEN 
     128         IF( .NOT. sn_cfctl%l_glochk ) THEN 
    131129            WRITE(ctmp8,*) 'E R R O R message from sub-domain: ', narea 
    132130            CALL ctl_stop( 'STOP', ctmp1, ' ', ctmp2, ' ', ctmp6, ' ' ) 
Note: See TracChangeset for help on using the changeset viewer.