[3] | 1 | MODULE step |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE step *** |
---|
| 4 | !! Time-stepping : manager of the ocean, tracer and ice time stepping |
---|
| 5 | !!====================================================================== |
---|
[888] | 6 | !! History : ! 91-03 (G. Madec) Original code |
---|
[508] | 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 |
---|
[888] | 21 | !! " " ! 06-08 (G. Madec) surface module |
---|
[911] | 22 | !! " " ! 07-07 (J. Chanut, A. Sellar) Unstructured open boundaries (BDY) |
---|
[3] | 23 | !!---------------------------------------------------------------------- |
---|
[888] | 24 | |
---|
| 25 | !!---------------------------------------------------------------------- |
---|
[3] | 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 |
---|
[467] | 31 | USE ldftra_oce ! ocean tracer - trends |
---|
| 32 | USE ldfdyn_oce ! ocean dynamics - trends |
---|
[216] | 33 | USE cpl_oce ! coupled ocean-atmosphere variables |
---|
[3] | 34 | USE in_out_manager ! I/O manager |
---|
[888] | 35 | USE iom ! |
---|
[3] | 36 | USE lbclnk |
---|
| 37 | |
---|
| 38 | USE daymod ! calendar (day routine) |
---|
| 39 | |
---|
| 40 | USE dtatem ! ocean temperature data (dta_tem routine) |
---|
| 41 | USE dtasal ! ocean salinity data (dta_sal routine) |
---|
[888] | 42 | USE sbcmod ! surface boundary condition (sbc routine) |
---|
| 43 | USE sbcrnf ! surface boundary condition: runoff variables |
---|
[3] | 44 | |
---|
[187] | 45 | USE trcstp ! passive tracer time-stepping (trc_stp routine) |
---|
[3] | 46 | |
---|
[467] | 47 | USE traqsr ! solar radiation penetration (tra_qsr routine) |
---|
| 48 | USE trasbc ! surface boundary condition (tra_sbc routine) |
---|
[3] | 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) |
---|
[467] | 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) |
---|
[3] | 58 | USE tranpc ! non-penetrative convection (tra_npc routine) |
---|
| 59 | |
---|
| 60 | USE eosbn2 ! equation of state (eos_bn2 routine) |
---|
| 61 | |
---|
[643] | 62 | USE dynadv ! advection (dyn_adv routine) |
---|
| 63 | USE dynvor ! vorticity term (dyn_vor routine) |
---|
[467] | 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 | |
---|
[3] | 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 | |
---|
[911] | 77 | USE bdy_par ! unstructured open boundary data variables |
---|
| 78 | USE bdydta ! unstructured open boundary data (bdy_dta routine) |
---|
| 79 | |
---|
[3] | 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 zdfbfr ! bottom friction (zdf_bfr routine) |
---|
| 88 | USE zdftke ! TKE vertical mixing (zdf_tke routine) |
---|
[255] | 89 | USE zdfkpp ! KPP vertical mixing (zdf_kpp routine) |
---|
[3] | 90 | USE zdfddm ! double diffusion mixing (zdf_ddm routine) |
---|
| 91 | USE zdfevd ! enhanced vertical diffusion (zdf_evd routine) |
---|
| 92 | USE zdfric ! Richardson vertical mixing (zdf_ric routine) |
---|
| 93 | USE zdfmxl ! Mixed-layer depth (zdf_mxl routine) |
---|
| 94 | |
---|
| 95 | USE zpshde ! partial step: hor. derivative (zps_hde routine) |
---|
| 96 | USE ice_oce ! sea-ice variable |
---|
[888] | 97 | |
---|
[3] | 98 | USE diawri ! Standard run outputs (dia_wri routine) |
---|
[216] | 99 | USE trdicp ! Ocean momentum/tracers trends (trd_wri routine) |
---|
[3] | 100 | USE trdmld ! mixed-layer trends (trd_mld routine) |
---|
[503] | 101 | USE trdmld_rst ! restart for mixed-layer trends |
---|
| 102 | USE trdmod_oce ! ocean momentum/tracers trends |
---|
[108] | 103 | USE trdvor ! vorticity budget (trd_vor routine) |
---|
[216] | 104 | USE diagap ! hor. mean model-data gap (dia_gap routine) |
---|
[3] | 105 | USE diahdy ! dynamic height (dia_hdy routine) |
---|
[132] | 106 | USE diaptr ! poleward transports (dia_ptr routine) |
---|
[3] | 107 | USE diahth ! thermocline depth (dia_hth routine) |
---|
| 108 | USE diafwb ! freshwater budget (dia_fwb routine) |
---|
| 109 | USE diaspr ! suface pressure (rigid-lid) (dia_spr routine) |
---|
| 110 | USE flo_oce ! floats variables |
---|
| 111 | USE floats ! floats computation (flo_stp routine) |
---|
| 112 | |
---|
[1884] | 113 | USE tamtrj ! writing out state trajectory |
---|
| 114 | |
---|
[3] | 115 | USE stpctl ! time stepping control (stp_ctl routine) |
---|
[75] | 116 | USE restart ! ocean restart (rst_wri routine) |
---|
[258] | 117 | USE prtctl ! Print control (prt_ctl routine) |
---|
[593] | 118 | USE domvvl ! variable volume (dom_vvl routine) |
---|
[3] | 119 | |
---|
[392] | 120 | #if defined key_agrif |
---|
[389] | 121 | USE agrif_opa_sponge ! Momemtum and tracers sponges |
---|
| 122 | #endif |
---|
| 123 | |
---|
[3] | 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 | !!---------------------------------------------------------------------- |
---|
[247] | 133 | !! OPA 9.0 , LOCEAN-IPSL (2005) |
---|
[888] | 134 | !! $Id$ |
---|
[508] | 135 | !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) |
---|
[3] | 136 | !!---------------------------------------------------------------------- |
---|
| 137 | |
---|
| 138 | CONTAINS |
---|
| 139 | |
---|
[508] | 140 | #if defined key_agrif |
---|
| 141 | SUBROUTINE stp( ) |
---|
| 142 | #else |
---|
[467] | 143 | SUBROUTINE stp( kstp ) |
---|
| 144 | #endif |
---|
| 145 | !!---------------------------------------------------------------------- |
---|
[3] | 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 | !!---------------------------------------------------------------------- |
---|
[719] | 161 | !! * Arguments |
---|
[508] | 162 | #if defined key_agrif |
---|
[888] | 163 | INTEGER :: kstp ! ocean time-step index |
---|
[508] | 164 | #else |
---|
[888] | 165 | INTEGER, INTENT(in) :: kstp ! ocean time-step index |
---|
[389] | 166 | #endif |
---|
[1884] | 167 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: zta_tmp, zsa_tmp |
---|
[888] | 168 | INTEGER :: jk ! dummy loop indice |
---|
[3] | 169 | INTEGER :: indic ! error indicator if < 0 |
---|
| 170 | !! --------------------------------------------------------------------- |
---|
| 171 | |
---|
[392] | 172 | #if defined key_agrif |
---|
[389] | 173 | kstp = nit000 + Agrif_Nb_Step() |
---|
[445] | 174 | ! IF ( Agrif_Root() .and. lwp) Write(*,*) '---' |
---|
[508] | 175 | ! IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp |
---|
[389] | 176 | #endif |
---|
[3] | 177 | indic = 1 ! reset to no error condition |
---|
[508] | 178 | |
---|
[3] | 179 | CALL day( kstp ) ! Calendar |
---|
| 180 | |
---|
[508] | 181 | CALL rst_opn( kstp ) ! Open the restart file |
---|
| 182 | |
---|
[3] | 183 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[888] | 184 | ! Update data, open boundaries, surface boundary condition (including sea-ice) |
---|
[3] | 185 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 186 | |
---|
| 187 | IF( lk_dtatem ) CALL dta_tem( kstp ) ! update 3D temperature data |
---|
[888] | 188 | IF( lk_dtasal ) CALL dta_sal( kstp ) ! update 3D salinity data |
---|
[3] | 189 | |
---|
[888] | 190 | CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) |
---|
[3] | 191 | |
---|
[35] | 192 | IF( lk_obc ) CALL obc_dta( kstp ) ! update dynamic and tracer data at open boundaries |
---|
[3] | 193 | IF( lk_obc ) CALL obc_rad( kstp ) ! compute phase velocities at open boundaries |
---|
| 194 | |
---|
[911] | 195 | IF( lk_bdy ) CALL bdy_dta( kstp ) ! update dynamic and tracer data at unstructured open boundary |
---|
| 196 | |
---|
[888] | 197 | IF( ninist == 1 ) THEN ! Output the initial state and forcings |
---|
| 198 | CALL dia_wri_state( 'output.init' ) |
---|
| 199 | ninist = 0 |
---|
[3] | 200 | ENDIF |
---|
| 201 | |
---|
| 202 | |
---|
| 203 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 204 | ! Ocean physics update |
---|
| 205 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 206 | !----------------------------------------------------------------------- |
---|
| 207 | ! VERTICAL PHYSICS |
---|
| 208 | !----------------------------------------------------------------------- |
---|
| 209 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 210 | !----------------------------------------------------------------------- |
---|
| 211 | |
---|
[888] | 212 | CALL bn2( tb, sb, rn2 ) ! before Brunt-Vaisala frequency |
---|
[3] | 213 | |
---|
| 214 | ! ! Vertical eddy viscosity and diffusivity coefficients |
---|
| 215 | IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz |
---|
[789] | 216 | |
---|
[3] | 217 | IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz |
---|
[789] | 218 | |
---|
[255] | 219 | IF( lk_zdfkpp ) CALL zdf_kpp( kstp ) ! KPP closure scheme for Kz |
---|
[467] | 220 | |
---|
[677] | 221 | IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) |
---|
| 222 | avt (:,:,:) = avt0 * tmask(:,:,:) |
---|
| 223 | avmu(:,:,:) = avm0 * umask(:,:,:) |
---|
| 224 | avmv(:,:,:) = avm0 * vmask(:,:,:) |
---|
| 225 | ENDIF |
---|
[3] | 226 | |
---|
[1116] | 227 | IF( ln_rnf_mouth ) THEN ! increase diffusivity at rivers mouths |
---|
| 228 | DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:) ; END DO |
---|
[3] | 229 | ENDIF |
---|
| 230 | |
---|
| 231 | IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity |
---|
| 232 | |
---|
[888] | 233 | IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & |
---|
[255] | 234 | & CALL zdf_ddm( kstp ) ! double diffusive mixing |
---|
[3] | 235 | |
---|
[75] | 236 | CALL zdf_bfr( kstp ) ! bottom friction |
---|
[3] | 237 | |
---|
| 238 | CALL zdf_mxl( kstp ) ! mixed layer depth |
---|
| 239 | |
---|
| 240 | |
---|
| 241 | !----------------------------------------------------------------------- |
---|
| 242 | ! LATERAL PHYSICS |
---|
| 243 | !----------------------------------------------------------------------- |
---|
| 244 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 245 | !----------------------------------------------------------------------- |
---|
| 246 | IF( lk_ldfslp ) CALL ldf_slp( kstp, rhd, rn2 ) ! before slope of the lateral mixing |
---|
| 247 | #if defined key_traldf_c2d |
---|
| 248 | IF( lk_traldf_eiv ) CALL ldf_eiv( kstp ) ! eddy induced velocity coefficient |
---|
| 249 | #endif |
---|
| 250 | |
---|
[923] | 251 | #if defined key_top |
---|
[3] | 252 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 253 | ! Passive Tracer Model |
---|
| 254 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 255 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 256 | !----------------------------------------------------------------------- |
---|
[345] | 257 | CALL trc_stp( kstp, indic ) ! time-stepping |
---|
[3] | 258 | #endif |
---|
| 259 | |
---|
| 260 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 261 | ! Active tracers |
---|
| 262 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 263 | ! N.B. ua, va arrays are used as workspace in this section |
---|
| 264 | !----------------------------------------------------------------------- |
---|
[467] | 265 | ta(:,:,:) = 0.e0 ! set tracer trends to zero |
---|
| 266 | sa(:,:,:) = 0.e0 |
---|
[3] | 267 | |
---|
[1884] | 268 | ! Saving non-linear trajectory at restart state |
---|
| 269 | ! May not be exact for sbc and zdf parameters |
---|
| 270 | IF( ( ln_trjwri ) .AND. ( kstp == nit000 ) ) CALL tam_trj_wri( kstp - 1 ) |
---|
| 271 | |
---|
[467] | 272 | CALL tra_sbc ( kstp ) ! surface boundary condition |
---|
| 273 | IF( ln_traqsr ) CALL tra_qsr ( kstp ) ! penetrative solar radiation qsr |
---|
| 274 | IF( lk_trabbc ) CALL tra_bbc ( kstp ) ! bottom heat flux |
---|
| 275 | IF( lk_trabbl_dif ) CALL tra_bbl_dif( kstp ) ! diffusive bottom boundary layer scheme |
---|
| 276 | IF( lk_trabbl_adv ) CALL tra_bbl_adv( kstp ) ! advective (and/or diffusive) bottom boundary layer scheme |
---|
| 277 | IF( lk_tradmp ) CALL tra_dmp ( kstp ) ! internal damping trends |
---|
| 278 | CALL tra_adv ( kstp ) ! horizontal & vertical advection |
---|
| 279 | IF( n_cla == 1 ) CALL tra_cla ( kstp ) ! Cross Land Advection (Update Hor. advection) |
---|
| 280 | IF( lk_zdfkpp ) CALL tra_kpp ( kstp ) ! KPP non-local tracer fluxes |
---|
| 281 | CALL tra_ldf ( kstp ) ! lateral mixing |
---|
[392] | 282 | #if defined key_agrif |
---|
[782] | 283 | IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra ! tracers sponge |
---|
[389] | 284 | #endif |
---|
[1111] | 285 | CALL tra_zdf ( kstp ) ! vertical mixing and after tracer fields |
---|
| 286 | IF( ln_zdfnpc ) CALL tra_npc ( kstp ) ! update after fields by non-penetrative convection |
---|
| 287 | CALL tra_nxt ( kstp ) ! tracer fields at next time step |
---|
[3] | 288 | |
---|
[467] | 289 | IF( ln_dynhpg_imp ) THEN ! semi-implicit hpg |
---|
| 290 | CALL eos( ta, sa, rhd, rhop ) ! Time-filtered in situ density used in dynhpg module |
---|
| 291 | IF( ln_zps ) CALL zps_hde( kstp, ta, sa, rhd, & ! Partial steps: time filtered hor. gradient |
---|
| 292 | & gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level |
---|
| 293 | & gtv, gsv, grv ) |
---|
| 294 | ELSE ! centered hpg (default case) |
---|
| 295 | CALL eos( tb, sb, rhd, rhop ) ! now (swap=before) in situ density for dynhpg module |
---|
| 296 | IF( ln_zps ) CALL zps_hde( kstp, tb, sb, rhd, & ! Partial steps: now horizontal gradient |
---|
| 297 | & gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level |
---|
| 298 | & gtv, gsv, grv ) |
---|
[3] | 299 | ENDIF |
---|
| 300 | |
---|
| 301 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[1884] | 302 | ! saving ta and sa (temporary fix, please do not remove) |
---|
| 303 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 304 | IF (ln_trjwri) THEN |
---|
| 305 | ALLOCATE ( zta_tmp(jpi,jpj,jpk), & |
---|
| 306 | & zsa_tmp(jpi,jpj,jpk) ) |
---|
| 307 | zta_tmp(:,:,:) = ta(:,:,:) |
---|
| 308 | zsa_tmp(:,:,:) = sa(:,:,:) |
---|
| 309 | END IF |
---|
| 310 | |
---|
| 311 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[3] | 312 | ! Dynamics |
---|
| 313 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 314 | ! N.B. ta, sa arrays are used as workspace in this section |
---|
| 315 | !----------------------------------------------------------------------- |
---|
[75] | 316 | ua(:,:,:) = 0.e0 ! set dynamics trends to zero |
---|
| 317 | va(:,:,:) = 0.e0 |
---|
[3] | 318 | |
---|
[643] | 319 | CALL dyn_adv( kstp ) ! advection (vector or flux form) |
---|
[467] | 320 | CALL dyn_vor( kstp ) ! vorticity term including Coriolis |
---|
| 321 | CALL dyn_ldf( kstp ) ! lateral mixing |
---|
[392] | 322 | #if defined key_agrif |
---|
[782] | 323 | IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_dyn ! momemtum sponge |
---|
[389] | 324 | #endif |
---|
[467] | 325 | CALL dyn_hpg( kstp ) ! horizontal gradient of Hydrostatic pressure |
---|
| 326 | CALL dyn_zdf( kstp ) ! vertical diffusion |
---|
| 327 | IF( lk_dynspg_rl ) THEN |
---|
[75] | 328 | IF( lk_obc ) CALL obc_spg( kstp ) ! surface pressure gradient at open boundaries |
---|
[3] | 329 | ENDIF |
---|
[888] | 330 | indic=0 |
---|
[359] | 331 | CALL dyn_spg( kstp, indic ) ! surface pressure gradient |
---|
[467] | 332 | CALL dyn_nxt( kstp ) ! lateral velocity at next time step |
---|
[593] | 333 | IF( lk_vvl ) CALL dom_vvl ! vertical mesh at next time step |
---|
[3] | 334 | |
---|
[593] | 335 | |
---|
[3] | 336 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 337 | ! Computation of diagnostic variables |
---|
| 338 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 339 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 340 | !----------------------------------------------------------------------- |
---|
| 341 | CALL div_cur( kstp ) ! Horizontal divergence & Relative vorticity |
---|
| 342 | IF( n_cla == 1 ) CALL div_cla( kstp ) ! Cross Land Advection (Update Hor. divergence) |
---|
| 343 | CALL wzv( kstp ) ! Vertical velocity |
---|
| 344 | |
---|
| 345 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[888] | 346 | ! Control and restarts |
---|
[3] | 347 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[508] | 348 | CALL stp_ctl( kstp, indic ) |
---|
| 349 | IF( indic < 0 ) CALL ctl_stop( 'step: indic < 0' ) |
---|
| 350 | IF( kstp == nit000 ) CALL iom_close( numror ) ! close input ocean restart file |
---|
[1151] | 351 | IF( lrst_oce ) CALL rst_write ( kstp ) ! write output ocean restart file |
---|
| 352 | IF( lk_obc ) CALL obc_rst_write( kstp ) ! write open boundary restart file |
---|
[3] | 353 | |
---|
[508] | 354 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 355 | ! diagnostics and outputs |
---|
| 356 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 357 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 358 | !----------------------------------------------------------------------- |
---|
| 359 | |
---|
[888] | 360 | IF( nstop == 0 ) THEN ! Diagnostics: |
---|
[75] | 361 | IF( lk_floats ) CALL flo_stp( kstp ) ! drifting Floats |
---|
[216] | 362 | IF( lk_trddyn ) CALL trd_dwr( kstp ) ! trends: dynamics |
---|
| 363 | IF( lk_trdtra ) CALL trd_twr( kstp ) ! trends: active tracers |
---|
[75] | 364 | IF( lk_trdmld ) CALL trd_mld( kstp ) ! trends: Mixed-layer |
---|
[108] | 365 | IF( lk_trdvor ) CALL trd_vor( kstp ) ! trends: vorticity budget |
---|
[75] | 366 | IF( lk_diaspr ) CALL dia_spr( kstp ) ! Surface pressure diagnostics |
---|
| 367 | IF( lk_diahth ) CALL dia_hth( kstp ) ! Thermocline depth (20 degres isotherm depth) |
---|
| 368 | IF( lk_diagap ) CALL dia_gap( kstp ) ! basin averaged diagnostics |
---|
| 369 | IF( lk_diahdy ) CALL dia_hdy( kstp ) ! dynamical heigh diagnostics |
---|
| 370 | IF( lk_diafwb ) CALL dia_fwb( kstp ) ! Fresh water budget diagnostics |
---|
[414] | 371 | IF( ln_diaptr ) CALL dia_ptr( kstp ) ! Poleward TRansports diagnostics |
---|
[1884] | 372 | |
---|
| 373 | ! ! Outputs |
---|
| 374 | |
---|
| 375 | |
---|
| 376 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 377 | ! restoring ta and sa (temporary fix, please do not remove) |
---|
| 378 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 379 | IF (ln_trjwri) THEN |
---|
| 380 | ta(:,:,:) = zta_tmp(:,:,:) |
---|
| 381 | sa(:,:,:) = zsa_tmp(:,:,:) |
---|
| 382 | DEALLOCATE ( zta_tmp, & |
---|
| 383 | & zsa_tmp ) |
---|
| 384 | END IF |
---|
| 385 | |
---|
| 386 | ! ! Outputs |
---|
| 387 | CALL dia_wri ( kstp, indic ) ! ocean model: outputs |
---|
| 388 | |
---|
| 389 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 390 | ! Assimilation mode |
---|
| 391 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 392 | |
---|
| 393 | IF( ln_trjwri ) CALL tam_trj_wri( kstp ) ! Output trajectory fields |
---|
| 394 | |
---|
[75] | 395 | ENDIF |
---|
[3] | 396 | |
---|
[75] | 397 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 398 | ! Coupled mode |
---|
| 399 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[3] | 400 | |
---|
[988] | 401 | #if defined key_oasis3 |
---|
[75] | 402 | IF( lk_cpl ) CALL cpl_stp( kstp ) ! coupled mode : field exchanges |
---|
[988] | 403 | #endif |
---|
[508] | 404 | ! |
---|
[3] | 405 | END SUBROUTINE stp |
---|
| 406 | |
---|
| 407 | !!====================================================================== |
---|
| 408 | END MODULE step |
---|