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

Last change on this file since 1334 was 1334, checked in by smasson, 15 years ago

complete work on time origin in outputs (ticket:335) + downward vertical axis (ticket:357)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 24.5 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 zdfbfr          ! bottom friction                  (zdf_bfr routine)
89   USE zdftke          ! TKE vertical mixing              (zdf_tke routine)
90   USE zdftke2         ! TKE2 vertical mixing             (zdf_tke2 routine)
91   USE zdfkpp          ! KPP vertical mixing              (zdf_kpp routine)
92   USE zdfddm          ! double diffusion mixing          (zdf_ddm routine)
93   USE zdfevd          ! enhanced vertical diffusion      (zdf_evd routine)
94   USE zdfric          ! Richardson vertical mixing       (zdf_ric routine)
95   USE zdfmxl          ! Mixed-layer depth                (zdf_mxl routine)
96
97   USE zpshde          ! partial step: hor. derivative     (zps_hde routine)
98   USE ice_oce         ! sea-ice variable
99
100   USE diawri          ! Standard run outputs             (dia_wri routine)
101   USE trdicp          ! Ocean momentum/tracers trends    (trd_wri routine)
102   USE trdmld          ! mixed-layer trends               (trd_mld routine)
103   USE trdmld_rst      ! restart for mixed-layer trends
104   USE trdmod_oce      ! ocean momentum/tracers trends
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 prtctl          ! Print control                    (prt_ctl routine)
118   USE domvvl          ! variable volume                  (dom_vvl 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   PUBLIC stp            ! called by opa.F90
128
129   !! * Substitutions
130#  include "domzgr_substitute.h90"
131#  include "zdfddm_substitute.h90"
132   !!----------------------------------------------------------------------
133   !!   OPA 9.0 , LOCEAN-IPSL (2005)
134   !! $Id$
135   !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt)
136   !!----------------------------------------------------------------------
137
138CONTAINS
139
140#if defined key_agrif
141   SUBROUTINE stp( )
142#else
143   SUBROUTINE stp( 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      !! * Arguments
162#if defined key_agrif   
163      INTEGER             ::   kstp   ! ocean time-step index
164#else
165      INTEGER, INTENT(in) ::   kstp   ! ocean time-step index
166#endif     
167      INTEGER ::   jk       ! dummy loop indice
168      INTEGER ::   indic    ! error indicator if < 0
169      !! ---------------------------------------------------------------------
170
171#if defined key_agrif
172      kstp = nit000 + Agrif_Nb_Step()
173!      IF ( Agrif_Root() .and. lwp) Write(*,*) '---'
174!      IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp
175#endif   
176      indic = 1                    ! reset to no error condition
177
178      CALL day( kstp )             ! Calendar
179
180      CALL rst_opn( kstp )         ! Open the restart file
181
182      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
183      ! Update data, open boundaries, surface boundary condition (including sea-ice)
184      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
185
186      IF( lk_dtatem  )   CALL dta_tem( kstp )         ! update 3D temperature data
187      IF( lk_dtasal  )   CALL dta_sal( kstp )         ! update 3D salinity data
188
189                         CALL sbc    ( kstp )         ! Sea Boundary Condition (including sea-ice)
190
191      IF( lk_obc     )   CALL obc_dta( kstp )         ! update dynamic and tracer data at open boundaries
192      IF( lk_obc     )   CALL obc_rad( kstp )         ! compute phase velocities at open boundaries
193
194      IF( lk_bdy     )   CALL bdy_dta( kstp )         ! update dynamic and tracer data at unstructured open boundary
195
196      IF( ninist == 1 ) THEN                       ! Output the initial state and forcings
197                        CALL dia_wri_state( 'output.init', kstp )
198                        ninist = 0
199      ENDIF
200
201
202      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
203      ! Ocean physics update
204      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
205#if defined key_zdftke2
206      IF ( ln_dynhpg_imp ) THEN
207      !-----------------------------------------------------------------------
208      !  LATERAL PHYSICS
209      !-----------------------------------------------------------------------
210      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
211      !-----------------------------------------------------------------------
212                               CALL zdf_mxl( kstp )                 ! mixed layer depth
213         IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing
214#  if defined key_traldf_c2d
215         IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient
216#  endif
217      ENDIF
218#endif
219      !-----------------------------------------------------------------------
220      !  VERTICAL PHYSICS
221      !-----------------------------------------------------------------------
222      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
223      !-----------------------------------------------------------------------
224#if defined key_zdftke2
225                        CALL bn2( tn, sn, rn2 )              ! now Brunt-Vaisala frequency
226#else
227                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
228#endif
229      !                                                     ! Vertical eddy viscosity and diffusivity coefficients
230      IF( lk_zdfric )   CALL zdf_ric( kstp )                       ! Richardson number dependent Kz
231
232      IF( lk_zdftke )   CALL zdf_tke ( kstp )                      ! TKE  closure scheme for Kz
233      IF( lk_zdftke2)   CALL zdf_tke2( kstp )                      ! TKE2 closure scheme for Kz
234
235      IF( lk_zdfkpp )   CALL zdf_kpp( kstp )                       ! KPP closure scheme for Kz
236
237      IF( lk_zdfcst )   THEN                                       ! Constant Kz (reset avt, avm[uv] to the background value)
238         avt (:,:,:) = avt0 * tmask(:,:,:)
239         avmu(:,:,:) = avm0 * umask(:,:,:)
240         avmv(:,:,:) = avm0 * vmask(:,:,:)
241      ENDIF
242
243      IF( ln_rnf_mouth ) THEN                                ! increase diffusivity at rivers mouths
244         DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO
245      ENDIF
246
247      IF( ln_zdfevd )   CALL zdf_evd( kstp )                 ! enhanced vertical eddy diffusivity
248
249      IF( lk_zdfddm .AND. .NOT. lk_zdfkpp )   &
250         &              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#if defined key_zdftke2
257      IF( .NOT. ln_dynhpg_imp ) THEN
258                        CALL bn2( tb, sb, rn2 )              ! before Brunt-Vaisala frequency
259                        CALL eos( tb, sb, rhd, rhop )        ! now (swap=before) in situ density for dynhpg module
260#endif
261      !-----------------------------------------------------------------------
262      !  LATERAL PHYSICS
263      !-----------------------------------------------------------------------
264      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
265      !-----------------------------------------------------------------------
266      IF( lk_ldfslp     )   CALL ldf_slp( kstp, rhd, rn2 )       ! before slope of the lateral mixing
267#if defined key_traldf_c2d
268      IF( lk_traldf_eiv )   CALL ldf_eiv( kstp )                 ! eddy induced velocity coefficient
269#  endif
270#if defined key_zdftke2
271      ENDIF
272#endif
273
274#if defined key_top
275      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
276      ! Passive Tracer Model
277      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
278      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
279      !-----------------------------------------------------------------------
280                             CALL trc_stp( kstp, indic )            ! time-stepping
281#endif
282
283      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
284      ! Active tracers
285      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
286      ! N.B. ua, va arrays are used as workspace in this section
287      !-----------------------------------------------------------------------
288                             ta(:,:,:) = 0.e0               ! set tracer trends to zero
289                             sa(:,:,:) = 0.e0
290
291                             CALL tra_sbc    ( kstp )       ! surface boundary condition
292      IF( ln_traqsr      )   CALL tra_qsr    ( kstp )       ! penetrative solar radiation qsr
293      IF( lk_trabbc      )   CALL tra_bbc    ( kstp )       ! bottom heat flux
294      IF( lk_trabbl_dif  )   CALL tra_bbl_dif( kstp )       ! diffusive bottom boundary layer scheme
295      IF( lk_trabbl_adv  )   CALL tra_bbl_adv( kstp )       ! advective (and/or diffusive) bottom boundary layer scheme
296      IF( lk_tradmp      )   CALL tra_dmp    ( kstp )       ! internal damping trends
297                             CALL tra_adv    ( kstp )       ! horizontal & vertical advection
298      IF( n_cla == 1     )   CALL tra_cla    ( kstp )       ! Cross Land Advection (Update Hor. advection)
299      IF( lk_zdfkpp )        CALL tra_kpp    ( kstp )       ! KPP non-local tracer fluxes
300                             CALL tra_ldf    ( kstp )       ! lateral mixing
301#if defined key_agrif
302      IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra          ! tracers sponge
303#endif
304                             CALL tra_zdf    ( kstp )       ! vertical mixing and after tracer fields
305
306#if ! defined key_zdftke2
307      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )       ! update after fields by non-penetrative convection
308                             CALL tra_nxt    ( kstp )       ! tracer fields at next time step
309
310      IF( ln_dynhpg_imp  ) THEN                             ! semi-implicit hpg
311                               CALL eos( ta, sa, rhd, rhop )          ! Time-filtered in situ density used in dynhpg module
312         IF( ln_zps    )       CALL zps_hde( kstp, ta, sa, rhd,   &   ! Partial steps: time filtered hor. gradient
313            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level
314            &                                     gtv, gsv, grv )
315      ELSE                                                  ! centered hpg (default case)
316                               CALL eos( tb, sb, rhd, rhop )          ! now (swap=before) in situ density for dynhpg module
317         IF( ln_zps    )       CALL zps_hde( kstp, tb, sb, rhd,   &   ! Partial steps: now horizontal gradient
318            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level
319            &                                     gtv, gsv, grv )
320      ENDIF
321#else
322      IF( .NOT. ln_dynhpg_imp  ) THEN                       ! centered hpg (default case)
323                               CALL eos( tn, sn, rhd, rhop )          ! now (swap=before) in situ density for dynhpg module
324         IF( ln_zps    )       CALL zps_hde( kstp, tn, sn, rhd,   &   ! Partial steps: now horizontal gradient
325            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level
326            &                                     gtv, gsv, grv )
327      ENDIF
328      IF( ln_zdfnpc      )   CALL tra_npc    ( kstp )       ! update after fields by non-penetrative convection
329                             CALL tra_nxt    ( kstp )       ! tracer fields at next time step
330      IF( ln_dynhpg_imp  ) THEN                             ! semi-implicit hpg
331                               CALL eos( ta, sa, rhd, rhop )          ! Time-filtered in situ density used in dynhpg module
332         IF( lk_ldfslp     )   CALL bn2( ta, sa, rn2 )                ! Time-filtered Brunt-Vaisala frequency
333         IF( ln_zps    )       CALL zps_hde( kstp, ta, sa, rhd,   &   ! Partial steps: time filtered hor. gradient
334            &                                     gtu, gsu, gru,  &   ! of t, s, rd at the bottom ocean level
335            &                                     gtv, gsv, grv )
336      ENDIF
337#endif
338      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
339      ! Dynamics
340      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
341      ! N.B. ta, sa arrays are used as workspace in this section
342      !-----------------------------------------------------------------------
343                               ua(:,:,:) = 0.e0               ! set dynamics trends to zero
344                               va(:,:,:) = 0.e0
345
346                               CALL dyn_adv( kstp )           ! advection (vector or flux form)
347                               CALL dyn_vor( kstp )           ! vorticity term including Coriolis
348                               CALL dyn_ldf( kstp )           ! lateral mixing
349#if defined key_agrif
350      IF(.NOT. Agrif_Root())   CALL Agrif_Sponge_dyn          ! momemtum sponge
351#endif
352                               CALL dyn_hpg( kstp )           ! horizontal gradient of Hydrostatic pressure
353                               CALL dyn_zdf( kstp )           ! vertical diffusion
354      IF( lk_dynspg_rl ) THEN
355         IF( lk_obc    )       CALL obc_spg( kstp )           ! surface pressure gradient at open boundaries
356      ENDIF
357                               indic=0
358                               CALL dyn_spg( kstp, indic )    ! surface pressure gradient
359                               CALL dyn_nxt( kstp )           ! lateral velocity at next time step
360      IF( lk_vvl )             CALL dom_vvl                   ! vertical mesh at next time step
361
362
363      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
364      ! Computation of diagnostic variables
365      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
366      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
367      !-----------------------------------------------------------------------
368                       CALL div_cur( kstp )                 ! Horizontal divergence & Relative vorticity
369      IF( n_cla == 1 ) CALL div_cla( kstp )                 ! Cross Land Advection (Update Hor. divergence)
370                       CALL wzv( kstp )                     ! Vertical velocity
371
372      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
373      ! Control and restarts
374      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
375                                 CALL stp_ctl( kstp, indic )
376      IF( indic < 0          )   CALL ctl_stop( 'step: indic < 0' )
377      IF( kstp == nit000     )   CALL iom_close( numror )             ! close input  ocean restart file
378      IF( lrst_oce           )   CALL rst_write    ( kstp )           ! write output ocean restart file
379      IF( lk_obc             )   CALL obc_rst_write( kstp )           ! write open boundary restart file
380
381      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
382      ! diagnostics and outputs
383      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
384      ! N.B. ua, va, ta, sa arrays are used as workspace in this section
385      !-----------------------------------------------------------------------
386
387      IF( nstop == 0 ) THEN                                 ! Diagnostics:
388         IF( lk_floats  )   CALL flo_stp( kstp )                 ! drifting Floats
389         IF( lk_trddyn  )   CALL trd_dwr( kstp )                 ! trends: dynamics
390         IF( lk_trdtra  )   CALL trd_twr( kstp )                 ! trends: active tracers
391         IF( lk_trdmld  )   CALL trd_mld( kstp )                 ! trends: Mixed-layer
392         IF( lk_trdvor  )   CALL trd_vor( kstp )                 ! trends: vorticity budget
393         IF( lk_diaspr  )   CALL dia_spr( kstp )                 ! Surface pressure diagnostics
394         IF( lk_diahth  )   CALL dia_hth( kstp )                 ! Thermocline depth (20 degres isotherm depth)
395         IF( lk_diagap  )   CALL dia_gap( kstp )                 ! basin averaged diagnostics
396         IF( lk_diahdy  )   CALL dia_hdy( kstp )                 ! dynamical heigh diagnostics
397         IF( lk_diafwb  )   CALL dia_fwb( kstp )                 ! Fresh water budget diagnostics
398         IF( ln_diaptr  )   CALL dia_ptr( kstp )                 ! Poleward TRansports diagnostics
399         !                                                 ! outputs
400                            CALL dia_wri( kstp, indic )          ! ocean model: outputs
401      ENDIF
402
403      !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
404      ! Coupled mode
405      !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
406
407      IF( lk_cpl )   CALL sbc_cpl_snd( kstp )                 ! coupled mode : field exchanges
408
409#if defined key_zdftke2
410      IF( ( kstp == nitend ).AND.( lrst_oce ) )  THEN
411
412         CALL day( kstp+1 )             ! Calendar
413         !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
414         ! Update data, open boundaries, surface boundary condition (including sea-ice)
415         !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
416                            CALL sbc    ( kstp+1 )         ! Sea Boundary Condition (including sea-ice)
417         !-----------------------------------------------------------------------
418         !  VERTICAL PHYSICS
419         !-----------------------------------------------------------------------
420         ! N.B. ua, va, ta, sa arrays are used as workspace in this section
421         !-----------------------------------------------------------------------
422                            CALL bn2( tn, sn, rn2 )            ! now Brunt-Vaisala frequency
423         !                                                     ! Vertical eddy viscosity and diffusivity coefficients
424         IF( lk_zdftke2 )   CALL zdf_tke2 ( kstp+1 )           ! TKE2 closure scheme for Kz
425                            CALL rst_write( kstp+1 )           ! close the restart file
426      ENDIF
427#endif
428      !
429   END SUBROUTINE stp
430
431   !!======================================================================
432END MODULE step
Note: See TracBrowser for help on using the repository browser.