Changeset 7953 for branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC
- Timestamp:
- 2017-04-23T09:30:41+02:00 (7 years ago)
- Location:
- branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
r7646 r7953 121 121 DO jj = 2, jpjm1 122 122 DO ji = fs_2, fs_jpim1 ! vector opt. 123 IF( av t(ji,jj,jk) <= 5.e-4_wp ) THEN123 IF( avs(ji,jj,jk) <= 5.e-4_wp ) THEN 124 124 tra(ji,jj,jk,jn) = tra(ji,jj,jk,jn) + restotr(ji,jj,jk) * ( ztrcdta(ji,jj,jk) - trb(ji,jj,jk,jn) ) 125 125 ENDIF -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
r7931 r7953 4 4 !! Ocean Passive tracers : vertical diffusive trends 5 5 !!===================================================================== 6 !! History : 9.0 ! 2005-11 (G. Madec) Original code6 !! History : 9.0 ! 2005-11 (G. Madec) Original code 7 7 !! NEMO 3.0 ! 2008-01 (C. Ethe, G. Madec) merge TRC-TRA 8 !! 4.0 ! 2017-04 (G. Madec) remove the explicit case 8 9 !!---------------------------------------------------------------------- 9 10 #if defined key_top … … 11 12 !! 'key_top' TOP models 12 13 !!---------------------------------------------------------------------- 13 !! trc_zdf : update the tracer trend with the lateral diffusion 14 !! trc_zdf_ini : initialization, namelist read, and parameters control 14 !! trc_zdf : update the tracer trend with the vertical diffusion 15 15 !!---------------------------------------------------------------------- 16 16 USE trc ! ocean passive tracers variables … … 27 27 28 28 PUBLIC trc_zdf ! called by step.F90 29 PUBLIC trc_zdf_ini ! called by nemogcm.F9030 29 31 ! !!** Vertical diffusion (nam_trczdf) **32 LOGICAL , PUBLIC :: ln_trczdf_exp !: explicit vertical diffusion scheme flag33 INTEGER , PUBLIC :: nn_trczdf_exp !: number of sub-time step (explicit time stepping)34 35 INTEGER :: nzdf = 0 ! type vertical diffusion algorithm used36 ! ! defined from ln_zdf... namlist logicals)37 !! * Substitutions38 # include "vectopt_loop_substitute.h90"39 30 !!---------------------------------------------------------------------- 40 31 !! NEMO/TOP 3.7 , NEMO Consortium (2015) … … 48 39 !! *** ROUTINE trc_zdf *** 49 40 !! 50 !! ** Purpose : compute the vertical ocean tracer physics. 41 !! ** Purpose : compute the vertical ocean tracer physics using 42 !! an implicit time-stepping scheme. 51 43 !!--------------------------------------------------------------------- 52 44 INTEGER, INTENT( in ) :: kt ! ocean time-step index … … 54 46 INTEGER :: jk, jn 55 47 CHARACTER (len=22) :: charout 56 REAL(wp), POINTER, DIMENSION(:,:,:,:) :: ztrtrd ! 4D workspace48 REAL(wp), DIMENSION(jpi,jpj,jpk,jptra) :: ztrtrd ! 4D workspace 57 49 !!--------------------------------------------------------------------- 58 50 ! 59 51 IF( nn_timing == 1 ) CALL timing_start('trc_zdf') 60 52 ! 61 IF( l_trdtrc ) THEN 62 CALL wrk_alloc( jpi, jpj, jpk, jptra, ztrtrd ) 63 ztrtrd(:,:,:,:) = tra(:,:,:,:) 64 ENDIF 65 66 SELECT CASE ( nzdf ) ! compute lateral mixing trend and add it to the general trend 67 CASE ( 0 ) ; CALL tra_zdf_exp( kt, nittrc000, 'TRC', r2dttrc, nn_trczdf_exp, trb, tra, jptra ) ! explicit scheme 68 CASE ( 1 ) ; CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra ) ! implicit scheme 69 END SELECT 70 53 IF( l_trdtrc ) ztrtrd(:,:,:,:) = tra(:,:,:,:) 54 ! 55 CALL tra_zdf_imp( kt, nittrc000, 'TRC', r2dttrc, trb, tra, jptra ) ! implicit scheme 56 ! 71 57 IF( l_trdtrc ) THEN ! save the vertical diffusive trends for further diagnostics 72 58 DO jn = 1, jptra … … 76 62 CALL trd_tra( kt, 'TRC', jn, jptra_zdf, ztrtrd(:,:,:,jn) ) 77 63 END DO 78 CALL wrk_dealloc( jpi, jpj, jpk, jptra, ztrtrd )79 64 ENDIF 80 65 ! ! print mean trends (used for debugging) 81 66 IF( ln_ctl ) THEN 82 WRITE(charout, FMT="('zdf ')") ; CALL prt_ctl_trc_info(charout) 83 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 67 WRITE(charout, FMT="('zdf ')") 68 CALL prt_ctl_trc_info(charout) 69 CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' ) 84 70 END IF 85 71 ! … … 87 73 ! 88 74 END SUBROUTINE trc_zdf 89 90 91 SUBROUTINE trc_zdf_ini92 !!----------------------------------------------------------------------93 !! *** ROUTINE trc_zdf_ini ***94 !!95 !! ** Purpose : Choose the vertical mixing scheme96 !!97 !! ** Method : Set nzdf from ln_zdfexp98 !! nzdf = 0 explicit (time-splitting) scheme (ln_trczdf_exp=T)99 !! = 1 implicit (euler backward) scheme (ln_trczdf_exp=F)100 !! NB: The implicit scheme is required when using :101 !! - rotated lateral mixing operator102 !! - TKE, GLS vertical mixing scheme103 !!----------------------------------------------------------------------104 INTEGER :: ios ! Local integer output status for namelist read105 !!106 NAMELIST/namtrc_zdf/ ln_trczdf_exp , nn_trczdf_exp107 !!----------------------------------------------------------------------108 !109 REWIND( numnat_ref ) ! namtrc_zdf in reference namelist110 READ ( numnat_ref, namtrc_zdf, IOSTAT = ios, ERR = 905)111 905 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in reference namelist', lwp )112 !113 REWIND( numnat_cfg ) ! namtrc_zdf in configuration namelist114 READ ( numnat_cfg, namtrc_zdf, IOSTAT = ios, ERR = 906 )115 906 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namtrc_zdf in configuration namelist', lwp )116 IF(lwm) WRITE ( numont, namtrc_zdf )117 !118 IF(lwp) THEN ! Control print119 WRITE(numout,*)120 WRITE(numout,*) ' Namelist namtrc_zdf : set vertical diffusion parameters'121 WRITE(numout,*) ' time splitting / backward scheme ln_trczdf_exp = ', ln_trczdf_exp122 WRITE(numout,*) ' number of time step nn_trczdf_exp = ', nn_trczdf_exp123 ENDIF124 125 ! ! Define the vertical tracer physics scheme126 IF( ln_trczdf_exp ) THEN ; nzdf = 0 ! explicit scheme127 ELSE ; nzdf = 1 ! implicit scheme128 ENDIF129 130 ! ! Force implicit schemes131 IF( ln_trcldf_iso ) nzdf = 1 ! iso-neutral lateral physics132 IF( ln_trcldf_hor .AND. ln_sco ) nzdf = 1 ! horizontal lateral physics in s-coordinate133 #if defined key_zdftke || defined key_zdfgls134 nzdf = 1 ! TKE or GLS physics135 #endif136 IF( ln_trczdf_exp .AND. nzdf == 1 ) &137 CALL ctl_stop( 'trc_zdf : If using the rotated lateral mixing operator or TKE, GLS vertical scheme ', &138 & ' the implicit scheme is required, set ln_trczdf_exp = .false.' )139 140 IF(lwp) THEN141 WRITE(numout,*)142 WRITE(numout,*) 'trc:zdf_ctl : vertical passive tracer physics scheme'143 WRITE(numout,*) '~~~~~~~~~~~'144 IF( nzdf == 0 ) WRITE(numout,*) ' Explicit time-splitting scheme'145 IF( nzdf == 1 ) WRITE(numout,*) ' Implicit (euler backward) scheme'146 ENDIF147 !148 END SUBROUTINE trc_zdf_ini149 75 150 76 #else -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
r7881 r7953 101 101 102 102 !* vertical diffusion * 103 USE zdf_oce , ONLY : avt => avt !: vert. diffusivity coef. at w-point for temp 104 # if defined key_zdfddm 105 USE zdfddm , ONLY : avs => avs !: salinity vertical diffusivity coeff. at w-point 106 # endif 103 USE zdf_oce , ONLY : avs => avs !: vert. diffusivity coef. for salinity (w-point) 107 104 108 105 !* mixing & mixed layer depth * -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trc.F90
r7881 r7953 126 126 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: vn_tm !: j-horizontal velocity average [m/s] 127 127 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_tm !: t/s average [m/s] 128 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: av t_tm !: vertical diffusivity coeff. at w-point [m2/s]128 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_tm !: vertical diffusivity coeff. at w-point [m2/s] 129 129 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: rhop_tm !: 130 # if defined key_zdfddm131 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_tm !: vertical double diffusivity coeff. at w-point [m/s]132 # endif133 130 #if defined key_trabbl 134 131 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: ahu_bbl_tm !: u-, w-points … … 154 151 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) :: tsn_temp 155 152 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: un_temp,vn_temp,wn_temp !: hold current values of avt, un, vn, wn 156 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: av t_temp, rhop_temp !: hold current values of avt, un, vn, wn153 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_temp, rhop_temp !: hold current values of avt, un, vn, wn 157 154 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:) :: sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp 158 155 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: hdivn_temp, rotn_temp … … 165 162 #endif 166 163 ! 167 # if defined key_zdfddm168 REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) :: avs_temp !: salinity vertical diffusivity coeff. at w-point [m/s]169 # endif170 164 ! 171 165 CHARACTER(len=20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) :: cn_trc_dflt ! Default OBC condition for all tracers -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcini.F90
r7753 r7953 196 196 USE trcadv , ONLY: trc_adv_ini 197 197 USE trcldf , ONLY: trc_ldf_ini 198 USE trczdf , ONLY: trc_zdf_ini199 198 USE trcrad , ONLY: trc_rad_ini 200 199 ! … … 205 204 CALL trc_adv_ini ! advection 206 205 CALL trc_ldf_ini ! lateral diffusion 207 CALL trc_zdf_ini ! vertical diffusion206 ! ! vertical diffusion: always implicit time stepping scheme 208 207 CALL trc_rad_ini ! positivity of passive tracers 209 208 ! … … 223 222 !!---------------------------------------------------------------------- 224 223 ! 225 ! Initialisation of tracers Initial Conditions 226 IF( ln_trcdta ) CALL trc_dta_ini(jptra)227 228 ! Initialisation oftracers Boundary Conditions229 IF( ln_my_trc ) CALL trc_bc_ini(jptra) 230 231 IF( ln_rsttr ) THEN 224 225 IF( ln_trcdta ) CALL trc_dta_ini( jptra ) ! set initial tracers values 226 227 IF( ln_my_trc ) CALL trc_bc_ini ( jptra ) ! set tracers Boundary Conditions 228 229 230 IF( ln_rsttr ) THEN ! restart from a file 232 231 ! 233 CALL trc_rst_read ! restart from a file232 CALL trc_rst_read 234 233 ! 235 ELSE 236 ! Initialisation of tracer from a file that may also be used for damping 234 ELSE ! Initialisation of tracer from a file that may also be used for damping 235 !!gm BUG ? if damping and restart, what's happening ? 237 236 IF( ln_trcdta .AND. nb_trcdta > 0 ) THEN 238 237 ! update passive tracers arrays with input data read from file … … 250 249 ENDIF 251 250 ENDIF 252 END DO251 END DO 253 252 ! 254 253 ENDIF … … 262 261 END SUBROUTINE trc_ini_state 263 262 263 264 264 SUBROUTINE top_alloc 265 265 !!---------------------------------------------------------------------- -
branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
r7646 r7953 84 84 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 85 85 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t_n(:,:,:) 86 avt_tm (:,:,:) = avt_tm (:,:,:) + avt (:,:,:) * e3w_n(:,:,:)87 # if defined key_zdfddm88 86 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w_n(:,:,:) 89 # endif90 87 IF( l_ldfslp ) THEN 91 88 uslp_tm (:,:,:) = uslp_tm (:,:,:) + uslp (:,:,:) … … 122 119 tsn_temp (:,:,:,:) = tsn (:,:,:,:) 123 120 rhop_temp (:,:,:) = rhop (:,:,:) 124 avt_temp (:,:,:) = avt (:,:,:)125 # if defined key_zdfddm126 121 avs_temp (:,:,:) = avs (:,:,:) 127 # endif128 122 IF( l_ldfslp ) THEN 129 123 uslp_temp (:,:,:) = uslp (:,:,:) ; wslpi_temp (:,:,:) = wslpi (:,:,:) … … 161 155 tsn_tm (:,:,:,jp_sal) = tsn_tm (:,:,:,jp_sal) + tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 162 156 rhop_tm (:,:,:) = rhop_tm (:,:,:) + rhop (:,:,:) * e3t_n(:,:,:) 163 avt_tm (:,:,:) = avt_tm (:,:,:) + avt (:,:,:) * e3w_n(:,:,:)164 # if defined key_zdfddm165 157 avs_tm (:,:,:) = avs_tm (:,:,:) + avs (:,:,:) * e3w_n(:,:,:) 166 # endif167 158 IF( l_ldfslp ) THEN 168 159 uslp_tm (:,:,:) = uslp_tm (:,:,:) + uslp (:,:,:) … … 245 236 tsn (ji,jj,jk,jp_sal) = tsn_tm (ji,jj,jk,jp_sal) * z1_ne3t 246 237 rhop (ji,jj,jk) = rhop_tm (ji,jj,jk) * z1_ne3t 247 !!gm : BUG? ==>> for avt & avs I don't understand the division by e3w 248 avt (ji,jj,jk) = avt_tm (ji,jj,jk) * z1_ne3w 249 # if defined key_zdfddm 238 !!gm : BUG ==>> for avs I don't understand the division by e3w 250 239 avs (ji,jj,jk) = avs_tm (ji,jj,jk) * z1_ne3w 251 # endif252 240 END DO 253 241 END DO … … 297 285 rhop_tm (:,:,:) = rhop (:,:,:) * e3t_n(:,:,:) 298 286 !!gm : BUG? ==>> for avt & avs I don't understand the division by e3w 299 avt_tm (:,:,:) = avt (:,:,:) * e3w_n(:,:,:)300 # if defined key_zdfddm301 287 avs_tm (:,:,:) = avs (:,:,:) * e3w_n(:,:,:) 302 # endif303 288 IF( l_ldfslp ) THEN 304 289 wslpi_tm(:,:,:) = wslpi(:,:,:) … … 354 339 tsn (:,:,:,:) = tsn_temp (:,:,:,:) 355 340 rhop (:,:,:) = rhop_temp (:,:,:) 356 avt (:,:,:) = avt_temp (:,:,:)357 # if defined key_zdfddm358 341 avs (:,:,:) = avs_temp (:,:,:) 359 # endif360 342 IF( l_ldfslp ) THEN 361 343 wslpi (:,:,:)= wslpi_temp (:,:,:) … … 396 378 tsn_tm (:,:,:,jp_sal) = tsn (:,:,:,jp_sal) * e3t_n(:,:,:) 397 379 rhop_tm (:,:,:) = rhop (:,:,:) * e3t_n(:,:,:) 398 avt_tm (:,:,:) = avt (:,:,:) * e3w_n(:,:,:)399 # if defined key_zdfddm400 380 avs_tm (:,:,:) = avs (:,:,:) * e3w_n(:,:,:) 401 # endif402 381 IF( l_ldfslp ) THEN 403 382 uslp_tm (:,:,:) = uslp (:,:,:) … … 534 513 ! 535 514 ALLOCATE( un_temp(jpi,jpj,jpk) , vn_temp(jpi,jpj,jpk) , & 536 & wn_temp(jpi,jpj,jpk) , avt_temp(jpi,jpj,jpk) ,&515 & wn_temp(jpi,jpj,jpk) , & 537 516 & rhop_temp(jpi,jpj,jpk) , rhop_tm(jpi,jpj,jpk) , & 538 517 & sshn_temp(jpi,jpj) , sshb_temp(jpi,jpj) , & … … 548 527 & fr_i_temp(jpi,jpj) , fr_i_tm(jpi,jpj) , & 549 528 & wndm_temp(jpi,jpj) , wndm_tm(jpi,jpj) , & 550 # if defined key_zdfddm551 529 & avs_tm(jpi,jpj,jpk) , avs_temp(jpi,jpj,jpk) , & 552 # endif553 530 & hdivn_temp(jpi,jpj,jpk) , hdivb_temp(jpi,jpj,jpk), & 554 531 & un_tm(jpi,jpj,jpk) , vn_tm(jpi,jpj,jpk) , & 555 & avt_tm(jpi,jpj,jpk) , &556 532 & sshn_tm(jpi,jpj) , sshb_hold(jpi,jpj) , & 557 533 & tsn_tm(jpi,jpj,jpk,2) , &
Note: See TracChangeset
for help on using the changeset viewer.