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 10603 for NEMO – NEMO

Changeset 10603 for NEMO


Ignore:
Timestamp:
2019-01-29T12:18:09+01:00 (5 years ago)
Author:
acc
Message:

Update SAS/stpctl.F90 with missing controls over run.stat etc.

File:
1 edited

Legend:

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

    r10425 r10603  
    5858      !! 
    5959      REAL(wp), DIMENSION(3) ::   zmax 
     60      LOGICAL                ::   ll_wrtstp, ll_colruns, ll_wrtruns 
    6061      CHARACTER(len=20) :: clname 
    6162      !!---------------------------------------------------------------------- 
    62  
     63      ! 
     64      ll_wrtstp  = ( MOD( kt, sn_cfctl%ptimincr ) == 0 ) .OR. ( kt == nitend ) 
     65      ll_colruns = ll_wrtstp .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) 
     66      ll_wrtruns = ll_colruns .AND. lwm 
    6367      IF( kt == nit000 .AND. lwp ) THEN 
    6468         WRITE(numout,*) 
     
    6771         !                                ! open time.step file 
    6872         IF( lwm ) CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    69          !                                ! open run.stat file 
    70          IF( ln_ctl .AND. lwm ) THEN 
     73         !                                ! open run.stat file(s) at start whatever 
     74         !                                ! the value of sn_cfctl%ptimincr 
     75         IF( lwm .AND. ( ln_ctl .OR. sn_cfctl%l_runstat ) ) THEN 
    7176            CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
    7277            clname = 'run.stat.nc' 
     
    8287      IF( kt == nit000 )   lsomeoce = COUNT( ssmask(:,:) == 1._wp ) > 0 
    8388      ! 
    84       IF(lwm) THEN                        !==  current time step  ==!   ("time.step" file) 
     89      IF(lwm .AND. ll_wrtstp) THEN        !==  current time step  ==!   ("time.step" file) 
    8590         WRITE ( numstp, '(1x, i8)' )   kt 
    8691         REWIND( numstp ) 
    8792      ENDIF 
    8893      !                                   !==  test of extrema  ==! 
    89       IF( ln_ctl ) THEN   ! must be done by all processes because of the mpp_max 
     94      IF( ll_colruns ) THEN 
    9095         zmax(1) = MAXVAL(      vt_i (:,:) )                                           ! max ice thickness 
    9196         zmax(2) = MAXVAL( ABS( u_ice(:,:) ) )                                         ! max ice velocity (zonal only) 
     
    9499      END IF 
    95100      !                                            !==  run statistics  ==!   ("run.stat" file) 
    96       IF( ln_ctl .AND. lwm ) THEN 
    97          IF(lwp) WRITE(numrun,9500) kt, zmax(1), zmax(2), - zmax(3) 
     101      IF( ll_wrtruns ) THEN 
     102         WRITE(numrun,9500) kt, zmax(1), zmax(2), - zmax(3) 
    98103         istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) ) 
    99104         istatus = NF90_PUT_VAR( idrun,   idu, (/ zmax(2)/), (/kt/), (/1/) ) 
Note: See TracChangeset for help on using the changeset viewer.