[3] | 1 | MODULE step |
---|
| 2 | !!====================================================================== |
---|
| 3 | !! *** MODULE step *** |
---|
| 4 | !! Time-stepping : manager of the ocean, tracer and ice time stepping |
---|
| 5 | !!====================================================================== |
---|
| 6 | |
---|
| 7 | !!---------------------------------------------------------------------- |
---|
| 8 | !! stp : OPA system time-stepping |
---|
| 9 | !!---------------------------------------------------------------------- |
---|
| 10 | !! * Modules used |
---|
| 11 | USE oce ! ocean dynamics and tracers variables |
---|
| 12 | USE dom_oce ! ocean space and time domain variables |
---|
| 13 | USE zdf_oce ! ocean vertical physics variables |
---|
| 14 | USE ldftra_oce |
---|
| 15 | USE ldfdyn_oce |
---|
| 16 | USE cpl ! coupled exchanges (???) |
---|
| 17 | USE in_out_manager ! I/O manager |
---|
| 18 | USE lbclnk |
---|
| 19 | |
---|
| 20 | USE daymod ! calendar (day routine) |
---|
| 21 | |
---|
| 22 | USE dtatem ! ocean temperature data (dta_tem routine) |
---|
| 23 | USE dtasal ! ocean salinity data (dta_sal routine) |
---|
| 24 | USE dtasst ! ocean sea surface temerature (dta_sst routine) |
---|
| 25 | USE taumod ! surface stress (tau routine) |
---|
| 26 | USE flxmod ! thermohaline fluxes (flx routine) |
---|
| 27 | USE ocesbc ! thermohaline fluxes (oce_sbc routine) |
---|
| 28 | USE flxrnf ! runoffs (flx_rnf routine) |
---|
| 29 | USE flxfwb ! freshwater budget correction (flx_fwb routine) |
---|
| 30 | USE closea ! closed sea freshwater budget (flx_clo routine) |
---|
| 31 | USE ocfzpt ! surface ocean freezing point (oc_fz_pt routine) |
---|
| 32 | |
---|
| 33 | #if defined key_passivetrc |
---|
| 34 | !!bug trcstp ! passive tracer time-stepping (trc_stp routine) |
---|
| 35 | #endif |
---|
| 36 | |
---|
| 37 | USE dynhpg ! hydrostatic pressure grad. (dyn_hpg routine) |
---|
| 38 | USE dynhpg_atsk ! hydrostatic pressure grad. (dyn_hpg_atsk routine) |
---|
| 39 | USE dynspg_fsc ! surface pressure gradient (dyn_spg_fsc routine) |
---|
| 40 | USE dynspg_fsc_atsk ! surface pressure gradient (dyn_spgfsc_atsk routine) |
---|
| 41 | USE dynspg_rl ! surface pressure gradient (dyn_spg_rl routine) |
---|
| 42 | USE dynkeg ! kinetic energy gradient (dyn_keg routine) |
---|
| 43 | USE dynvor ! vorticity term (dyn_vor routine) |
---|
| 44 | USE dynzad ! vertical advection (dyn_adv routine) |
---|
| 45 | USE dynldf_bilapg ! lateral mixing (dyn_ldf_bilapg routine) |
---|
| 46 | USE dynldf_bilap ! lateral mixing (dyn_ldf_bilap routine) |
---|
| 47 | USE dynldf_iso ! lateral mixing (dyn_ldf_iso routine) |
---|
| 48 | USE dynldf_lap ! lateral mixing (dyn_ldf_lap routine) |
---|
| 49 | USE dynzdf_imp ! vertical diffusion: implicit (dyn_zdf routine) |
---|
| 50 | USE dynzdf_imp_atsk ! vertical diffusion: implicit (dyn_zdf routine) |
---|
| 51 | USE dynzdf_iso ! vertical diffusion: isopycnal (dyn_zdf routine) |
---|
| 52 | USE dynzdf_exp ! vertical diffusion: explicit (dyn_zdf_exp routine) |
---|
| 53 | USE dynnxt ! time-stepping (dyn_nxt routine) |
---|
| 54 | |
---|
| 55 | USE trabbc ! bottom boundary condition (tra_bbc routine) |
---|
| 56 | USE trabbl ! bottom boundary layer (tra_bbl routine) |
---|
| 57 | USE tradmp ! internal damping (tra_dmp routine) |
---|
| 58 | USE traldf_bilapg ! lateral mixing (tra_ldf_bilapg routine) |
---|
| 59 | USE traldf_bilap ! lateral mixing (tra_ldf_bilap routine) |
---|
| 60 | USE traldf_iso ! lateral mixing (tra_ldf_iso routine) |
---|
| 61 | USE traldf_iso_zps ! lateral mixing (tra_ldf_iso_zps routine) |
---|
| 62 | USE traldf_lap ! lateral mixing (tra_ldf_lap routine) |
---|
| 63 | USE traqsr ! solar radiation penetration (tra_qsr routine) |
---|
| 64 | USE tranpc ! non-penetrative convection (tra_npc routine) |
---|
| 65 | USE tranxt ! time-stepping (tra_nxt routine) |
---|
| 66 | USE traadv_ctl ! advection scheme control (tra_adv_ctl routine) |
---|
| 67 | USE traadv_cen2 ! 2nd order centered scheme (tra_adv_cen2 routine) |
---|
| 68 | USE traadv_tvd ! TVD scheme (tra_adv_tvd routine) |
---|
| 69 | USE traadv_muscl ! MUSCL scheme (tra_adv_muscl routine) |
---|
| 70 | USE traadv_muscl2 ! MUSCL2 scheme (tra_adv_muscl2 routine) |
---|
| 71 | USE cla ! cross land advection (tra_cla routine) |
---|
| 72 | USE trazdf_exp ! vertical diffusion: explicit (tra_zdf_exp routine) |
---|
| 73 | USE trazdf_imp ! vertical diffusion: implicit (tra_zdf_imp routine) |
---|
| 74 | USE trazdf_iso ! vertical diffusion (tra_zdf_exp routine) |
---|
| 75 | USE trazdf_iso_vopt ! vertical diffusion (tra_zdf_exp routine) |
---|
| 76 | USE trasbc ! surface boundary condition (tra_sbc routine) |
---|
| 77 | |
---|
| 78 | USE eosbn2 ! equation of state (eos_bn2 routine) |
---|
| 79 | |
---|
| 80 | USE obc_par ! open boundary condition variables |
---|
| 81 | USE obcdta ! open boundary condition data (obc_dta routine) |
---|
| 82 | USE obcrst ! open boundary cond. restart (obc_rst routine) |
---|
| 83 | USE obcrad ! open boundary cond. radiation (obc_rad routine) |
---|
| 84 | USE obcspg ! open boundary cond spg (obc_spg routine) |
---|
| 85 | |
---|
| 86 | USE divcur ! hor. divergence and curl (div & cur routines) |
---|
| 87 | USE cla_div ! cross land: hor. divergence (div_cla routine) |
---|
| 88 | USE wzvmod ! vertical velocity (wzv routine) |
---|
| 89 | |
---|
| 90 | USE ldfslp ! iso-neutral slopes (ldf_slp routine) |
---|
| 91 | USE ldfeiv ! eddy induced velocity coef. (ldf_eiv routine) |
---|
| 92 | |
---|
| 93 | USE zdfbfr ! bottom friction (zdf_bfr routine) |
---|
| 94 | USE zdftke ! TKE vertical mixing (zdf_tke routine) |
---|
| 95 | USE zdfddm ! double diffusion mixing (zdf_ddm routine) |
---|
| 96 | USE zdfevd ! enhanced vertical diffusion (zdf_evd routine) |
---|
| 97 | USE zdfric ! Richardson vertical mixing (zdf_ric routine) |
---|
| 98 | USE zdfmxl ! Mixed-layer depth (zdf_mxl routine) |
---|
| 99 | |
---|
| 100 | USE zpshde ! partial step: hor. derivative (zps_hde routine) |
---|
| 101 | USE ice_oce ! sea-ice variable |
---|
| 102 | USE icestp ! sea-ice time-stepping (ice_stp routine) |
---|
| 103 | |
---|
| 104 | USE diawri ! Standard run outputs (dia_wri routine) |
---|
| 105 | USE trddyn ! Ocean momentum trends (trd_dyn routine) |
---|
| 106 | USE trdtra ! Ocean active tracer trends (trd_tra routine) |
---|
| 107 | USE diagap ! hor. mean model-data gap (dia_gap routine) |
---|
| 108 | USE trdmld ! mixed-layer trends (trd_mld routine) |
---|
| 109 | USE diahdy ! dynamic height (dia_hdy routine) |
---|
| 110 | USE ptr ! poleward transports (dia_ptr_init routine) |
---|
| 111 | ! ! (dia_ptr routine) |
---|
| 112 | USE diahth ! thermocline depth (dia_hth routine) |
---|
| 113 | USE diafwb ! freshwater budget (dia_fwb routine) |
---|
| 114 | USE diaspr ! suface pressure (rigid-lid) (dia_spr routine) |
---|
| 115 | USE flo_oce ! floats variables |
---|
| 116 | USE floats ! floats computation (flo_stp routine) |
---|
| 117 | |
---|
| 118 | USE stpctl ! time stepping control (stp_ctl routine) |
---|
| 119 | USE restart ! ocean restart (rst_write routine) |
---|
| 120 | |
---|
| 121 | IMPLICIT NONE |
---|
| 122 | PRIVATE |
---|
| 123 | |
---|
| 124 | !! * Routine accessibility |
---|
| 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 , LODYC-IPSL (2003) |
---|
| 132 | !!---------------------------------------------------------------------- |
---|
| 133 | |
---|
| 134 | CONTAINS |
---|
| 135 | |
---|
| 136 | SUBROUTINE stp( kstp ) |
---|
| 137 | !!---------------------------------------------------------------------- |
---|
| 138 | !! *** ROUTINE stp *** |
---|
| 139 | !! |
---|
| 140 | !! ** Purpose : - Time stepping of OPA (momentum and active tracer eqs.) |
---|
| 141 | !! - Time stepping of LIM (dynamic and thermodynamic eqs.) |
---|
| 142 | !! - Tme stepping of TRC (passive tracer eqs.) |
---|
| 143 | !! |
---|
| 144 | !! ** Method : -1- Update forcings and data |
---|
| 145 | !! -2- Update ocean physics |
---|
| 146 | !! -3- Compute the t and s trends |
---|
| 147 | !! -4- Update t and s |
---|
| 148 | !! -5- Compute the momentum trends |
---|
| 149 | !! -6- Update the horizontal velocity |
---|
| 150 | !! -7- Compute the diagnostics variables (rd,N2, div,cur,w) |
---|
| 151 | !! -8- Outputs and diagnostics |
---|
| 152 | !! |
---|
| 153 | !! History : |
---|
| 154 | !! ! 91-03 () Original code |
---|
| 155 | !! ! 91-11 (G. Madec) |
---|
| 156 | !! ! 92-06 (M. Imbard) add a first output record |
---|
| 157 | !! ! 96-04 (G. Madec) introduction of dynspg |
---|
| 158 | !! ! 96-04 (M.A. Foujols) introduction of passive tracer |
---|
| 159 | !! 8.0 ! 97-06 (G. Madec) new architecture of call |
---|
| 160 | !! 8.2 ! 97-06 (G. Madec, M. Imbard, G. Roullet) free surface |
---|
| 161 | !! 8.2 ! 99-02 (G. Madec, N. Grima) hpg implicit |
---|
| 162 | !! 8.2 ! 00-07 (J-M Molines, M. Imbard) Open Bondary Conditions |
---|
| 163 | !! 9.0 ! 02-06 (G. Madec) free form, suppress macro-tasking |
---|
| 164 | !!---------------------------------------------------------------------- |
---|
| 165 | !! * Arguments |
---|
| 166 | INTEGER, INTENT( in ) :: kstp ! ocean time-step index |
---|
| 167 | |
---|
| 168 | !! * local declarations |
---|
| 169 | INTEGER :: indic ! error indicator if < 0 |
---|
[15] | 170 | INTEGER :: ii0, ii1, ij0, ij1 ! temporary integers |
---|
[3] | 171 | !! --------------------------------------------------------------------- |
---|
| 172 | |
---|
| 173 | indic = 1 ! reset to no error condition |
---|
| 174 | adatrj = adatrj + rdt/86400._wp |
---|
| 175 | |
---|
| 176 | CALL day( kstp ) ! Calendar |
---|
| 177 | |
---|
| 178 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 179 | ! Update data, open boundaries and Forcings |
---|
| 180 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 181 | |
---|
| 182 | IF( lk_dtatem ) CALL dta_tem( kstp ) ! update 3D temperature data |
---|
| 183 | |
---|
| 184 | IF( lk_dtasal ) CALL dta_sal( kstp ) ! Salinity data |
---|
| 185 | |
---|
| 186 | IF( lk_dtasst ) CALL dta_sst( kstp ) ! Sea Surface Temperature data |
---|
| 187 | |
---|
| 188 | IF( lk_obc ) CALL obc_dta_psi( kstp ) ! update bsf data at open boundaries |
---|
| 189 | |
---|
| 190 | IF( lk_obc ) CALL obc_dta_uvt( kstp ) ! update u, v, t, s data at open boundaries |
---|
| 191 | |
---|
| 192 | IF( lk_obc ) CALL obc_rad( kstp ) ! compute phase velocities at open boundaries |
---|
| 193 | |
---|
| 194 | CALL tau( kstp ) ! wind stress |
---|
| 195 | |
---|
| 196 | CALL flx_rnf( kstp ) ! runoff data |
---|
| 197 | |
---|
| 198 | CALL flx( kstp ) ! heat and freshwater fluxes |
---|
| 199 | |
---|
| 200 | IF( lk_ice_lim ) CALL ice_stp( kstp ) ! sea-ice model (Update stress & fluxes) |
---|
| 201 | |
---|
| 202 | CALL oce_sbc( kstp ) ! ocean surface boudaries |
---|
| 203 | |
---|
| 204 | IF( ln_fwb ) CALL flx_fwb( kstp ) ! freshwater budget |
---|
| 205 | |
---|
| 206 | IF( nclosea == 1 ) CALL flx_clo( kstp ) ! closed sea in the domain (update freshwater fluxes) |
---|
| 207 | |
---|
| 208 | IF( kstp == nit000 ) THEN |
---|
| 209 | IF( ninist == 1 ) THEN ! Output the initial state and forcings |
---|
| 210 | CALL dia_wri_state( 'output.init' ) |
---|
| 211 | ENDIF |
---|
| 212 | IF( lk_diaptr ) CALL dia_ptr_init ! Poleward TRansport initialization |
---|
| 213 | ENDIF |
---|
| 214 | |
---|
| 215 | IF( l_ctl .AND. lwp ) THEN ! print mean trends (used for debugging) |
---|
| 216 | WRITE(numout,*) ' emp - : ', SUM( emp * tmask(:,:,1) ) |
---|
| 217 | WRITE(numout,*) ' emps - : ', SUM( emps * tmask(:,:,1) ) |
---|
| 218 | WRITE(numout,*) ' qt - : ', SUM( qt * tmask(:,:,1) ) |
---|
| 219 | WRITE(numout,*) ' qsr - : ', SUM( qsr * tmask(:,:,1) ) |
---|
| 220 | WRITE(numout,*) ' runoff : ', SUM( runoff * tmask(:,:,1) ) |
---|
| 221 | WRITE(numout,*) ' tmask : ', SUM( tmask ) |
---|
| 222 | WRITE(numout,*) ' sst - : ', SUM( tn(:,:,1) * tmask(:,:,1) ) |
---|
| 223 | WRITE(numout,*) ' sss - : ', SUM( sn(:,:,1) * tmask(:,:,1) ) |
---|
| 224 | WRITE(numout,*) ' tau - x : ', SUM( taux ), ' - y : ', SUM( tauy ) |
---|
| 225 | ENDIF |
---|
| 226 | |
---|
| 227 | |
---|
| 228 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 229 | ! Ocean physics update |
---|
| 230 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 231 | !----------------------------------------------------------------------- |
---|
| 232 | ! VERTICAL PHYSICS |
---|
| 233 | !----------------------------------------------------------------------- |
---|
| 234 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 235 | !----------------------------------------------------------------------- |
---|
| 236 | |
---|
| 237 | CALL bn2( tb, sb, rn2 ) ! before Brunt-Vaisala frequency |
---|
| 238 | |
---|
| 239 | ! ! Vertical eddy viscosity and diffusivity coefficients |
---|
| 240 | IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz |
---|
| 241 | IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz |
---|
| 242 | IF( lk_zdfcst ) avt (:,:,:) = avt0 * tmask(:,:,:) ! Constant Kz (reset avt to the background value) |
---|
| 243 | |
---|
| 244 | IF( cp_cfg == "orca" ) THEN ! ORCA: Reduce vertical mixing in some straits |
---|
| 245 | SELECT CASE ( jp_cfg ) |
---|
| 246 | CASE ( 05 ) ! ORCA R2 configuration |
---|
| 247 | avt (:,:,2) = avt (:,:,2) + 1.e-3 * upsrnfh(:,:) ! increase diffusivity of rivers mouths |
---|
| 248 | CASE ( 2 ) ! ORCA R2 configuration |
---|
[15] | 249 | ij0 = 102 ; ij1 = 102 ; ii0 = 140 ; ii1 = 140 |
---|
| 250 | avt( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 2:jpkm1 ) = & ! Strait of Gibraltar |
---|
| 251 | avt( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 2:jpkm1 ) / 5.e0 |
---|
| 252 | ij0 = 88 ; ij1 = 88 ; ii0 = 161 ; ii1 = 161 |
---|
| 253 | avt( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 2:jpkm1 ) = & ! Strait of Bab el Mandeb |
---|
| 254 | avt( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 2:jpkm1 ) / 5.e0 |
---|
[3] | 255 | CASE ( 4 ) ! ORCA R4 configuration |
---|
[15] | 256 | ij0 = 52 ; ij1 = 52 ; ii0 = 71 ; ii1 = 71 |
---|
| 257 | avt( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 2:jpkm1 ) = & ! Strait of Gibraltar |
---|
| 258 | avt( mi0(ii0):mi1(ii1) , mj0(ij0):mj1(ij1) , 2:jpkm1 ) / 5.e0 |
---|
[3] | 259 | END SELECT |
---|
| 260 | ENDIF |
---|
| 261 | |
---|
| 262 | IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity |
---|
| 263 | |
---|
| 264 | IF( lk_zdfddm ) CALL zdf_ddm( kstp ) ! double diffusive mixing |
---|
| 265 | |
---|
| 266 | CALL zdf_bfr( kstp ) ! Bottom boudary condition |
---|
| 267 | |
---|
| 268 | CALL zdf_mxl( kstp ) ! mixed layer depth |
---|
| 269 | |
---|
| 270 | |
---|
| 271 | !----------------------------------------------------------------------- |
---|
| 272 | ! LATERAL PHYSICS |
---|
| 273 | !----------------------------------------------------------------------- |
---|
| 274 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 275 | !----------------------------------------------------------------------- |
---|
| 276 | |
---|
| 277 | IF( lk_ldfslp ) CALL ldf_slp( kstp, rhd, rn2 ) ! before slope of the lateral mixing |
---|
| 278 | |
---|
| 279 | #if defined key_traldf_c2d |
---|
| 280 | IF( lk_traldf_eiv ) CALL ldf_eiv( kstp ) ! eddy induced velocity coefficient |
---|
| 281 | #endif |
---|
| 282 | |
---|
| 283 | |
---|
| 284 | #if defined key_passivetrc |
---|
| 285 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 286 | ! Passive Tracer Model |
---|
| 287 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 288 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 289 | !----------------------------------------------------------------------- |
---|
| 290 | IF( kstp == nit000 ) CALL trcdia( kstp, indic ) ! diagnostics init. |
---|
| 291 | |
---|
| 292 | CALL trc_stp( kstp ) ! time-stepping |
---|
| 293 | |
---|
| 294 | CALL trcwri( kstp ) ! outputs |
---|
| 295 | |
---|
| 296 | CALL trcdia( kstp, indic ) ! diagnostics |
---|
| 297 | #endif |
---|
| 298 | |
---|
| 299 | |
---|
| 300 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 301 | ! Active tracers |
---|
| 302 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 303 | ! N.B. ua, va arrays are used as workspace in this section |
---|
| 304 | !----------------------------------------------------------------------- |
---|
| 305 | |
---|
| 306 | ta(:,:,:) = 0.e0 ! set tracer trends to zero |
---|
| 307 | sa(:,:,:) = 0.e0 |
---|
| 308 | |
---|
| 309 | CALL tra_sbc( kstp ) ! surface boundary condition |
---|
| 310 | |
---|
| 311 | IF( ln_traqsr ) CALL tra_qsr( kstp ) ! penetrative solar radiation qsr |
---|
| 312 | |
---|
| 313 | IF( lk_trabbc ) CALL tra_bbc( kstp ) ! bottom heat flux |
---|
| 314 | |
---|
| 315 | IF( lk_trabbl_dif ) CALL tra_bbl_dif( kstp ) ! diffusive bottom boundary layer scheme |
---|
| 316 | IF( lk_trabbl_adv ) CALL tra_bbl_adv( kstp ) ! advective (and/or diffusive) bottom boundary layer scheme |
---|
| 317 | |
---|
| 318 | IF( lk_tradmp ) CALL tra_dmp( kstp ) ! internal damping trends |
---|
| 319 | |
---|
| 320 | ! ! horizontal & vertical advection |
---|
| 321 | IF( kstp == nit000 ) CALL tra_adv_ctl ! chose/control the scheme used |
---|
| 322 | IF( ln_traadv_cen2 ) CALL tra_adv_cen2 ( kstp ) ! 2nd order centered scheme |
---|
| 323 | IF( ln_traadv_tvd ) CALL tra_adv_tvd ( kstp ) ! TVD scheme |
---|
| 324 | IF( ln_traadv_muscl ) CALL tra_adv_muscl ( kstp ) ! MUSCL scheme |
---|
| 325 | IF( ln_traadv_muscl2 ) CALL tra_adv_muscl2( kstp ) ! MUSCL2 scheme |
---|
| 326 | |
---|
| 327 | IF( n_cla == 1 ) CALL tra_cla( kstp ) ! Cross Land Advection (Update Hor. advection) |
---|
| 328 | |
---|
| 329 | ! ! lateral mixing |
---|
| 330 | IF( l_traldf_lap ) CALL tra_ldf_lap ( kstp ) ! iso-level laplacian |
---|
| 331 | IF( l_traldf_bilap ) CALL tra_ldf_bilap ( kstp ) ! iso-level bilaplacian |
---|
| 332 | IF( l_traldf_bilapg ) CALL tra_ldf_bilapg ( kstp ) ! s-coord. horizontal bilaplacian |
---|
| 333 | IF( l_traldf_iso ) CALL tra_ldf_iso ( kstp ) ! iso-neutral/geopot. laplacian |
---|
| 334 | IF( l_traldf_iso_zps ) CALL tra_ldf_iso_zps( kstp ) ! partial step iso-neutral/geopot. laplacian |
---|
| 335 | |
---|
| 336 | ! ! vertical diffusion |
---|
[15] | 337 | IF( l_trazdf_exp ) CALL tra_zdf_exp ( kstp ) ! explicit time stepping (time splitting scheme) |
---|
| 338 | IF( l_trazdf_imp ) CALL tra_zdf_imp ( kstp ) ! implicit time stepping (euler backward) |
---|
| 339 | IF( l_trazdf_iso ) CALL tra_zdf_iso ( kstp ) ! isopycnal |
---|
[3] | 340 | IF( l_trazdf_iso_vo ) CALL tra_zdf_iso_vopt( kstp ) ! vector opt. isopycnal |
---|
| 341 | |
---|
| 342 | CALL tra_nxt( kstp ) ! tracer fields at next time step |
---|
| 343 | |
---|
| 344 | IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! update the new (t,s) fields by non |
---|
| 345 | ! ! penetrative convective adjustment |
---|
| 346 | |
---|
| 347 | IF( ln_dynhpg_imp ) THEN ! semi-implicit hpg |
---|
| 348 | CALL eos( ta, sa, rhd, rhop ) ! Time-filtered in situ density used in dynhpg module |
---|
| 349 | IF( lk_zps ) CALL zps_hde( kstp, ta, sa, rhd, & ! Partial steps: time filtered hor. gradient |
---|
| 350 | & gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level |
---|
| 351 | & gtv, gsv, grv ) |
---|
| 352 | ELSE ! centered hpg (default case) |
---|
| 353 | CALL eos( tb, sb, rhd, rhop ) ! now (swap=before) in situ density for dynhpg module |
---|
| 354 | IF( lk_zps ) CALL zps_hde( kstp, tb, sb, rhd, & ! Partial steps: now horizontal gradient |
---|
| 355 | & gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level |
---|
| 356 | & gtv, gsv, grv ) |
---|
| 357 | ENDIF |
---|
| 358 | |
---|
| 359 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 360 | ! Dynamics |
---|
| 361 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 362 | ! N.B. ta, sa arrays are used as workspace in this section |
---|
| 363 | !----------------------------------------------------------------------- |
---|
| 364 | |
---|
| 365 | ua(:,:,:) = 0.e0 ! set dynamics trends to zero |
---|
| 366 | va(:,:,:) = 0.e0 |
---|
| 367 | |
---|
| 368 | CALL dyn_keg( kstp ) ! horizontal gradient of kinetic energy |
---|
| 369 | |
---|
| 370 | ! ! vorticity term including Coriolis |
---|
| 371 | IF( ln_dynvor_ens ) CALL dyn_vor_enstrophy( kstp ) ! enstrophy conserving scheme |
---|
| 372 | IF( ln_dynvor_ene ) CALL dyn_vor_energy ( kstp ) ! energy conserving scheme |
---|
| 373 | IF( ln_dynvor_mix ) CALL dyn_vor_mixed ( kstp ) ! combined scheme |
---|
| 374 | |
---|
| 375 | ! ! lateral mixing |
---|
| 376 | IF( l_dynldf_lap ) CALL dyn_ldf_lap ( kstp ) ! iso-level laplacian |
---|
| 377 | IF( l_dynldf_bilap ) CALL dyn_ldf_bilap ( kstp ) ! iso-level bilaplacian |
---|
| 378 | IF( l_dynldf_bilapg ) CALL dyn_ldf_bilapg ( kstp ) ! s-coord. horizontal bilaplacian |
---|
| 379 | IF( l_dynldf_iso ) CALL dyn_ldf_iso ( kstp ) ! iso-neutral laplacian |
---|
| 380 | |
---|
| 381 | ! ! horizontal gradient of Hydrostatic pressure |
---|
[15] | 382 | IF( lk_dynhpg ) CALL dyn_hpg ( kstp ) ! default case (k-j-i loop) |
---|
| 383 | IF( lk_dynhpg_tsk ) CALL dyn_hpg_atsk( kstp ) ! autatask case (j-k-i loop) |
---|
[3] | 384 | |
---|
[15] | 385 | CALL dyn_zad ( kstp ) ! vertical advection |
---|
[3] | 386 | |
---|
| 387 | ! ! vertical diffusion |
---|
| 388 | IF( l_dynzdf_exp ) CALL dyn_zdf_exp ( kstp ) ! explicit time stepping (time splitting scheme) |
---|
| 389 | IF( l_dynzdf_imp ) CALL dyn_zdf_imp ( kstp ) ! implicit time stepping (euler backward) |
---|
| 390 | IF( l_dynzdf_imp_tsk ) CALL dyn_zdf_imp_tsk( kstp ) ! autotask implicit time stepping (euler backward) |
---|
| 391 | IF( l_dynzdf_iso ) CALL dyn_zdf_iso ( kstp ) ! iso-neutral case |
---|
| 392 | |
---|
| 393 | IF( lk_dynspg_rl ) THEN |
---|
| 394 | IF( lk_obc ) CALL obc_spg( kstp ) ! surface pressure gradient at open boundaries |
---|
| 395 | ENDIF |
---|
| 396 | indic=0 |
---|
| 397 | ! ! surface pressure gradient |
---|
| 398 | !i bug lbc sur emp |
---|
| 399 | CALL lbc_lnk( emp, 'T', 1. ) |
---|
| 400 | !i |
---|
| 401 | IF( lk_dynspg_fsc ) CALL dyn_spg_fsc ( kstp, indic ) ! free surface constant volume case |
---|
| 402 | IF( lk_dynspg_fsc_tsk ) CALL dyn_spg_fsc_atsk( kstp, indic ) ! autotask free surface constant volume case |
---|
| 403 | IF( lk_dynspg_rl ) CALL dyn_spg_rl ( kstp, indic ) ! rigid-lid case |
---|
| 404 | |
---|
| 405 | CALL dyn_nxt( kstp ) ! lateral velocity at next time step |
---|
| 406 | |
---|
| 407 | |
---|
| 408 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 409 | ! Computation of diagnostic variables |
---|
| 410 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 411 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 412 | !----------------------------------------------------------------------- |
---|
| 413 | |
---|
| 414 | CALL oc_fz_pt ! ocean surface freezing temperature |
---|
| 415 | |
---|
| 416 | CALL div_cur( kstp ) ! Horizontal divergence & Relative vorticity |
---|
| 417 | |
---|
| 418 | IF( n_cla == 1 ) CALL div_cla( kstp ) ! Cross Land Advection (Update Hor. divergence) |
---|
| 419 | |
---|
| 420 | CALL wzv( kstp ) ! Vertical velocity |
---|
| 421 | |
---|
| 422 | |
---|
| 423 | |
---|
| 424 | !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
---|
| 425 | ! Control, diagnostics and outputs |
---|
| 426 | !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< |
---|
| 427 | ! N.B. ua, va, ta, sa arrays are used as workspace in this section |
---|
| 428 | !----------------------------------------------------------------------- |
---|
| 429 | |
---|
| 430 | ! Time loop: control and print |
---|
| 431 | ! ---------------------------- |
---|
| 432 | |
---|
| 433 | CALL stp_ctl( kstp, indic ) |
---|
| 434 | |
---|
| 435 | IF ( indic < 0 ) nstop = nstop + 1 |
---|
| 436 | |
---|
| 437 | IF ( nstop /= 0 ) RETURN |
---|
| 438 | |
---|
| 439 | ! Diagnostics: |
---|
| 440 | ! ------------ |
---|
| 441 | |
---|
| 442 | IF( lk_floats ) CALL flo_stp( kstp ) ! drifting Floats |
---|
| 443 | |
---|
| 444 | IF( lk_trddyn ) CALL trd_dyn( kstp ) ! trends: dynamics |
---|
| 445 | |
---|
| 446 | IF( lk_trdtra ) CALL trd_tra( kstp ) ! trends: active tracers |
---|
| 447 | |
---|
| 448 | IF( lk_trdmld ) CALL trd_mld( kstp ) ! trends: Mixed-layer |
---|
| 449 | |
---|
| 450 | IF( lk_diaspr ) CALL dia_spr( kstp ) ! Surface pressure diagnostics |
---|
| 451 | |
---|
| 452 | IF( lk_diahth ) CALL dia_hth( kstp ) ! Thermocline depth (20 degres isotherm depth) |
---|
| 453 | |
---|
| 454 | IF( lk_diaptr ) CALL dia_ptr( kstp ) ! Poleward TRansport diagnostics |
---|
| 455 | |
---|
| 456 | IF( lk_diagap ) CALL dia_gap( kstp ) ! basin averaged diagnostics |
---|
| 457 | |
---|
| 458 | IF( lk_diahdy ) CALL dia_hdy( kstp ) ! dynamical heigh diagnostics |
---|
| 459 | |
---|
| 460 | IF( lk_diafwb ) CALL dia_fwb( kstp ) ! Fresh water budget diagnostics |
---|
| 461 | #if defined key_diaptr |
---|
| 462 | IF( MOD( kstp, nf_ptr ) == 0 ) CALL dia_ptr( kstp ) ! Poleward TRansports |
---|
| 463 | #endif |
---|
| 464 | |
---|
| 465 | ! save and outputs |
---|
| 466 | ! ---------------- |
---|
| 467 | CALL rst_write( kstp ) ! ocean model: restart file output |
---|
| 468 | |
---|
| 469 | IF( lk_obc ) CALL obc_rst_wri(kstp) ! ocean model: open boundary restart file output |
---|
| 470 | |
---|
| 471 | CALL dia_wri( kstp, indic ) ! ocean model: outputs |
---|
| 472 | #if defined key_coupled |
---|
| 473 | CALL stp_cmo( kstp ) ! coupling fields |
---|
| 474 | #endif |
---|
| 475 | |
---|
| 476 | END SUBROUTINE stp |
---|
| 477 | |
---|
| 478 | !!====================================================================== |
---|
| 479 | END MODULE step |
---|