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 on Ticket #1614 – Attachment – NEMO

Ticket #1614: stpctl.F90

File stpctl.F90, 3.3 KB (added by emalod, 8 years ago)

proposition of stpctl.F90 SAS file

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   !!----------------------------------------------------------------------
14
15   !!----------------------------------------------------------------------
16   !!   stp_ctl      : Control the run
17   !!----------------------------------------------------------------------
18   USE oce             ! ocean dynamics and tracers variables
19   USE dom_oce         ! ocean space and time domain variables
20   USE in_out_manager  ! I/O manager
21   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
22   USE lib_mpp         ! distributed memory computing
23   USE sbc_oce          ! Surface boundary condition: ocean fields
24
25   IMPLICIT NONE
26   PRIVATE
27
28   PUBLIC stp_ctl           ! routine called by step.F90
29   !!----------------------------------------------------------------------
30   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
31   !! $Id: stpctl.F90 5215 2015-04-15 16:11:56Z nicolasmartin $
32   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
33   !!----------------------------------------------------------------------
34
35CONTAINS
36
37   SUBROUTINE stp_ctl( kt, kindic )
38      !!----------------------------------------------------------------------
39      !!                    ***  ROUTINE stp_ctl  ***
40      !!                     
41      !! ** Purpose :   Control the run
42      !!
43      !! ** Method  : - Save the time step in numstp
44      !!              - Print it each 50 time steps
45      !!
46      !! ** Actions :   'time.step' file containing the last ocean time-step
47      !!               
48      !!----------------------------------------------------------------------
49      INTEGER, INTENT( in ) ::      kt      ! ocean time-step index
50      INTEGER, INTENT( inout ) ::   kindic  ! indicator of solver convergence
51      CHARACTER(len = 32) ::        clfname ! time stepping output file name
52      !!----------------------------------------------------------------------
53
54      IF( kt == nit000 .AND. lwp ) THEN
55         WRITE(numout,*)
56         WRITE(numout,*) 'stp_ctl : time-stepping control'
57         WRITE(numout,*) '~~~~~~~'
58         ! open time.step file
59         IF ( nn_components == jp_iam_sas ) THEN
60            clfname = 'time.step.sas'
61         ELSE
62            clfname = 'time.step'
63         ENDIF
64         CALL ctl_opn( numstp, TRIM(clfname), 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
65      ENDIF
66
67      IF(lwp) WRITE ( numstp, '(1x, i8)' )   kt      !* save the current time step in numstp
68      IF(lwp) REWIND( numstp )                       !  --------------------------
69
70   END SUBROUTINE stp_ctl
71
72   !!======================================================================
73END MODULE stpctl