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

Last change on this file since 1418 was 1417, checked in by ctlod, 15 years ago

add zdftmx.F90 module linked to the calculation of vertical viscosity/diffusion coefficients due to internal tidal mixing, see ticket: #425

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 24.8 KB
Line 
1MODULE step
2   !!======================================================================
3   !!                       ***  MODULE step  ***
4   !! Time-stepping    : manager of the ocean, tracer and ice time stepping
5   !!======================================================================
6   !! History :        !  91-03  (G. Madec)  Original code
7   !!                  !  92-06  (M. Imbard)  add a first output record
8   !!                  !  96-04  (G. Madec)  introduction of dynspg
9   !!                  !  96-04  (M.A. Foujols)  introduction of passive tracer
10   !!             8.0  !  97-06  (G. Madec)  new architecture of call
11   !!             8.2  !  97-06  (G. Madec, M. Imbard, G. Roullet)  free surface
12   !!             8.2  !  99-02  (G. Madec, N. Grima)  hpg implicit
13   !!             8.2  !  00-07  (J-M Molines, M. Imbard)  Open Bondary Conditions
14   !!             9.0  !  02-06  (G. Madec)  free form, suppress macro-tasking
15   !!             " "  !  04-08  (C. Talandier) New trends organization
16   !!             " "  !  05-01  (C. Ethe) Add the KPP closure scheme
17   !!             " "  !  05-11  (V. Garnier) Surface pressure gradient organization
18   !!             " "  !  05-11  (G. Madec)  Reorganisation of tra and dyn calls
19   !!             " "  !  06-01  (L. Debreu, C. Mazauric)  Agrif implementation
20   !!             " "  !  06-07  (S. Masson)  restart using iom
21   !!             " "  !  06-08  (G. Madec)  surface module
22   !!             " "  !  07-07  (J. Chanut, A. Sellar) Unstructured open boundaries (BDY)
23   !!----------------------------------------------------------------------
24
25   !!----------------------------------------------------------------------
26   !!   stp            : OPA system time-stepping
27   !!----------------------------------------------------------------------
28   USE oce             ! ocean dynamics and tracers variables
29   USE dom_oce         ! ocean space and time domain variables
30   USE zdf_oce         ! ocean vertical physics variables
31   USE ldftra_oce      ! ocean tracer   - trends
32   USE ldfdyn_oce      ! ocean dynamics - trends
33   USE in_out_manager  ! I/O manager
34   USE iom             !
35   USE lbclnk
36
37   USE daymod          ! calendar                         (day     routine)
38
39   USE dtatem          ! ocean temperature data           (dta_tem routine)
40   USE dtasal          ! ocean salinity    data           (dta_sal routine)
41   USE sbcmod          ! surface boundary condition       (sbc     routine)
42   USE sbcrnf          ! surface boundary condition: runoff variables
43   USE sbccpl          ! surface boundary condition: coupled formulation (call send at end of step)
44   USE cpl_oasis3, ONLY : lk_cpl
45
46   USE trcstp          ! passive tracer time-stepping      (trc_stp routine)
47
48   USE traqsr          ! solar radiation penetration      (tra_qsr routine)
49   USE trasbc          ! surface boundary condition       (tra_sbc routine)
50   USE trabbc          ! bottom boundary condition        (tra_bbc routine)
51   USE trabbl          ! bottom boundary layer            (tra_bbl routine)
52   USE tradmp          ! internal damping                 (tra_dmp routine)
53   USE traadv          ! advection scheme control     (tra_adv_ctl routine)
54   USE traldf          ! lateral mixing                   (tra_ldf routine)
55   USE cla             ! cross land advection             (tra_cla routine)
56   !   zdfkpp          ! KPP non-local tracer fluxes      (tra_kpp routine)
57   USE trazdf          ! vertical mixing                  (tra_zdf routine)
58   USE tranxt          ! time-stepping                    (tra_nxt routine)
59   USE tranpc          ! non-penetrative convection       (tra_npc routine)
60
61   USE eosbn2          ! equation of state                (eos_bn2 routine)
62
63   USE dynadv          ! advection                        (dyn_adv routine)
64   USE dynvor          ! vorticity term                   (dyn_vor routine)
65   USE dynhpg          ! hydrostatic pressure grad.       (dyn_hpg routine)
66   USE dynldf          ! lateral momentum diffusion       (dyn_ldf routine)
67   USE dynzdf          ! vertical diffusion               (dyn_zdf routine)
68   USE dynspg_oce      ! surface pressure gradient        (dyn_spg routine)
69   USE dynspg          ! surface pressure gradient        (dyn_spg routine)
70   USE dynnxt          ! time-stepping                    (dyn_nxt routine)
71
72   USE obc_par         ! open boundary condition variables
73   USE obcdta          ! open boundary condition data     (obc_dta routine)
74   USE obcrst          ! open boundary cond. restart      (obc_rst routine)
75   USE obcrad          ! open boundary cond. radiation    (obc_rad routine)
76   USE obcspg          ! open boundary cond  spg          (obc_spg routine)
77
78   USE bdy_par         ! unstructured open boundary data variables
79   USE bdydta          ! unstructured open boundary data  (bdy_dta routine)
80
81   USE divcur          ! hor. divergence and curl      (div & cur routines)
82   USE cla_div         ! cross land: hor. divergence      (div_cla routine)
83   USE wzvmod          ! vertical velocity                (wzv     routine)
84
85   USE ldfslp          ! iso-neutral slopes               (ldf_slp routine)
86   USE ldfeiv          ! eddy induced velocity coef.      (ldf_eiv routine)
87
88   USE zdftmx          ! tide-induced vertical mixing     (zdf_tmx routine)
89   USE zdfbfr          ! bottom friction                  (zdf_bfr routine)
90   USE zdftke          ! TKE vertical mixing              (zdf_tke routine)
91   USE zdftke2         ! TKE2 vertical mixing             (zdf_tke2 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
101   USE diawri          ! Standard run outputs             (dia_wri routine)
102   USE trdicp          ! Ocean momentum/tracers trends    (trd_wri routine)
103   USE trdmld          ! mixed-layer trends               (trd_mld routine)
104   USE trdmld_rst      ! restart for mixed-layer trends
105   USE trdmod_oce      ! ocean momentum/tracers trends
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 prtctl          ! Print control                    (prt_ctl routine)
119   USE domvvl          ! variable volume                  (dom_vvl 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   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   !! $Id$
136   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
137   !!----------------------------------------------------------------------
138
139CONTAINS
140
141#if defined key_agrif
142   SUBROUTINE stp( )
143#else
144   SUBROUTINE stp( 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      !! * Arguments
163#if defined key_agrif   
164      INTEGER             ::   kstp   ! ocean time-step index
165#else
166      INTEGER, INTENT(in) ::   kstp   ! ocean time-step index
167#endif     
168      INTEGER ::   jk       ! dummy loop indice
169      INTEGER ::   indic    ! error indicator if < 0
170      !! ---------------------------------------------------------------------
171
172#if defined key_agrif
173      kstp = nit000 + Agrif_Nb_Step()
174!      IF ( Agrif_Root() .and. lwp) Write(*,*) '---'
175!      IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp
176#endif   
177      indic = 1                    ! reset to no error condition
178
179      CALL day( kstp )             ! Calendar
180
181      CALL iom_setkt( kstp )       ! say to iom that we are at time step kstp
182     
183      CALL rst_opn( kstp )         ! Open the restart file
184
185      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
186      ! Update data, open boundaries, surface boundary condition (including sea-ice)
187      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
188
189      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data
190      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! update 3D salinity data
191
192                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice)
193
194      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries
195      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries
196
197      IF( lk_bdy     )   CALL bdy_dta( kstp )         ! update dynamic and tracer data at unstructured open boundary
198
199      IF( ninist == 1 ) THEN                       ! Output the initial state and forcings
200                        CALL dia_wri_state( 'output.init', kstp )
201                        ninist = 0
202      ENDIF
203
204
205      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
206      ! Ocean physics update
207      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
208#if defined key_zdftke2
209      IF ( ln_dynhpg_imp ) THEN
210      !-----------------------------------------------------------------------
211      !  LATERAL PHYSICS
212      !-----------------------------------------------------------------------
213      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
214      !-----------------------------------------------------------------------
215                               CALL zdf_mxl( kstp )                 ! mixed layer depth
216         IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing
217#  if defined key_traldf_c2d
218         IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient
219#  endif
220      ENDIF
221#endif
222      !-----------------------------------------------------------------------
223      !  VERTICAL PHYSICS
224      !-----------------------------------------------------------------------
225      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
226      !-----------------------------------------------------------------------
227#if defined key_zdftke2
228                        CALL bn2( tn, sn, rn2 )              ! now Brunt-Vaisala frequency
229#else
230                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
231#endif
232      !                                                     ! Vertical eddy viscosity and diffusivity coefficients
233      IF( lk_zdfric )   CALL zdf_ric( kstp )                       ! Richardson number dependent Kz
234
235      IF( lk_zdftke )   CALL zdf_tke ( kstp )                      ! TKE  closure scheme for Kz
236      IF( lk_zdftke2)   CALL zdf_tke2( kstp )                      ! TKE2 closure scheme for Kz
237
238      IF( lk_zdfkpp )   CALL zdf_kpp( kstp )                       ! KPP closure scheme for Kz
239
240      IF( lk_zdfcst )   THEN                                       ! Constant Kz (reset avt, avm[uv] to the background value)
241         avt (:,:,:) = avt0 * tmask(:,:,:)
242         avmu(:,:,:) = avm0 * umask(:,:,:)
243         avmv(:,:,:) = avm0 * vmask(:,:,:)
244      ENDIF
245
246      IF( ln_rnf_mouth ) THEN                                ! increase diffusivity at rivers mouths
247         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO
248      ENDIF
249
250      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity
251
252      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   &
253         &              CALL zdf_ddm( kstp )                 ! double diffusive mixing
254
255      IF( lk_zdftmx )   CALL zdf_tmx( kstp )                 ! tidal vertical mixing
256
257                        CALL zdf_bfr( kstp )                 ! bottom friction
258
259                        CALL zdf_mxl( kstp )                 ! mixed layer depth
260
261#if defined key_zdftke2
262      IF( .NOT. ln_dynhpg_imp ) THEN
263                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
264                        CALL eos( tb, sb, rhd, rhop )        ! now (swap=before) in situ density for dynhpg module
265#endif
266      !-----------------------------------------------------------------------
267      !  LATERAL PHYSICS
268      !-----------------------------------------------------------------------
269      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
270      !-----------------------------------------------------------------------
271      IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing
272#if defined key_traldf_c2d
273      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient
274#  endif
275#if defined key_zdftke2
276      ENDIF
277#endif
278
279#if defined key_top
280      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
281      ! Passive Tracer Model
282      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
283      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
284      !-----------------------------------------------------------------------
285                             CALL trc_stp( kstp, indic )            ! time-stepping
286#endif
287
288      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
289      ! Active tracers
290      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
291      ! N.B. ua, va arrays are used as workspace in this section
292      !-----------------------------------------------------------------------
293                             ta(:,:,:) = 0.e0               ! set tracer trends to zero
294                             sa(:,:,:) = 0.e0
295
296                             CALL tra_sbc    ( kstp )       ! surface boundary condition
297      IF( ln_traqsr      )   CALL tra_qsr    ( kstp )       ! penetrative solar radiation qsr
298      IF( lk_trabbc      )   CALL tra_bbc    ( kstp )       ! bottom heat flux
299      IF( lk_trabbl_dif  )   CALL tra_bbl_dif( kstp )       ! diffusive bottom boundary layer scheme
300      IF( lk_trabbl_adv  )   CALL tra_bbl_adv( kstp )       ! advective (and/or diffusive) bottom boundary layer scheme
301      IF( lk_tradmp      )   CALL tra_dmp    ( kstp )       ! internal damping trends
302                             CALL tra_adv    ( kstp )       ! horizontal & vertical advection
303      IF( n_cla == 1     )   CALL tra_cla    ( kstp )       ! Cross Land Advection (Update Hor. advection)
304      IF( lk_zdfkpp )        CALL tra_kpp    ( kstp )       ! KPP non-local tracer fluxes
305                             CALL tra_ldf    ( kstp )       ! lateral mixing
306#if defined key_agrif
307      IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra          ! tracers sponge
308#endif
309                             CALL tra_zdf    ( kstp )       ! vertical mixing and after tracer fields
310
311#if ! defined key_zdftke2
312      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )       ! update after fields by non-penetrative convection
313                             CALL tra_nxt    ( kstp )       ! tracer fields at next time step
314
315      IF( ln_dynhpg_imp  ) THEN                             ! semi-implicit hpg
316                               CALL eos( ta, sa, rhd, rhop )          ! Time-filtered in situ density used in dynhpg module
317         IF( ln_zps    )       CALL zps_hde( kstp, ta, sa, rhd,   &   ! Partial steps: time filtered hor. gradient
318            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level
319            &                                     gtv, gsv, grv )
320      ELSE                                                  ! centered hpg (default case)
321                               CALL eos( tb, sb, rhd, rhop )          ! now (swap=before) in situ density for dynhpg module
322         IF( ln_zps    )       CALL zps_hde( kstp, tb, sb, rhd,   &   ! Partial steps: now horizontal gradient
323            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level
324            &                                     gtv, gsv, grv )
325      ENDIF
326#else
327      IF( .NOT. ln_dynhpg_imp  ) THEN                       ! centered hpg (default case)
328                               CALL eos( tn, sn, rhd, rhop )          ! now (swap=before) in situ density for dynhpg module
329         IF( ln_zps    )       CALL zps_hde( kstp, tn, sn, rhd,   &   ! Partial steps: now horizontal gradient
330            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level
331            &                                     gtv, gsv, grv )
332      ENDIF
333      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )       ! update after fields by non-penetrative convection
334                             CALL tra_nxt    ( kstp )       ! tracer fields at next time step
335      IF( ln_dynhpg_imp  ) THEN                             ! semi-implicit hpg
336                               CALL eos( ta, sa, rhd, rhop )          ! Time-filtered in situ density used in dynhpg module
337         IF( lk_ldfslp     )   CALL bn2( ta, sa, rn2 )                ! Time-filtered Brunt-Vaisala frequency
338         IF( ln_zps    )       CALL zps_hde( kstp, ta, sa, rhd,   &   ! Partial steps: time filtered hor. gradient
339            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level
340            &                                     gtv, gsv, grv )
341      ENDIF
342#endif
343      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
344      ! Dynamics
345      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
346      ! N.B. ta, sa arrays are used as workspace in this section
347      !-----------------------------------------------------------------------
348                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero
349                               va(:,:,:) = 0.e0
350
351                               CALL dyn_adv( kstp )           ! advection (vector or flux form)
352                               CALL dyn_vor( kstp )           ! vorticity term including Coriolis
353                               CALL dyn_ldf( kstp )           ! lateral mixing
354#if defined key_agrif
355      IF(.NOT. Agrif_Root())   CALL Agrif_Sponge_dyn          ! momemtum sponge
356#endif
357                               CALL dyn_hpg( kstp )           ! horizontal gradient of Hydrostatic pressure
358                               CALL dyn_zdf( kstp )           ! vertical diffusion
359      IF( lk_dynspg_rl ) THEN
360         IF( lk_obc    )       CALL obc_spg( kstp )           ! surface pressure gradient at open boundaries
361      ENDIF
362                               indic=0
363                               CALL dyn_spg( kstp, indic )    ! surface pressure gradient
364                               CALL dyn_nxt( kstp )           ! lateral velocity at next time step
365      IF( lk_vvl )             CALL dom_vvl                   ! vertical mesh at next time step
366
367
368      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
369      ! Computation of diagnostic variables
370      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
371      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
372      !-----------------------------------------------------------------------
373                       CALL div_cur( kstp )                 ! Horizontal divergence & Relative vorticity
374      IF( n_cla == 1 ) CALL div_cla( kstp )                 ! Cross Land Advection (Update Hor. divergence)
375                       CALL wzv( kstp )                     ! Vertical velocity
376
377      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
378      ! Control and restarts
379      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
380                                 CALL stp_ctl( kstp, indic )
381      IF( indic < 0          )   CALL ctl_stop( 'step: indic < 0' )
382      IF( kstp == nit000     )   CALL iom_close( numror )             ! close input  ocean restart file
383      IF( lrst_oce           )   CALL rst_write    ( kstp )           ! write output ocean restart file
384      IF( lk_obc             )   CALL obc_rst_write( kstp )           ! write open boundary restart file
385
386      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
387      ! diagnostics and outputs
388      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
389      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
390      !-----------------------------------------------------------------------
391
392      IF( nstop == 0 ) THEN                                 ! Diagnostics:
393         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats
394         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics
395         IF( lk_trdtra  )   CALL trd_twr( kstp )                 ! trends: active tracers
396         IF( lk_trdmld  )   CALL trd_mld( kstp )                 ! trends: Mixed-layer
397         IF( lk_trdvor  )   CALL trd_vor( kstp )                 ! trends: vorticity budget
398         IF( lk_diaspr  )   CALL dia_spr( kstp )                 ! Surface pressure diagnostics
399         IF( lk_diahth  )   CALL dia_hth( kstp )                 ! Thermocline depth (20 degres isotherm depth)
400         IF( lk_diagap  )   CALL dia_gap( kstp )                 ! basin averaged diagnostics
401         IF( lk_diahdy  )   CALL dia_hdy( kstp )                 ! dynamical heigh diagnostics
402         IF( lk_diafwb  )   CALL dia_fwb( kstp )                 ! Fresh water budget diagnostics
403         IF( ln_diaptr  )   CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics
404         !                                                 ! outputs
405                            CALL dia_wri( kstp, indic )          ! ocean model: outputs
406      ENDIF
407
408      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
409      ! Coupled mode
410      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
411
412      IF( lk_cpl )   CALL sbc_cpl_snd( kstp )                 ! coupled mode : field exchanges
413
414#if defined key_zdftke2
415      IF( ( kstp == nitend ).AND.( lrst_oce ) )  THEN
416
417         CALL day( kstp+1 )             ! Calendar
418         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
419         ! Update data, open boundaries, surface boundary condition (including sea-ice)
420         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
421                            CALL sbc    ( kstp+1 )         ! Sea Boundary Condition (including sea-ice)
422         !-----------------------------------------------------------------------
423         !  VERTICAL PHYSICS
424         !-----------------------------------------------------------------------
425         ! N.B. ua, va, ta, sa arrays are used as workspace in this section
426         !-----------------------------------------------------------------------
427                            CALL bn2( tn, sn, rn2 )            ! now Brunt-Vaisala frequency
428         !                                                     ! Vertical eddy viscosity and diffusivity coefficients
429         IF( lk_zdftke2 )   CALL zdf_tke2 ( kstp+1 )           ! TKE2 closure scheme for Kz
430                            CALL rst_write( kstp+1 )           ! close the restart file
431      ENDIF
432#endif
433      !
434   END SUBROUTINE stp
435
436   !!======================================================================
437END MODULE step
Note: See TracBrowser for help on using the repository browser.