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

Last change on this file since 247 was 247, checked in by opalod, 19 years ago

CL : Add CVS Header and CeCILL licence information

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 25.5 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 temerature     (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_fsc      ! surface pressure gradient   (dyn_spg_fsc  routine)
38   USE dynspg_fsc_atsk ! surface pressure gradient (dyn_spgfsc_atsk routine)
39   USE dynspg_rl       ! surface pressure gradient     (dyn_spg_rl 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 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
119   IMPLICIT NONE
120   PRIVATE
121
122   !! * Routine accessibility
123   PUBLIC stp            ! called by opa.F90
124
125   !! * Substitutions
126#  include "domzgr_substitute.h90"
127#  include "zdfddm_substitute.h90"
128   !!----------------------------------------------------------------------
129   !!   OPA 9.0 , LOCEAN-IPSL (2005)
130   !! $Header$
131   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
132   !!----------------------------------------------------------------------
133
134CONTAINS
135
136   SUBROUTINE stp( kstp )
137      !!----------------------------------------------------------------------
138      !!                     ***  ROUTINE stp  ***
139      !!                     
140      !! ** Purpose : - Time stepping of OPA (momentum and active tracer eqs.)
141      !!              - Time stepping of LIM (dynamic and thermodynamic eqs.)
142      !!              - Tme stepping  of TRC (passive tracer eqs.)
143      !!
144      !! ** Method  : -1- Update forcings and data 
145      !!              -2- Update ocean physics
146      !!              -3- Compute the t and s trends
147      !!              -4- Update t and s
148      !!              -5- Compute the momentum trends
149      !!              -6- Update the horizontal velocity
150      !!              -7- Compute the diagnostics variables (rd,N2, div,cur,w)
151      !!              -8- Outputs and diagnostics
152      !!
153      !! History :
154      !!        !  91-03  ()  Original code
155      !!        !  91-11  (G. Madec)
156      !!        !  92-06  (M. Imbard)  add a first output record
157      !!        !  96-04  (G. Madec)  introduction of dynspg
158      !!        !  96-04  (M.A. Foujols)  introduction of passive tracer
159      !!   8.0  !  97-06  (G. Madec)  new architecture of call
160      !!   8.2  !  97-06  (G. Madec, M. Imbard, G. Roullet)  free surface
161      !!   8.2  !  99-02  (G. Madec, N. Grima)  hpg implicit
162      !!   8.2  !  00-07  (J-M Molines, M. Imbard)  Open Bondary Conditions
163      !!   9.0  !  02-06  (G. Madec)  free form, suppress macro-tasking
164      !!    "   !  04-08  (C. Talandier) New trends organization
165      !!----------------------------------------------------------------------
166      !! * Arguments
167      INTEGER, INTENT( in ) ::   kstp   ! ocean time-step index
168
169      !! * local declarations
170      INTEGER ::   indic    ! error indicator if < 0
171      !! ---------------------------------------------------------------------
172
173      indic = 1                    ! reset to no error condition
174      adatrj = adatrj + rdt/86400._wp
175
176      CALL day( kstp )             ! Calendar
177
178      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
179      ! Update data, open boundaries and Forcings
180      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
181
182      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data
183
184      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! Salinity data
185
186      IF( lk_dtasst  )   CALL dta_sst( kstp )         ! Sea Surface Temperature data
187
188      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries
189
190      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries
191
192                         CALL tau( kstp )             ! wind stress
193
194                         CALL flx_rnf( kstp )         ! runoff data
195
196                         CALL flx( kstp )             ! heat and freshwater fluxes
197
198      IF( lk_ice_lim )   CALL ice_stp( kstp )         ! sea-ice model (Update stress & fluxes)
199
200                         CALL oce_sbc( kstp )         ! ocean surface boudaries
201
202      IF( ln_fwb     )   CALL flx_fwb( kstp )         ! freshwater budget
203
204      IF( nclosea == 1 ) CALL flx_clo( kstp )         ! closed sea in the domain (update freshwater fluxes)
205
206      IF( kstp == nit000 ) THEN
207         IF( ninist == 1 ) THEN                       ! Output the initial state and forcings
208            CALL dia_wri_state( 'output.init' )
209         ENDIF
210      ENDIF
211
212      IF(l_ctl) THEN         ! print mean trends (used for debugging)
213         WRITE(numout,*) ' emp  -   : ', SUM( emp   (1:nictl+1,1:njctl+1)   * tmask(1:nictl+1,1:njctl+1,1) )
214         WRITE(numout,*) ' emps -   : ', SUM( emps  (1:nictl+1,1:njctl+1)   * tmask(1:nictl+1,1:njctl+1,1) )
215         WRITE(numout,*) ' qt   -   : ', SUM( qt    (1:nictl+1,1:njctl+1)   * tmask(1:nictl+1,1:njctl+1,1) )
216         WRITE(numout,*) ' qsr  -   : ', SUM( qsr   (1:nictl+1,1:njctl+1)   * tmask(1:nictl+1,1:njctl+1,1) )
217         WRITE(numout,*) ' runoff   : ', SUM( runoff(1:nictl+1,1:njctl+1)   * tmask(1:nictl+1,1:njctl+1,1) )
218         WRITE(numout,*) ' tmask    : ', SUM( tmask (1:nictl+1,1:njctl+1,:) )
219         WRITE(numout,*) ' sst  -   : ', SUM( tn    (1:nictl+1,1:njctl+1,1) * tmask(1:nictl+1,1:njctl+1,1) )
220         WRITE(numout,*) ' sss  -   : ', SUM( sn    (1:nictl+1,1:njctl+1,1) * tmask(1:nictl+1,1:njctl+1,1) )
221         WRITE(numout,*) ' tau  - x : ', SUM( taux  (1:nictl+1,1:njctl+1) ), ' - y : ', SUM( tauy(1:nictl+1,1:njctl+1) )
222      ENDIF
223
224
225      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
226      ! Ocean physics update
227      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
228      !-----------------------------------------------------------------------
229      !  VERTICAL PHYSICS
230      !-----------------------------------------------------------------------
231      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
232      !-----------------------------------------------------------------------
233
234                       CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
235     
236      !                                                     ! Vertical eddy viscosity and diffusivity coefficients
237      IF( lk_zdfric )   CALL zdf_ric( kstp )                       ! Richardson number dependent Kz
238      IF( lk_zdftke )   CALL zdf_tke( kstp )                       ! TKE closure scheme for Kz
239      IF( lk_zdfcst )   avt (:,:,:) = avt0 * tmask(:,:,:)          ! Constant Kz (reset avt to the background value)
240
241      IF( cp_cfg == "orca" ) THEN                           ! ORCA: Reduce vertical mixing in some specific areas
242         SELECT CASE ( jp_cfg )
243            CASE ( 05 )                         ! ORCA R2 configuration
244               avt  (:,:,2) = avt  (:,:,2) + 1.e-3 * upsrnfh(:,:)   ! increase diffusivity of rivers mouths
245         END SELECT
246      ENDIF
247
248      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity
249
250      IF( lk_zdfddm )   CALL zdf_ddm( kstp )                 ! double diffusive mixing
251
252                        CALL zdf_bfr( kstp )                 ! bottom friction
253
254                        CALL zdf_mxl( kstp )                 ! mixed layer depth
255
256
257      !-----------------------------------------------------------------------
258      !  LATERAL PHYSICS
259      !-----------------------------------------------------------------------
260      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
261      !-----------------------------------------------------------------------
262
263      IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing
264
265#if defined key_traldf_c2d
266      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient
267#endif
268
269
270#if defined key_passivetrc
271      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
272      ! Passive Tracer Model
273      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
274      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
275      !-----------------------------------------------------------------------
276      IF( kstp == nit000 )   CALL trcdia( kstp, indic )     ! diagnostics init.
277
278                             CALL trc_stp( kstp )           ! time-stepping
279
280                             CALL trcwri( kstp )            ! outputs
281
282                             CALL trcdia( kstp, indic )     ! diagnostics
283#endif
284
285
286      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
287      ! Active tracers
288      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
289      ! N.B. ua, va arrays are used as workspace in this section
290      !-----------------------------------------------------------------------
291
292                               ta(:,:,:) = 0.e0               ! set tracer trends to zero
293                               sa(:,:,:) = 0.e0
294
295                               CALL tra_sbc( kstp )           ! surface boundary condition
296
297      IF( ln_traqsr        )   CALL tra_qsr( kstp )           ! penetrative solar radiation qsr
298
299      IF( lk_trabbc        )   CALL tra_bbc( kstp )           ! bottom heat flux
300
301      IF( lk_trabbl_dif    )   CALL tra_bbl_dif( kstp )           ! diffusive bottom boundary layer scheme
302      IF( lk_trabbl_adv    )   CALL tra_bbl_adv( kstp )           ! advective (and/or diffusive) bottom boundary layer scheme
303
304      IF( lk_tradmp        )   CALL tra_dmp( kstp )           ! internal damping trends
305
306      !                                                       ! horizontal & vertical advection
307      IF( kstp == nit000   )   CALL tra_adv_ctl                    ! chose/control the scheme used
308      IF( ln_traadv_cen2   )   CALL tra_adv_cen2  ( kstp )         ! 2nd order centered scheme
309      IF( ln_traadv_tvd    )   CALL tra_adv_tvd   ( kstp )         ! TVD scheme
310      IF( ln_traadv_muscl  )   CALL tra_adv_muscl ( kstp )         ! MUSCL scheme
311      IF( ln_traadv_muscl2 )   CALL tra_adv_muscl2( kstp )         ! MUSCL2 scheme
312
313      IF( n_cla == 1       )   CALL tra_cla( kstp )           ! Cross Land Advection (Update Hor. advection)
314
315      !                                                       ! lateral mixing
316      IF( l_traldf_lap     )   CALL tra_ldf_lap    ( kstp )           ! iso-level laplacian
317      IF( l_traldf_bilap   )   CALL tra_ldf_bilap  ( kstp )           ! iso-level bilaplacian
318      IF( l_traldf_bilapg  )   CALL tra_ldf_bilapg ( kstp )           ! s-coord. horizontal bilaplacian
319      IF( l_traldf_iso     )   CALL tra_ldf_iso    ( kstp )           ! iso-neutral/geopot. laplacian
320      IF( l_traldf_iso_zps )   CALL tra_ldf_iso_zps( kstp )           ! partial step iso-neutral/geopot. laplacian
321
322      !                                                       ! vertical diffusion
323      IF( l_trazdf_exp     )   CALL tra_zdf_exp     ( kstp )          ! explicit time stepping (time splitting scheme)
324      IF( l_trazdf_imp     )   CALL tra_zdf_imp     ( kstp )          ! implicit time stepping (euler backward)
325      IF( l_trazdf_iso     )   CALL tra_zdf_iso     ( kstp )          ! isopycnal
326      IF( l_trazdf_iso_vo  )   CALL tra_zdf_iso_vopt( kstp )          ! vector opt. isopycnal
327
328                               CALL tra_nxt( kstp )           ! tracer fields at next time step
329
330      IF( ln_zdfnpc        )   CALL tra_npc( kstp )           ! update the new (t,s) fields by non
331      !                                                       ! penetrative convective adjustment
332
333      IF( ln_dynhpg_imp    ) THEN                             ! semi-implicit hpg
334                                  CALL eos( ta, sa, rhd, rhop )   ! Time-filtered in situ density used in dynhpg module
335         IF( lk_zps    )          CALL zps_hde( kstp, ta, sa, rhd,  & ! Partial steps: time filtered hor. gradient
336            &                                        gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level
337            &                                        gtv, gsv, grv ) 
338      ELSE                                                    ! centered hpg (default case)
339                                  CALL eos( tb, sb, rhd, rhop )       ! now (swap=before) in situ density for dynhpg module
340         IF( lk_zps    )          CALL zps_hde( kstp, tb, sb, rhd,  & ! Partial steps: now horizontal gradient
341            &                                        gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level
342            &                                        gtv, gsv, grv ) 
343      ENDIF
344
345      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
346      ! Dynamics
347      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
348      ! N.B. ta, sa arrays are used as workspace in this section
349      !-----------------------------------------------------------------------
350
351                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero
352                               va(:,:,:) = 0.e0
353
354                               CALL dyn_keg( kstp )           ! horizontal gradient of kinetic energy
355
356      !                                                       ! vorticity term including Coriolis
357      IF( kstp == nit000   )   CALL dyn_vor_ctl                      ! chose/control the scheme used
358      IF( ln_dynvor_ens    )   CALL dyn_vor_enstrophy( kstp )        ! enstrophy conserving scheme
359      IF( ln_dynvor_ene    )   CALL dyn_vor_energy   ( kstp )        ! energy conserving scheme
360      IF( ln_dynvor_mix    )   CALL dyn_vor_mixed    ( kstp )        ! mixed energy/enstrophy conserving scheme
361      IF( ln_dynvor_een    )   CALL dyn_vor_ene_ens  ( kstp )        ! combined energy/enstrophy conserving scheme
362
363      !                                                       ! lateral mixing
364      IF( l_dynldf_lap     )   CALL dyn_ldf_lap    ( kstp )          ! iso-level laplacian
365      IF( l_dynldf_bilap   )   CALL dyn_ldf_bilap  ( kstp )          ! iso-level bilaplacian
366      IF( l_dynldf_bilapg  )   CALL dyn_ldf_bilapg ( kstp )          ! s-coord. horizontal bilaplacian
367      IF( l_dynldf_iso     )   CALL dyn_ldf_iso    ( kstp )          ! iso-neutral laplacian
368
369      !                                                       ! horizontal gradient of Hydrostatic pressure
370      IF( lk_dynhpg        )   CALL dyn_hpg     ( kstp )             ! default case  (k-j-i loop)
371      IF( lk_dynhpg_tsk    )   CALL dyn_hpg_atsk( kstp )             ! autatask case (j-k-i loop)
372
373                               CALL dyn_zad    ( kstp )       ! vertical advection       
374
375      !                                                       ! vertical diffusion
376      IF( l_dynzdf_exp     )   CALL dyn_zdf_exp    ( kstp )          ! explicit time stepping (time splitting scheme)
377      IF( l_dynzdf_imp     )   CALL dyn_zdf_imp    ( kstp )          ! implicit time stepping (euler backward)
378      IF( l_dynzdf_imp_tsk )   CALL dyn_zdf_imp_tsk( kstp )          ! autotask implicit time stepping (euler backward)
379      IF( l_dynzdf_iso     )   CALL dyn_zdf_iso    ( kstp )          ! iso-neutral case
380
381      IF( lk_dynspg_rl ) THEN
382         IF( lk_obc    )       CALL obc_spg( kstp )           ! surface pressure gradient at open boundaries
383      ENDIF
384                       indic=0
385!i bug lbc sur emp
386      CALL lbc_lnk( emp, 'T', 1. )
387!i
388      !                                                       ! surface pressure gradient
389      IF( lk_dynspg_fsc     )   CALL dyn_spg_fsc     ( kstp, indic )  ! free surface constant volume case
390      IF( lk_dynspg_fsc_tsk )   CALL dyn_spg_fsc_atsk( kstp, indic )  ! autotask free surface constant volume case
391      IF( lk_dynspg_rl      )   CALL dyn_spg_rl      ( kstp, indic )  ! rigid-lid case
392
393                                CALL dyn_nxt( kstp )          ! lateral velocity at next time step
394
395
396      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
397      ! Computation of diagnostic variables
398      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
399      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
400      !-----------------------------------------------------------------------
401
402                       CALL oc_fz_pt                        ! ocean surface freezing temperature
403
404                       CALL div_cur( kstp )                 ! Horizontal divergence & Relative vorticity
405
406      IF( n_cla == 1 ) CALL div_cla( kstp )                 ! Cross Land Advection (Update Hor. divergence)
407
408                       CALL wzv( kstp )                     ! Vertical velocity
409
410
411
412      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
413      ! Control, diagnostics and outputs
414      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
415      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
416      !-----------------------------------------------------------------------
417
418      !                                            ! Time loop: control and print
419                       CALL stp_ctl( kstp, indic )
420                       IF ( indic < 0 )   nstop = nstop + 1
421
422      IF ( nstop == 0 ) THEN
423         !                                         ! Diagnostics:
424         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats
425         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics
426         IF( lk_trdtra  )   CALL trd_twr( kstp )                 ! trends: active tracers
427         IF( lk_trdmld  )   CALL trd_mld( kstp )                 ! trends: Mixed-layer
428         IF( lk_trdvor  )   CALL trd_vor( kstp )                 ! trends: vorticity budget
429         IF( lk_diaspr  )   CALL dia_spr( kstp )                 ! Surface pressure diagnostics
430         IF( lk_diahth  )   CALL dia_hth( kstp )                 ! Thermocline depth (20 degres isotherm depth)
431         IF( lk_diagap  )   CALL dia_gap( kstp )                 ! basin averaged diagnostics
432         IF( lk_diahdy  )   CALL dia_hdy( kstp )                 ! dynamical heigh diagnostics
433         IF( lk_diafwb  )   CALL dia_fwb( kstp )                 ! Fresh water budget diagnostics
434
435         IF( ln_diaptr .AND. ( kstp == nit000 .OR. MOD( kstp, nf_ptr ) == 0 ) )  &
436                            CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics
437
438         !                                         ! save and outputs
439                            CALL rst_write  ( kstp )             ! ocean model: restart file output
440         IF( lk_obc     )   CALL obc_rst_wri( kstp )             ! ocean model: open boundary restart file output
441                            CALL dia_wri    ( kstp, indic )      ! ocean model: outputs
442
443      ENDIF
444
445      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
446      ! Coupled mode
447      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
448
449      IF( lk_cpl    )   CALL cpl_stp( kstp )                 ! coupled mode : field exchanges
450
451   END SUBROUTINE stp
452
453   !!======================================================================
454END MODULE step
Note: See TracBrowser for help on using the repository browser.