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

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

supress ice_oce module, see ticket:448

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