[3] | 1 | MODULE step |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE step *** |
---|
| 4 | !! Time-stepping : manager of the ocean, tracer and ice time stepping |
---|
| 5 | !!====================================================================== |
---|
[1438] | 6 | !! History : OPA ! 1991-03 (G. Madec) Original code |
---|
[1492] | 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 |
---|
[1438] | 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 |
---|
[1492] | 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 |
---|
[1438] | 21 | !! 3.2 ! 2009-02 (G. Madec, R. Benshila) reintroduicing z*-coordinate |
---|
[1533] | 22 | !! - ! 2009-06 (S. Masson, G. Madec) TKE restart compatible with key_cpl |
---|
[2528] | 23 | !! 3.3 ! 2010-05 (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface |
---|
| 24 | !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA |
---|
[3294] | 25 | !! 3.4 ! 2011-04 (G. Madec, C. Ethe) Merge of dtatem and dtasal |
---|
[5836] | 26 | !! 3.6 ! 2012-07 (J. Simeon, G. Madec. C. Ethe) Online coarsening of outputs |
---|
| 27 | !! 3.6 ! 2014-04 (F. Roquet, G. Madec) New equations of state |
---|
[7167] | 28 | !! 3.6 ! 2014-10 (E. Clementi, P. Oddo) Add Qiao vertical mixing in case of waves |
---|
[5836] | 29 | !! 3.7 ! 2014-10 (G. Madec) LDF simplication |
---|
| 30 | !! - ! 2014-12 (G. Madec) remove KPP scheme |
---|
[5930] | 31 | !! - ! 2015-11 (J. Chanut) free surface simplification |
---|
[3] | 32 | !!---------------------------------------------------------------------- |
---|
[888] | 33 | |
---|
| 34 | !!---------------------------------------------------------------------- |
---|
[2528] | 35 | !! stp : OPA system time-stepping |
---|
[3] | 36 | !!---------------------------------------------------------------------- |
---|
[3764] | 37 | USE step_oce ! time stepping definition modules |
---|
[4990] | 38 | USE iom |
---|
[389] | 39 | |
---|
[3] | 40 | IMPLICIT NONE |
---|
| 41 | PRIVATE |
---|
| 42 | |
---|
[5836] | 43 | PUBLIC stp ! called by nemogcm.F90 |
---|
[3] | 44 | |
---|
| 45 | !! * Substitutions |
---|
| 46 | # include "domzgr_substitute.h90" |
---|
[4990] | 47 | !!gm # include "zdfddm_substitute.h90" |
---|
[3] | 48 | !!---------------------------------------------------------------------- |
---|
[5836] | 49 | !! NEMO/OPA 3.7 , NEMO Consortium (2015) |
---|
[888] | 50 | !! $Id$ |
---|
[2528] | 51 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
[3] | 52 | !!---------------------------------------------------------------------- |
---|
| 53 | CONTAINS |
---|
| 54 | |
---|
[508] | 55 | #if defined key_agrif |
---|
[5656] | 56 | RECURSIVE SUBROUTINE stp( ) |
---|
[1438] | 57 | INTEGER :: kstp ! ocean time-step index |
---|
[508] | 58 | #else |
---|
[467] | 59 | SUBROUTINE stp( kstp ) |
---|
[1438] | 60 | INTEGER, INTENT(in) :: kstp ! ocean time-step index |
---|
[467] | 61 | #endif |
---|
| 62 | !!---------------------------------------------------------------------- |
---|
[3] | 63 | !! *** ROUTINE stp *** |
---|
[3764] | 64 | !! |
---|
[3] | 65 | !! ** Purpose : - Time stepping of OPA (momentum and active tracer eqs.) |
---|
| 66 | !! - Time stepping of LIM (dynamic and thermodynamic eqs.) |
---|
| 67 | !! - Tme stepping of TRC (passive tracer eqs.) |
---|
[3764] | 68 | !! |
---|
| 69 | !! ** Method : -1- Update forcings and data |
---|
| 70 | !! -2- Update ocean physics |
---|
| 71 | !! -3- Compute the t and s trends |
---|
| 72 | !! -4- Update t and s |
---|
[3] | 73 | !! -5- Compute the momentum trends |
---|
| 74 | !! -6- Update the horizontal velocity |
---|
[5836] | 75 | !! -7- Compute the diagnostics variables (rd,N2, hdiv,w) |
---|
[3] | 76 | !! -8- Outputs and diagnostics |
---|
| 77 | !!---------------------------------------------------------------------- |
---|
[7167] | 78 | INTEGER :: ji,jj,jk ! dummy loop indice |
---|
[3] | 79 | INTEGER :: indic ! error indicator if < 0 |
---|
[4338] | 80 | INTEGER :: kcall ! optional integer argument (dom_vvl_sf_nxt) |
---|
[3] | 81 | !! --------------------------------------------------------------------- |
---|
[392] | 82 | #if defined key_agrif |
---|
[389] | 83 | kstp = nit000 + Agrif_Nb_Step() |
---|
[5836] | 84 | IF( lk_agrif_debug ) THEN |
---|
| 85 | IF( Agrif_Root() .and. lwp) WRITE(*,*) '---' |
---|
| 86 | IF(lwp) WRITE(*,*) 'Grid Number', Agrif_Fixed(),' time step ', kstp, 'int tstep', Agrif_NbStepint() |
---|
[5656] | 87 | ENDIF |
---|
[5836] | 88 | IF( kstp == nit000 + 1 ) lk_agrif_fstep = .FALSE. |
---|
[1793] | 89 | # if defined key_iomput |
---|
[5407] | 90 | IF( Agrif_Nbstepint() == 0 ) CALL iom_swap( cxios_context ) |
---|
[3764] | 91 | # endif |
---|
| 92 | #endif |
---|
[5836] | 93 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 94 | ! update I/O and calendar |
---|
| 95 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 96 | indic = 0 ! reset to no error condition |
---|
| 97 | |
---|
| 98 | IF( kstp == nit000 ) THEN ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS) |
---|
| 99 | CALL iom_init( cxios_context ) ! for model grid (including passible AGRIF zoom) |
---|
| 100 | IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" ) ! for coarse grid |
---|
[4152] | 101 | ENDIF |
---|
[1725] | 102 | IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) |
---|
[5836] | 103 | CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell IOM we are at time step kstp |
---|
| 104 | IF( ln_crs ) CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" ) ! tell IOM we are at time step kstp |
---|
[3] | 105 | |
---|
| 106 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[5836] | 107 | ! Update external forcing (tides, open boundaries, and surface boundary condition (including sea-ice) |
---|
[3] | 108 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5836] | 109 | IF( lk_tide ) CALL sbc_tide( kstp ) ! update tide potential |
---|
| 110 | IF( ln_apr_dyn ) CALL sbc_apr ( kstp ) ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib) |
---|
| 111 | IF( lk_bdy ) CALL bdy_dta ( kstp, time_offset=+1 ) ! update dynamic & tracer data at open boundaries |
---|
| 112 | CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) |
---|
| 113 | |
---|
[3] | 114 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[5329] | 115 | ! Update stochastic parameters and random T/S fluctuations |
---|
| 116 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[5836] | 117 | CALL sto_par( kstp ) ! Stochastic parameters |
---|
[5329] | 118 | |
---|
| 119 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[3294] | 120 | ! Ocean physics update (ua, va, tsa used as workspace) |
---|
[3] | 121 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[4990] | 122 | ! THERMODYNAMICS |
---|
| 123 | CALL eos_rab( tsb, rab_b ) ! before local thermal/haline expension ratio at T-points |
---|
| 124 | CALL eos_rab( tsn, rab_n ) ! now local thermal/haline expension ratio at T-points |
---|
| 125 | CALL bn2 ( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency |
---|
| 126 | CALL bn2 ( tsn, rab_n, rn2 ) ! now Brunt-Vaisala frequency |
---|
[5836] | 127 | |
---|
[1492] | 128 | ! |
---|
[3764] | 129 | ! VERTICAL PHYSICS |
---|
[4369] | 130 | CALL zdf_bfr( kstp ) ! bottom friction (if quadratic) |
---|
[1492] | 131 | ! ! Vertical eddy viscosity and diffusivity coefficients |
---|
[2528] | 132 | IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz |
---|
| 133 | IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz |
---|
| 134 | IF( lk_zdfgls ) CALL zdf_gls( kstp ) ! GLS closure scheme for Kz |
---|
[7167] | 135 | IF( ln_zdfqiao ) THEN |
---|
| 136 | CALL zdf_qiao(kstp ) ! Qiao vertical mixing |
---|
| 137 | DO jk = 1, jpkm1 |
---|
| 138 | DO jj = 1, jpj |
---|
| 139 | DO ji = 1, jpi |
---|
| 140 | avmu(ji,jj,jk) = (avmu(ji,jj,jk) + QBvu(ji,jj,jk)) * umask(ji,jj,jk) |
---|
| 141 | avmv(ji,jj,jk) = (avmv(ji,jj,jk) + QBvv(ji,jj,jk)) * vmask(ji,jj,jk) |
---|
| 142 | avt( ji,jj,jk) = (avt( ji,jj,jk) + QBv(ji,jj,jk)) * tmask(ji,jj,jk) |
---|
| 143 | END DO |
---|
| 144 | END DO |
---|
| 145 | END DO |
---|
| 146 | ENDIF |
---|
| 147 | ! |
---|
[4292] | 148 | IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) |
---|
[5120] | 149 | avt (:,:,:) = rn_avt0 * wmask (:,:,:) |
---|
| 150 | avmu(:,:,:) = rn_avm0 * wumask(:,:,:) |
---|
| 151 | avmv(:,:,:) = rn_avm0 * wvmask(:,:,:) |
---|
[677] | 152 | ENDIF |
---|
[5836] | 153 | |
---|
[1492] | 154 | IF( ln_rnf_mouth ) THEN ! increase diffusivity at rivers mouths |
---|
[5836] | 155 | DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + 2._wp * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk) ; END DO |
---|
[3] | 156 | ENDIF |
---|
[1492] | 157 | IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity |
---|
[3] | 158 | |
---|
[1492] | 159 | IF( lk_zdftmx ) CALL zdf_tmx( kstp ) ! tidal vertical mixing |
---|
[3] | 160 | |
---|
[5836] | 161 | IF( lk_zdfddm ) CALL zdf_ddm( kstp ) ! double diffusive mixing |
---|
[3764] | 162 | |
---|
[1492] | 163 | CALL zdf_mxl( kstp ) ! mixed layer depth |
---|
[3] | 164 | |
---|
[2528] | 165 | ! write TKE or GLS information in the restart file |
---|
[1531] | 166 | IF( lrst_oce .AND. lk_zdftke ) CALL tke_rst( kstp, 'WRITE' ) |
---|
[2528] | 167 | IF( lrst_oce .AND. lk_zdfgls ) CALL gls_rst( kstp, 'WRITE' ) |
---|
[1492] | 168 | ! |
---|
[3764] | 169 | ! LATERAL PHYSICS |
---|
[1492] | 170 | ! |
---|
[5836] | 171 | IF( l_ldfslp ) THEN ! slope of lateral mixing |
---|
| 172 | !!gm : why this here ???? |
---|
[5329] | 173 | IF(ln_sto_eos ) CALL sto_pts( tsn ) ! Random T/S fluctuations |
---|
[5836] | 174 | !!gm |
---|
[5120] | 175 | CALL eos( tsb, rhd, gdept_0(:,:,:) ) ! before in situ density |
---|
[5836] | 176 | |
---|
[5120] | 177 | IF( ln_zps .AND. .NOT. ln_isfcav) & |
---|
| 178 | & CALL zps_hde ( kstp, jpts, tsb, gtsu, gtsv, & ! Partial steps: before horizontal gradient |
---|
| 179 | & rhd, gru , grv ) ! of t, s, rd at the last ocean level |
---|
[5836] | 180 | |
---|
[5120] | 181 | IF( ln_zps .AND. ln_isfcav) & |
---|
[5836] | 182 | & CALL zps_hde_isf( kstp, jpts, tsb, gtsu, gtsv, gtui, gtvi, & ! Partial steps for top cell (ISF) |
---|
[5120] | 183 | & rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv , & |
---|
[5836] | 184 | & grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) ! of t, s, rd at the first ocean level |
---|
| 185 | |
---|
| 186 | IF( ln_traldf_triad ) THEN |
---|
| 187 | CALL ldf_slp_triad( kstp ) ! before slope for triad operator |
---|
| 188 | ELSE |
---|
| 189 | CALL ldf_slp ( kstp, rhd, rn2b ) ! before slope for standard operator |
---|
[2528] | 190 | ENDIF |
---|
[1481] | 191 | ENDIF |
---|
[5836] | 192 | ! ! eddy diffusivity coeff. and/or eiv coeff. |
---|
| 193 | IF( l_ldftra_time .OR. l_ldfeiv_time ) CALL ldf_tra( kstp ) |
---|
[3] | 194 | |
---|
[4369] | 195 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[5930] | 196 | ! Ocean dynamics : hdiv, ssh, e3, u, v, w |
---|
[4369] | 197 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5930] | 198 | |
---|
[5836] | 199 | CALL ssh_nxt ( kstp ) ! after ssh (includes call to div_hor) |
---|
[4387] | 200 | IF( lk_vvl ) CALL dom_vvl_sf_nxt( kstp ) ! after vertical scale factors |
---|
| 201 | CALL wzv ( kstp ) ! now cross-level velocity |
---|
[3634] | 202 | |
---|
[5836] | 203 | !!gm : why also here ???? |
---|
[5930] | 204 | IF(ln_sto_eos ) CALL sto_pts( tsn ) ! Random T/S fluctuations |
---|
[5836] | 205 | !!gm |
---|
[5930] | 206 | CALL eos ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation |
---|
| 207 | |
---|
| 208 | !!jc: fs simplification |
---|
| 209 | !!jc: lines below are useless if lk_vvl=T. Keep them here (which maintains a bug if lk_vvl=F and ln_zps=T, cf ticket #1636) |
---|
| 210 | !! but ensures reproductible results |
---|
| 211 | !! with previous versions using split-explicit free surface |
---|
[5836] | 212 | IF( ln_zps .AND. .NOT. ln_isfcav) & ! Partial steps: bottom before horizontal gradient |
---|
| 213 | & CALL zps_hde ( kstp, jpts, tsn, gtsu, gtsv, & ! of t, s, rd at the last ocean level |
---|
| 214 | & rhd, gru , grv ) |
---|
| 215 | IF( ln_zps .AND. ln_isfcav) & ! Partial steps: top & bottom before horizontal gradient |
---|
| 216 | & CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv, gtui, gtvi, & |
---|
[5120] | 217 | & rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv , & |
---|
[5836] | 218 | & grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) |
---|
[5930] | 219 | !!jc: fs simplification |
---|
| 220 | |
---|
| 221 | ua(:,:,:) = 0._wp ! set dynamics trends to zero |
---|
| 222 | va(:,:,:) = 0._wp |
---|
[4369] | 223 | |
---|
[5930] | 224 | IF( lk_asminc .AND. ln_asmiau .AND. ln_dyninc ) & |
---|
| 225 | CALL dyn_asm_inc ( kstp ) ! apply dynamics assimilation increment |
---|
| 226 | IF( lk_bdy ) CALL bdy_dyn3d_dmp ( kstp ) ! bdy damping trends |
---|
[4369] | 227 | #if defined key_agrif |
---|
[5930] | 228 | IF(.NOT. Agrif_Root()) & |
---|
| 229 | & CALL Agrif_Sponge_dyn ! momentum sponge |
---|
[4369] | 230 | #endif |
---|
[5930] | 231 | CALL dyn_adv ( kstp ) ! advection (vector or flux form) |
---|
| 232 | CALL dyn_vor ( kstp ) ! vorticity term including Coriolis |
---|
[7168] | 233 | IF( ln_stcor ) CALL dyn_stcor ( kstp ) ! Stokes-Coriolis forcing |
---|
[5930] | 234 | CALL dyn_ldf ( kstp ) ! lateral mixing |
---|
| 235 | CALL dyn_hpg ( kstp ) ! horizontal gradient of Hydrostatic pressure |
---|
| 236 | CALL dyn_spg ( kstp ) ! surface pressure gradient |
---|
[4369] | 237 | |
---|
[5930] | 238 | ! With split-explicit free surface, since now transports have been updated and ssha as well |
---|
| 239 | IF( ln_dynspg_ts ) THEN ! vertical scale factors and vertical velocity need to be updated |
---|
| 240 | CALL div_hor ( kstp ) ! Horizontal divergence (2nd call in time-split case) |
---|
| 241 | IF( lk_vvl ) CALL dom_vvl_sf_nxt( kstp, kcall=2 ) ! after vertical scale factors (update depth average component) |
---|
| 242 | CALL wzv ( kstp ) ! now cross-level velocity |
---|
[4369] | 243 | ENDIF |
---|
| 244 | |
---|
[5930] | 245 | CALL dyn_bfr ( kstp ) ! bottom friction |
---|
| 246 | CALL dyn_zdf ( kstp ) ! vertical diffusion |
---|
| 247 | |
---|
[1482] | 248 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[5930] | 249 | ! diagnostics and outputs |
---|
[1482] | 250 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5930] | 251 | IF( lk_floats ) CALL flo_stp ( kstp ) ! drifting Floats |
---|
| 252 | IF( lk_diahth ) CALL dia_hth ( kstp ) ! Thermocline depth (20 degres isotherm depth) |
---|
| 253 | IF(.NOT.ln_cpl ) CALL dia_fwb ( kstp ) ! Fresh water budget diagnostics |
---|
| 254 | IF( lk_diadct ) CALL dia_dct ( kstp ) ! Transports |
---|
| 255 | IF( lk_diaar5 ) CALL dia_ar5 ( kstp ) ! ar5 diag |
---|
| 256 | IF( lk_diaharm ) CALL dia_harm ( kstp ) ! Tidal harmonic analysis |
---|
| 257 | CALL dia_wri ( kstp ) ! ocean model: outputs |
---|
[4152] | 258 | ! |
---|
[5930] | 259 | IF( ln_crs ) CALL crs_fld ( kstp ) ! ocean model: online field coarsening & output |
---|
[1482] | 260 | |
---|
[923] | 261 | #if defined key_top |
---|
[3] | 262 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 263 | ! Passive Tracer Model |
---|
| 264 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5930] | 265 | CALL trc_stp ( kstp ) ! time-stepping |
---|
[3] | 266 | #endif |
---|
| 267 | |
---|
| 268 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[5930] | 269 | ! Active tracers |
---|
[3] | 270 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5930] | 271 | tsa(:,:,:,:) = 0._wp ! set tracer trends to zero |
---|
[3] | 272 | |
---|
[5656] | 273 | IF( lk_asminc .AND. ln_asmiau .AND. & |
---|
[5930] | 274 | & ln_trainc ) CALL tra_asm_inc ( kstp ) ! apply tracer assimilation increment |
---|
| 275 | CALL tra_sbc ( kstp ) ! surface boundary condition |
---|
| 276 | IF( ln_traqsr ) CALL tra_qsr ( kstp ) ! penetrative solar radiation qsr |
---|
| 277 | IF( ln_trabbc ) CALL tra_bbc ( kstp ) ! bottom heat flux |
---|
| 278 | IF( lk_trabbl ) CALL tra_bbl ( kstp ) ! advective (and/or diffusive) bottom boundary layer scheme |
---|
| 279 | IF( ln_tradmp ) CALL tra_dmp ( kstp ) ! internal damping trends |
---|
| 280 | IF( lk_bdy ) CALL bdy_tra_dmp ( kstp ) ! bdy damping trends |
---|
[392] | 281 | #if defined key_agrif |
---|
[5930] | 282 | IF(.NOT. Agrif_Root()) & |
---|
| 283 | & CALL Agrif_Sponge_tra ! tracers sponge |
---|
[389] | 284 | #endif |
---|
[5930] | 285 | CALL tra_adv ( kstp ) ! horizontal & vertical advection |
---|
| 286 | CALL tra_ldf ( kstp ) ! lateral mixing |
---|
[1239] | 287 | |
---|
[5930] | 288 | !!gm : why CALL to dia_ptr has been moved here??? (use trends info?) |
---|
| 289 | IF( ln_diaptr ) CALL dia_ptr ! Poleward adv/ldf TRansports diagnostics |
---|
[5836] | 290 | !!gm |
---|
[5930] | 291 | CALL tra_zdf ( kstp ) ! vertical mixing and after tracer fields |
---|
| 292 | IF( ln_zdfnpc ) CALL tra_npc ( kstp ) ! update after fields by non-penetrative convection |
---|
[1481] | 293 | |
---|
[3] | 294 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[5930] | 295 | ! Set boundary conditions and Swap |
---|
[3] | 296 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5930] | 297 | !!jc1: For agrif, it would be much better to finalize tracers/momentum here (e.g. bdy conditions) and move the swap |
---|
| 298 | !! (and time filtering) after Agrif update. Then restart would be done after and would contain updated fields. |
---|
| 299 | !! If so: |
---|
| 300 | !! (i) no need to call agrif update at initialization time |
---|
| 301 | !! (ii) no need to update "before" fields |
---|
| 302 | !! |
---|
| 303 | !! Apart from creating new tra_swp/dyn_swp routines, this however: |
---|
| 304 | !! (i) makes boundary conditions at initialization time computed from updated fields which is not the case between |
---|
| 305 | !! two restarts => restartability issue. One can circumvent this, maybe, by assuming "interface separation", |
---|
| 306 | !! e.g. a shift of the feedback interface inside child domain. |
---|
| 307 | !! (ii) requires that all restart outputs of updated variables by agrif (e.g. passive tracers/tke/barotropic arrays) are done at the same |
---|
| 308 | !! place. |
---|
| 309 | !! |
---|
| 310 | !!jc2: dynnxt must be the latest call. fse3t_b are indeed updated in that routine |
---|
| 311 | CALL tra_nxt ( kstp ) ! finalize (bcs) tracer fields at next time step and swap |
---|
| 312 | CALL dyn_nxt ( kstp ) ! finalize (bcs) velocities at next time step and swap |
---|
| 313 | CALL ssh_swp ( kstp ) ! swap of sea surface height |
---|
| 314 | IF( lk_vvl ) CALL dom_vvl_sf_swp( kstp ) ! swap of vertical scale factors |
---|
[5656] | 315 | ! |
---|
[5836] | 316 | |
---|
| 317 | !!gm : This does not only concern the dynamics ==>>> add a new title |
---|
| 318 | !!gm2: why ouput restart before AGRIF update? |
---|
[5930] | 319 | !! |
---|
| 320 | !!jc: That would be better, but see comment above |
---|
| 321 | !! |
---|
| 322 | IF( lrst_oce ) CALL rst_write ( kstp ) ! write output ocean restart file |
---|
[593] | 323 | |
---|
[5656] | 324 | #if defined key_agrif |
---|
| 325 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 326 | ! AGRIF |
---|
| 327 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5930] | 328 | CALL Agrif_Integrate_ChildGrids( stp ) |
---|
[5656] | 329 | |
---|
[5930] | 330 | IF ( Agrif_NbStepint().EQ.0 ) THEN ! AGRIF Update |
---|
| 331 | !!jc in fact update i useless at last time step, but do it for global diagnostics |
---|
| 332 | CALL Agrif_Update_Tra() ! Update active tracers |
---|
| 333 | CALL Agrif_Update_Dyn() ! Update momentum |
---|
[5656] | 334 | ENDIF |
---|
| 335 | #endif |
---|
[5930] | 336 | IF( ln_diahsb ) CALL dia_hsb ( kstp ) ! - ML - global conservation diagnostics |
---|
| 337 | IF( lk_diaobs ) CALL dia_obs ( kstp ) ! obs-minus-model (assimilation) diagnostics (call after dynamics update) |
---|
[2528] | 338 | |
---|
[3] | 339 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[5656] | 340 | ! Control |
---|
[3] | 341 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5930] | 342 | CALL stp_ctl ( kstp, indic ) |
---|
| 343 | IF( indic < 0 ) THEN |
---|
| 344 | CALL ctl_stop( 'step: indic < 0' ) |
---|
| 345 | CALL dia_wri_state( 'output.abort', kstp ) |
---|
[1482] | 346 | ENDIF |
---|
[5930] | 347 | IF( kstp == nit000 ) THEN |
---|
[4624] | 348 | CALL iom_close( numror ) ! close input ocean restart file |
---|
| 349 | IF(lwm) CALL FLUSH ( numond ) ! flush output namelist oce |
---|
[5836] | 350 | IF(lwm.AND.numoni /= -1 ) & |
---|
| 351 | & CALL FLUSH ( numoni ) ! flush output namelist ice (if exist) |
---|
[4147] | 352 | ENDIF |
---|
[3] | 353 | |
---|
[508] | 354 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[75] | 355 | ! Coupled mode |
---|
| 356 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[5836] | 357 | !!gm why lk_oasis and not lk_cpl ???? |
---|
[5930] | 358 | IF( lk_oasis ) CALL sbc_cpl_snd( kstp ) ! coupled mode : field exchanges |
---|
[508] | 359 | ! |
---|
[4153] | 360 | #if defined key_iomput |
---|
| 361 | IF( kstp == nitend .OR. indic < 0 ) THEN |
---|
[5407] | 362 | CALL iom_context_finalize( cxios_context ) ! needed for XIOS+AGRIF |
---|
| 363 | IF( ln_crs ) CALL iom_context_finalize( trim(cxios_context)//"_crs" ) ! |
---|
[4152] | 364 | ENDIF |
---|
[4153] | 365 | #endif |
---|
[3769] | 366 | ! |
---|
[3294] | 367 | IF( nn_timing == 1 .AND. kstp == nit000 ) CALL timing_reset |
---|
[1481] | 368 | ! |
---|
[3] | 369 | END SUBROUTINE stp |
---|
| 370 | |
---|
| 371 | !!====================================================================== |
---|
| 372 | END MODULE step |
---|