Changeset 3236 for trunk/LMDZ.GENERIC
- Timestamp:
- Feb 26, 2024, 4:22:34 PM (10 months ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/changelog.txt
r3235 r3236 1865 1865 of a mix of gases is calculated according to Mason & Saxena (1958) semi-empirical 1866 1866 formulation. 1867 1868 == 26/02/2024 == GM 1869 Add virtual correction for convective adjustment and turbulent diffusion 1870 (turbdiff and vdifc) + correction of allocated tables in physiq_mod for varspec. -
trunk/LMDZ.GENERIC/libf/phystd/callkeys_mod.F90
r3235 r3236 48 48 logical,save :: generic_condensation 49 49 logical,save :: generic_rain 50 !$OMP THREADPRIVATE(varactive,varfixed,sedimentation,generic_condensation,generic_rain) 50 logical,save :: virtual_correction 51 !$OMP THREADPRIVATE(varactive,varfixed,sedimentation,generic_condensation,generic_rain,virtual_correction) 51 52 logical,save :: water ,watercond, waterrain, moistadjustment 52 53 !$OMP THREADPRIVATE(water, watercond, waterrain, moistadjustment) -
trunk/LMDZ.GENERIC/libf/phystd/convadj.F
r2482 r3236 7 7 USE tracer_h 8 8 use comcstfi_mod, only: g 9 use callkeys_mod, only: tracer,water 9 use generic_cloud_common_h 10 use generic_tracer_index_mod, only: generic_tracer_index 11 use callkeys_mod, only: tracer,water,generic_condensation, 12 & virtual_correction 10 13 11 14 implicit none … … 55 58 REAL sig(nlay+1),sdsig(nlay),dsig(nlay) 56 59 REAL zu(ngrid,nlay),zv(ngrid,nlay) 57 REAL zh(ngrid,nlay) 60 REAL zh(ngrid,nlay), zvh(ngrid,nlay) 58 61 REAL zu2(ngrid,nlay),zv2(ngrid,nlay) 59 REAL zh2(ngrid,nlay), 62 REAL zh2(ngrid,nlay),zvh2(ngrid,nlay),zhc(ngrid,nlay) 60 63 REAL zhm,zsm,zdsm,zum,zvm,zalpha,zhmc 61 64 … … 64 67 REAL zq(ngrid,nlay,nq), zq2(ngrid,nlay,nq) 65 68 REAL zqm(nq),zqco2m 69 70 integer igcm_generic_vap, igcm_generic_ice 71 logical call_ice_vap_generic 66 72 67 73 LOGICAL vtest(ngrid),down … … 75 81 ! Initialisation 76 82 ! -------------- 77 78 DO l=1,nlay 79 DO ig=1,ngrid 80 zh(ig,l)=ph(ig,l)+pdhfi(ig,l)*ptimestep 81 zu(ig,l)=pu(ig,l)+pdufi(ig,l)*ptimestep 82 zv(ig,l)=pv(ig,l)+pdvfi(ig,l)*ptimestep 83 ENDDO 84 ENDDO 83 zh(:,:)=ph(:,:)+pdhfi(:,:)*ptimestep 84 zu(:,:)=pu(:,:)+pdufi(:,:)*ptimestep 85 zv(:,:)=pv(:,:)+pdvfi(:,:)*ptimestep 85 86 86 87 if(tracer) then 87 DO iq =1, nq 88 DO l=1,nlay 89 DO ig=1,ngrid 90 zq(ig,l,iq)=pq(ig,l,iq)+pdqfi(ig,l,iq)*ptimestep 91 ENDDO 92 ENDDO 93 ENDDO 88 zq(:,:,:)=pq(:,:,:)+pdqfi(:,:,:)*ptimestep 89 !zq(:,:,:)=0 94 90 end if 95 91 … … 99 95 CALL scopy(ngrid*nlay*nq,zq,1,zq2,1) 100 96 97 101 98 ! ----------------------------- 102 99 ! Detection of unstable columns … … 108 105 ENDDO 109 106 110 CALL scopy(ngrid*nlay,zh2,1,zhc,1) 107 if((generic_condensation) .and. (virtual_correction)) THEN 108 DO iq=1,nq 109 call generic_tracer_index(nq,iq,igcm_generic_vap, 110 & igcm_generic_ice,call_ice_vap_generic) 111 if(call_ice_vap_generic) then 112 zvh(:,:)=zh(:,:)* 113 & (1.+zq(:,:,igcm_generic_vap)/epsi_generic)/ 114 & (1.+zq(:,:,igcm_generic_vap)) 115 endif 116 ENDDO 117 CALL scopy(ngrid*nlay,zvh,1,zvh2,1) 118 CALL scopy(ngrid*nlay,zvh2,1,zhc,1) 119 else 120 CALL scopy(ngrid*nlay,zh2,1,zhc,1) 121 endif 111 122 112 123 ! Find out which grid points are convectively unstable … … 169 180 zdsm = zdsm + dsig(l) 170 181 zhm = zhm + sdsig(l) * (zh2(i, l) - zhm) / zsm 171 zhmc = zhm 182 183 if (generic_condensation .and. virtual_correction) then 184 zhmc = zhm* 185 & (1.+zq(i,l,igcm_generic_vap)/epsi_generic)/ 186 & (1.+zq(i,l,igcm_generic_vap)) 187 else 188 zhmc = zhm 189 endif 172 190 173 191 ! do we have to extend the column downwards? … … 327 345 ENDDO 328 346 329 DO l=1,nlay 330 DO ig=1,ngrid 331 pdhadj(ig,l)=(zh2(ig,l)-zh(ig,l))/ptimestep 332 pduadj(ig,l)=(zu2(ig,l)-zu(ig,l))/ptimestep 333 pdvadj(ig,l)=(zv2(ig,l)-zv(ig,l))/ptimestep 334 ENDDO 335 ENDDO 347 pdhadj(:,:)=(zh2(:,:)-zh(:,:))/ptimestep 348 pduadj(:,:)=(zu2(:,:)-zu(:,:))/ptimestep 349 pdvadj(:,:)=(zv2(:,:)-zv(:,:))/ptimestep 336 350 337 351 if(tracer) then 338 do iq=1, nq 339 do l=1,nlay 340 DO ig=1,ngrid 341 pdqadj(ig,l,iq)=(zq2(ig,l,iq)-zq(ig,l,iq))/ptimestep 342 end do 343 end do 344 end do 352 pdqadj(:,:,:)=(zq2(:,:,:)-zq(:,:,:))/ptimestep 345 353 end if 346 354 -
trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90
r3235 r3236 1024 1024 call getin_p("generic_rain",generic_rain) 1025 1025 if (is_master) write(*,*)trim(rname)//": generic_rain = ",generic_rain 1026 1027 if (is_master) write(*,*)trim(rname)//": Virtual correction ?" 1028 virtual_correction=.false. !default value 1029 call getin_p("virtual_correction",virtual_correction) 1030 if (is_master) write(*,*)trim(rname)//": virtual_correction = ",virtual_correction 1026 1031 1027 1032 if (is_master) write(*,*)trim(rname)//": Compute water cycle ?" -
trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
r3235 r3236 551 551 endif 552 552 close(33) 553 else 554 IF (.NOT.ALLOCATED(p_var)) ALLOCATE(p_var(nlayer)) 555 IF (.NOT.ALLOCATED(mu_var)) ALLOCATE(mu_var(nlayer)) 556 IF (.NOT.ALLOCATED(frac_var)) ALLOCATE(frac_var(nlayer,ngasmx)) 553 557 endif 554 558 -
trunk/LMDZ.GENERIC/libf/phystd/turbdiff_mod.F90
r2482 r3236 247 247 ! ------------------------------------------------------ 248 248 249 call vdif_kc(ngrid,nlay, ptimestep,g,pzlev,pzlay,pu,pv,zh,zcdv_true,pq2,zkv,zkh) !JL12 why not call vdif_kc with updated winds and temperature249 call vdif_kc(ngrid,nlay,nq,ptimestep,g,pzlev,pzlay,pu,pv,pq,zh,zcdv_true,pq2,zkv,zkh) !JL12 why not call vdif_kc with updated winds and temperature 250 250 251 251 ! Adding eddy mixing to mimic 3D general circulation in 1D -
trunk/LMDZ.GENERIC/libf/phystd/vdif_kc.F
r1529 r3236 1 SUBROUTINE vdif_kc(ngrid,nlay,dt,g,zlev,zlay,u,v,teta,cd,q2,km,kn) 1 SUBROUTINE vdif_kc(ngrid,nlay,nq,dt,g,zlev,zlay,u,v, 2 & zq,teta,cd,q2,km,kn) 3 use generic_cloud_common_h, only: epsi_generic 4 use generic_tracer_index_mod, only: generic_tracer_index 5 use callkeys_mod, only: generic_condensation, virtual_correction 2 6 IMPLICIT NONE 3 7 c....................................................................... … … 26 30 INTEGER,INTENT(IN) :: ngrid 27 31 INTEGER,INTENT(IN) :: nlay 32 INTEGER,INTENT(IN) :: nq 28 33 REAL,INTENT(IN) :: dt,g 29 34 REAL,INTENT(IN) :: zlev(ngrid,nlay+1) … … 31 36 REAL,INTENT(IN) :: u(ngrid,nlay) 32 37 REAL,INTENT(IN) :: v(ngrid,nlay) 38 REAL,INTENT(IN) :: zq(ngrid,nlay,nq) 33 39 REAL,INTENT(IN) :: teta(ngrid,nlay) 34 40 REAL,INTENT(IN) :: cd(ngrid) … … 52 58 REAL unsdzdec(ngrid,nlay+1) 53 59 REAL q(ngrid,nlay+1) 60 REAL tetav(ngrid,nlay) 61 integer iq,igcm_generic_vap, igcm_generic_ice 62 logical call_ice_vap_generic 54 63 c....................................................................... 55 64 c … … 250 259 mpre(igrid,1)=m(igrid,1) 251 260 ENDDO 261 262 c 263 c....................................................................... 264 c Virtual correction 265 c....................................................................... 266 c 267 268 if((generic_condensation) .and. (virtual_correction)) THEN 269 DO ilev=1,nlay 270 DO igrid=1,ngrid 271 DO iq=1,nq 272 call generic_tracer_index(nq,iq,igcm_generic_vap, 273 & igcm_generic_ice,call_ice_vap_generic) 274 if(call_ice_vap_generic) then 275 tetav(igrid,ilev) = teta(igrid,ilev)* 276 & (1.+zq(igrid,ilev,igcm_generic_vap)/epsi_generic)/ 277 & (1.+zq(igrid,ilev,igcm_generic_vap)) 278 endif 279 ENDDO 280 ENDDO 281 ENDDO 282 endif 283 252 284 c 253 285 c----------------------------------------------------------------------- … … 256 288 c----------------------------------------------------------------------- 257 289 c 290 if((generic_condensation) .and. (virtual_correction)) THEN 258 291 n2(igrid,ilev)=g*unsdzdec(igrid,ilev) 259 & *(teta(igrid,ilev)-teta(igrid,ilev-1)) 260 & /(teta(igrid,ilev)+teta(igrid,ilev-1)) *2.E+0 292 & *(tetav(igrid,ilev)-tetav(igrid,ilev-1)) 293 & /(tetav(igrid,ilev)+tetav(igrid,ilev-1))*2.E+0 294 else 295 n2(igrid,ilev)=g*unsdzdec(igrid,ilev) 296 & *(teta(igrid,ilev)-teta(igrid,ilev-1)) 297 & /(teta(igrid,ilev)+teta(igrid,ilev-1)) *2.E+0 298 endif 261 299 c 262 300 c ---> -
trunk/LMDZ.GENERIC/libf/phystd/vdifc_mod.F
r2427 r3236 246 246 ! ------------------------------------------------------ 247 247 248 call vdif_kc(ngrid,nlay, ptimestep,g,pzlev,pzlay249 & ,pu,pv,p h,zcdv_true248 call vdif_kc(ngrid,nlay,nq,ptimestep,g,pzlev,pzlay 249 & ,pu,pv,pq,ph,zcdv_true 250 250 & ,pq2,zkv,zkh) 251 251
Note: See TracChangeset
for help on using the changeset viewer.