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

source: trunk/NEMO/OPA_SRC/step.F90 @ 443

Last change on this file since 443 was 434, checked in by opalod, 18 years ago

nemo_v1_update_044 : CT : update the passive tracers TOP component and the standard GYRE configuration

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 25.9 KB
Line 
1MODULE step
2   !!======================================================================
3   !!                       ***  MODULE step  ***
4   !! Time-stepping    : manager of the ocean, tracer and ice time stepping
5   !!======================================================================
6
7   !!----------------------------------------------------------------------
8   !!   stp            : OPA system time-stepping
9   !!----------------------------------------------------------------------
10   !! * Modules used
11   USE oce             ! ocean dynamics and tracers variables
12   USE dom_oce         ! ocean space and time domain variables
13   USE zdf_oce         ! ocean vertical physics variables
14   USE ldftra_oce
15   USE ldfdyn_oce
16   USE cpl_oce         ! coupled ocean-atmosphere variables
17   USE in_out_manager  ! I/O manager
18   USE lbclnk
19
20   USE daymod          ! calendar                         (day     routine)
21
22   USE dtatem          ! ocean temperature data           (dta_tem routine)
23   USE dtasal          ! ocean salinity    data           (dta_sal routine)
24   USE dtasst          ! ocean sea surface temperature    (dta_sst routine)
25   USE dtasss          ! ocean sea surface salinity       (dta_sss routine)
26   USE taumod          ! surface stress                   (tau     routine)
27   USE flxmod          ! thermohaline fluxes              (flx     routine)
28   USE ocesbc          ! thermohaline fluxes              (oce_sbc routine)
29   USE flxrnf          ! runoffs                          (flx_rnf routine)
30   USE flxfwb          ! freshwater budget correction     (flx_fwb routine)
31   USE closea          ! closed sea freshwater budget     (flx_clo routine)
32   USE ocfzpt          ! surface ocean freezing point    (oc_fz_pt routine)
33
34   USE trcstp          ! passive tracer time-stepping      (trc_stp routine)
35
36   USE dynhpg          ! hydrostatic pressure grad.       (dyn_hpg routine)
37   USE dynhpg_atsk     ! hydrostatic pressure grad.  (dyn_hpg_atsk routine)
38   USE dynspg_oce      ! surface pressure gradient        (dyn_spg routine)
39   USE dynspg          ! surface pressure gradient        (dyn_spg routine)
40   USE dynkeg          ! kinetic energy gradient          (dyn_keg routine)
41   USE dynvor          ! vorticity term              (dyn_vor_... routines)
42   USE dynzad          ! vertical advection               (dyn_adv routine)
43   USE dynldf_bilapg   ! lateral mixing            (dyn_ldf_bilapg routine)
44   USE dynldf_bilap    ! lateral mixing             (dyn_ldf_bilap routine)
45   USE dynldf_iso      ! lateral mixing               (dyn_ldf_iso routine)
46   USE dynldf_lap      ! lateral mixing               (dyn_ldf_lap routine)
47   USE dynzdf_imp      ! vertical diffusion: implicit     (dyn_zdf routine)
48   USE dynzdf_imp_atsk ! vertical diffusion: implicit     (dyn_zdf routine)
49   USE dynzdf_iso      ! vertical diffusion: isopycnal    (dyn_zdf routine)
50   USE dynzdf_exp      ! vertical diffusion: explicit (dyn_zdf_exp routine)
51   USE dynnxt          ! time-stepping                    (dyn_nxt routine)
52
53   USE trabbc          ! bottom boundary condition        (tra_bbc routine)
54   USE trabbl          ! bottom boundary layer            (tra_bbl routine)
55   USE tradmp          ! internal damping                 (tra_dmp routine)
56   USE traldf_bilapg   ! lateral mixing            (tra_ldf_bilapg routine)
57   USE traldf_bilap    ! lateral mixing             (tra_ldf_bilap routine)
58   USE traldf_iso      ! lateral mixing               (tra_ldf_iso routine)
59   USE traldf_iso_zps  ! lateral mixing           (tra_ldf_iso_zps routine)
60   USE traldf_lap      ! lateral mixing               (tra_ldf_lap routine)
61   USE traqsr          ! solar radiation penetration      (tra_qsr routine)
62   USE tranpc          ! non-penetrative convection       (tra_npc routine)
63   USE tranxt          ! time-stepping                    (tra_nxt routine)
64   USE traadv_ctl      ! advection scheme control     (tra_adv_ctl routine)
65   USE traadv_cen2     ! 2nd order centered scheme   (tra_adv_cen2 routine)
66   USE traadv_tvd      ! TVD scheme                (tra_adv_tvd    routine)
67   USE traadv_muscl    ! MUSCL scheme              (tra_adv_muscl  routine)
68   USE traadv_muscl2   ! MUSCL2 scheme             (tra_adv_muscl2 routine)
69   USE cla             ! cross land advection             (tra_cla routine)
70   USE trazdf_exp      ! vertical diffusion: explicit (tra_zdf_exp routine)
71   USE trazdf_imp      ! vertical diffusion: implicit (tra_zdf_imp routine)
72   USE trazdf_iso      ! vertical diffusion           (tra_zdf_exp routine)
73   USE trazdf_iso_vopt ! vertical diffusion           (tra_zdf_exp routine)
74   USE trasbc          ! surface boundary condition       (tra_sbc routine)
75
76   USE eosbn2          ! equation of state                (eos_bn2 routine)
77
78   USE obc_par         ! open boundary condition variables
79   USE obcdta          ! open boundary condition data     (obc_dta routine)
80   USE obcrst          ! open boundary cond. restart      (obc_rst routine)
81   USE obcrad          ! open boundary cond. radiation    (obc_rad routine)
82   USE obcspg          ! open boundary cond  spg          (obc_spg routine)
83
84   USE divcur          ! hor. divergence and curl      (div & cur routines)
85   USE cla_div         ! cross land: hor. divergence      (div_cla routine)
86   USE wzvmod          ! vertical velocity                (wzv     routine)
87
88   USE ldfslp          ! iso-neutral slopes               (ldf_slp routine)
89   USE ldfeiv          ! eddy induced velocity coef.      (ldf_eiv routine)
90
91   USE zdfbfr          ! bottom friction                  (zdf_bfr routine)
92   USE zdftke          ! TKE vertical mixing              (zdf_tke routine)
93   USE zdfkpp          ! KPP vertical mixing              (zdf_kpp routine)
94   USE zdfddm          ! double diffusion mixing          (zdf_ddm routine)
95   USE zdfevd          ! enhanced vertical diffusion      (zdf_evd routine)
96   USE zdfric          ! Richardson vertical mixing       (zdf_ric routine)
97   USE zdfmxl          ! Mixed-layer depth                (zdf_mxl routine)
98
99   USE zpshde          ! partial step: hor. derivative     (zps_hde routine)
100   USE ice_oce         ! sea-ice variable
101   USE icestp          ! sea-ice time-stepping             (ice_stp routine)
102
103   USE diawri          ! Standard run outputs             (dia_wri routine)
104   USE trdicp          ! Ocean momentum/tracers trends    (trd_wri routine)
105   USE trdmld          ! mixed-layer trends               (trd_mld routine)
106   USE trdvor          ! vorticity budget                 (trd_vor routine)
107   USE diagap          ! hor. mean model-data gap         (dia_gap routine)
108   USE diahdy          ! dynamic height                   (dia_hdy routine)
109   USE diaptr          ! poleward transports              (dia_ptr routine)
110   USE diahth          ! thermocline depth                (dia_hth routine)
111   USE diafwb          ! freshwater budget                (dia_fwb routine)
112   USE diaspr          ! suface pressure (rigid-lid)      (dia_spr routine)
113   USE flo_oce         ! floats variables
114   USE floats          ! floats computation               (flo_stp routine)
115
116   USE stpctl          ! time stepping control            (stp_ctl routine)
117   USE restart         ! ocean restart                    (rst_wri routine)
118   USE cpl             ! exchanges in coupled mode        (cpl_stp routine)
119   USE prtctl          ! Print control                    (prt_ctl routine)
120
121#if defined key_agrif
122   USE agrif_opa_sponge ! Momemtum and tracers sponges
123#endif
124
125   IMPLICIT NONE
126   PRIVATE
127
128   !! * Routine accessibility
129   PUBLIC stp            ! called by opa.F90
130
131   !! * Substitutions
132#  include "domzgr_substitute.h90"
133#  include "zdfddm_substitute.h90"
134   !!----------------------------------------------------------------------
135   !!   OPA 9.0 , LOCEAN-IPSL (2005)
136   !! $Header$
137   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
138   !!----------------------------------------------------------------------
139
140CONTAINS
141
142   SUBROUTINE stp( &
143#if !defined key_agrif
144   kstp &
145#endif   
146   )      !!----------------------------------------------------------------------
147      !!                     ***  ROUTINE stp  ***
148      !!                     
149      !! ** Purpose : - Time stepping of OPA (momentum and active tracer eqs.)
150      !!              - Time stepping of LIM (dynamic and thermodynamic eqs.)
151      !!              - Tme stepping  of TRC (passive tracer eqs.)
152      !!
153      !! ** Method  : -1- Update forcings and data 
154      !!              -2- Update ocean physics
155      !!              -3- Compute the t and s trends
156      !!              -4- Update t and s
157      !!              -5- Compute the momentum trends
158      !!              -6- Update the horizontal velocity
159      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w)
160      !!              -8- Outputs and diagnostics
161      !!
162      !! History :
163      !!        !  91-03  ()  Original code
164      !!        !  91-11  (G. Madec)
165      !!        !  92-06  (M. Imbard)  add a first output record
166      !!        !  96-04  (G. Madec)  introduction of dynspg
167      !!        !  96-04  (M.A. Foujols)  introduction of passive tracer
168      !!   8.0  !  97-06  (G. Madec)  new architecture of call
169      !!   8.2  !  97-06  (G. Madec, M. Imbard, G. Roullet)  free surface
170      !!   8.2  !  99-02  (G. Madec, N. Grima)  hpg implicit
171      !!   8.2  !  00-07  (J-M Molines, M. Imbard)  Open Bondary Conditions
172      !!   9.0  !  02-06  (G. Madec)  free form, suppress macro-tasking
173      !!    "   !  04-08  (C. Talandier) New trends organization
174      !!    "   !  05-01  (C. Ethe) Add the KPP closure scheme
175      !!    "   !  05-11  (V. Garnier) Surface pressure gradient organization
176      !!----------------------------------------------------------------------
177      !! * Arguments
178      INTEGER &
179#if !defined key_agrif   
180      , INTENT( in ) &
181#endif     
182      ::   kstp   ! ocean time-step index
183
184      !! * local declarations
185      INTEGER ::   indic    ! error indicator if < 0
186      !! ---------------------------------------------------------------------
187
188#if defined key_agrif
189      kstp = nit000 + Agrif_Nb_Step()
190      IF ( Agrif_Root() .and. lwp) Write(*,*) '---'
191      IF (lwp) Write(*,*) 'Grid N°',Agrif_Fixed(),' time step ',kstp
192#endif   
193      indic = 1                    ! reset to no error condition
194      adatrj = adatrj + rdt/86400._wp
195
196      CALL day( kstp )             ! Calendar
197
198      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
199      ! Update data, open boundaries and Forcings
200      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
201
202      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data
203
204      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! Salinity data
205
206      IF( lk_dtasst  )   CALL dta_sst( kstp )         ! Sea Surface Temperature data
207
208      IF( lk_dtasss  )   CALL dta_sss( kstp )         ! Sea Surface salinity data
209
210      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries
211
212      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries
213
214                         CALL tau( kstp )             ! wind stress
215
216                         CALL flx_rnf( kstp )         ! runoff data
217
218                         CALL flx( kstp )             ! heat and freshwater fluxes
219
220      IF( lk_ice_lim )   CALL ice_stp( kstp )         ! sea-ice model (Update stress & fluxes)
221
222                         CALL oce_sbc( kstp )         ! ocean surface boudaries
223
224      IF( ln_fwb     )   CALL flx_fwb( kstp )         ! freshwater budget
225
226      IF( nclosea == 1 ) CALL flx_clo( kstp )         ! closed sea in the domain (update freshwater fluxes)
227
228      IF( kstp == nit000 ) THEN
229         IF( ninist == 1 ) THEN                       ! Output the initial state and forcings
230            CALL dia_wri_state( 'output.init' )
231         ENDIF
232      ENDIF
233
234      IF(ln_ctl) THEN         ! print mean trends (used for debugging)
235         CALL prt_ctl(tab2d_1=emp    , clinfo1=' emp  -   : ', mask1=tmask, ovlap=1)
236         CALL prt_ctl(tab2d_1=emps   , clinfo1=' emps -   : ', mask1=tmask, ovlap=1)
237         CALL prt_ctl(tab2d_1=qt     , clinfo1=' qt   -   : ', mask1=tmask, ovlap=1)
238         CALL prt_ctl(tab2d_1=qsr    , clinfo1=' qsr  -   : ', mask1=tmask, ovlap=1)
239         CALL prt_ctl(tab2d_1=runoff , clinfo1=' runoff   : ', mask1=tmask, ovlap=1)
240         CALL prt_ctl(tab3d_1=tmask  , clinfo1=' tmask    : ', mask1=tmask, ovlap=1, kdim=jpk)
241         CALL prt_ctl(tab3d_1=tn     , clinfo1=' sst  -   : ', mask1=tmask, ovlap=1, kdim=1)
242         CALL prt_ctl(tab3d_1=sn     , clinfo1=' sss  -   : ', mask1=tmask, ovlap=1, kdim=1)
243         CALL prt_ctl(tab2d_1=taux   , clinfo1=' tau  - x : ', tab2d_2=tauy, clinfo2='      - y : ', ovlap=1)
244      ENDIF
245
246
247      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
248      ! Ocean physics update
249      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
250      !-----------------------------------------------------------------------
251      !  VERTICAL PHYSICS
252      !-----------------------------------------------------------------------
253      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
254      !-----------------------------------------------------------------------
255
256                       CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
257     
258      !                                                     ! Vertical eddy viscosity and diffusivity coefficients
259      IF( lk_zdfric )   CALL zdf_ric( kstp )                       ! Richardson number dependent Kz
260      IF( lk_zdftke )   CALL zdf_tke( kstp )                       ! TKE closure scheme for Kz
261      IF( lk_zdfkpp )   CALL zdf_kpp( kstp )                       ! KPP closure scheme for Kz
262      IF( lk_zdfcst )   avt (:,:,:) = avt0 * tmask(:,:,:)          ! Constant Kz (reset avt to the background value)
263
264      IF( cp_cfg == "orca" ) THEN                           ! ORCA: Reduce vertical mixing in some specific areas
265         SELECT CASE ( jp_cfg )
266            CASE ( 05 )                         ! ORCA R2 configuration
267               avt  (:,:,2) = avt  (:,:,2) + 1.e-3 * upsrnfh(:,:)   ! increase diffusivity of rivers mouths
268         END SELECT
269      ENDIF
270
271      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity
272
273      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp)   &
274         &              CALL zdf_ddm( kstp )                 ! double diffusive mixing
275
276                        CALL zdf_bfr( kstp )                 ! bottom friction
277
278                        CALL zdf_mxl( kstp )                 ! mixed layer depth
279
280
281      !-----------------------------------------------------------------------
282      !  LATERAL PHYSICS
283      !-----------------------------------------------------------------------
284      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
285      !-----------------------------------------------------------------------
286
287      IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing
288
289#if defined key_traldf_c2d
290      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient
291#endif
292
293
294#if defined key_passivetrc
295      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
296      ! Passive Tracer Model
297      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
298      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
299      !-----------------------------------------------------------------------
300
301                             CALL trc_stp( kstp, indic )            ! time-stepping
302
303#endif
304
305
306      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
307      ! Active tracers
308      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
309      ! N.B. ua, va arrays are used as workspace in this section
310      !-----------------------------------------------------------------------
311
312                               ta(:,:,:) = 0.e0               ! set tracer trends to zero
313                               sa(:,:,:) = 0.e0
314
315                               CALL tra_sbc( kstp )           ! surface boundary condition
316
317      IF( ln_traqsr        )   CALL tra_qsr( kstp )           ! penetrative solar radiation qsr
318
319      IF( lk_trabbc        )   CALL tra_bbc( kstp )           ! bottom heat flux
320
321      IF( lk_trabbl_dif    )   CALL tra_bbl_dif( kstp )           ! diffusive bottom boundary layer scheme
322      IF( lk_trabbl_adv    )   CALL tra_bbl_adv( kstp )           ! advective (and/or diffusive) bottom boundary layer scheme
323
324      IF( lk_tradmp        )   CALL tra_dmp( kstp )           ! internal damping trends
325
326      !                                                       ! horizontal & vertical advection
327      IF( kstp == nit000   )   CALL tra_adv_ctl                    ! chose/control the scheme used
328      IF( ln_traadv_cen2   )   CALL tra_adv_cen2  ( kstp )         ! 2nd order centered scheme
329      IF( ln_traadv_tvd    )   CALL tra_adv_tvd   ( kstp )         ! TVD scheme
330      IF( ln_traadv_muscl  )   CALL tra_adv_muscl ( kstp )         ! MUSCL scheme
331      IF( ln_traadv_muscl2 )   CALL tra_adv_muscl2( kstp )         ! MUSCL2 scheme
332
333      IF( n_cla == 1       )   CALL tra_cla( kstp )           ! Cross Land Advection (Update Hor. advection)
334
335      !                                                       ! lateral mixing
336      IF( l_traldf_lap     )   CALL tra_ldf_lap    ( kstp )           ! iso-level laplacian
337      IF( l_traldf_bilap   )   CALL tra_ldf_bilap  ( kstp )           ! iso-level bilaplacian
338      IF( l_traldf_bilapg  )   CALL tra_ldf_bilapg ( kstp )           ! s-coord. horizontal bilaplacian
339      IF( l_traldf_iso     )   CALL tra_ldf_iso    ( kstp )           ! iso-neutral/geopot. laplacian
340      IF( l_traldf_iso_zps )   CALL tra_ldf_iso_zps( kstp )           ! partial step iso-neutral/geopot. laplacian
341
342#if defined key_agrif
343      IF (.NOT. Agrif_Root())  CALL Agrif_Sponge_tra( kstp )          ! tracers sponge
344#endif
345      !                                                       ! vertical diffusion
346      IF( l_trazdf_exp     )   CALL tra_zdf_exp     ( kstp )          ! explicit time stepping (time splitting scheme)
347      IF( l_trazdf_imp     )   CALL tra_zdf_imp     ( kstp )          ! implicit time stepping (euler backward)
348      IF( l_trazdf_iso     )   CALL tra_zdf_iso     ( kstp )          ! isopycnal
349      IF( l_trazdf_iso_vo  )   CALL tra_zdf_iso_vopt( kstp )          ! vector opt. isopycnal
350
351                               CALL tra_nxt( kstp )           ! tracer fields at next time step
352
353      IF( ln_zdfnpc        )   CALL tra_npc( kstp )           ! update the new (t,s) fields by non
354      !                                                       ! penetrative convective adjustment
355
356      IF( ln_dynhpg_imp    ) THEN                             ! semi-implicit hpg
357                                  CALL eos( ta, sa, rhd, rhop )   ! Time-filtered in situ density used in dynhpg module
358         IF( lk_zps    )          CALL zps_hde( kstp, ta, sa, rhd,  & ! Partial steps: time filtered hor. gradient
359            &                                        gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level
360            &                                        gtv, gsv, grv ) 
361      ELSE                                                    ! centered hpg (default case)
362                                  CALL eos( tb, sb, rhd, rhop )       ! now (swap=before) in situ density for dynhpg module
363         IF( lk_zps    )          CALL zps_hde( kstp, tb, sb, rhd,  & ! Partial steps: now horizontal gradient
364            &                                        gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level
365            &                                        gtv, gsv, grv ) 
366      ENDIF
367
368      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
369      ! Dynamics
370      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
371      ! N.B. ta, sa arrays are used as workspace in this section
372      !-----------------------------------------------------------------------
373
374                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero
375                               va(:,:,:) = 0.e0
376
377                               CALL dyn_keg( kstp )           ! horizontal gradient of kinetic energy
378
379      !                                                       ! vorticity term including Coriolis
380      IF( kstp == nit000   )   CALL dyn_vor_ctl                      ! chose/control the scheme used
381      IF( ln_dynvor_ens    )   CALL dyn_vor_enstrophy( kstp )        ! enstrophy conserving scheme
382      IF( ln_dynvor_ene    )   CALL dyn_vor_energy   ( kstp )        ! energy conserving scheme
383      IF( ln_dynvor_mix    )   CALL dyn_vor_mixed    ( kstp )        ! mixed energy/enstrophy conserving scheme
384      IF( ln_dynvor_een    )   CALL dyn_vor_ene_ens  ( kstp )        ! combined energy/enstrophy conserving scheme
385     
386      !                                                       ! lateral mixing
387      IF( l_dynldf_lap     )   CALL dyn_ldf_lap    ( kstp )          ! iso-level laplacian
388      IF( l_dynldf_bilap   )   CALL dyn_ldf_bilap  ( kstp )          ! iso-level bilaplacian
389      IF( l_dynldf_bilapg  )   CALL dyn_ldf_bilapg ( kstp )          ! s-coord. horizontal bilaplacian
390      IF( l_dynldf_iso     )   CALL dyn_ldf_iso    ( kstp )          ! iso-neutral laplacian
391
392#if defined key_agrif
393      IF (.NOT. Agrif_Root())  CALL Agrif_Sponge_dyn( kstp )         ! momemtum sponge
394#endif
395      !                                                       ! horizontal gradient of Hydrostatic pressure
396      IF ( lk_jki ) THEN
397                               CALL dyn_hpg_atsk( kstp )             ! autotask case (j-k-i loop)
398      ELSE
399                               CALL dyn_hpg     ( kstp )             ! default case  (k-j-i loop)
400      ENDIF
401
402                               CALL dyn_zad    ( kstp )       ! vertical advection       
403
404      !                                                       ! vertical diffusion
405      IF( l_dynzdf_exp     )   CALL dyn_zdf_exp    ( kstp )          ! explicit time stepping (time splitting scheme)
406      IF( l_dynzdf_imp     )   CALL dyn_zdf_imp    ( kstp )          ! implicit time stepping (euler backward)
407      IF( l_dynzdf_imp_tsk )   CALL dyn_zdf_imp_tsk( kstp )          ! autotask implicit time stepping (euler backward)
408      IF( l_dynzdf_iso     )   CALL dyn_zdf_iso    ( kstp )          ! iso-neutral case
409
410      IF( lk_dynspg_rl ) THEN
411         IF( lk_obc    )       CALL obc_spg( kstp )           ! surface pressure gradient at open boundaries
412      ENDIF
413                       indic=0
414!i bug lbc sur emp
415      CALL lbc_lnk( emp, 'T', 1. )
416!i
417                               CALL dyn_spg( kstp, indic )    ! surface pressure gradient
418
419                               CALL dyn_nxt( kstp )           ! velocity at next time step
420
421
422      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
423      ! Computation of diagnostic variables
424      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
425      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
426      !-----------------------------------------------------------------------
427
428                       CALL oc_fz_pt                        ! ocean surface freezing temperature
429
430                       CALL div_cur( kstp )                 ! Horizontal divergence & Relative vorticity
431
432      IF( n_cla == 1 ) CALL div_cla( kstp )                 ! Cross Land Advection (Update Hor. divergence)
433
434                       CALL wzv( kstp )                     ! Vertical velocity
435
436
437
438      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
439      ! Control, diagnostics and outputs
440      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
441      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
442      !-----------------------------------------------------------------------
443
444      !                                            ! Time loop: control and print
445                       CALL stp_ctl( kstp, indic )
446                       IF ( indic < 0 )   nstop = nstop + 1
447
448      IF ( nstop == 0 ) THEN
449         !                                         ! Diagnostics:
450         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats
451         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics
452         IF( lk_trdtra  )   CALL trd_twr( kstp )                 ! trends: active tracers
453         IF( lk_trdmld  )   CALL trd_mld( kstp )                 ! trends: Mixed-layer
454         IF( lk_trdvor  )   CALL trd_vor( kstp )                 ! trends: vorticity budget
455         IF( lk_diaspr  )   CALL dia_spr( kstp )                 ! Surface pressure diagnostics
456         IF( lk_diahth  )   CALL dia_hth( kstp )                 ! Thermocline depth (20 degres isotherm depth)
457         IF( lk_diagap  )   CALL dia_gap( kstp )                 ! basin averaged diagnostics
458         IF( lk_diahdy  )   CALL dia_hdy( kstp )                 ! dynamical heigh diagnostics
459         IF( lk_diafwb  )   CALL dia_fwb( kstp )                 ! Fresh water budget diagnostics
460         IF( ln_diaptr  )   CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics
461
462         !                                         ! save and outputs
463                            CALL rst_write  ( kstp )             ! ocean model: restart file output
464         IF( lk_obc     )   CALL obc_rst_wri( kstp )             ! ocean model: open boundary restart file output
465                            CALL dia_wri    ( kstp, indic )      ! ocean model: outputs
466
467      ENDIF
468
469      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
470      ! Coupled mode
471      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
472
473      IF( lk_cpl    )   CALL cpl_stp( kstp )                 ! coupled mode : field exchanges
474
475   END SUBROUTINE stp
476
477   !!======================================================================
478END MODULE step
Note: See TracBrowser for help on using the repository browser.