Changeset 2528 for trunk/NEMOGCM/NEMO/OPA_SRC/step.F90
- Timestamp:
- 2010-12-27T18:33:53+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEMOGCM/NEMO/OPA_SRC/step.F90
- Property svn:eol-style deleted
r2191 r2528 21 21 !! 3.2 ! 2009-02 (G. Madec, R. Benshila) reintroduicing z*-coordinate 22 22 !! - ! 2009-06 (S. Masson, G. Madec) TKE restart compatible with key_cpl 23 !!---------------------------------------------------------------------- 24 25 !!---------------------------------------------------------------------- 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 31 USE ldftra_oce ! ocean tracer - trends 32 USE ldfdyn_oce ! ocean dynamics - trends 33 USE in_out_manager ! I/O manager 34 USE iom ! 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) 41 USE sbcmod ! surface boundary condition (sbc routine) 42 USE sbcrnf ! surface boundary condition: runoff variables 43 USE sbccpl ! surface boundary condition: coupled formulation (call send at end of step) 44 USE cpl_oasis3, ONLY : lk_cpl 45 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 25 !!---------------------------------------------------------------------- 26 27 !!---------------------------------------------------------------------- 28 !! stp : OPA system time-stepping 29 !!---------------------------------------------------------------------- 30 USE step_oce ! time stepping definition modules 46 31 #if defined key_top 47 USE trcstp ! passive tracer time-stepping (trc_stp routine) 48 #endif 49 50 USE traqsr ! solar radiation penetration (tra_qsr routine) 51 USE trasbc ! surface boundary condition (tra_sbc routine) 52 USE trabbc ! bottom boundary condition (tra_bbc routine) 53 USE trabbl ! bottom boundary layer (tra_bbl routine) 54 USE tradmp ! internal damping (tra_dmp routine) 55 USE traadv ! advection scheme control (tra_adv_ctl routine) 56 USE traldf ! lateral mixing (tra_ldf routine) 57 USE cla ! cross land advection (tra_cla routine) 58 ! zdfkpp ! KPP non-local tracer fluxes (tra_kpp routine) 59 USE trazdf ! vertical mixing (tra_zdf routine) 60 USE tranxt ! time-stepping (tra_nxt routine) 61 USE tranpc ! non-penetrative convection (tra_npc routine) 62 63 USE eosbn2 ! equation of state (eos_bn2 routine) 64 65 USE dynadv ! advection (dyn_adv routine) 66 USE dynbfr ! Bottom friction terms (dyn_bfr routine) 67 USE dynvor ! vorticity term (dyn_vor routine) 68 USE dynhpg ! hydrostatic pressure grad. (dyn_hpg routine) 69 USE dynldf ! lateral momentum diffusion (dyn_ldf routine) 70 USE dynzdf ! vertical diffusion (dyn_zdf routine) 71 USE dynspg_oce ! surface pressure gradient (dyn_spg routine) 72 USE dynspg ! surface pressure gradient (dyn_spg routine) 73 USE dynnxt ! time-stepping (dyn_nxt routine) 74 75 USE obc_par ! open boundary condition variables 76 USE obcdta ! open boundary condition data (obc_dta routine) 77 USE obcrst ! open boundary cond. restart (obc_rst routine) 78 USE obcrad ! open boundary cond. radiation (obc_rad routine) 79 80 USE bdy_par ! unstructured open boundary data variables 81 USE bdydta ! unstructured open boundary data (bdy_dta routine) 82 83 USE sshwzv ! vertical velocity and ssh (ssh_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 zdftmx ! tide-induced vertical mixing (zdf_tmx routine) 89 USE zdfbfr ! bottom friction (zdf_bfr routine) 90 USE zdftke_old ! old TKE vertical mixing (zdf_tke_old routine) 91 USE zdftke ! TKE vertical mixing (zdf_tke routine) 92 USE zdfkpp ! KPP vertical mixing (zdf_kpp routine) 93 USE zdfddm ! double diffusion mixing (zdf_ddm routine) 94 USE zdfevd ! enhanced vertical diffusion (zdf_evd routine) 95 USE zdfric ! Richardson vertical mixing (zdf_ric routine) 96 USE zdfmxl ! Mixed-layer depth (zdf_mxl routine) 97 98 USE zpshde ! partial step: hor. derivative (zps_hde routine) 99 100 USE diawri ! Standard run outputs (dia_wri routine) 101 USE trdicp ! Ocean momentum/tracers trends (trd_wri routine) 102 USE trdmld ! mixed-layer trends (trd_mld routine) 103 USE trdmld_rst ! restart for mixed-layer trends 104 USE trdmod_oce ! ocean momentum/tracers trends 105 USE trdvor ! vorticity budget (trd_vor routine) 106 USE diagap ! hor. mean model-data gap (dia_gap routine) 107 USE diahdy ! dynamic height (dia_hdy routine) 108 USE diaptr ! poleward transports (dia_ptr routine) 109 USE diaar5 ! AR5 diagnosics (dia_ar5 routine) 110 USE diahth ! thermocline depth (dia_hth routine) 111 USE diafwb ! freshwater budget (dia_fwb 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) 116 USE restart ! ocean restart (rst_wri routine) 117 USE prtctl ! Print control (prt_ctl routine) 118 32 USE trcstp ! passive tracer time-stepping (trc_stp routine) 33 #endif 119 34 #if defined key_agrif 120 35 USE agrif_opa_sponge ! Momemtum and tracers sponges 121 36 #endif 37 USE asminc ! assimilation increments (tra_asm_inc, dyn_asm_inc routines) 122 38 123 39 IMPLICIT NONE 124 40 PRIVATE 125 41 126 PUBLIC stp 42 PUBLIC stp ! called by opa.F90 127 43 128 44 !! * Substitutions … … 130 46 # include "zdfddm_substitute.h90" 131 47 !!---------------------------------------------------------------------- 132 !! NEMO/OPA 3. 2 , LOCEAN-IPSL (2009)48 !! NEMO/OPA 3.3 , NEMO Consortium (2010) 133 49 !! $Id$ 134 !! Software governed by the CeCILL licence (modipsl/doc/NEMO_CeCILL.txt) 135 !!---------------------------------------------------------------------- 136 50 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) 51 !!---------------------------------------------------------------------- 137 52 CONTAINS 138 53 … … 166 81 #if defined key_agrif 167 82 kstp = nit000 + Agrif_Nb_Step() 168 ! IF( Agrif_Root() .and. lwp) Write(*,*) '---'169 ! IF(lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp170 83 # if defined key_iomput 171 IF( Agrif_Nbstepint() == 0 )CALL iom_swap84 IF( Agrif_Nbstepint() == 0 ) CALL iom_swap 172 85 # endif 173 86 #endif 174 indic = 1 ! reset to no error condition 175 87 indic = 0 ! reset to no error condition 176 88 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) 177 178 CALL iom_setkt( kstp ) ! say to iom that we are at time step kstp 179 89 CALL iom_setkt( kstp ) ! say to iom that we are at time step kstp 90 180 91 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 181 92 ! Update data, open boundaries, surface boundary condition (including sea-ice) … … 186 97 IF( lk_obc ) CALL obc_dta( kstp ) ! update dynamic and tracer data at open boundaries 187 98 IF( lk_obc ) CALL obc_rad( kstp ) ! compute phase velocities at open boundaries 188 IF( lk_bdy ) CALL bdy_dta ( kstp ) ! update dynamic and tracer data at unstructured open boundary99 IF( lk_bdy ) CALL bdy_dta_frs( kstp ) ! update dynamic and tracer data for FRS conditions (BDY) 189 100 190 101 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 196 107 ! Ocean physics update (ua, va, ta, sa used as workspace) 197 108 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 198 CALL bn2( t b, sb, rn2b )! before Brunt-Vaisala frequency199 CALL bn2( t n, sn, rn2 )! now Brunt-Vaisala frequency109 CALL bn2( tsb, rn2b ) ! before Brunt-Vaisala frequency 110 CALL bn2( tsn, rn2 ) ! now Brunt-Vaisala frequency 200 111 ! 201 112 ! VERTICAL PHYSICS 202 113 CALL zdf_bfr( kstp ) ! bottom friction 114 203 115 ! ! Vertical eddy viscosity and diffusivity coefficients 204 IF( lk_zdfric ) CALL zdf_ric ( kstp )! Richardson number dependent Kz205 IF( lk_zdftke _old ) CALL zdf_tke_old( kstp ) ! TKE closure scheme for Kz (old scheme)206 IF( lk_zdf tke ) CALL zdf_tke ( kstp ) ! TKEclosure scheme for Kz207 IF( lk_zdfkpp ) CALL zdf_kpp ( kstp )! KPP closure scheme for Kz208 IF( lk_zdfcst ) THEN! Constant Kz (reset avt, avm[uv] to the background value)116 IF( lk_zdfric ) CALL zdf_ric( kstp ) ! Richardson number dependent Kz 117 IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz 118 IF( lk_zdfgls ) CALL zdf_gls( kstp ) ! GLS closure scheme for Kz 119 IF( lk_zdfkpp ) CALL zdf_kpp( kstp ) ! KPP closure scheme for Kz 120 IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) 209 121 avt (:,:,:) = rn_avt0 * tmask(:,:,:) 210 122 avmu(:,:,:) = rn_avm0 * umask(:,:,:) … … 220 132 IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & 221 133 & CALL zdf_ddm( kstp ) ! double diffusive mixing 134 222 135 CALL zdf_mxl( kstp ) ! mixed layer depth 223 136 224 ! write tkeinformation in the restart file137 ! write TKE or GLS information in the restart file 225 138 IF( lrst_oce .AND. lk_zdftke ) CALL tke_rst( kstp, 'WRITE' ) 139 IF( lrst_oce .AND. lk_zdfgls ) CALL gls_rst( kstp, 'WRITE' ) 226 140 ! 227 141 ! LATERAL PHYSICS 228 142 ! 229 143 IF( lk_ldfslp ) THEN ! slope of lateral mixing 230 CALL eos( tb, sb, rhd ) ! before in situ density 231 IF( ln_zps ) CALL zps_hde( kstp, tb, sb, rhd, & ! Partial steps: before horizontal gradient 232 & gtu, gsu, gru, & ! of t, s, rd at the last ocean level 233 & gtv, gsv, grv ) 234 CALL ldf_slp( kstp, rhd, rn2b ) ! before slope of the lateral mixing 144 CALL eos( tsb, rhd ) ! before in situ density 145 IF( ln_zps ) CALL zps_hde( kstp, jpts, tsb, gtsu, gtsv, & ! Partial steps: before horizontal gradient 146 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 147 IF( ln_traldf_grif ) THEN ! before slope for Griffies operator 148 CALL ldf_slp_grif( kstp ) 149 ELSE 150 CALL ldf_slp( kstp, rhd, rn2b ) ! before slope for Madec operator 151 ENDIF 235 152 ENDIF 236 153 #if defined key_traldf_c2d 237 154 IF( lk_traldf_eiv ) CALL ldf_eiv( kstp ) ! eddy induced velocity coefficient 238 # 155 #endif 239 156 240 157 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 243 160 IF( lk_floats ) CALL flo_stp( kstp ) ! drifting Floats 244 161 IF( lk_diahth ) CALL dia_hth( kstp ) ! Thermocline depth (20 degres isotherm depth) 245 IF( lk_diagap ) CALL dia_gap( kstp ) ! basin averaged diagnostics246 IF( lk_diahdy ) CALL dia_hdy( kstp ) ! dynamical heigh diagnostics247 162 IF( lk_diafwb ) CALL dia_fwb( kstp ) ! Fresh water budget diagnostics 248 163 IF( ln_diaptr ) CALL dia_ptr( kstp ) ! Poleward TRansports diagnostics … … 260 175 ! Active tracers (ua, va used as workspace) 261 176 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 262 ta(:,:,:) = 0.e0 ! set tracer trends to zero 263 sa(:,:,:) = 0.e0 264 177 tsa(:,:,:,:) = 0.e0 ! set tracer trends to zero 178 179 IF( ln_asmiau .AND. & 180 & ln_trainc ) CALL tra_asm_inc( kstp ) ! apply tracer assimilation increment 265 181 CALL tra_sbc ( kstp ) ! surface boundary condition 266 182 IF( ln_traqsr ) CALL tra_qsr ( kstp ) ! penetrative solar radiation qsr 267 IF( lk_trabbc ) CALL tra_bbc ( kstp ) ! bottom heat flux 268 IF( lk_trabbl_dif ) CALL tra_bbl_dif( kstp ) ! diffusive bottom boundary layer scheme 269 IF( lk_trabbl_adv ) CALL tra_bbl_adv( kstp ) ! advective (and/or diffusive) bottom boundary layer scheme 183 IF( ln_trabbc ) CALL tra_bbc ( kstp ) ! bottom heat flux 184 IF( lk_trabbl ) CALL tra_bbl ( kstp ) ! advective (and/or diffusive) bottom boundary layer scheme 270 185 IF( lk_tradmp ) CALL tra_dmp ( kstp ) ! internal damping trends 271 186 CALL tra_adv ( kstp ) ! horizontal & vertical advection 272 IF( n_cla == 1 ) CALL tra_cla ( kstp ) ! Cross Land Advection (Update Hor. advection) 273 IF( lk_zdfkpp ) CALL tra_kpp ( kstp ) ! KPP non-local tracer fluxes 187 IF( lk_zdfkpp ) CALL tra_kpp ( kstp ) ! KPP non-local tracer fluxes 274 188 CALL tra_ldf ( kstp ) ! lateral mixing 275 189 #if defined key_agrif 190 CALL tra_unswap 276 191 IF(.NOT. Agrif_Root()) CALL Agrif_Sponge_tra ! tracers sponge 192 CALL tra_swap 277 193 #endif 278 194 CALL tra_zdf ( kstp ) ! vertical mixing and after tracer fields 279 195 280 196 IF( ln_dynhpg_imp ) THEN ! semi-implicit hpg (time stepping then eos) 281 IF( ln_zdfnpc ) CALL tra_npc ( kstp ) ! update after fields by non-penetrative convection 282 CALL tra_nxt ( kstp ) ! tracer fields at next time step 283 CALL eos( ta, sa, rhd, rhop ) ! Time-filtered in situ density for hpg computation 284 IF( ln_zps ) CALL zps_hde( kstp, ta, sa, rhd, & ! Partial steps: time filtered hor. derivative 285 & gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level 286 & gtv, gsv, grv ) 197 IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! update after fields by non-penetrative convection 198 CALL tra_nxt( kstp ) ! tracer fields at next time step 199 CALL eos ( tsa, rhd, rhop ) ! Time-filtered in situ density for hpg computation 200 IF( ln_zps ) CALL zps_hde( kstp, jpts, tsa, gtsu, gtsv, & ! zps: time filtered hor. derivative 201 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 287 202 288 203 ELSE ! centered hpg (eos then time stepping) 289 CALL eos( tn, sn, rhd, rhop ) ! now in situ density for hpg computation 290 IF( ln_zps ) CALL zps_hde( kstp, tn, sn, rhd, & ! Partial steps: now horizontal derivative 291 & gtu, gsu, gru, & ! of t, s, rd at the bottom ocean level 292 & gtv, gsv, grv ) 293 IF( ln_zdfnpc ) CALL tra_npc ( kstp ) ! update after fields by non-penetrative convection 294 CALL tra_nxt ( kstp ) ! tracer fields at next time step 204 CALL eos ( tsn, rhd, rhop ) ! now in situ density for hpg computation 205 IF( ln_zps ) CALL zps_hde( kstp, jpts, tsn, gtsu, gtsv, & ! zps: now hor. derivative 206 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 207 IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! update after fields by non-penetrative convection 208 CALL tra_nxt( kstp ) ! tracer fields at next time step 295 209 ENDIF 210 CALL tra_unswap ! udate T & S 3D arrays (to be suppressed) 296 211 297 212 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 301 216 va(:,:,:) = 0.e0 302 217 218 IF( ln_asmiau .AND. & 219 & ln_dyninc ) CALL dyn_asm_inc( kstp ) ! apply dynamics assimilation increment 303 220 CALL dyn_adv( kstp ) ! advection (vector or flux form) 304 221 CALL dyn_vor( kstp ) ! vorticity term including Coriolis … … 308 225 #endif 309 226 CALL dyn_hpg( kstp ) ! horizontal gradient of Hydrostatic pressure 310 CALL dyn_bfr( kstp ) 227 CALL dyn_bfr( kstp ) ! bottom friction 311 228 CALL dyn_zdf( kstp ) ! vertical diffusion 312 indic=0313 229 CALL dyn_spg( kstp, indic ) ! surface pressure gradient 314 230 CALL dyn_nxt( kstp ) ! lateral velocity at next time step 315 231 316 232 CALL ssh_nxt( kstp ) ! sea surface height at next time step 233 234 IF( ln_diahsb ) CALL dia_hsb( kstp ) ! - ML - global conservation diagnostics 235 IF( lk_diaobs ) CALL dia_obs( kstp ) ! obs-minus-model (assimilation) diagnostics (call after dynamics update) 317 236 318 237 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Note: See TracChangeset
for help on using the changeset viewer.