[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 |
---|
[3] | 33 | USE in_out_manager ! I/O manager |
---|
[888] | 34 | USE iom ! |
---|
[3] | 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) |
---|
[888] | 41 | USE sbcmod ! surface boundary condition (sbc routine) |
---|
| 42 | USE sbcrnf ! surface boundary condition: runoff variables |
---|
[1218] | 43 | USE sbccpl ! surface boundary condition: coupled formulation (call send at end of step) |
---|
| 44 | USE cpl_oasis3, ONLY : lk_cpl |
---|
[3] | 45 | |
---|
[187] | 46 | USE trcstp ! passive tracer time-stepping (trc_stp routine) |
---|
[3] | 47 | |
---|
[467] | 48 | USE traqsr ! solar radiation penetration (tra_qsr routine) |
---|
| 49 | USE trasbc ! surface boundary condition (tra_sbc routine) |
---|
[3] | 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) |
---|
[467] | 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) |
---|
[3] | 59 | USE tranpc ! non-penetrative convection (tra_npc routine) |
---|
| 60 | |
---|
| 61 | USE eosbn2 ! equation of state (eos_bn2 routine) |
---|
| 62 | |
---|
[643] | 63 | USE dynadv ! advection (dyn_adv routine) |
---|
| 64 | USE dynvor ! vorticity term (dyn_vor routine) |
---|
[467] | 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 | |
---|
[3] | 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 | |
---|
[911] | 78 | USE bdy_par ! unstructured open boundary data variables |
---|
| 79 | USE bdydta ! unstructured open boundary data (bdy_dta routine) |
---|
| 80 | |
---|
[3] | 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) |
---|
[1239] | 90 | USE zdftke2 ! TKE2 vertical mixing (zdf_tke2 routine) |
---|
[255] | 91 | USE zdfkpp ! KPP vertical mixing (zdf_kpp routine) |
---|
[3] | 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 |
---|
[888] | 99 | |
---|
[3] | 100 | USE diawri ! Standard run outputs (dia_wri routine) |
---|
[216] | 101 | USE trdicp ! Ocean momentum/tracers trends (trd_wri routine) |
---|
[3] | 102 | USE trdmld ! mixed-layer trends (trd_mld routine) |
---|
[503] | 103 | USE trdmld_rst ! restart for mixed-layer trends |
---|
| 104 | USE trdmod_oce ! ocean momentum/tracers trends |
---|
[108] | 105 | USE trdvor ! vorticity budget (trd_vor routine) |
---|
[216] | 106 | USE diagap ! hor. mean model-data gap (dia_gap routine) |
---|
[3] | 107 | USE diahdy ! dynamic height (dia_hdy routine) |
---|
[132] | 108 | USE diaptr ! poleward transports (dia_ptr routine) |
---|
[3] | 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) |
---|
[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 |
---|
[888] | 167 | INTEGER :: jk ! dummy loop indice |
---|
[3] | 168 | INTEGER :: indic ! error indicator if < 0 |
---|
| 169 | !! --------------------------------------------------------------------- |
---|
| 170 | |
---|
[392] | 171 | #if defined key_agrif |
---|
[389] | 172 | kstp = nit000 + Agrif_Nb_Step() |
---|
[445] | 173 | ! IF ( Agrif_Root() .and. lwp) Write(*,*) '---' |
---|
[508] | 174 | ! IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp |
---|
[389] | 175 | #endif |
---|
[3] | 176 | indic = 1 ! reset to no error condition |
---|
[508] | 177 | |
---|
[3] | 178 | CALL day( kstp ) ! Calendar |
---|
| 179 | |
---|
[508] | 180 | CALL rst_opn( kstp ) ! Open the restart file |
---|
| 181 | |
---|
[3] | 182 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[888] | 183 | ! Update data, open boundaries, surface boundary condition (including sea-ice) |
---|
[3] | 184 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 185 | |
---|
| 186 | IF( lk_dtatem ) CALL dta_tem( kstp ) ! update 3D temperature data |
---|
[888] | 187 | IF( lk_dtasal ) CALL dta_sal( kstp ) ! update 3D salinity data |
---|
[3] | 188 | |
---|
[888] | 189 | CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) |
---|
[3] | 190 | |
---|
[35] | 191 | IF( lk_obc ) CALL obc_dta( kstp ) ! update dynamic and tracer data at open boundaries |
---|
[3] | 192 | IF( lk_obc ) CALL obc_rad( kstp ) ! compute phase velocities at open boundaries |
---|
| 193 | |
---|
[911] | 194 | IF( lk_bdy ) CALL bdy_dta( kstp ) ! update dynamic and tracer data at unstructured open boundary |
---|
| 195 | |
---|
[888] | 196 | IF( ninist == 1 ) THEN ! Output the initial state and forcings |
---|
[1334] | 197 | CALL dia_wri_state( 'output.init', kstp ) |
---|
[888] | 198 | ninist = 0 |
---|
[3] | 199 | ENDIF |
---|
| 200 | |
---|
| 201 | |
---|
| 202 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 203 | ! Ocean physics update |
---|
| 204 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[1239] | 205 | #if defined key_zdftke2 |
---|
| 206 | IF ( ln_dynhpg_imp ) THEN |
---|
[3] | 207 | !----------------------------------------------------------------------- |
---|
[1239] | 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 | !----------------------------------------------------------------------- |
---|
[3] | 220 | ! VERTICAL PHYSICS |
---|
| 221 | !----------------------------------------------------------------------- |
---|
| 222 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 223 | !----------------------------------------------------------------------- |
---|
[1239] | 224 | #if defined key_zdftke2 |
---|
| 225 | CALL bn2( tn, sn, rn2 ) ! now Brunt-Vaisala frequency |
---|
| 226 | #else |
---|
[888] | 227 | CALL bn2( tb, sb, rn2 ) ! before Brunt-Vaisala frequency |
---|
[1239] | 228 | #endif |
---|
[3] | 229 | ! ! Vertical eddy viscosity and diffusivity coefficients |
---|
| 230 | IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz |
---|
[789] | 231 | |
---|
[1239] | 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 |
---|
[789] | 234 | |
---|
[255] | 235 | IF( lk_zdfkpp ) CALL zdf_kpp( kstp ) ! KPP closure scheme for Kz |
---|
[467] | 236 | |
---|
[677] | 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 |
---|
[3] | 242 | |
---|
[1116] | 243 | IF( ln_rnf_mouth ) THEN ! increase diffusivity at rivers mouths |
---|
[1246] | 244 | DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + 2.e0 * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk) ; END DO |
---|
[3] | 245 | ENDIF |
---|
| 246 | |
---|
| 247 | IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity |
---|
| 248 | |
---|
[888] | 249 | IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & |
---|
[255] | 250 | & CALL zdf_ddm( kstp ) ! double diffusive mixing |
---|
[3] | 251 | |
---|
[75] | 252 | CALL zdf_bfr( kstp ) ! bottom friction |
---|
[3] | 253 | |
---|
| 254 | CALL zdf_mxl( kstp ) ! mixed layer depth |
---|
| 255 | |
---|
[1239] | 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 |
---|
[3] | 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 |
---|
[1239] | 269 | # endif |
---|
| 270 | #if defined key_zdftke2 |
---|
| 271 | ENDIF |
---|
[3] | 272 | #endif |
---|
| 273 | |
---|
[923] | 274 | #if defined key_top |
---|
[3] | 275 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 276 | ! Passive Tracer Model |
---|
| 277 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 278 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 279 | !----------------------------------------------------------------------- |
---|
[345] | 280 | CALL trc_stp( kstp, indic ) ! time-stepping |
---|
[3] | 281 | #endif |
---|
| 282 | |
---|
| 283 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 284 | ! Active tracers |
---|
| 285 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 286 | ! N.B. ua, va arrays are used as workspace in this section |
---|
| 287 | !----------------------------------------------------------------------- |
---|
[467] | 288 | ta(:,:,:) = 0.e0 ! set tracer trends to zero |
---|
| 289 | sa(:,:,:) = 0.e0 |
---|
[3] | 290 | |
---|
[467] | 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 |
---|
[392] | 301 | #if defined key_agrif |
---|
[782] | 302 | IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra ! tracers sponge |
---|
[389] | 303 | #endif |
---|
[1111] | 304 | CALL tra_zdf ( kstp ) ! vertical mixing and after tracer fields |
---|
[1239] | 305 | |
---|
| 306 | #if ! defined key_zdftke2 |
---|
[1111] | 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 |
---|
[3] | 309 | |
---|
[467] | 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 ) |
---|
[3] | 320 | ENDIF |
---|
[1239] | 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 |
---|
[3] | 338 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 339 | ! Dynamics |
---|
| 340 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 341 | ! N.B. ta, sa arrays are used as workspace in this section |
---|
| 342 | !----------------------------------------------------------------------- |
---|
[75] | 343 | ua(:,:,:) = 0.e0 ! set dynamics trends to zero |
---|
| 344 | va(:,:,:) = 0.e0 |
---|
[3] | 345 | |
---|
[643] | 346 | CALL dyn_adv( kstp ) ! advection (vector or flux form) |
---|
[467] | 347 | CALL dyn_vor( kstp ) ! vorticity term including Coriolis |
---|
| 348 | CALL dyn_ldf( kstp ) ! lateral mixing |
---|
[392] | 349 | #if defined key_agrif |
---|
[782] | 350 | IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_dyn ! momemtum sponge |
---|
[389] | 351 | #endif |
---|
[467] | 352 | CALL dyn_hpg( kstp ) ! horizontal gradient of Hydrostatic pressure |
---|
| 353 | CALL dyn_zdf( kstp ) ! vertical diffusion |
---|
| 354 | IF( lk_dynspg_rl ) THEN |
---|
[75] | 355 | IF( lk_obc ) CALL obc_spg( kstp ) ! surface pressure gradient at open boundaries |
---|
[3] | 356 | ENDIF |
---|
[888] | 357 | indic=0 |
---|
[359] | 358 | CALL dyn_spg( kstp, indic ) ! surface pressure gradient |
---|
[467] | 359 | CALL dyn_nxt( kstp ) ! lateral velocity at next time step |
---|
[593] | 360 | IF( lk_vvl ) CALL dom_vvl ! vertical mesh at next time step |
---|
[3] | 361 | |
---|
[593] | 362 | |
---|
[3] | 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 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
[888] | 373 | ! Control and restarts |
---|
[3] | 374 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[508] | 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 |
---|
[1151] | 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 |
---|
[3] | 380 | |
---|
[508] | 381 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 382 | ! diagnostics and outputs |
---|
| 383 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 384 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 385 | !----------------------------------------------------------------------- |
---|
| 386 | |
---|
[888] | 387 | IF( nstop == 0 ) THEN ! Diagnostics: |
---|
[75] | 388 | IF( lk_floats ) CALL flo_stp( kstp ) ! drifting Floats |
---|
[216] | 389 | IF( lk_trddyn ) CALL trd_dwr( kstp ) ! trends: dynamics |
---|
| 390 | IF( lk_trdtra ) CALL trd_twr( kstp ) ! trends: active tracers |
---|
[75] | 391 | IF( lk_trdmld ) CALL trd_mld( kstp ) ! trends: Mixed-layer |
---|
[108] | 392 | IF( lk_trdvor ) CALL trd_vor( kstp ) ! trends: vorticity budget |
---|
[75] | 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 |
---|
[414] | 398 | IF( ln_diaptr ) CALL dia_ptr( kstp ) ! Poleward TRansports diagnostics |
---|
[888] | 399 | ! ! outputs |
---|
| 400 | CALL dia_wri( kstp, indic ) ! ocean model: outputs |
---|
[75] | 401 | ENDIF |
---|
[3] | 402 | |
---|
[75] | 403 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 404 | ! Coupled mode |
---|
| 405 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
[3] | 406 | |
---|
[1218] | 407 | IF( lk_cpl ) CALL sbc_cpl_snd( kstp ) ! coupled mode : field exchanges |
---|
[1239] | 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 |
---|
[508] | 428 | ! |
---|
[3] | 429 | END SUBROUTINE stp |
---|
| 430 | |
---|
| 431 | !!====================================================================== |
---|
| 432 | END MODULE step |
---|