Changeset 2871 for trunk/LMDZ.GENERIC
- Timestamp:
- Jan 16, 2023, 4:47:11 PM (23 months ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/callkeys_mod.F90
r2831 r2871 42 42 logical,save :: generic_rain 43 43 !$OMP THREADPRIVATE(varactive,varfixed,radfixed,sedimentation,generic_condensation,generic_rain) 44 logical,save :: water ,watercond,waterrain45 !$OMP THREADPRIVATE(water, watercond,waterrain)46 logical,save :: aeroco2, aeroh2o,aeroh2so4,aeroback2lay47 !$OMP THREADPRIVATE(aeroco2, aeroh2o,aeroh2so4,aeroback2lay)44 logical,save :: water ,watercond, waterrain, moistadjustment 45 !$OMP THREADPRIVATE(water, watercond, waterrain, moistadjustment) 46 logical,save :: aeroco2, aeroh2o, aeroh2so4, aeroback2lay 47 !$OMP THREADPRIVATE(aeroco2, aeroh2o, aeroh2so4, aeroback2lay) 48 48 logical,save :: aeronh3, aeronlay, aeroaurora 49 49 !$OMP THREADPRIVATE(aeronh3,aeronlay,aeroaurora) … … 52 52 !$OMP THREADPRIVATE(aerovenus) 53 53 ! detailed sub-options when with "Venus-like" aerosol additions 54 logical,save :: aerovenus1, aerovenus2,aerovenus2p,aerovenus3,aerovenusUV55 !$OMP THREADPRIVATE(aerovenus1, aerovenus2,aerovenus2p,aerovenus3,aerovenusUV)54 logical,save :: aerovenus1, aerovenus2, aerovenus2p, aerovenus3, aerovenusUV 55 !$OMP THREADPRIVATE(aerovenus1, aerovenus2, aerovenus2p, aerovenus3, aerovenusUV) 56 56 57 logical,save :: aerofixco2, aerofixh2o58 !$OMP THREADPRIVATE(aerofixco2, aerofixh2o)57 logical,save :: aerofixco2, aerofixh2o 58 !$OMP THREADPRIVATE(aerofixco2, aerofixh2o) 59 59 integer,save :: aerogeneric ! number of aerosols of "generic" kind 60 60 !$OMP THREADPRIVATE(aerogeneric) -
trunk/LMDZ.GENERIC/libf/phystd/largescale.F90
r2073 r2871 40 40 ! Options du programme 41 41 REAL, SAVE :: ratqs ! determine largeur de la distribution de vapeur 42 !$OMP THREADPRIVATE(ratqs) 42 REAL, SAVE :: qvap_deep ! deep mixing ratio of water vapor when simulating bottom less planets 43 !$OMP THREADPRIVATE(ratqs, qvap_deep) 43 44 44 45 ! Variables locales … … 72 73 call getin_p("ratqs",ratqs) 73 74 write(*,*) " ratqs = ",ratqs 75 76 write(*,*) "Deep water vapor mixing ratio ? (no effect if negative) " 77 qvap_deep=-1. ! default value 78 call getin_p("qvap_deep",qvap_deep) 79 write(*,*) " qvap_deep = ",qvap_deep 74 80 75 81 firstcall = .false. … … 181 187 182 188 Enddo ! k= nlayer, 1, -1 183 189 190 if (qvap_deep >= 0.) then 191 !brings lower vapor ratio to a fixed value. 192 ! tau=3600. seems too fast 193 pdqvaplsc(1:ngrid,1) = (qvap_deep - pq(1:ngrid,1,igcm_h2o_vap))/14400. - pdq(1:ngrid,1,igcm_h2o_vap) 194 endif 195 184 196 185 197 end -
trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
r2867 r2871 61 61 startphy_file, testradtimes, tlocked, & 62 62 tracer, UseTurbDiff, water, watercond, & 63 waterrain, generic_rain, global1d, szangle63 waterrain, generic_rain, global1d, moistadjustment, szangle 64 64 use generic_tracer_index_mod, only: generic_tracer_index 65 65 use nonoro_gwd_ran_mod, only: nonoro_gwd_ran … … 85 85 comm_FLUXTOP_LW,comm_FLUXSURF_SW, & 86 86 comm_FLUXSURF_LW,comm_FLXGRD, & 87 comm_DTRAIN,comm_DTLSC,comm_H2OICE_REFF 87 comm_DTRAIN,comm_DTLSC,comm_H2OICE_REFF, & 88 comm_LATENT_HF 89 88 90 #endif 89 91 … … 1425 1427 if(watercond.and.(RLVTT.gt.1.e-8))then 1426 1428 1427 if ( .not.calltherm) then1429 if ((.not.calltherm).and.moistadjustment) then 1428 1430 dqmoist(1:ngrid,1:nlayer,1:nq)=0. 1429 1431 dtmoist(1:ngrid,1:nlayer)=0. … … 1506 1508 zdqssnow(1:ngrid) = 0.0 1507 1509 1508 call rain(ngrid,nlayer,nq,ptimestep,pplev,pplay,p t,pdt,pq,pdq, &1510 call rain(ngrid,nlayer,nq,ptimestep,pplev,pplay,pphi,pt,pdt,pq,pdq, & 1509 1511 zdtrain,zdqrain,zdqsrain,zdqssnow,reevap_precip,cloudfrac) 1510 1512 … … 2448 2450 2449 2451 call writediagfi(ngrid,"lscaledE","heat from largescale","W m-2",2,lscaledE) 2450 call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE) 2452 if ((.not.calltherm).and.moistadjustment) then 2453 call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE) 2454 endif 2451 2455 call writediagfi(ngrid,"qsatatm","atm qsat"," ",3,qsat) 2452 2456 … … 2571 2575 comm_HR_SW(1:ngrid,1:nlayer) = zdtsw(1:ngrid,1:nlayer) 2572 2576 comm_HR_LW(1:ngrid,1:nlayer) = zdtlw(1:ngrid,1:nlayer) 2577 comm_ALBEQ(1:ngrid)=albedo_equivalent(1:ngrid) 2578 if (.not.calldifv) comm_LATENT_HF(:)=0.0 2573 2579 if ((tracer).and.(water)) then 2574 2580 comm_CLOUDFRAC(1:ngrid,1:nlayer)=cloudfrac(1:ngrid,1:nlayer) … … 2576 2582 comm_SURFRAIN(1:ngrid)=zdqsrain(1:ngrid) 2577 2583 comm_DQVAP(1:ngrid,1:nlayer)=pdq(1:ngrid,1:nlayer,igcm_h2o_vap) 2578 comm_ ALBEQ(1:ngrid)=albedo_equivalent(1:ngrid)2584 comm_DQICE(1:ngrid,1:nlayer)=pdq(1:ngrid,1:nlayer,igcm_h2o_ice) 2579 2585 comm_H2OICE_REFF(1:ngrid,1:nlayer)=reffrad(1:ngrid,1:nlayer,iaero_h2o) 2580 2586 comm_REEVAP(1:ngrid)=reevap_precip(1:ngrid) … … 2582 2588 comm_DTLSC(1:ngrid,1:nlayer)=dtlscale(1:ngrid,1:nlayer) 2583 2589 comm_RH(1:ngrid,1:nlayer)=RH(1:ngrid,1:nlayer) 2590 else 2591 comm_CLOUDFRAC(1:ngrid,1:nlayer)=0. 2592 comm_TOTCLOUDFRAC(1:ngrid)=0. 2593 comm_SURFRAIN(1:ngrid)=0. 2594 comm_DQVAP(1:ngrid,1:nlayer)=0. 2595 comm_DQICE(1:ngrid,1:nlayer)=0. 2596 comm_H2OICE_REFF(1:ngrid,1:nlayer)=0. 2597 comm_REEVAP(1:ngrid)=0. 2598 comm_DTRAIN(1:ngrid,1:nlayer)=0. 2599 comm_DTLSC(1:ngrid,1:nlayer)=0. 2600 comm_RH(1:ngrid,1:nlayer)=0. 2584 2601 endif 2585 !comm_DQICE(1:ngrid,1:nlayer)=zdqdyn(1:ngrid,1:nlayer)2586 2602 comm_FLUXTOP_DN(1:ngrid)=fluxtop_dn(1:ngrid) 2587 2603 comm_FLUXABS_SW(1:ngrid)=fluxabs_sw(1:ngrid) -
trunk/LMDZ.GENERIC/libf/phystd/rain.F90
r1995 r2871 1 subroutine rain(ngrid,nlayer,nq,ptimestep,pplev,pplay, t,pdt,pq,pdq,d_t,dqrain,dqsrain,dqssnow,reevap_precip,rneb)1 subroutine rain(ngrid,nlayer,nq,ptimestep,pplev,pplay,pphi,t,pdt,pq,pdq,d_t,dqrain,dqsrain,dqssnow,reevap_precip,rneb) 2 2 3 3 … … 30 30 real,intent(in) :: pplev(ngrid,nlayer+1) ! inter-layer pressure (Pa) 31 31 real,intent(in) :: pplay(ngrid,nlayer) ! mid-layer pressure (Pa) 32 real,intent(in) :: pphi(ngrid,nlayer) ! mid-layer geopotential 32 33 real,intent(in) :: t(ngrid,nlayer) ! input temperature (K) 33 34 real,intent(in) :: pdt(ngrid,nlayer) ! input tendency on temperature (K/s) … … 74 75 INTEGER i, k, n 75 76 REAL zqs(ngrid,nlayer),Tsat(ngrid,nlayer), zdelta, zcor 76 REAL zrfl(ngrid), zrfln(ngrid), zqev, zqevt77 REAL precip_rate(ngrid), precip_rate_tmp(ngrid), zqev, zqevt 77 78 78 79 REAL zoliq(ngrid) … … 85 86 real tnext(ngrid,nlayer) 86 87 87 real l2c(ngrid,nlayer)88 real dmass(ngrid,nlayer) 88 89 real dWtot 89 90 … … 177 178 d_q(1:ngrid,1:nlayer) = 0.0 178 179 d_ql(1:ngrid,1:nlayer) = 0.0 179 zrfl(1:ngrid) = 0.0180 zrfln(1:ngrid) = 0.0180 precip_rate(1:ngrid) = 0.0 181 precip_rate_tmp(1:ngrid) = 0.0 181 182 182 183 ! calculate saturation mixing ratio … … 192 193 DO k = 1, nlayer 193 194 DO i = 1, ngrid 194 l2c(i,k)=(pplev(i,k)-pplev(i,k+1))/g195 dmass(i,k)=(pplev(i,k)-pplev(i,k+1))/g 195 196 ENDDO 196 197 ENDDO … … 203 204 IF (evap_prec) THEN ! note no rneb dependence! 204 205 DO i = 1, ngrid 205 IF ( zrfl(i) .GT.0.) THEN206 IF (precip_rate(i) .GT.0.) THEN 206 207 207 208 if(zt(i,k).gt.Tsat(i,k))then 208 !! 209 zqev=MIN((zt(i,k)-Tsat(i,k))*RCPD*l2c(i,k)/RLVTT/ptimestep,zrfl(i))210 zrfl(i)=MAX(zrfl(i)-zqev,0.)211 d_q(i,k)=zqev/l2c(i,k)*ptimestep212 213 214 zqev = MAX (0.0, (zqs(i,k)-q(i,k)))* l2c(i,k)/ptimestep !there was a bug here209 !! treat the case where all liquid water should boil 210 zqev=MIN((zt(i,k)-Tsat(i,k))*RCPD*dmass(i,k)/RLVTT/ptimestep,precip_rate(i)) 211 precip_rate(i)=MAX(precip_rate(i)-zqev,0.) 212 d_q(i,k)=zqev/dmass(i,k)*ptimestep 213 d_t(i,k) = - d_q(i,k) * RLVTT/RCPD 214 else 215 zqev = MAX (0.0, (zqs(i,k)-q(i,k)))*dmass(i,k)/ptimestep !there was a bug here 215 216 zqevt= 2.0e-5*(1.0-q(i,k)/zqs(i,k)) & !default was 2.e-5 216 *sqrt( zrfl(i))*l2c(i,k)/pplay(i,k)*zt(i,k)*R ! BC modif here217 *sqrt(precip_rate(i))*dmass(i,k)/pplay(i,k)*zt(i,k)*R ! BC modif here 217 218 zqevt = MAX (zqevt, 0.0) 218 219 zqev = MIN (zqev, zqevt) 219 220 zqev = MAX (zqev, 0.0) 220 zrfln(i)= zrfl(i) - zqev221 zrfln(i)= max(zrfln(i),0.0)222 223 d_q(i,k) = - ( zrfln(i)-zrfl(i))/l2c(i,k)*ptimestep221 precip_rate_tmp(i)= precip_rate(i) - zqev 222 precip_rate_tmp(i)= max(precip_rate_tmp(i),0.0) 223 224 d_q(i,k) = - (precip_rate_tmp(i)-precip_rate(i))/dmass(i,k)*ptimestep 224 225 !d_t(i,k) = d_q(i,k) * RLVTT/RCPD!/(1.0+RVTMP2*q(i,k)) ! double BC modif here 225 226 d_t(i,k) = - d_q(i,k) * RLVTT/RCPD ! was bugged! 226 zrfl(i) = zrfln(i) 227 end if 228 229 230 ENDIF ! of IF (zrfl(i) .GT.0.) 227 precip_rate(i) = precip_rate_tmp(i) 228 end if 229 #ifdef MESOSCALE 230 d_t(i,k) = d_t(i,k)+(pphi(i,k+1)-pphi(i,k))*precip_rate(i)*ptimestep/(RCPD*dmass(i,k)) 231 ! JL22. Accounts for gravitational energy of falling precipitations (probably not to be used in the GCM 232 ! where the counterpart is not included in the dynamics.) 233 #endif 234 235 ENDIF ! of IF (precip_rate(i) .GT.0.) 231 236 ENDDO 232 237 ENDIF ! of IF (evap_prec) … … 253 258 IF ((ql(i,k)/zneb(i)).gt.lconvert)THEN ! precipitate! 254 259 d_ql(i,k) = -MAX((ql(i,k)-lconvert*zneb(i)),0.0) 255 zrfl(i) = zrfl(i) - d_ql(i,k)*l2c(i,k)/ptimestep260 precip_rate(i) = precip_rate(i) - d_ql(i,k)*dmass(i,k)/ptimestep 256 261 ENDIF 257 262 ENDIF … … 350 355 IF (rneb(i,k).GT.0.0) THEN 351 356 d_ql(i,k) = (zoliq(i) - ql(i,k))!/ptimestep 352 zrfl(i) = zrfl(i)+ MAX(ql(i,k)-zoliq(i),0.0)*l2c(i,k)/ptimestep357 precip_rate(i) = precip_rate(i)+ MAX(ql(i,k)-zoliq(i),0.0)*dmass(i,k)/ptimestep 353 358 ENDIF 354 359 ENDDO … … 361 366 ! Rain or snow on the ground 362 367 DO i = 1, ngrid 363 if( zrfl(i).lt.0.0)then368 if(precip_rate(i).lt.0.0)then 364 369 print*,'Droplets of negative rain are falling...' 365 370 call abort 366 371 endif 367 372 IF (t(i,1) .LT. T_h2O_ice_liq) THEN 368 dqssnow(i) = zrfl(i)373 dqssnow(i) = precip_rate(i) 369 374 dqsrain(i) = 0.0 370 375 ELSE 371 376 dqssnow(i) = 0.0 372 dqsrain(i) = zrfl(i) ! liquid water = ice for now377 dqsrain(i) = precip_rate(i) ! liquid water = ice for now 373 378 ENDIF 374 379 ENDDO … … 381 386 reevap_precip(i)=0. 382 387 do k=1,nlayer 383 reevap_precip(i)=reevap_precip(i)+dqrain(i,k,i_vap)* l2c(i,k)388 reevap_precip(i)=reevap_precip(i)+dqrain(i,k,i_vap)*dmass(i,k) 384 389 enddo 385 390 enddo
Note: See TracChangeset
for help on using the changeset viewer.