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

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

RB:nemo_v1_update_038: first integration of Agrif :

  • configuration parameters are just integer when agrif is used
  • add call to agrif routines with key_agrif
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 25.7 KB
RevLine 
[3]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
[216]16   USE cpl_oce         ! coupled ocean-atmosphere variables
[3]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)
[294]24   USE dtasst          ! ocean sea surface temperature    (dta_sst routine)
[3]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
[187]33   USE trcstp          ! passive tracer time-stepping      (trc_stp routine)
[3]34
35   USE dynhpg          ! hydrostatic pressure grad.       (dyn_hpg routine)
36   USE dynhpg_atsk     ! hydrostatic pressure grad.  (dyn_hpg_atsk routine)
[367]37   USE dynspg_oce      ! surface pressure gradient        (dyn_spg routine)
[359]38   USE dynspg          ! surface pressure gradient        (dyn_spg routine)
[3]39   USE dynkeg          ! kinetic energy gradient          (dyn_keg routine)
[75]40   USE dynvor          ! vorticity term              (dyn_vor_... routines)
[3]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)
[255]92   USE zdfkpp          ! KPP vertical mixing              (zdf_kpp routine)
[3]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)
[216]103   USE trdicp          ! Ocean momentum/tracers trends    (trd_wri routine)
[3]104   USE trdmld          ! mixed-layer trends               (trd_mld routine)
[108]105   USE trdvor          ! vorticity budget                 (trd_vor routine)
[216]106   USE diagap          ! hor. mean model-data gap         (dia_gap routine)
[3]107   USE diahdy          ! dynamic height                   (dia_hdy routine)
[132]108   USE diaptr          ! poleward transports              (dia_ptr routine)
[3]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)
[75]116   USE restart         ! ocean restart                    (rst_wri routine)
117   USE cpl             ! exchanges in coupled mode        (cpl_stp routine)
[258]118   USE prtctl          ! Print control                    (prt_ctl routine)
[3]119
[389]120#if defined key_AGRIF
121   USE agrif_opa_sponge ! Momemtum and tracers sponges
122#endif
123
[3]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   !!----------------------------------------------------------------------
[247]134   !!   OPA 9.0 , LOCEAN-IPSL (2005)
135   !! $Header$
136   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
[3]137   !!----------------------------------------------------------------------
138
139CONTAINS
140
[389]141   SUBROUTINE stp( &
142#if !defined key_AGRIF
143   kstp &
144#endif   
145   )      !!----------------------------------------------------------------------
[3]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
[216]172      !!    "   !  04-08  (C. Talandier) New trends organization
[255]173      !!    "   !  05-01  (C. Ethe) Add the KPP closure scheme
[3]174      !!----------------------------------------------------------------------
175      !! * Arguments
[389]176      INTEGER &
177#if !defined key_AGRIF   
178      , INTENT( in ) &
179#endif     
180      ::   kstp   ! ocean time-step index
[3]181
182      !! * local declarations
183      INTEGER ::   indic    ! error indicator if < 0
184      !! ---------------------------------------------------------------------
185
[389]186#if defined key_AGRIF
187      kstp = nit000 + Agrif_Nb_Step()
188      IF ( Agrif_Root() .and. lwp) Write(*,*) '---'
189      IF (lwp) Write(*,*) 'Grid N°',Agrif_Fixed(),' time step ',kstp
190#endif   
[3]191      indic = 1                    ! reset to no error condition
192      adatrj = adatrj + rdt/86400._wp
193
194      CALL day( kstp )             ! Calendar
195
196      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
197      ! Update data, open boundaries and Forcings
198      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
199
200      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data
201
202      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! Salinity data
203
204      IF( lk_dtasst  )   CALL dta_sst( kstp )         ! Sea Surface Temperature data
205
[35]206      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries
[3]207
208      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries
209
210                         CALL tau( kstp )             ! wind stress
211
212                         CALL flx_rnf( kstp )         ! runoff data
213
214                         CALL flx( kstp )             ! heat and freshwater fluxes
215
216      IF( lk_ice_lim )   CALL ice_stp( kstp )         ! sea-ice model (Update stress & fluxes)
217
218                         CALL oce_sbc( kstp )         ! ocean surface boudaries
219
220      IF( ln_fwb     )   CALL flx_fwb( kstp )         ! freshwater budget
221
222      IF( nclosea == 1 ) CALL flx_clo( kstp )         ! closed sea in the domain (update freshwater fluxes)
223
224      IF( kstp == nit000 ) THEN
225         IF( ninist == 1 ) THEN                       ! Output the initial state and forcings
226            CALL dia_wri_state( 'output.init' )
227         ENDIF
228      ENDIF
229
[258]230      IF(ln_ctl) THEN         ! print mean trends (used for debugging)
231         CALL prt_ctl(tab2d_1=emp    , clinfo1=' emp  -   : ', mask1=tmask, ovlap=1)
232         CALL prt_ctl(tab2d_1=emps   , clinfo1=' emps -   : ', mask1=tmask, ovlap=1)
233         CALL prt_ctl(tab2d_1=qt     , clinfo1=' qt   -   : ', mask1=tmask, ovlap=1)
234         CALL prt_ctl(tab2d_1=qsr    , clinfo1=' qsr  -   : ', mask1=tmask, ovlap=1)
235         CALL prt_ctl(tab2d_1=runoff , clinfo1=' runoff   : ', mask1=tmask, ovlap=1)
236         CALL prt_ctl(tab3d_1=tmask  , clinfo1=' tmask    : ', mask1=tmask, ovlap=1, kdim=jpk)
237         CALL prt_ctl(tab3d_1=tn     , clinfo1=' sst  -   : ', mask1=tmask, ovlap=1, kdim=1)
238         CALL prt_ctl(tab3d_1=sn     , clinfo1=' sss  -   : ', mask1=tmask, ovlap=1, kdim=1)
239         CALL prt_ctl(tab2d_1=taux   , clinfo1=' tau  - x : ', tab2d_2=tauy, clinfo2='      - y : ', ovlap=1)
[3]240      ENDIF
241
242
243      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
244      ! Ocean physics update
245      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
246      !-----------------------------------------------------------------------
247      !  VERTICAL PHYSICS
248      !-----------------------------------------------------------------------
249      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
250      !-----------------------------------------------------------------------
251
252                       CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
253     
254      !                                                     ! Vertical eddy viscosity and diffusivity coefficients
255      IF( lk_zdfric )   CALL zdf_ric( kstp )                       ! Richardson number dependent Kz
256      IF( lk_zdftke )   CALL zdf_tke( kstp )                       ! TKE closure scheme for Kz
[255]257      IF( lk_zdfkpp )   CALL zdf_kpp( kstp )                       ! KPP closure scheme for Kz
[3]258      IF( lk_zdfcst )   avt (:,:,:) = avt0 * tmask(:,:,:)          ! Constant Kz (reset avt to the background value)
259
[236]260      IF( cp_cfg == "orca" ) THEN                           ! ORCA: Reduce vertical mixing in some specific areas
[3]261         SELECT CASE ( jp_cfg )
262            CASE ( 05 )                         ! ORCA R2 configuration
263               avt  (:,:,2) = avt  (:,:,2) + 1.e-3 * upsrnfh(:,:)   ! increase diffusivity of rivers mouths
264         END SELECT
265      ENDIF
266
267      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity
268
[255]269      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp)   &
270         &              CALL zdf_ddm( kstp )                 ! double diffusive mixing
[3]271
[75]272                        CALL zdf_bfr( kstp )                 ! bottom friction
[3]273
274                        CALL zdf_mxl( kstp )                 ! mixed layer depth
275
276
277      !-----------------------------------------------------------------------
278      !  LATERAL PHYSICS
279      !-----------------------------------------------------------------------
280      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
281      !-----------------------------------------------------------------------
282
283      IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing
284
285#if defined key_traldf_c2d
286      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient
287#endif
288
289
290#if defined key_passivetrc
291      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
292      ! Passive Tracer Model
293      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
294      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
295      !-----------------------------------------------------------------------
296
[345]297                             CALL trc_stp( kstp, indic )            ! time-stepping
[3]298
299#endif
300
301
302      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
303      ! Active tracers
304      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
305      ! N.B. ua, va arrays are used as workspace in this section
306      !-----------------------------------------------------------------------
307
[75]308                               ta(:,:,:) = 0.e0               ! set tracer trends to zero
309                               sa(:,:,:) = 0.e0
[3]310
[75]311                               CALL tra_sbc( kstp )           ! surface boundary condition
[3]312
313      IF( ln_traqsr        )   CALL tra_qsr( kstp )           ! penetrative solar radiation qsr
314
315      IF( lk_trabbc        )   CALL tra_bbc( kstp )           ! bottom heat flux
316
317      IF( lk_trabbl_dif    )   CALL tra_bbl_dif( kstp )           ! diffusive bottom boundary layer scheme
318      IF( lk_trabbl_adv    )   CALL tra_bbl_adv( kstp )           ! advective (and/or diffusive) bottom boundary layer scheme
319
[75]320      IF( lk_tradmp        )   CALL tra_dmp( kstp )           ! internal damping trends
[3]321
[75]322      !                                                       ! horizontal & vertical advection
[3]323      IF( kstp == nit000   )   CALL tra_adv_ctl                    ! chose/control the scheme used
324      IF( ln_traadv_cen2   )   CALL tra_adv_cen2  ( kstp )         ! 2nd order centered scheme
325      IF( ln_traadv_tvd    )   CALL tra_adv_tvd   ( kstp )         ! TVD scheme
326      IF( ln_traadv_muscl  )   CALL tra_adv_muscl ( kstp )         ! MUSCL scheme
327      IF( ln_traadv_muscl2 )   CALL tra_adv_muscl2( kstp )         ! MUSCL2 scheme
328
[75]329      IF( n_cla == 1       )   CALL tra_cla( kstp )           ! Cross Land Advection (Update Hor. advection)
[3]330
[75]331      !                                                       ! lateral mixing
332      IF( l_traldf_lap     )   CALL tra_ldf_lap    ( kstp )           ! iso-level laplacian
333      IF( l_traldf_bilap   )   CALL tra_ldf_bilap  ( kstp )           ! iso-level bilaplacian
334      IF( l_traldf_bilapg  )   CALL tra_ldf_bilapg ( kstp )           ! s-coord. horizontal bilaplacian
335      IF( l_traldf_iso     )   CALL tra_ldf_iso    ( kstp )           ! iso-neutral/geopot. laplacian
336      IF( l_traldf_iso_zps )   CALL tra_ldf_iso_zps( kstp )           ! partial step iso-neutral/geopot. laplacian
[3]337
[389]338#if defined key_AGRIF
339      IF (.NOT. Agrif_Root())  CALL Agrif_Sponge_tra( kstp )          ! tracers sponge
340#endif
[75]341      !                                                       ! vertical diffusion
342      IF( l_trazdf_exp     )   CALL tra_zdf_exp     ( kstp )          ! explicit time stepping (time splitting scheme)
343      IF( l_trazdf_imp     )   CALL tra_zdf_imp     ( kstp )          ! implicit time stepping (euler backward)
344      IF( l_trazdf_iso     )   CALL tra_zdf_iso     ( kstp )          ! isopycnal
345      IF( l_trazdf_iso_vo  )   CALL tra_zdf_iso_vopt( kstp )          ! vector opt. isopycnal
[3]346
[75]347                               CALL tra_nxt( kstp )           ! tracer fields at next time step
[3]348
[75]349      IF( ln_zdfnpc        )   CALL tra_npc( kstp )           ! update the new (t,s) fields by non
350      !                                                       ! penetrative convective adjustment
[3]351
[75]352      IF( ln_dynhpg_imp    ) THEN                             ! semi-implicit hpg
353                                  CALL eos( ta, sa, rhd, rhop )   ! Time-filtered in situ density used in dynhpg module
354         IF( lk_zps    )          CALL zps_hde( kstp, ta, sa, rhd,  & ! Partial steps: time filtered hor. gradient
355            &                                        gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level
356            &                                        gtv, gsv, grv ) 
357      ELSE                                                    ! centered hpg (default case)
[3]358                                  CALL eos( tb, sb, rhd, rhop )       ! now (swap=before) in situ density for dynhpg module
359         IF( lk_zps    )          CALL zps_hde( kstp, tb, sb, rhd,  & ! Partial steps: now horizontal gradient
360            &                                        gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level
361            &                                        gtv, gsv, grv ) 
362      ENDIF
363
364      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
365      ! Dynamics
366      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
367      ! N.B. ta, sa arrays are used as workspace in this section
368      !-----------------------------------------------------------------------
369
[75]370                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero
371                               va(:,:,:) = 0.e0
[3]372
[389]373      CALL dyn_keg( kstp )           ! horizontal gradient of kinetic energy
[3]374
[75]375      !                                                       ! vorticity term including Coriolis
376      IF( kstp == nit000   )   CALL dyn_vor_ctl                      ! chose/control the scheme used
[3]377      IF( ln_dynvor_ens    )   CALL dyn_vor_enstrophy( kstp )        ! enstrophy conserving scheme
378      IF( ln_dynvor_ene    )   CALL dyn_vor_energy   ( kstp )        ! energy conserving scheme
[35]379      IF( ln_dynvor_mix    )   CALL dyn_vor_mixed    ( kstp )        ! mixed energy/enstrophy conserving scheme
[108]380      IF( ln_dynvor_een    )   CALL dyn_vor_ene_ens  ( kstp )        ! combined energy/enstrophy conserving scheme
[389]381     
[75]382      !                                                       ! lateral mixing
[3]383      IF( l_dynldf_lap     )   CALL dyn_ldf_lap    ( kstp )          ! iso-level laplacian
384      IF( l_dynldf_bilap   )   CALL dyn_ldf_bilap  ( kstp )          ! iso-level bilaplacian
385      IF( l_dynldf_bilapg  )   CALL dyn_ldf_bilapg ( kstp )          ! s-coord. horizontal bilaplacian
386      IF( l_dynldf_iso     )   CALL dyn_ldf_iso    ( kstp )          ! iso-neutral laplacian
387
[389]388#if defined key_AGRIF
389      IF (.NOT. Agrif_Root())  CALL Agrif_Sponge_dyn( kstp )         ! momemtum sponge
390#endif
[75]391      !                                                       ! horizontal gradient of Hydrostatic pressure
[359]392      IF ( lk_jki ) THEN
393                               CALL dyn_hpg_atsk( kstp )             ! autotask case (j-k-i loop)
394      ELSE
395                               CALL dyn_hpg     ( kstp )             ! default case  (k-j-i loop)
396      ENDIF
[3]397
[389]398      CALL dyn_zad    ( kstp )       ! vertical advection       
[3]399
[75]400      !                                                       ! vertical diffusion
[216]401      IF( l_dynzdf_exp     )   CALL dyn_zdf_exp    ( kstp )          ! explicit time stepping (time splitting scheme)
402      IF( l_dynzdf_imp     )   CALL dyn_zdf_imp    ( kstp )          ! implicit time stepping (euler backward)
403      IF( l_dynzdf_imp_tsk )   CALL dyn_zdf_imp_tsk( kstp )          ! autotask implicit time stepping (euler backward)
404      IF( l_dynzdf_iso     )   CALL dyn_zdf_iso    ( kstp )          ! iso-neutral case
[3]405
406      IF( lk_dynspg_rl ) THEN
[75]407         IF( lk_obc    )       CALL obc_spg( kstp )           ! surface pressure gradient at open boundaries
[3]408      ENDIF
409                       indic=0
410!i bug lbc sur emp
411      CALL lbc_lnk( emp, 'T', 1. )
412!i
[359]413                               CALL dyn_spg( kstp, indic )    ! surface pressure gradient
[3]414
[359]415                               CALL dyn_nxt( kstp )           ! velocity at next time step
[3]416
417
418      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
419      ! Computation of diagnostic variables
420      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
421      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
422      !-----------------------------------------------------------------------
423
424                       CALL oc_fz_pt                        ! ocean surface freezing temperature
425
426                       CALL div_cur( kstp )                 ! Horizontal divergence & Relative vorticity
427
428      IF( n_cla == 1 ) CALL div_cla( kstp )                 ! Cross Land Advection (Update Hor. divergence)
429
430                       CALL wzv( kstp )                     ! Vertical velocity
431
432
433
434      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
435      ! Control, diagnostics and outputs
436      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
437      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
438      !-----------------------------------------------------------------------
439
[75]440      !                                            ! Time loop: control and print
[3]441                       CALL stp_ctl( kstp, indic )
[75]442                       IF ( indic < 0 )   nstop = nstop + 1
[3]443
[75]444      IF ( nstop == 0 ) THEN
445         !                                         ! Diagnostics:
446         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats
[216]447         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics
448         IF( lk_trdtra  )   CALL trd_twr( kstp )                 ! trends: active tracers
[75]449         IF( lk_trdmld  )   CALL trd_mld( kstp )                 ! trends: Mixed-layer
[108]450         IF( lk_trdvor  )   CALL trd_vor( kstp )                 ! trends: vorticity budget
[75]451         IF( lk_diaspr  )   CALL dia_spr( kstp )                 ! Surface pressure diagnostics
452         IF( lk_diahth  )   CALL dia_hth( kstp )                 ! Thermocline depth (20 degres isotherm depth)
453         IF( lk_diagap  )   CALL dia_gap( kstp )                 ! basin averaged diagnostics
454         IF( lk_diahdy  )   CALL dia_hdy( kstp )                 ! dynamical heigh diagnostics
455         IF( lk_diafwb  )   CALL dia_fwb( kstp )                 ! Fresh water budget diagnostics
[132]456
457         IF( ln_diaptr .AND. ( kstp == nit000 .OR. MOD( kstp, nf_ptr ) == 0 ) )  &
[75]458                            CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics
[3]459
[75]460         !                                         ! save and outputs
[216]461                            CALL rst_write  ( kstp )             ! ocean model: restart file output
462         IF( lk_obc     )   CALL obc_rst_wri( kstp )             ! ocean model: open boundary restart file output
463                            CALL dia_wri    ( kstp, indic )      ! ocean model: outputs
[3]464
[75]465      ENDIF
[3]466
[75]467      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
468      ! Coupled mode
469      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[3]470
[75]471      IF( lk_cpl    )   CALL cpl_stp( kstp )                 ! coupled mode : field exchanges
472
[3]473   END SUBROUTINE stp
474
475   !!======================================================================
476END MODULE step
Note: See TracBrowser for help on using the repository browser.