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

source: branches/2013/dev_MERGE_2013/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90 @ 4313

Last change on this file since 4313 was 4313, checked in by cetlod, 10 years ago

dev_MERGE_2013 : fix on argument call of eos

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