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.
stpctl.F90 in branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC – NEMO

source: branches/2017/dev_merge_2017/NEMOGCM/NEMO/SAS_SRC/stpctl.F90 @ 9436

Last change on this file since 9436 was 9267, checked in by clem, 6 years ago

add a run.stat for sas containing ice diagnostics

  • Property svn:keywords set to Id
File size: 4.3 KB
Line 
1MODULE stpctl
2   !!======================================================================
3   !!                       ***  MODULE  stpctl  ***
4   !! Ocean run control :  gross check of the ocean time stepping
5   !!                      version for standalone surface scheme
6   !!======================================================================
7   !! History :  OPA  ! 1991-03  (G. Madec) Original code
8   !!            6.0  ! 1992-06  (M. Imbard)
9   !!            8.0  ! 1997-06  (A.M. Treguier)
10   !!   NEMO     1.0  ! 2002-06  (G. Madec)  F90: Free form and module
11   !!            2.0  ! 2009-07  (G. Madec)  Add statistic for time-spliting
12   !!            3.5  ! 2012-03  (S. Alderson)
13   !!            4.0  ! 2017-04  (G. Madec)  regroup global communications
14   !!----------------------------------------------------------------------
15
16   !!----------------------------------------------------------------------
17   !!   stp_ctl      : Control the run
18   !!----------------------------------------------------------------------
19   USE oce             ! ocean dynamics and tracers variables
20   USE dom_oce         ! ocean space and time domain variables
21   USE ice      , ONLY : vt_i, u_ice, tm_i
22   !
23   USE in_out_manager  ! I/O manager
24   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
25   USE lib_mpp         ! distributed memory computing
26
27   IMPLICIT NONE
28   PRIVATE
29
30   PUBLIC stp_ctl           ! routine called by step.F90
31   !!----------------------------------------------------------------------
32   !! NEMO/OPA 4.0 , NEMO Consortium (2017)
33   !! $Id$
34   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
35   !!----------------------------------------------------------------------
36
37CONTAINS
38
39   SUBROUTINE stp_ctl( kt, kindic )
40      !!----------------------------------------------------------------------
41      !!                    ***  ROUTINE stp_ctl  ***
42      !!                     
43      !! ** Purpose :   Control the run
44      !!
45      !! ** Method  : - Save the time step in numstp
46      !!              - Print it each 50 time steps
47      !!
48      !! ** Actions :   "time.step" file = last ocean time-step
49      !!                "run.stat"  file = run statistics
50      !!               
51      !!----------------------------------------------------------------------
52      INTEGER, INTENT( in    ) ::   kt       ! ocean time-step index
53      INTEGER, INTENT( inout ) ::   kindic   ! indicator of solver convergence
54      !!
55      REAL(wp), DIMENSION(3) ::   zmax
56      !!----------------------------------------------------------------------
57
58      IF( kt == nit000 .AND. lwp ) THEN
59         WRITE(numout,*)
60         WRITE(numout,*) 'stp_ctl : time-stepping control'
61         WRITE(numout,*) '~~~~~~~'
62         !                                ! open time.step file
63         CALL ctl_opn( numstp, 'time.step', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
64         !                                ! open run.stat file
65         CALL ctl_opn( numrun, 'run.stat', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
66      ENDIF
67      !
68      IF(lwp) THEN                        !==  current time step  ==!   ("time.step" file)
69         WRITE ( numstp, '(1x, i8)' )   kt
70         REWIND( numstp )
71      ENDIF
72      !                                   !==  test of extrema  ==!
73      zmax(1) = MAXVAL(      vt_i (:,:) )                                           ! max ice thickness
74      zmax(2) = MAXVAL( ABS( u_ice(:,:) ) )                                         ! max ice velocity (zonal only)
75      zmax(3) = MAXVAL(     -tm_i (:,:)+273.15_wp , mask = ssmask(:,:) == 1._wp )   ! min ice temperature
76      !
77      IF( lk_mpp ) THEN
78         CALL mpp_max_multiple( zmax(:), 3 )    ! max over the global domain
79      ENDIF
80      !
81      IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN
82         WRITE(numout,*) ' ==>> time-step= ', kt, ' vt_i max: ',  zmax(1), ' |u_ice| max: ', zmax(2), ' tm_i min: ', -zmax(3)
83      ENDIF
84
85      !                                            !==  run statistics  ==!   ("run.stat" file)
86      IF(lwp) WRITE(numrun,9400) kt, zmax(1), zmax(2), -zmax(3)
87      !
889400  FORMAT(' it :', i8, '    vt_i_max: ', e16.10, ' |u_ice|_max: ',e16.10,' tm_i_min: ',e16.10)
89      !
90   END SUBROUTINE stp_ctl
91
92   !!======================================================================
93END MODULE stpctl
Note: See TracBrowser for help on using the repository browser.