Changeset 2177 for trunk/LMDZ.GENERIC/libf/phystd/thermcell_main.F90
- Timestamp:
- Nov 12, 2019, 11:55:58 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/thermcell_main.F90
r2144 r2177 42 42 ! New detr and entre formulae (no longer alimentation) 43 43 ! lmin can be greater than 1 44 ! Mix every tracer (EN COURS) 45 ! Old version of thermcell_dq is removed 46 ! Alternative version thermcell_dv2 is removed 44 ! Mix every tracer 47 45 ! 48 46 !=============================================================================== … … 61 59 ! ------- 62 60 63 INTEGER ngrid, nlay, nq 64 65 REAL ptimestep 66 REAL pplay(ngrid,nlay) ! Layer pressure 67 REAL pplev(ngrid,nlay+1) ! Level pressure 68 REAL pphi(ngrid,nlay) ! Geopotential 69 70 REAL pu(ngrid,nlay) ! Zonal wind 71 REAL pv(ngrid,nlay) ! Meridional wind 72 REAL pt(ngrid,nlay) ! Temperature 73 REAL pq(ngrid,nlay,nq) ! Tracers mass mixing ratio 74 75 LOGICAL firstcall 61 INTEGER, INTENT(in) :: ngrid 62 INTEGER, INTENT(in) :: nlay 63 INTEGER, INTENT(in) :: nq 64 65 REAL, INTENT(in) :: ptimestep 66 REAL, INTENT(in) :: pplay(ngrid,nlay) ! Layer pressure 67 REAL, INTENT(in) :: pplev(ngrid,nlay+1) ! Level pressure 68 REAL, INTENT(in) :: pphi(ngrid,nlay) ! Geopotential 69 70 REAL, INTENT(in) :: pu(ngrid,nlay) ! Zonal wind 71 REAL, INTENT(in) :: pv(ngrid,nlay) ! Meridional wind 72 REAL, INTENT(in) :: pt(ngrid,nlay) ! Temperature 73 REAL, INTENT(in) :: pq(ngrid,nlay,nq) ! Tracers mass mixing ratio 74 75 LOGICAL, INTENT(in) :: firstcall 76 76 77 77 ! Outputs: 78 78 ! -------- 79 79 80 REAL pduadj(ngrid,nlay) ! u convective variations 81 REAL pdvadj(ngrid,nlay) ! v convective variations 82 REAL pdtadj(ngrid,nlay) ! t convective variations 83 REAL pdqadj(ngrid,nlay,nq) ! q convective variations 84 85 REAL f0(ngrid) ! mass flux norm (after possible time relaxation) 86 REAL fm0(ngrid,nlay+1) ! mass flux (after possible time relaxation) 87 REAL entr0(ngrid,nlay) ! entrainment (after possible time relaxation) 88 REAL detr0(ngrid,nlay) ! detrainment (after possible time relaxation) 80 INTEGER, INTENT(out) :: lmax(ngrid) ! Highest layer reached by the plume 81 INTEGER, INTENT(out) :: lmix(ngrid) ! Layer in which plume vertical speed is maximal 82 INTEGER, INTENT(out) :: lmin(ngrid) ! First unstable layer 83 84 REAL, INTENT(out) :: pduadj(ngrid,nlay) ! u convective variations 85 REAL, INTENT(out) :: pdvadj(ngrid,nlay) ! v convective variations 86 REAL, INTENT(out) :: pdtadj(ngrid,nlay) ! t convective variations 87 REAL, INTENT(out) :: pdqadj(ngrid,nlay,nq) ! q convective variations 88 89 REAL, INTENT(inout) :: f0(ngrid) ! mass flux norm (after possible time relaxation) 90 REAL, INTENT(inout) :: fm0(ngrid,nlay+1) ! mass flux (after possible time relaxation) 91 REAL, INTENT(inout) :: entr0(ngrid,nlay) ! entrainment (after possible time relaxation) 92 REAL, INTENT(inout) :: detr0(ngrid,nlay) ! detrainment (after possible time relaxation) 89 93 90 94 ! Local: … … 92 96 93 97 INTEGER ig, k, l, iq 94 INTEGER lmax(ngrid) ! Highest layer reached by the plume 95 INTEGER lmix(ngrid) ! Layer in which plume vertical speed is maximal 96 INTEGER lmin(ngrid) ! First unstable layer 97 98 REAL zmix(ngrid) ! Altitude of maximal vertical speed 99 REAL zmax(ngrid) ! Maximal altitudes where plumes are active 100 REAL zmin(ngrid) ! Minimal altitudes where plumes are active 101 102 REAL zlay(ngrid,nlay) ! Layers altitudes 103 REAL zlev(ngrid,nlay+1) ! Levels altitudes 104 REAL rho(ngrid,nlay) ! Layers densities 105 REAL rhobarz(ngrid,nlay) ! Levels densities 106 REAL masse(ngrid,nlay) ! Layers masses 107 REAL zpopsk(ngrid,nlay) ! Exner function 108 109 REAL zu(ngrid,nlay) ! u environment 110 REAL zv(ngrid,nlay) ! v environment 111 REAL zt(ngrid,nlay) ! TR environment 112 REAL zqt(ngrid,nlay) ! qt environment 113 REAL zql(ngrid,nlay) ! ql environment 114 REAL zhl(ngrid,nlay) ! TP environment 115 REAL ztv(ngrid,nlay) ! TRPV environment 116 REAL zqs(ngrid,nlay) ! qsat environment 117 118 REAL zua(ngrid,nlay) ! u plume 119 REAL zva(ngrid,nlay) ! v plume 120 REAL zta(ngrid,nlay) ! TR plume 121 REAL zqla(ngrid,nlay) ! qv plume 122 REAL zqta(ngrid,nlay) ! qt plume 123 REAL zhla(ngrid,nlay) ! TP plume 124 REAL ztva(ngrid,nlay) ! TRPV plume 125 REAL zqsa(ngrid,nlay) ! qsat plume 126 127 REAL zqa(ngrid,nlay,nq) ! q plume (ql=0, qv=qt) 128 129 REAL f_star(ngrid,nlay+1) ! Normalized mass flux 130 REAL entr_star(ngrid,nlay) ! Normalized entrainment (E* = e* dz) 131 REAL detr_star(ngrid,nlay) ! Normalized detrainment (D* = d* dz) 132 133 REAL fm(ngrid,nlay+1) ! Mass flux 134 REAL entr(ngrid,nlay) ! Entrainment (E = e dz) 135 REAL detr(ngrid,nlay) ! Detrainment (D = d dz) 136 137 REAL f(ngrid) ! Mass flux norm 138 REAL lambda ! Time relaxation coefficent 139 REAL fraca(ngrid,nlay+1) ! Updraft fraction 140 REAL linter(ngrid) ! Level (continuous) of maximal vertical speed 141 REAL wmax(ngrid) ! Maximal vertical speed 142 REAL zw2(ngrid,nlay+1) ! Plume vertical speed 143 REAL zdthladj(ngrid,nlay) ! Potential temperature variations 144 REAL dummy(ngrid,nlay) ! Dummy argument for thermcell_dq() 98 99 REAL zmix(ngrid) ! Altitude of maximal vertical speed 100 REAL zmax(ngrid) ! Maximal altitudes where plumes are active 101 REAL zmin(ngrid) ! Minimal altitudes where plumes are active 102 103 REAL zlay(ngrid,nlay) ! Layers altitudes 104 REAL zlev(ngrid,nlay+1) ! Levels altitudes 105 REAL rho(ngrid,nlay) ! Layers densities 106 REAL rhobarz(ngrid,nlay) ! Levels densities 107 REAL masse(ngrid,nlay) ! Layers masses 108 REAL zpopsk(ngrid,nlay) ! Exner function 109 110 REAL zu(ngrid,nlay) ! u environment 111 REAL zv(ngrid,nlay) ! v environment 112 REAL zt(ngrid,nlay) ! TR environment 113 REAL zqt(ngrid,nlay) ! qt environment 114 REAL zql(ngrid,nlay) ! ql environment 115 REAL zhl(ngrid,nlay) ! TP environment 116 REAL ztv(ngrid,nlay) ! TRPV environment 117 REAL zqs(ngrid,nlay) ! qsat environment 118 119 REAL zua(ngrid,nlay) ! u plume 120 REAL zva(ngrid,nlay) ! v plume 121 REAL zqla(ngrid,nlay) ! qv plume 122 REAL zqta(ngrid,nlay) ! qt plume 123 REAL zhla(ngrid,nlay) ! TP plume 124 REAL ztva(ngrid,nlay) ! TRPV plume 125 REAL zqsa(ngrid,nlay) ! qsat plume 126 127 REAL zqa(ngrid,nlay,nq) ! q plume (ql=0, qv=qt) 128 129 REAL f_star(ngrid,nlay+1) ! Normalized mass flux 130 REAL entr_star(ngrid,nlay) ! Normalized entrainment (E* = e* dz) 131 REAL detr_star(ngrid,nlay) ! Normalized detrainment (D* = d* dz) 132 133 REAL fm(ngrid,nlay+1) ! Mass flux 134 REAL entr(ngrid,nlay) ! Entrainment (E = e dz) 135 REAL detr(ngrid,nlay) ! Detrainment (D = d dz) 136 137 REAL f(ngrid) ! Mass flux norm 138 REAL lambda ! Time relaxation coefficent 139 REAL fraca(ngrid,nlay+1) ! Updraft fraction 140 REAL wmax(ngrid) ! Maximal vertical speed 141 REAL zw2(ngrid,nlay+1) ! Plume vertical speed 142 REAL zdthladj(ngrid,nlay) ! Potential temperature variations 143 REAL dummy(ngrid,nlay) ! Dummy argument for thermcell_dq() 145 144 146 145 !=============================================================================== … … 154 153 ENDIF 155 154 156 f_star(:,:) = 0. 157 entr_star(:,:) = 0. 158 detr_star(:,:) = 0. 159 160 f(:) = 0. 161 162 fm(:,:) = 0. 163 entr(:,:) = 0. 164 detr(:,:) = 0. 165 166 lmax(:) = 1 167 lmix(:) = 1 168 lmin(:) = 1 155 DO ig=1,ngrid 156 ! AB: Minimal f0 value is set to 0. (instead of 1.e-2 in Earth version) 157 f0(ig) = MAX(f0(ig), 0.) 158 ENDDO 169 159 170 160 pduadj(:,:) = 0.0 … … 173 163 pdqadj(:,:,:) = 0.0 174 164 175 DO ig=1,ngrid 176 ! AB: Careful: Hard-coded value from Earth version! 177 ! f0(ig) = max(f0(ig), 1.e-2) 178 ! AB: No pescribed minimal value for f0 179 f0(ig) = max(f0(ig), 0.) 180 ENDDO 165 zdthladj(:,:) = 0.0 181 166 182 167 !=============================================================================== … … 212 197 rho(:,:) = pplay(:,:) / (zpopsk(:,:) * RD * ztv(:,:)) 213 198 199 rhobarz(:,1) = rho(:,1) 214 200 IF (prt_level.ge.10) THEN 215 201 print *, 'WARNING: density in the first layer is equal to density at the first level!' 216 print *, 'rhobarz(:,1)', rhobarz(:,1) 217 print *, 'rho(:,1) ', rho(:,1) 218 ENDIF 219 220 rhobarz(:,1) = rho(:,1) 202 ENDIF 221 203 222 204 DO l=2,nlay … … 244 226 ! 245 227 ! --------------------------- 246 ! 247 ! ----- F_lmax+1=0 ------zmax 248 ! lmax 249 ! ------F_lmax>0------------- 250 ! 251 ! --------------------------- 252 ! 253 ! --------------------------- 254 ! 255 ! ------------------wmax,zmix 256 ! lmix 257 ! --------------------------- 258 ! 259 ! --------------------------- 260 ! 261 ! --------------------------- 262 ! 228 ! _ 229 ! ----- F_lmax+1=0 ------zmax \ 230 ! lmax | 231 ! ------F_lmax>0------------- | 232 ! | 233 ! --------------------------- | 234 ! | 235 ! --------------------------- | 236 ! | 237 ! ------------------wmax,zmix | 238 ! lmix | 239 ! --------------------------- | 240 ! | 241 ! --------------------------- | 242 ! | E, D 243 ! --------------------------- | 244 ! | 263 245 ! --------------------------- rhobarz, f_star, fm, fm0, zw2, fraca 264 ! zt, zu, zv, zo, rho 265 ! --------------------------- 266 ! 267 ! --------------------------- 268 ! 269 ! --------------------------- 270 ! 271 ! ------F_lmin+1>0----------- 272 ! lmin 273 ! ----- F_lmin=0 ------------ 246 ! zt, zu, zv, zo, rho | 247 ! --------------------------- | 248 ! | 249 ! --------------------------- | 250 ! | 251 ! --------------------------- | 252 ! | 253 ! ------F_lmin+1>0----------- | 254 ! lmin | 255 ! ----- F_lmin=0 ------------ _/ 274 256 ! 275 257 ! --------------------------- … … 309 291 !------------------------------------------------------------------------------- 310 292 311 CALL thermcell_plume(ngrid,nlay,nq,ptimestep, ztv,&312 & z hl,zqt,zql,rhobarz,zlev,pplev,pphi,zpopsk,&293 CALL thermcell_plume(ngrid,nlay,nq,ptimestep, & 294 & ztv,zhl,zqt,zql,zlev,pplev,zpopsk, & 313 295 & detr_star,entr_star,f_star, & 314 & ztva,zhla,zq la,zqta,zta,zqsa,&315 & zw2,lmi x,lmin)296 & ztva,zhla,zqta,zqla,zqsa, & 297 & zw2,lmin) 316 298 317 299 !------------------------------------------------------------------------------- … … 320 302 321 303 ! AB: Careful, zw2 became its square root in thermcell_height! 322 CALL thermcell_height(ngrid,nlay,lmin,l inter,lmix,lmax,zw2,&323 & z lev,zmin,zmix,zmax,wmax,f_star)304 CALL thermcell_height(ngrid,nlay,lmin,lmix,lmax,zlev, & 305 & zmin,zmix,zmax,zw2,wmax,f_star) 324 306 325 307 !=============================================================================== … … 341 323 ENDIF 342 324 343 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 344 ! Test valable seulement en 1D mais pas genant 345 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 325 ! FH: Test valable seulement en 1D mais pas genant 346 326 IF (.not. (f0(1).ge.0.) ) THEN 347 327 print *, 'ERROR: mass flux norm is not positive!' … … 403 383 404 384 CALL thermcell_dq(ngrid,nlay,ptimestep,fm0,entr0,detr0,masse, & 405 & zhl,zdthladj,dummy,lmin )385 & zhl,zdthladj,dummy,lmin,lmax) 406 386 407 387 DO l=1,nlay … … 417 397 DO iq=1,nq 418 398 CALL thermcell_dq(ngrid,nlay,ptimestep,fm0,entr0,detr0,masse, & 419 & pq(:,:,iq),pdqadj(:,:,iq),zqa(:,:,iq),lmin )399 & pq(:,:,iq),pdqadj(:,:,iq),zqa(:,:,iq),lmin,lmax) 420 400 ENDDO 421 401 … … 429 409 ELSE 430 410 CALL thermcell_dq(ngrid,nlay,ptimestep,fm0,entr0,detr0,masse, & 431 & zu,pduadj,zua,lmin )411 & zu,pduadj,zua,lmin,lmax) 432 412 CALL thermcell_dq(ngrid,nlay,ptimestep,fm0,entr0,detr0,masse, & 433 & zv,pdvadj,zva,lmin )413 & zv,pdvadj,zva,lmin,lmax) 434 414 ENDIF 435 415
Note: See TracChangeset
for help on using the changeset viewer.