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 10570 for NEMO/trunk/src/OCE/stpctl.F90 – NEMO

Ignore:
Timestamp:
2019-01-24T16:14:49+01:00 (5 years ago)
Author:
acc
Message:

Trunk update to implement finer control over the choice of text report files generated. See ticket: #2167

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/trunk/src/OCE/stpctl.F90

    r10425 r10570  
    6767      REAL(wp)               ::   zzz                 ! local real  
    6868      REAL(wp), DIMENSION(9) ::   zmax 
     69      LOGICAL                ::   ll_wrtstp, ll_colruns, ll_wrtruns 
    6970      CHARACTER(len=20) :: clname 
    7071      !!---------------------------------------------------------------------- 
    7172      ! 
     73      ll_wrtstp  = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
     74      ll_colruns = ll_wrtstp .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) 
     75      ll_wrtruns = ll_colruns .AND. lwm 
    7276      IF( kt == nit000 .AND. lwp ) THEN 
    7377         WRITE(numout,*) 
     
    7680         !                                ! open time.step file 
    7781         IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    78          !                                ! open run.stat file 
    79          IF( ln_ctl .AND. lwm ) THEN 
     82         !                                ! open run.stat file(s) at start whatever 
     83         !                                ! the value of sn_cfctl%ptimincr 
     84         IF( lwm .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) ) THEN 
    8085            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    8186            clname = 'run.stat.nc' 
     
    99104      IF( kt == nit000 )   lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 
    100105      ! 
    101       IF(lwm) THEN                        !==  current time step  ==!   ("time.step" file) 
     106      IF(lwm .AND. ll_wrtstp) THEN        !==  current time step  ==!   ("time.step" file) 
    102107         WRITE ( numstp, '(1x, i8)' )   kt 
    103108         REWIND( numstp ) 
     
    121126      ENDIF 
    122127      ! 
    123       IF( ln_ctl ) THEN 
     128      IF( ll_colruns ) THEN 
    124129         CALL mpp_max( "stpctl", zmax )          ! max over the global domain 
    125130         nstop = NINT( zmax(7) )                 ! nstop indicator sheared among all local domains 
    126131      ENDIF 
    127132      !                                   !==  run statistics  ==!   ("run.stat" files) 
    128       IF( ln_ctl .AND. lwm ) THEN 
     133      IF( ll_wrtruns ) THEN 
    129134         WRITE(numrun,9500) kt, zmax(1), zmax(2), -zmax(3), zmax(4) 
    130135         istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) ) 
Note: See TracChangeset for help on using the changeset viewer.