Changeset 594 for trunk/LMDZ.GENERIC/libf/phystd
- Timestamp:
- Mar 22, 2012, 8:25:03 PM (13 years ago)
- Location:
- trunk/LMDZ.GENERIC/libf/phystd
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
r588 r594 98 98 ! Improved water cycle: R. Wordsworth / B. Charnay (2010) 99 99 ! To F90: R. Wordsworth (2010) 100 ! New turbulent diffusion scheme: J. Leconte (2012) 100 101 ! 101 102 !================================================================== … … 200 201 real OLR_nu(ngridmx,L_NSPECTI)! Outgoing LW radition in each band (Normalized to the band width (W/m2/cm-1) 201 202 real OSR_nu(ngridmx,L_NSPECTV)! Outgoing SW radition in each band (Normalized to the band width (W/m2/cm-1) 202 save fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn,OLR_nu,OSR_nu 203 204 real sensibFlux(ngridmx) ! turbulent flux given by the atm to the surface 205 206 save fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn,OLR_nu,OSR_nu,sensibFlux 203 207 204 208 … … 285 289 real ISR,ASR,OLR,GND,DYN,GSR,Ts1,Ts2,Ts3,TsS 286 290 287 ! included by RW for temporary comparison288 real zdtnirco2(ngridmx,nlayermx) ! (K/s)289 290 291 ! included by RW to compute tracer column densities 291 292 real qcol(ngridmx,nqmx) … … 311 312 real dtsurfh2olat(ngridmx) 312 313 313 ! included by RW to test energy conservation314 real dEtot, dEtots, masse, vabs, dvabs314 ! to test energy conservation (RW+JL) 315 real dEtot, dEtots, masse, AtmToSurf_TurbFlux 315 316 real dEtotSW, dEtotsSW, dEtotLW, dEtotsLW 316 317 real dEzRad(ngridmx,nlayermx),dEzdif(ngridmx,nlayermx) 318 real madjdE(ngridmx), lscaledE(ngridmx) 319 !JL12 conservation test for mean flow kinetic energy has been disabled temporarily 320 317 321 real dItot, dVtot 318 319 ! included by RW to test water conservation320 real h2otot321 322 323 322 324 323 ! included by BC for evaporation … … 332 331 333 332 ! included by RW to test water conservation (by routine) 333 real h2otot 334 334 real dWtot, dWtots 335 335 real h2o_surf_all … … 364 364 real totcloudfrac(ngridmx) 365 365 366 ! included by RW for Tmax test367 integer iTmax368 369 366 ! included by RW for vdifc water conservation test 370 367 real nconsMAX … … 392 389 real reffcol(ngridmx,2) 393 390 394 ! included by RW for flexible 3D energy conservation testing395 real vdifcdE(ngridmx), madjdE(ngridmx), lscaledE(ngridmx)396 391 397 392 ! included by RW for sourceevol … … 405 400 logical ice_update 406 401 save ice_update 402 403 !JL12 temporary to test difference in diffusion schemes 404 logical UseTurbDiff 407 405 408 406 !======================================================================= … … 555 553 556 554 if(ngrid.eq.1)then 557 qzero1D = 0.0555 qzero1D = 20.0 558 556 qsurf(1,igcm_h2o_vap) = qzero1D 559 557 do l=1, nlayer … … 642 640 do ig=1,ngrid 643 641 zpopsk(ig,l)=(pplay(ig,l)/pplev(ig,1))**rcp 644 zh(ig,l)=pt(ig,l)/zpopsk(ig,l)645 642 enddo 646 643 enddo … … 839 836 dEtotsLW = dEtotsLW/totarea 840 837 print*,'---------------------------------------------------------------' 841 print*,'In corrk SW atmospheric energy change=',dEtotSW,' W m-2'842 print*,'In corrk LW atmospheric energy change=',dEtotLW,' W m-2'843 print*,'atmospheric energy change(SW+LW) =',dEtotLW+dEtotSW,' W m-2'844 print*,'In corrk SW surface energy change=',dEtotsSW,' W m-2'845 print*,'In corrk LW surface energy change=',dEtotsLW,' W m-2'846 print*,'surface energy change (SW+LW)=',dEtotsLW+dEtotsSW,' W m-2'838 print*,'In corrk SW atmospheric heating =',dEtotSW,' W m-2' 839 print*,'In corrk LW atmospheric heating =',dEtotLW,' W m-2' 840 print*,'atmospheric net rad heating (SW+LW) =',dEtotLW+dEtotSW,' W m-2' 841 print*,'In corrk SW surface heating =',dEtotsSW,' W m-2' 842 print*,'In corrk LW surface heating =',dEtotsLW,' W m-2' 843 print*,'surface net rad heating (SW+LW) =',dEtotsLW+dEtotsSW,' W m-2' 847 844 endif 848 845 !------------------------- … … 862 859 zdum1(:,:)=0.0 863 860 zdum2(:,:)=0.0 864 do l=1,nlayer 865 do ig=1,ngrid 861 862 863 !JL12 the following if test is temporarily there to allow us to compare the old vdifc with turbdiff 864 UseTurbDiff=.true. 865 if (UseTurbDiff) then 866 867 call turbdiff(ngrid,nlayer,nq,rnat, & 868 ptimestep,capcal,lwrite, & 869 pplay,pplev,zzlay,zzlev,z0, & 870 pu,pv,pt,zpopsk,pq,tsurf,emis,qsurf, & 871 zdum1,zdum2,pdt,pdq,zflubid, & 872 zdudif,zdvdif,zdtdif,zdtsdif, & 873 sensibFlux,q2,zdqdif,zdqsdif,lastcall) 874 875 else 876 877 do l=1,nlayer 878 do ig=1,ngrid 879 zh(ig,l)=pt(ig,l)/zpopsk(ig,l) 866 880 zdh(ig,l)=pdt(ig,l)/zpopsk(ig,l) 867 enddo868 enddo869 870 call vdifc(ngrid,nlayer,nq,rnat,zpopsk,&881 enddo 882 enddo 883 884 call vdifc(ngrid,nlayer,nq,rnat,zpopsk, & 871 885 ptimestep,capcal,lwrite, & 872 886 pplay,pplev,zzlay,zzlev,z0, & 873 887 pu,pv,zh,pq,tsurf,emis,qsurf, & 874 888 zdum1,zdum2,zdh,pdq,zflubid, & 875 zdudif,zdvdif,zdhdif,zdtsdif,q2, & 876 zdqdif,zdqsdif,lastcall) 889 zdudif,zdvdif,zdhdif,zdtsdif, & 890 sensibFlux,q2,zdqdif,zdqsdif,lastcall) 891 892 do l=1,nlayer 893 do ig=1,ngrid 894 zdtdif(ig,l)=zdhdif(ig,l)*zpopsk(ig,l) ! for diagnostic only 895 enddo 896 enddo 897 898 end if !turbdiff 877 899 878 900 do l=1,nlayer … … 880 902 pdv(ig,l)=pdv(ig,l)+zdvdif(ig,l) 881 903 pdu(ig,l)=pdu(ig,l)+zdudif(ig,l) 882 pdt(ig,l)=pdt(ig,l)+zdhdif(ig,l)*zpopsk(ig,l) 883 zdtdif(ig,l)=zdhdif(ig,l)*zpopsk(ig,l) ! for diagnostic only 904 pdt(ig,l)=pdt(ig,l)+zdtdif(ig,l) 884 905 enddo 885 906 enddo … … 910 931 dEtot=0.0 911 932 dEtots=0.0 912 913 vdifcdE(:)=0.0 933 dEzdif(:,:)=0. 934 AtmToSurf_TurbFlux=0. 935 914 936 do ig = 1, ngrid 915 937 do l = 1, nlayer 916 938 masse = (pplev(ig,l) - pplev(ig,l+1))/g 917 939 dEtot = dEtot + cpp*masse*zdtdif(ig,l)*area(ig) 918 919 vabs = sqrt(pdu(ig,l)**2 + pdv(ig,l)**2) 920 dvabs = sqrt(zdudif(ig,l)**2 + zdvdif(ig,l)**2) 921 dEtot = dEtot + masse*vabs*dvabs*area(ig) 922 923 vdifcdE(ig) = vdifcdE(ig) + masse*vabs*dvabs 924 925 enddo 926 dEtot = dEtot - zflubid(ig)*area(ig) ! subtract flux from ground 927 928 dEtots = dEtots + capcal(ig)*zdtsdif(ig)*area(ig) 929 vdifcdE(ig) = vdifcdE(ig) + capcal(ig)*zdtsdif(ig) 940 dEzdif (ig,l)= cpp*masse*(zdtdif(ig,l))*area(ig) 941 enddo 942 dEtot = dEtot + sensibFlux(ig)*area(ig)! subtract flux to the ground 943 dEtots = dEtots + capcal(ig)*zdtsdif(ig)*area(ig)-zflubid(ig)*area(ig)-sensibFlux(ig)*area(ig) 944 AtmToSurf_TurbFlux=AtmToSurf_TurbFlux+sensibFlux(ig)*area(ig) 930 945 enddo 931 946 dEtot = dEtot/totarea 932 947 dEtots = dEtots/totarea 933 print*,'In difv atmospheric energy change =',dEtot,' W m-2' 934 print*,'In difv surface energy change =',dEtots,' W m-2' 935 !print*,'Note we ignore the wind change...' 936 ! and latent heat for that matter... 948 AtmToSurf_TurbFlux=AtmToSurf_TurbFlux/totarea 949 print*,'In TurbDiff sensible flux (atm=>surf) =',AtmToSurf_TurbFlux,' W m-2' 950 print*,'In TurbDiff non-cons atm nrj change =',dEtot,' W m-2' 951 print*,'In TurbDiff (correc rad+latent heat) surf nrj change =',dEtots,' W m-2' 952 ! JL12 note that the black body radiative flux emitted by the surface has been updated by the implicit scheme 953 ! but not given back elsewhere 937 954 endif 938 955 !------------------------- … … 1053 1070 enddo 1054 1071 dEtot=dEtot/totarea 1055 print*,'In convadj atmospheric energy change 1072 print*,'In convadj atmospheric energy change =',dEtot,' W m-2' 1056 1073 endif 1057 1074 !------------------------- … … 1693 1710 OLR = OLR + area(ig)*fluxtop_lw(ig) 1694 1711 GND = GND + area(ig)*fluxgrd(ig) 1695 if(.not.callsoil) GND=GND+ area(ig)*fluxrad(ig)1696 1712 DYN = DYN + area(ig)*fluxdyn(ig) 1697 1713 … … 1715 1731 1716 1732 if(enertest)then 1717 print*,'SW energy balance SW++ - ASR = ',dEtotSW+dEtotsSW-ASR/totarea,' W m-2'1718 print*,'LW energy balance LW++ + ***ASR*** = ',dEtotLW+dEtotsLW+ASR/totarea,' W m-2'1719 print*,'LW energy balance LW++ - ***OLR*** = ',dEtotLW+dEtotsLW+OLR/totarea,' W m-2'1733 print*,'SW flux/heating difference SW++ - ASR = ',dEtotSW+dEtotsSW-ASR/totarea,' W m-2' 1734 print*,'LW flux/heating difference LW++ - OLR = ',dEtotLW+dEtotsLW+OLR/totarea,' W m-2' 1735 print*,'LW energy balance LW++ + ASR = ',dEtotLW+dEtotsLW+ASR/totarea,' W m-2' 1720 1736 endif 1721 1737 … … 1989 2005 call writediagfi(ngrid,"GND","heat flux from ground","W m-2",2,fluxgrd) 1990 2006 call writediagfi(ngrid,"DYN","dynamical heat input","W m-2",2,fluxdyn) 1991 !call writediagfi(ngrid,"lscaledE","heat from largescale","W m-2",2,lscaledE) 1992 !call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE) 1993 !call writediagfi(ngrid,"vdifcdE","heat from vdifc surface","W m-2",2,vdifcdE) 2007 endif 2008 2009 if(enertest) then 2010 call writediagfi(ngridmx,"dEzdif","atm vdifc energy change","w.m^-2",3,dEzdif) 2011 if(watercond) then 2012 call writediagfi(ngrid,"lscaledE","heat from largescale","W m-2",2,lscaledE) 2013 call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE) 2014 endif 1994 2015 endif 1995 2016 … … 2001 2022 2002 2023 ! debugging 2003 !call writediagfi(ngrid,"vdifNC","H2O loss vdifc","kg m-2 s-1",2,vdifcncons)2004 !call writediagfi(ngrid,"cadjNC","H2O loss convadj","kg m-2 s-1",2,cadjncons)2005 2024 !call writediagfi(ngrid,'rnat','Terrain type',' ',2,real(rnat)) 2006 2025 !call writediagfi(ngrid,'pphi','Geopotential',' ',3,pphi) … … 2027 2046 endif 2028 2047 2029 if(watercond )then2048 if(watercond.or.CLFvarying)then 2030 2049 !call writediagfi(ngrid,"CLF","H2O cloud fraction"," ",3,cloudfrac) 2031 2050 call writediagfi(ngrid,"CLFt","H2O column cloud fraction"," ",2,totcloudfrac) -
trunk/LMDZ.GENERIC/libf/phystd/vdifc.F
r586 r594 4 4 & pu,pv,ph,pq,ptsrf,pemis,pqsurf, 5 5 & pdufi,pdvfi,pdhfi,pdqfi,pfluxsrf, 6 & pdudif,pdvdif,pdhdif,pdtsrf, pq2,6 & pdudif,pdvdif,pdhdif,pdtsrf,sensibFlux,pq2, 7 7 & pdqdif,pdqsdif,lastcall) 8 8 … … 55 55 REAL pfluxsrf(ngrid) 56 56 REAL pdudif(ngrid,nlay),pdvdif(ngrid,nlay),pdhdif(ngrid,nlay) 57 REAL pdtsrf(ngrid), pcapcal(ngrid)57 REAL pdtsrf(ngrid),sensibFlux(ngrid),pcapcal(ngrid) 58 58 REAL pq2(ngrid,nlay+1) 59 59 … … 674 674 enddo 675 675 enddo 676 676 677 DO ig=1,ngrid ! computing sensible heat flux (atm => surface) 678 sensibFlux(ig)=cpp*zb(ig,1)/ptimestep*(zh(ig,1)-ztsrf2(ig)) 679 ENDDO 680 677 681 if (tracer) then 678 682 do iq = 1, nq
Note: See TracChangeset
for help on using the changeset viewer.