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/SAS_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/SAS_SRC/stpctl.F90

    r9267 r9441  
    2525   USE lib_mpp         ! distributed memory computing 
    2626 
     27   USE netcdf          ! NetCDF library 
    2728   IMPLICIT NONE 
    2829   PRIVATE 
    2930 
    3031   PUBLIC stp_ctl           ! routine called by step.F90 
     32 
     33   INTEGER  ::   idrun, idtime, idssh, idu, ids, istatus 
    3134   !!---------------------------------------------------------------------- 
    3235   !! NEMO/OPA 4.0 , NEMO Consortium (2017) 
     
    6467         !                                ! open run.stat file 
    6568         CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea ) 
     69 
     70         IF( lwm ) THEN 
     71            istatus = NF90_CREATE( 'run.stat.nc', NF90_CLOBBER, idrun ) 
     72            istatus = NF90_DEF_DIM( idrun, 'time', NF90_UNLIMITED, idtime ) 
     73            istatus = NF90_DEF_VAR( idrun, 'abs_ssh_max', NF90_DOUBLE, (/ idtime /), idssh ) 
     74            istatus = NF90_DEF_VAR( idrun,   'abs_u_max', NF90_DOUBLE, (/ idtime /), idu ) 
     75            istatus = NF90_DEF_VAR( idrun,       's_min', NF90_DOUBLE, (/ idtime /), ids ) 
     76            istatus = NF90_ENDDEF(idrun) 
     77         ENDIF 
     78          
    6679      ENDIF 
    6780      ! 
     
    8497 
    8598      !                                            !==  run statistics  ==!   ("run.stat" file) 
    86       IF(lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), -zmax(3) 
     99      IF(lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), - zmax(3) 
     100      IF( lwm ) THEN 
     101         istatus = NF90_PUT_VAR( idrun, idssh, (/ zmax(1)/), (/kt/), (/1/) ) 
     102         istatus = NF90_PUT_VAR( idrun,   idu, (/ zmax(2)/), (/kt/), (/1/) ) 
     103         istatus = NF90_PUT_VAR( idrun,   ids, (/-zmax(3)/), (/kt/), (/1/) ) 
     104         IF( MOD( kt , 100 ) == 0 ) istatus = NF90_SYNC(idrun) 
     105         IF( kt == nitend         ) istatus = NF90_CLOSE(idrun) 
     106      END IF 
    87107      ! 
    88 9400  FORMAT(' it :', i8, '    vt_i_max: ', e16.10, ' |u_ice|_max: ',e16.10,' tm_i_min: ',e16.10) 
     1089400  FORMAT(' it :', i8, '    |ssh|_max: ', D23.16, ' |U|_max: ', D23.16,' S_min: ', D23.16) 
    89109      ! 
    90110   END SUBROUTINE stp_ctl 
Note: See TracChangeset for help on using the changeset viewer.