- Timestamp:
- 2015-09-24T08:31:40+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2015/dev_r5721_CNRS9_NOC3_LDF/NEMOGCM/NEMO/OPA_SRC/step.F90
r5656 r5758 24 24 !! - ! 2010-10 (C. Ethe, G. Madec) reorganisation of initialisation phase + merge TRC-TRA 25 25 !! 3.4 ! 2011-04 (G. Madec, C. Ethe) Merge of dtatem and dtasal 26 !! ! 2012-07 (J. Simeon, G. Madec, C. Ethe) Online coarsening of outputs 27 !! 3.7 ! 2014-04 (F. Roquet, G. Madec) New equations of state 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 28 !! 3.7 ! 2014-10 (G. Madec) LDF simplication 29 !! - ! 2014-12 (G. Madec) remove KPP scheme 28 30 !!---------------------------------------------------------------------- 29 31 … … 37 39 PRIVATE 38 40 39 PUBLIC stp ! called by opa.F9041 PUBLIC stp ! called by nemogcm.F90 40 42 41 43 !! * Substitutions … … 43 45 !!gm # include "zdfddm_substitute.h90" 44 46 !!---------------------------------------------------------------------- 45 !! NEMO/OPA 3.7 , NEMO Consortium (201 4)47 !! NEMO/OPA 3.7 , NEMO Consortium (2015) 46 48 !! $Id$ 47 49 !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) … … 76 78 INTEGER :: kcall ! optional integer argument (dom_vvl_sf_nxt) 77 79 !! --------------------------------------------------------------------- 78 79 80 #if defined key_agrif 80 81 kstp = nit000 + Agrif_Nb_Step() 81 IF ( lk_agrif_debug ) THEN 82 IF ( Agrif_Root() .and. lwp) Write(*,*) '---' 83 IF (lwp) Write(*,*) 'Grid Number',Agrif_Fixed(),' time step ',kstp, 'int tstep',Agrif_NbStepint() 84 ENDIF 85 86 IF ( kstp == (nit000 + 1) ) lk_agrif_fstep = .FALSE. 87 82 IF( lk_agrif_debug ) THEN 83 IF( Agrif_Root() .and. lwp) WRITE(*,*) '---' 84 IF(lwp) WRITE(*,*) 'Grid Number', Agrif_Fixed(),' time step ', kstp, 'int tstep', Agrif_NbStepint() 85 ENDIF 86 IF( kstp == nit000 + 1 ) lk_agrif_fstep = .FALSE. 88 87 # if defined key_iomput 89 88 IF( Agrif_Nbstepint() == 0 ) CALL iom_swap( cxios_context ) 90 89 # endif 91 90 #endif 92 indic = 0 ! reset to no error condition 93 IF( kstp == nit000 ) THEN 94 ! must be done after nemo_init for AGRIF+XIOS+OASIS 95 CALL iom_init( cxios_context ) ! iom_put initialization 96 IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" ) ! initialize context for coarse grid 97 ENDIF 98 91 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 92 ! update I/O and calendar 93 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 94 indic = 0 ! reset to no error condition 95 96 IF( kstp == nit000 ) THEN ! initialize IOM context (must be done after nemo_init for AGRIF+XIOS+OASIS) 97 CALL iom_init( cxios_context ) ! for model grid (including passible AGRIF zoom) 98 IF( ln_crs ) CALL iom_init( TRIM(cxios_context)//"_crs" ) ! for coarse grid 99 ENDIF 99 100 IF( kstp /= nit000 ) CALL day( kstp ) ! Calendar (day was already called at nit000 in day_init) 100 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell iom we are at time step kstp 101 IF( ln_crs ) CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" ) ! tell iom we are at time step kstp 102 103 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 104 ! Update data, open boundaries, surface boundary condition (including sea-ice) 105 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 106 IF( lk_tide ) CALL sbc_tide( kstp ) 107 IF( lk_bdy ) THEN 108 IF( ln_apr_dyn) CALL sbc_apr( kstp ) ! bdy_dta needs ssh_ib 109 CALL bdy_dta ( kstp, time_offset=+1 ) ! update dynamic & tracer data at open boundaries 110 ENDIF 111 CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) 112 ! clem: moved here for bdy ice purpose 101 CALL iom_setkt( kstp - nit000 + 1, cxios_context ) ! tell IOM we are at time step kstp 102 IF( ln_crs ) CALL iom_setkt( kstp - nit000 + 1, TRIM(cxios_context)//"_crs" ) ! tell IOM we are at time step kstp 103 104 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 105 ! Update external forcing (tides, open boundaries, and surface boundary condition (including sea-ice) 106 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 107 IF( lk_tide ) CALL sbc_tide( kstp ) ! update tide potential 108 IF( ln_apr_dyn ) CALL sbc_apr ( kstp ) ! atmospheric pressure (NB: call before bdy_dta which needs ssh_ib) 109 IF( lk_bdy ) CALL bdy_dta ( kstp, time_offset=+1 ) ! update dynamic & tracer data at open boundaries 110 CALL sbc ( kstp ) ! Sea Boundary Condition (including sea-ice) 111 CALL FLUSH ( numout ) 113 112 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 114 113 ! Update stochastic parameters and random T/S fluctuations 115 114 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 116 CALL sto_par( kstp ) ! Stochastic parameters 115 CALL sto_par( kstp ) ! Stochastic parameters 116 CALL FLUSH ( numout ) 117 117 118 118 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 124 124 CALL bn2 ( tsb, rab_b, rn2b ) ! before Brunt-Vaisala frequency 125 125 CALL bn2 ( tsn, rab_n, rn2 ) ! now Brunt-Vaisala frequency 126 CALL FLUSH ( numout ) 126 127 ! 127 128 ! VERTICAL PHYSICS … … 131 132 IF( lk_zdftke ) CALL zdf_tke( kstp ) ! TKE closure scheme for Kz 132 133 IF( lk_zdfgls ) CALL zdf_gls( kstp ) ! GLS closure scheme for Kz 133 IF( lk_zdfkpp ) CALL zdf_kpp( kstp ) ! KPP closure scheme for Kz134 134 IF( lk_zdfcst ) THEN ! Constant Kz (reset avt, avm[uv] to the background value) 135 135 avt (:,:,:) = rn_avt0 * wmask (:,:,:) … … 137 137 avmv(:,:,:) = rn_avm0 * wvmask(:,:,:) 138 138 ENDIF 139 CALL FLUSH ( numout ) 139 140 IF( ln_rnf_mouth ) THEN ! increase diffusivity at rivers mouths 140 DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + 2. e0* rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk) ; END DO141 DO jk = 2, nkrnf ; avt(:,:,jk) = avt(:,:,jk) + 2._wp * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk) ; END DO 141 142 ENDIF 142 143 IF( ln_zdfevd ) CALL zdf_evd( kstp ) ! enhanced vertical eddy diffusivity … … 144 145 IF( lk_zdftmx ) CALL zdf_tmx( kstp ) ! tidal vertical mixing 145 146 146 IF( lk_zdfddm .AND. .NOT. lk_zdfkpp ) & 147 & CALL zdf_ddm( kstp ) ! double diffusive mixing 147 IF( lk_zdfddm ) CALL zdf_ddm( kstp ) ! double diffusive mixing 148 148 149 149 CALL zdf_mxl( kstp ) ! mixed layer depth … … 152 152 IF( lrst_oce .AND. lk_zdftke ) CALL tke_rst( kstp, 'WRITE' ) 153 153 IF( lrst_oce .AND. lk_zdfgls ) CALL gls_rst( kstp, 'WRITE' ) 154 CALL FLUSH ( numout ) 154 155 ! 155 156 ! LATERAL PHYSICS 156 157 ! 157 IF( lk_ldfslp ) THEN ! slope of lateral mixing 158 IF( l_ldfslp ) THEN ! slope of lateral mixing 159 !!gm : why this here ???? 158 160 IF(ln_sto_eos ) CALL sto_pts( tsn ) ! Random T/S fluctuations 161 !!gm 159 162 CALL eos( tsb, rhd, gdept_0(:,:,:) ) ! before in situ density 163 160 164 IF( ln_zps .AND. .NOT. ln_isfcav) & 161 165 & CALL zps_hde ( kstp, jpts, tsb, gtsu, gtsv, & ! Partial steps: before horizontal gradient 162 166 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 167 163 168 IF( ln_zps .AND. ln_isfcav) & 164 & CALL zps_hde_isf( kstp, jpts, tsb, gtsu, gtsv, & ! Partial steps for top cell (ISF)169 & CALL zps_hde_isf( kstp, jpts, tsb, gtsu, gtsv, gtui, gtvi, & ! Partial steps for top cell (ISF) 165 170 & rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv , & 166 & gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) ! of t, s, rd at the first ocean level 167 IF( ln_traldf_grif ) THEN ! before slope for Griffies operator 168 CALL ldf_slp_grif( kstp ) 169 ELSE 170 CALL ldf_slp( kstp, rhd, rn2b ) ! before slope for Madec operator 171 & grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) ! of t, s, rd at the first ocean level 172 173 IF( ln_traldf_triad ) THEN 174 CALL ldf_slp_triad( kstp ) ! before slope for triad operator 175 ELSE 176 CALL ldf_slp ( kstp, rhd, rn2b ) ! before slope for standard operator 171 177 ENDIF 172 178 ENDIF 173 #if defined key_traldf_c2d 174 IF( lk_traldf_eiv ) CALL ldf_eiv( kstp ) ! eddy induced velocity coefficient 175 #endif 176 #if defined key_traldf_c3d && defined key_traldf_smag 177 CALL ldf_tra_smag( kstp ) ! eddy induced velocity coefficient 178 # endif 179 #if defined key_dynldf_c3d && defined key_dynldf_smag 180 CALL ldf_dyn_smag( kstp ) ! eddy induced velocity coefficient 181 # endif 179 ! ! eddy diffusivity coeff. and/or eiv coeff. 180 IF( l_ldftra_time .OR. l_ldfeiv_time ) CALL ldf_tra( kstp ) 181 write(*,*) 'after ldf_slp' 182 CALL FLUSH ( numout ) 182 183 183 184 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 187 188 IF( lk_vvl ) CALL dom_vvl_sf_nxt( kstp ) ! after vertical scale factors 188 189 CALL wzv ( kstp ) ! now cross-level velocity 190 write(*,*) 'after wzv' 191 CALL FLUSH ( numout ) 189 192 190 193 IF( lk_dynspg_ts ) THEN … … 192 195 ! Note that the computation of vertical velocity above, hence "after" sea level 193 196 ! is necessary to compute momentum advection for the rhs of barotropic loop: 197 !!gm : why also here ???? 194 198 IF(ln_sto_eos ) CALL sto_pts( tsn ) ! Random T/S fluctuations 199 !!gm 195 200 CALL eos ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation 196 IF( ln_zps .AND. .NOT. ln_isfcav) & 197 & CALL zps_hde ( kstp, jpts, tsn, gtsu, gtsv, & ! Partial steps: before horizontal gradient 198 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 199 IF( ln_zps .AND. ln_isfcav) & 200 & CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv, & ! Partial steps for top cell (ISF) 201 202 IF( ln_zps .AND. .NOT. ln_isfcav) & ! Partial steps: bottom before horizontal gradient 203 & CALL zps_hde ( kstp, jpts, tsn, gtsu, gtsv, & ! of t, s, rd at the last ocean level 204 & rhd, gru , grv ) 205 IF( ln_zps .AND. ln_isfcav) & ! Partial steps: top & bottom before horizontal gradient 206 & CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv, gtui, gtvi, & 201 207 & rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv , & 202 & gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) ! of t, s, rd at the last ocean level203 204 ua(:,:,:) = 0. e0! set dynamics trends to zero205 va(:,:,:) = 0. e0208 & grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) 209 210 ua(:,:,:) = 0._wp ! set dynamics trends to zero 211 va(:,:,:) = 0._wp 206 212 IF( lk_asminc .AND. ln_asmiau .AND. & 207 213 & ln_dyninc ) CALL dyn_asm_inc ( kstp ) ! apply dynamics assimilation increment … … 225 231 CALL wzv ( kstp ) ! now cross-level velocity 226 232 ENDIF 233 write(*,*) 'after wzv 2' 234 CALL FLUSH ( numout ) 227 235 228 236 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 229 237 ! diagnostics and outputs (ua, va, tsa used as workspace) 230 238 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 231 IF( lk_floats ) 232 IF( lk_diahth ) 233 IF( .NOT. ln_cpl )CALL dia_fwb( kstp ) ! Fresh water budget diagnostics234 IF( lk_diadct ) 235 IF( lk_diaar5 ) 236 IF( lk_diaharm ) 237 238 ! 239 IF( ln_crs ) 239 IF( lk_floats ) CALL flo_stp( kstp ) ! drifting Floats 240 IF( lk_diahth ) CALL dia_hth( kstp ) ! Thermocline depth (20 degres isotherm depth) 241 IF(.NOT.ln_cpl ) CALL dia_fwb( kstp ) ! Fresh water budget diagnostics 242 IF( lk_diadct ) CALL dia_dct( kstp ) ! Transports 243 IF( lk_diaar5 ) CALL dia_ar5( kstp ) ! ar5 diag 244 IF( lk_diaharm ) CALL dia_harm( kstp ) ! Tidal harmonic analysis 245 CALL dia_wri( kstp ) ! ocean model: outputs 246 ! 247 IF( ln_crs ) CALL crs_fld( kstp ) ! ocean model: online field coarsening & output 240 248 241 249 #if defined key_top … … 245 253 CALL trc_stp( kstp ) ! time-stepping 246 254 #endif 247 255 write(*,*) 'end dyn ' 256 CALL FLUSH ( numout ) 248 257 249 258 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 250 259 ! Active tracers (ua, va used as workspace) 251 260 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 252 tsa(:,:,:,:) = 0. e0! set tracer trends to zero261 tsa(:,:,:,:) = 0._wp ! set tracer trends to zero 253 262 254 263 IF( lk_asminc .AND. ln_asmiau .AND. & … … 261 270 IF( lk_bdy ) CALL bdy_tra_dmp( kstp ) ! bdy damping trends 262 271 CALL tra_adv ( kstp ) ! horizontal & vertical advection 263 IF( lk_zdfkpp ) CALL tra_kpp ( kstp ) ! KPP non-local tracer fluxes 272 write(*,*) 'before tra_ldf' 273 CALL FLUSH ( numout ) 264 274 CALL tra_ldf ( kstp ) ! lateral mixing 265 275 write(*,*) 'after tra_ldf' 276 CALL FLUSH ( numout ) 277 278 !!gm : why CALL to dia_ptr has been moved here??? (use trends info?) 266 279 IF( ln_diaptr ) CALL dia_ptr ! Poleward adv/ldf TRansports diagnostics 280 !!gm 267 281 268 282 #if defined key_agrif … … 274 288 IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! update after fields by non-penetrative convection 275 289 CALL tra_nxt( kstp ) ! tracer fields at next time step 290 !!gm : why again a call to sto_pts ??? 276 291 IF( ln_sto_eos ) CALL sto_pts( tsn ) ! Random T/S fluctuations 292 !!gm 277 293 CALL eos ( tsa, rhd, rhop, fsdept_n(:,:,:) ) ! Time-filtered in situ density for hpg computation 278 294 IF( ln_zps .AND. .NOT. ln_isfcav) & … … 280 296 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 281 297 IF( ln_zps .AND. ln_isfcav) & 282 & CALL zps_hde_isf( kstp, jpts, tsa, gtsu, gtsv, & ! Partial steps for top cell (ISF)298 & CALL zps_hde_isf( kstp, jpts, tsa, gtsu, gtsv, gtui, gtvi, & ! Partial steps for top/bottom cells 283 299 & rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv , & 284 & gtui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) ! of t, s, rd at the last ocean level300 & grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) 285 301 ELSE ! centered hpg (eos then time stepping) 286 302 IF ( .NOT. lk_dynspg_ts ) THEN ! eos already called in time-split case 303 !!gm : why again a call to sto_pts ??? 287 304 IF( ln_sto_eos ) CALL sto_pts( tsn ) ! Random T/S fluctuations 305 !!gm 288 306 CALL eos ( tsn, rhd, rhop, fsdept_n(:,:,:) ) ! now in situ density for hpg computation 289 307 IF( ln_zps .AND. .NOT. ln_isfcav) & 290 & CALL zps_hde ( kstp, jpts, tsn, gtsu, gtsv, & ! Partial steps: b efore horizontal gradient291 & rhd, gru , grv ) ! of t, s, rd at the last ocean level308 & CALL zps_hde ( kstp, jpts, tsn, gtsu, gtsv, & ! Partial steps: bottom before horizontal gradient 309 & rhd, gru , grv ) ! of t, s, rd at the last ocean level 292 310 IF( ln_zps .AND. ln_isfcav) & 293 & CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv, & ! Partial steps for top cell (ISF)311 & CALL zps_hde_isf( kstp, jpts, tsn, gtsu, gtsv, gtui, gtvi, & ! Partial steps for top/bottom cells 294 312 & rhd, gru , grv , aru , arv , gzu , gzv , ge3ru , ge3rv , & 295 & g tui, gtvi, grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) ! of t, s, rd at the last ocean level313 & grui, grvi, arui, arvi, gzui, gzvi, ge3rui, ge3rvi ) ! of t, s, rd at the last ocean level 296 314 ENDIF 297 315 IF( ln_zdfnpc ) CALL tra_npc( kstp ) ! update after fields by non-penetrative convection 298 316 CALL tra_nxt( kstp ) ! tracer fields at next time step 299 317 ENDIF 318 write(*,*) 'after tra_nxt' 319 CALL FLUSH ( numout ) 300 320 301 321 !>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> … … 315 335 CALL dyn_zdf( kstp ) ! vertical diffusion 316 336 ELSE 317 ua(:,:,:) = 0. e0! set dynamics trends to zero318 va(:,:,:) = 0. e0337 ua(:,:,:) = 0._wp ! set dynamics trends to zero 338 va(:,:,:) = 0._wp 319 339 320 340 IF( lk_asminc .AND. ln_asmiau .AND. & … … 340 360 IF( lk_vvl ) CALL dom_vvl_sf_swp( kstp ) ! swap of vertical scale factors 341 361 ! 362 write(*,*) 'after dom_vvl' 363 CALL FLUSH ( numout ) 364 365 366 !!gm : This does not only concern the dynamics ==>>> add a new title 367 !!gm2: why ouput restart before AGRIF update? 342 368 IF( lrst_oce ) CALL rst_write( kstp ) ! write output ocean restart file 343 369 … … 367 393 CALL iom_close( numror ) ! close input ocean restart file 368 394 IF(lwm) CALL FLUSH ( numond ) ! flush output namelist oce 369 IF( lwm.AND.numoni /= -1 ) CALL FLUSH ( numoni ) ! flush output namelist ice 395 IF(lwm.AND.numoni /= -1 ) & 396 & CALL FLUSH ( numoni ) ! flush output namelist ice (if exist) 370 397 ENDIF 371 398 … … 373 400 ! Coupled mode 374 401 !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 402 !!gm why lk_oasis and not lk_cpl ???? 375 403 IF( lk_oasis ) CALL sbc_cpl_snd( kstp ) ! coupled mode : field exchanges 376 404 ! … … 383 411 ! 384 412 IF( nn_timing == 1 .AND. kstp == nit000 ) CALL timing_reset 385 !386 413 ! 387 414 END SUBROUTINE stp
Note: See TracChangeset
for help on using the changeset viewer.