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 trunk/NEMOGCM/NEMO/OPA_SRC/C1D – NEMO

source: trunk/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90 @ 3294

Last change on this file since 3294 was 3294, checked in by rblod, 12 years ago

Merge of 3.4beta into the trunk

File size: 8.8 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_c1d      ! time-stepping                    (dyn_nxt routine)
21
22   IMPLICIT NONE
23   PRIVATE
24
25   PUBLIC stp_c1d      ! called by opa.F90
26
27   !! * Substitutions
28#  include "domzgr_substitute.h90"
29#  include "zdfddm_substitute.h90"
30   !!----------------------------------------------------------------------
31   !! NEMO/C1D 3.3 , NEMO Consortium (2010)
32   !! $Id: step_c1d.F90 2382 2010-11-13 13:08:12Z gm $
33   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
34   !!----------------------------------------------------------------------
35CONTAINS
36
37   SUBROUTINE stp_c1d( kstp )
38      !!----------------------------------------------------------------------
39      !!                     ***  ROUTINE stp_c1d  ***
40      !!                     
41      !! ** Purpose :  - Time stepping of SBC including LIM (dynamic and thermodynamic eqs.)
42      !!               - Time stepping of OPA (momentum and active tracer eqs.)
43      !!               - Time stepping of TOP (passive tracer eqs.)
44      !!
45      !! ** Method  : -1- Update forcings and data 
46      !!              -2- Update vertical ocean physics
47      !!              -3- Compute the t and s trends
48      !!              -4- Update t and s
49      !!              -5- Compute the momentum trends
50      !!              -6- Update the horizontal velocity
51      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w)
52      !!              -8- Outputs and diagnostics
53      !!----------------------------------------------------------------------
54      INTEGER, INTENT(in) ::   kstp   ! ocean time-step index
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 day( kstp )         ! Calendar (day was already called at nit000 in day_init)
61                             CALL iom_setkt( kstp )   ! say to iom that we are at time step kstp
62
63      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
64      ! Update data, open boundaries, surface boundary condition (including sea-ice)
65      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
66                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice)
67
68      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
69      ! Ocean physics update                (ua, va, ta, sa used as workspace)
70      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
71                         CALL bn2( tsb, rn2b )        ! before Brunt-Vaisala frequency
72                         CALL bn2( tsn, rn2  )        ! now    Brunt-Vaisala frequency
73      !  VERTICAL PHYSICS   
74                         CALL zdf_bfr( kstp )         ! bottom friction
75      !                                               ! Vertical eddy viscosity and diffusivity coefficients
76      IF( lk_zdfric  )   CALL zdf_ric( kstp )            ! Richardson number dependent Kz
77      IF( lk_zdftke  )   CALL zdf_tke( kstp )            ! TKE closure scheme for Kz
78      IF( lk_zdfgls  )   CALL zdf_gls( kstp )            ! GLS closure scheme for Kz
79      IF( lk_zdfkpp  )   CALL zdf_kpp( kstp )            ! KPP closure scheme for Kz
80      IF( lk_zdfcst  )   THEN                            ! Constant Kz (reset avt, avm[uv] to the background value)
81         avt (:,:,:) = rn_avt0 * tmask(:,:,:)
82         avmu(:,:,:) = rn_avm0 * umask(:,:,:)
83         avmv(:,:,:) = rn_avm0 * vmask(:,:,:)
84      ENDIF
85
86      IF( ln_rnf_mouth ) THEN                         ! increase diffusivity at rivers mouths
87         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:)   ;   END DO
88      ENDIF
89      IF( ln_zdfevd  )   CALL zdf_evd( kstp )         ! enhanced vertical eddy diffusivity
90
91      IF( lk_zdftmx  )   CALL zdf_tmx( kstp )         ! tidal vertical mixing
92
93      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   &
94         &               CALL zdf_ddm( kstp )         ! double diffusive mixing
95         
96                         CALL zdf_mxl( kstp )         ! mixed layer depth
97
98                                                      ! write tke information in the restart file
99      IF( lrst_oce .AND. lk_zdftke )   CALL tke_rst( kstp, 'WRITE' )
100                                                      ! write gls information in the restart file
101      IF( lrst_oce .AND. lk_zdfgls )   CALL gls_rst( kstp, 'WRITE' )
102
103      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
104      ! diagnostics and outputs             (ua, va, ta, sa used as workspace)
105      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
106                         CALL dia_wri( kstp )       ! ocean model: outputs
107
108#if defined key_top
109      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
110      ! Passive Tracer Model
111      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
112                         CALL trc_stp( kstp )            ! time-stepping
113#endif
114
115      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
116      ! Active tracers                              (ua, va used as workspace)
117      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
118                             tsa(:,:,:,:) = 0.e0                ! set tracer trends to zero
119
120                             CALL tra_sbc    ( kstp )        ! surface boundary condition
121      IF( ln_traqsr      )   CALL tra_qsr    ( kstp )        ! penetrative solar radiation qsr
122      IF( lk_zdfkpp      )   CALL tra_kpp    ( kstp )        ! KPP non-local tracer fluxes
123                             CALL tra_zdf    ( kstp )        ! vertical mixing
124                             CALL tra_nxt    ( kstp )        ! tracer fields at next time step
125      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )        ! applied non penetrative convective adjustment on (t,s)
126                             CALL eos( tsb, rhd, rhop )      ! now (swap=before) in situ density for dynhpg module
127
128      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
129      ! Dynamics                                    (ta, sa used as workspace)
130      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
131                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero
132                               va(:,:,:) = 0.e0
133
134                               CALL dyn_cor_c1d( kstp )       ! vorticity term including Coriolis
135                               CALL dyn_zdf    ( kstp )       ! vertical diffusion
136                               CALL dyn_nxt_c1d( kstp )       ! lateral velocity at next time step
137
138      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
139      ! Control and restarts
140      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
141                                 CALL stp_ctl( kstp, indic )
142      IF( kstp == nit000     )   CALL iom_close( numror )             ! close input  ocean restart file
143      IF( lrst_oce           )   CALL rst_write  ( kstp )             ! write output ocean restart file
144      !
145   END SUBROUTINE stp_c1d
146
147#else
148   !!----------------------------------------------------------------------
149   !!   Default key                                            NO 1D Config
150   !!----------------------------------------------------------------------
151CONTAINS
152   SUBROUTINE stp_c1d ( kt )      ! dummy routine
153      WRITE(*,*) 'stp_c1d: You should not have seen this print! error?', kt
154   END SUBROUTINE stp_c1d
155#endif
156
157   !!======================================================================
158END MODULE step_c1d
Note: See TracBrowser for help on using the repository browser.