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_c1d.F90 in branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/C1D – NEMO

source: branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90 @ 7953

Last change on this file since 7953 was 7953, checked in by gm, 7 years ago

#1880 (HPC-09): add zdfphy (the ZDF manager) + remove all key_...

  • Property svn:keywords set to Id
File size: 7.7 KB
Line 
1MODULE step_c1d
2   !!======================================================================
3   !!                       ***  MODULE step_c1d  ***
4   !! Time-stepping    : manager of the ocean, tracer and ice time stepping - c1d case
5   !!======================================================================
6   !! History :   2.0  !  2004-04  (C. Ethe)  adapted from step.F90 for C1D
7   !!             3.0  !  2008-04  (G. Madec)  redo the adaptation to include SBC
8   !!----------------------------------------------------------------------
9#if defined key_c1d
10   !!----------------------------------------------------------------------
11   !!   'key_c1d'                                       1D Configuration
12   !!---------------------------------------------------------------------- 
13   !!   stp_c1d        : NEMO system time-stepping in c1d case
14   !!----------------------------------------------------------------------
15   USE step_oce        ! time stepping definition modules
16#if defined key_top
17   USE trcstp          ! passive tracer time-stepping      (trc_stp routine)
18#endif
19   USE dyncor_c1d      ! Coriolis term (c1d case)         (dyn_cor_1d     )
20   USE dynnxt          ! time-stepping                    (dyn_nxt routine)
21   USE dyndmp          ! U & V momentum damping           (dyn_dmp routine)
22   USE restart         ! restart
23
24   IMPLICIT NONE
25   PRIVATE
26
27   PUBLIC stp_c1d      ! called by opa.F90
28
29   !!----------------------------------------------------------------------
30   !! NEMO/C1D 3.7 , NEMO Consortium (2015)
31   !! $Id$
32   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
33   !!----------------------------------------------------------------------
34CONTAINS
35
36   SUBROUTINE stp_c1d( kstp )
37      !!----------------------------------------------------------------------
38      !!                     ***  ROUTINE stp_c1d  ***
39      !!                     
40      !! ** Purpose :  - Time stepping of SBC including LIM (dynamic and thermodynamic eqs.)
41      !!               - Time stepping of OPA (momentum and active tracer eqs.)
42      !!               - Time stepping of TOP (passive tracer eqs.)
43      !!
44      !! ** Method  : -1- Update forcings and data 
45      !!              -2- Update vertical ocean physics
46      !!              -3- Compute the t and s trends
47      !!              -4- Update t and s
48      !!              -5- Compute the momentum trends
49      !!              -6- Update the horizontal velocity
50      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w)
51      !!              -8- Outputs and diagnostics
52      !!----------------------------------------------------------------------
53      INTEGER, INTENT(in) ::   kstp   ! ocean time-step index
54      !
55      INTEGER ::   jk       ! dummy loop indice
56      INTEGER ::   indic    ! error indicator if < 0
57      !! ---------------------------------------------------------------------
58
59                             indic = 0                ! reset to no error condition
60      IF( kstp == nit000 )   CALL iom_init( "nemo")   ! iom_put initialization (must be done after nemo_init for AGRIF+XIOS+OASIS)
61      IF( kstp /= nit000 )   CALL day( kstp )         ! Calendar (day was already called at nit000 in day_init)
62                             CALL iom_setkt( kstp - nit000 + 1, "nemo" )   ! say to iom that we are at time step kstp
63
64      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
65      ! Update data, open boundaries, surface boundary condition (including sea-ice)
66      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
67                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice)
68
69      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
70      ! Ocean physics update                (ua, va, ta, sa used as workspace)
71      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
72                         CALL eos_rab( tsb, rab_b )   ! before local thermal/haline expension ratio at T-points
73                         CALL eos_rab( tsn, rab_n )   ! now    local thermal/haline expension ratio at T-points
74                         CALL bn2( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency
75                         CALL bn2( tsn, rab_n, rn2  ) ! now    Brunt-Vaisala frequency
76     
77      !  VERTICAL PHYSICS
78                         CALL zdf_phy( kstp )         ! vertical physics update (bfr, avt, avs, avm + MLD)
79
80      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
81      ! diagnostics and outputs             (ua, va, ta, sa used as workspace)
82      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
83                         CALL dia_wri( kstp )       ! ocean model: outputs
84      IF( lk_diahth  )   CALL dia_hth( kstp )       ! Thermocline depth (20°C)
85
86
87#if defined key_top
88      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
89      ! Passive Tracer Model
90      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
91                        CALL trc_stp( kstp )       ! time-stepping
92#endif
93
94      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
95      ! Active tracers                              (ua, va used as workspace)
96      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
97                        tsa(:,:,:,:) = 0._wp       ! set tracer trends to zero
98
99                        CALL tra_sbc( kstp )       ! surface boundary condition
100      IF( ln_traqsr )   CALL tra_qsr( kstp )       ! penetrative solar radiation qsr
101      IF( ln_tradmp )   CALL tra_dmp( kstp )       ! internal damping trends- tracers
102                        CALL tra_zdf( kstp )       ! vertical mixing
103                        CALL eos( tsn, rhd, rhop, gdept_0(:,:,:) )   ! now potential density for zdfmxl
104      IF( ln_zdfnpc )   CALL tra_npc( kstp )       ! applied non penetrative convective adjustment on (t,s)
105                        CALL tra_nxt( kstp )       ! tracer fields at next time step
106
107
108
109      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
110      ! Dynamics                                    (ta, sa used as workspace)
111      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
112                        ua(:,:,:) = 0._wp          ! set dynamics trends to zero
113                        va(:,:,:) = 0._wp
114
115      IF( ln_dyndmp )   CALL dyn_dmp    ( kstp )   ! internal damping trends- momentum
116                        CALL dyn_cor_c1d( kstp )   ! vorticity term including Coriolis
117                        CALL dyn_zdf    ( kstp )   ! vertical diffusion
118                        CALL dyn_nxt    ( kstp )   ! lateral velocity at next time step
119
120      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
121      ! Control and restarts
122      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
123                             CALL stp_ctl( kstp, indic )
124      IF( kstp == nit000 )   CALL iom_close( numror )      ! close input  ocean restart file
125      IF( lrst_oce       )   CALL rst_write( kstp )        ! write output ocean restart file
126      !
127#if defined key_iomput
128      IF( kstp == nitend .OR. indic < 0 )   CALL xios_context_finalize()   ! needed for XIOS
129      !
130#endif
131   END SUBROUTINE stp_c1d
132
133#else
134   !!----------------------------------------------------------------------
135   !!   Default key                                            NO 1D Config
136   !!----------------------------------------------------------------------
137CONTAINS
138   SUBROUTINE stp_c1d ( kt )      ! dummy routine
139      WRITE(*,*) 'stp_c1d: You should not have seen this print! error?', kt
140   END SUBROUTINE stp_c1d
141#endif
142
143   !!======================================================================
144END MODULE step_c1d
Note: See TracBrowser for help on using the repository browser.