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

Ignore:
Timestamp:
2018-03-27T15:57:02+02:00 (6 years ago)
Author:
acc
Message:

Branch 2017/dev_merge_2017. Reorganisation of nemogcm.F90 and mppini.F90. Stage 7: Add netcdf version of the run.stat files to stpctl.F90. Current implementation is very basic but may introduce opportunities for run-time monitoring; see ticket #2070

File:
1 edited

Legend:

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

    r9210 r9441  
    2626   USE wet_dry,   ONLY : ll_wd, ssh_ref    ! reference depth for negative bathy 
    2727 
     28   USE netcdf          ! NetCDF library 
    2829   IMPLICIT NONE 
    2930   PRIVATE 
    3031 
    3132   PUBLIC stp_ctl           ! routine called by step.F90 
     33 
     34   INTEGER  ::   idrun, idtime, idssh, idu, ids, istatus 
    3235   !!---------------------------------------------------------------------- 
    3336   !! NEMO/OPA 4.0 , NEMO Consortium (2017) 
     
    7578         !                                ! open run.stat file 
    7679         CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     80 
     81         IF( lwm ) THEN 
     82            istatus = NF90_CREATE( 'run.stat.nc', NF90_CLOBBER, idrun ) 
     83            istatus = NF90_DEF_DIM( idrun, 'time', NF90_UNLIMITED, idtime ) 
     84            istatus = NF90_DEF_VAR( idrun, 'abs_ssh_max', NF90_DOUBLE, (/ idtime /), idssh ) 
     85            istatus = NF90_DEF_VAR( idrun,   'abs_u_max', NF90_DOUBLE, (/ idtime /), idu ) 
     86            istatus = NF90_DEF_VAR( idrun,       's_min', NF90_DOUBLE, (/ idtime /), ids ) 
     87            istatus = NF90_ENDDEF(idrun) 
     88         ENDIF 
     89          
    7790      ENDIF 
    7891      ! 
     
    141154      !                                            !==  run statistics  ==!   ("run.stat" file) 
    142155      IF(lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), - zmax(3) 
     156      IF( lwm ) THEN 
     157         istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) ) 
     158         istatus = NF90_PUT_VAR( idrun,   idu, (/ zmax(2)/), (/kt/), (/1/) ) 
     159         istatus = NF90_PUT_VAR( idrun,   ids, (/-zmax(3)/), (/kt/), (/1/) ) 
     160         IF( MOD( kt , 100 ) == 0 ) istatus = NF90_SYNC(idrun) 
     161         IF( kt == nitend         ) istatus = NF90_CLOSE(idrun) 
     162      END IF 
    143163      ! 
    144 9400  FORMAT(' it :', i8, '    |ssh|_max: ', e16.10, ' |U|_max: ',e16.10,' S_min: ',e16.10) 
     1649400  FORMAT(' it :', i8, '    |ssh|_max: ', D23.16, ' |U|_max: ', D23.16,' S_min: ', D23.16) 
    145165      ! 
    146166   END SUBROUTINE stp_ctl 
Note: See TracChangeset for help on using the changeset viewer.