Changeset 3157 for trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
- Timestamp:
- Dec 12, 2023, 10:45:40 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/physiq_mod.F
r3152 r3157 343 343 REAL zzlay(ngrid,nlayer) ! altitude at the middle of the layers 344 344 REAL zzlev(ngrid,nlayer+1) ! altitude at layer boundaries 345 REAL gz(ngrid,nlayer) ! variation of g with altitude from aeroid surface 345 346 ! REAL latvl1,lonvl1 ! Viking Lander 1 point (for diagnostic) 346 347 … … 393 394 INTEGER length 394 395 PARAMETER (length=100) 396 REAL tlaymean ! temporary value of mean layer temperature for zzlay 397 395 398 396 399 c Variables for the total dust for diagnostics … … 836 839 dwatercap(:,:)=0 837 840 841 842 838 843 call compute_meshgridavg(ngrid,nq,albedo,emis,tsurf,qsurf, 839 844 & albedo_meshavg,emis_meshavg,tsurf_meshavg,qsurf_meshavg) … … 869 874 ps(:) = pplev(:,1) 870 875 876 877 #ifndef MESOSCALE 878 c----------------------------------------------------------------------- 879 c 1.2.1 Compute mean mass, cp, and R 880 c concentrations outputs rnew(ngrid,nlayer), cpnew(ngrid,nlayer) 881 c , mmean(ngrid,nlayer) and Akknew(ngrid,nlayer) 882 c -------------------------------- 883 884 if(photochem.or.callthermos) then 885 call concentrations(ngrid,nlayer,nq, 886 & zplay,pt,pdt,pq,pdq,ptimestep) 887 endif 888 #endif 889 871 890 c Compute geopotential at interlayers 872 891 c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 873 892 c ponderation des altitudes au niveau des couches en dp/p 874 875 DO l=1,nlayer 876 DO ig=1,ngrid 877 zzlay(ig,l)=pphi(ig,l)/g 878 ENDDO 893 cc ------------------------------------------ 894 !Calculation zzlev & zzlay for first layer 895 DO ig=1,ngrid 896 zzlay(ig,1)=-(log(pplay(ig,1)/ps(ig)))*rnew(ig,1)*pt(ig,1)/g 897 zzlev(ig,1)=0 898 zzlev(ig,nlayer+1)=1.e7 ! dummy top of last layer above 10000 km... 899 gz(ig,1)=g 900 901 DO l=2,nlayer 902 ! compute "mean" temperature of the layer 903 if(pt(ig,l) .eq. pt(ig,l-1)) then 904 tlaymean=pt(ig,l) 905 else 906 tlaymean=(pt(ig,l)- pt(ig,l-1))/log(pt(ig,l)/pt(ig,l-1)) 907 endif 908 909 ! compute gravitational acceleration (at altitude zaeroid(nlayer-1)) 910 gz(ig,l)=g*(rad**2)/(rad+zzlay(ig,l-1)+(phisfi(ig)/g))**2 911 912 zzlay(ig,l)=zzlay(ig,l-1)- 913 & (log(pplay(ig,l)/pplay(ig,l-1))*rnew(ig,l)*tlaymean/gz(ig,l)) 914 915 z1=(zplay(ig,l-1)+zplev(ig,l))/(zplay(ig,l-1)-zplev(ig,l)) 916 z2=(zplev(ig,l)+zplay(ig,l))/(zplev(ig,l)-zplay(ig,l)) 917 zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2) 918 ENDDO 879 919 ENDDO 880 DO ig=1,ngrid881 zzlev(ig,1)=0.882 zzlev(ig,nlayer+1)=1.e7 ! dummy top of last layer above 10000 km...883 ENDDO884 DO l=2,nlayer885 DO ig=1,ngrid886 z1=(zplay(ig,l-1)+zplev(ig,l))/(zplay(ig,l-1)-zplev(ig,l))887 z2=(zplev(ig,l)+zplay(ig,l))/(zplev(ig,l)-zplay(ig,l))888 zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2)889 ENDDO890 ENDDO891 892 920 893 921 ! Potential temperature calculation not the same in physiq and dynamic … … 902 930 ENDDO 903 931 904 #ifndef MESOSCALE905 c-----------------------------------------------------------------------906 c 1.2.5 Compute mean mass, cp, and R907 c --------------------------------908 909 if(photochem.or.callthermos) then910 call concentrations(ngrid,nlayer,nq,911 & zplay,pt,pdt,pq,pdq,ptimestep)912 endif913 #endif914 932 915 933 ! Compute vertical velocity (m/s) from vertical mass flux … … 1349 1367 & pdqrds,wspeed,dsodust,dsords,dsotop, 1350 1368 & tau_pref_scenario,tau_pref_gcm) 1351 1369 1352 1370 c update the tendencies of both dust after vertical transport 1353 1371 DO l=1,nlayer … … 1609 1627 $ pdu_th,pdv_th,pdt_th,pdq_th,lmax_th,zmax_th, 1610 1628 $ dtke_th,zdhdif,hfmax_th,wstar,sensibFlux) 1611 1629 1612 1630 DO l=1,nlayer 1613 1631 DO ig=1,ngrid … … 2061 2079 & tau,tauscaling) 2062 2080 2081 2063 2082 c Flux at the surface of co2 ice computed in co2cloud microtimestep 2064 2083 IF (rdstorm) THEN … … 2282 2301 ENDDO 2283 2302 zplev(:,nlayer+1) = 0. 2284 ! update layers altitude 2285 DO l=2,nlayer 2286 DO ig=1,ngrid 2287 z1=(zplay(ig,l-1)+zplev(ig,l))/(zplay(ig,l-1)-zplev(ig,l)) 2288 z2=(zplev(ig,l)+zplay(ig,l))/(zplev(ig,l)-zplay(ig,l)) 2289 zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2) 2303 2304 ! Calculation of zzlay and zzlay with udpated pressure and temperature 2305 DO ig=1,ngrid 2306 zzlay(ig,1)=-(log(zplay(ig,1)/ps(ig)))*rnew(ig,1)* 2307 & (pt(ig,1)+pdt(ig,1)*ptimestep) /g 2308 2309 DO l=2,nlayer 2310 2311 ! compute "mean" temperature of the layer 2312 if((pt(ig,l)+pdt(ig,l)*ptimestep) .eq. 2313 & (pt(ig,l-1)+pdt(ig,l-1)*ptimestep)) then 2314 tlaymean= pt(ig,l)+pdt(ig,l)*ptimestep 2315 else 2316 tlaymean=((pt(ig,l)+pdt(ig,l)*ptimestep)- 2317 & (pt(ig,l-1)+pdt(ig,l-1)*ptimestep))/ 2318 & log((pt(ig,l)+pdt(ig,l)*ptimestep)/ 2319 & (pt(ig,l-1)+pdt(ig,l-1)*ptimestep)) 2320 endif 2321 2322 ! compute gravitational acceleration (at altitude zaeroid(nlayer-1)) 2323 gz(ig,l)=g*(rad**2)/(rad+zzlay(ig,l-1)+(phisfi(ig)/g))**2 2324 2325 2326 zzlay(ig,l)=zzlay(ig,l-1)- 2327 & (log(zplay(ig,l)/zplay(ig,l-1))*rnew(ig,l)*tlaymean/gz(ig,l)) 2328 2329 2330 ! update layers altitude 2331 z1=(zplay(ig,l-1)+zplev(ig,l))/(zplay(ig,l-1)-zplev(ig,l)) 2332 z2=(zplev(ig,l)+zplay(ig,l))/(zplev(ig,l)-zplay(ig,l)) 2333 zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2) 2290 2334 ENDDO 2291 ENDDO 2335 ENDDO 2292 2336 #endif 2293 2337 ENDIF ! of IF (callcond)
Note: See TracChangeset
for help on using the changeset viewer.