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 @ 414

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

nemo_v1_bugfix_025 : CT : correction of various bugs in the computation of the Poleward Heat Transport

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