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.
step.F90 in branches/2016/dev_merge_2016/NEMOGCM/NEMO/SAS_SRC – NEMO

source: branches/2016/dev_merge_2016/NEMOGCM/NEMO/SAS_SRC/step.F90 @ 7412

Last change on this file since 7412 was 7412, checked in by lovato, 7 years ago

Merge dev_NOC_CMCC_merge_2016 into branch

  • Property svn:keywords set to Id
File size: 5.1 KB
Line 
1MODULE step
2   !!======================================================================
3   !!                       ***  MODULE step  ***
4   !! Time-stepping    : manager of the ocean, tracer and ice time stepping
5   !!                    version for standalone surface scheme
6   !!======================================================================
7   !! History :  OPA  !  1991-03  (G. Madec)  Original code
8   !!             .   !    .                                                     
9   !!             .   !    .                                                     
10   !!   NEMO     3.5  !  2012-03  (S. Alderson)
11   !!----------------------------------------------------------------------
12
13   !!----------------------------------------------------------------------
14   !!   stp             : OPA system time-stepping
15   !!----------------------------------------------------------------------
16   USE oce              ! ocean dynamics and tracers variables
17   USE dom_oce          ! ocean space and time domain variables
18   USE daymod           ! calendar                         (day     routine)
19   USE sbc_oce          ! surface boundary condition: fields
20   USE sbcmod           ! surface boundary condition       (sbc     routine)
21   USE sbcrnf           ! surface boundary condition: runoff variables
22   USE sbccpl           ! surface boundary condition: coupled interface
23   USE eosbn2           ! equation of state                (eos_bn2 routine)
24   USE diawri           ! Standard run outputs             (dia_wri routine)
25   USE bdy_oce   , ONLY: ln_bdy
26   USE bdydta           ! clem: mandatory for LIM3
27   USE stpctl           ! time stepping control            (stp_ctl routine)
28   !
29   USE in_out_manager   ! I/O manager
30   USE prtctl           ! Print control                    (prt_ctl routine)
31   USE iom              !
32   USE lbclnk           !
33   USE timing           ! Timing           
34#if defined key_iomput
35   USE xios
36#endif
37
38   IMPLICIT NONE
39   PRIVATE
40
41   PUBLIC   stp   ! called by nemogcm.F90
42
43   !!----------------------------------------------------------------------
44   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
45   !! $Id$
46   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
47   !!----------------------------------------------------------------------
48CONTAINS
49
50#if defined key_agrif
51   SUBROUTINE stp( )
52      INTEGER             ::   kstp   ! ocean time-step index
53#else
54   SUBROUTINE stp( kstp )
55      INTEGER, INTENT(in) ::   kstp   ! ocean time-step index
56#endif
57      !!----------------------------------------------------------------------
58      !!                     ***  ROUTINE stp  ***
59      !!                     
60      !! ** Purpose : - Time stepping of SBC (surface boundary)
61      !!
62      !! ** Method  : -1- Update forcings and data 
63      !!              -2- Outputs and diagnostics
64      !!----------------------------------------------------------------------
65      INTEGER ::   indic    ! error indicator if < 0
66      !! ---------------------------------------------------------------------
67
68#if defined key_agrif
69      kstp = nit000 + Agrif_Nb_Step()
70# if defined key_iomput
71      IF( Agrif_Nbstepint() == 0 )   CALL iom_swap( cxios_context )
72# endif   
73#endif   
74      IF( kstp == nit000 )   CALL iom_init( cxios_context ) ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
75      IF( kstp /= nit000 )   CALL day( kstp )             ! Calendar (day was already called at nit000 in day_init)
76                             CALL iom_setkt( kstp - nit000 + 1, cxios_context )   ! tell iom we are at time step kstp
77
78      ! ==> clem: open boundaries is mandatory for LIM3 because ice BDY is not decoupled from 
79      !           the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules.
80      !           From SAS: ocean bdy data are wrong  (but we do not care) and ice bdy data are OK. 
81      !           This is not clean and should be changed in the future.
82      IF( ln_bdy     )       CALL bdy_dta ( kstp, time_offset=+1 )   ! update dynamic & tracer data at open boundaries
83      ! ==>
84                             CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice)
85
86                             CALL dia_wri( kstp )         ! ocean model: outputs
87
88                             indic = 0                    ! although indic is not changed in stp_ctl
89                                                          ! need to keep the same interface
90                             CALL stp_ctl( kstp, indic )
91      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
92      ! Coupled mode
93      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
94      IF( lk_oasis    )  CALL sbc_cpl_snd( kstp )     ! coupled mode : field exchanges if OASIS-coupled ice
95
96#if defined key_iomput
97      IF( kstp == nitend .OR. indic < 0 ) THEN
98                             CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF
99      ENDIF
100#endif
101      !
102      IF( nn_timing == 1 .AND.  kstp == nit000  )   CALL timing_reset
103      !
104   END SUBROUTINE stp
105
106   !!======================================================================
107END MODULE step
Note: See TracBrowser for help on using the repository browser.