Ignore:
Timestamp:
Apr 16, 2012, 12:22:40 PM (13 years ago)
Author:
jleconte
Message:
  • Added consistency checks for calculations including water and global1d+diurnal.
  • Corrected small bugs in precipitation scheme
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/physiq.F90

    r600 r622  
    316316      real dEtot, dEtots, masse, AtmToSurf_TurbFlux
    317317      real dEtotSW, dEtotsSW, dEtotLW, dEtotsLW
    318       real dEzRadsw(ngridmx,nlayermx),dEzRadlw(ngridmx,nlayermx),dEzdif(ngridmx,nlayermx)
     318      real dEzRadsw(ngridmx,nlayermx),dEzRadlw(ngridmx,nlayermx),dEzdiff(ngridmx,nlayermx)
     319      real dEdiffs(ngridmx),dEdiff(ngridmx)
    319320      real madjdE(ngridmx), lscaledE(ngridmx)
    320321!JL12 conservation test for mean flow kinetic energy has been disabled temporarily
     
    559560
    560561            do ig=1,ngrid
    561                qsurf_hist(ig,igcm_h2o_vap) = qsurf(ig,igcm_h2o_vap)
     562!already done above (JL12)
     563!               qsurf_hist(ig,igcm_h2o_vap) = qsurf(ig,igcm_h2o_vap)
    562564               if(ice_update)then
    563565                  ice_initial(ig)=qsurf(ig,igcm_h2o_ice)
     
    877879           do l=1,nlayer
    878880             do ig=1,ngrid
    879                zh(ig,l)=pt(ig,l)/zpopsk(ig,l)
    880881               zdh(ig,l)=pdt(ig,l)/zpopsk(ig,l)
    881882             enddo
     
    931932            dEtot=0.0
    932933            dEtots=0.0
    933             dEzdif(:,:)=0.
     934            dEzdiff(:,:)=0.
    934935            AtmToSurf_TurbFlux=0.
    935            
     936            dEdiffs(:)=0.
     937            dEdiff(:)=0.
     938                   
    936939            do ig = 1, ngrid
    937940               do l = 1, nlayer
    938941                  masse = (pplev(ig,l) - pplev(ig,l+1))/g
    939                   dEtot = dEtot + cpp*masse*zdtdif(ig,l)*area(ig)
    940                   dEzdif (ig,l)= cpp*masse*(zdtdif(ig,l))
    941                enddo
    942                dEzdif(ig,1)= dEzdif(ig,1)+ sensibFlux(ig)! subtract flux to the ground
    943                dEtot = dEtot + sensibFlux(ig)*area(ig)! subtract flux to the ground
    944                dEtots = dEtots + capcal(ig)*zdtsdif(ig)*area(ig)-zflubid(ig)*area(ig)-sensibFlux(ig)*area(ig)
     942                  dEzdiff (ig,l)= cpp*masse*(zdtdif(ig,l))
     943                  dEdiff(ig)=dEdiff(ig)+dEzdiff (ig,l)
     944               enddo
     945               dEzdiff(ig,1)= dEzdiff(ig,1)+ sensibFlux(ig)! subtract flux to the ground
     946               dEdiff(ig)=dEdiff(ig)+ sensibFlux(ig)! subtract flux to the ground
     947               dEtot = dEtot + dEdiff(ig)*area(ig)
     948               dEdiffs(ig)=capcal(ig)*zdtsdif(ig)-zflubid(ig)-sensibFlux(ig)
     949               dEtots = dEtots + dEdiffs(ig)*area(ig)
    945950               AtmToSurf_TurbFlux=AtmToSurf_TurbFlux+sensibFlux(ig)*area(ig)
    946951            enddo
     
    13421347                 rainout(ig)             = zdqsrain(ig)+zdqssnow(ig) ! diagnostic   
    13431348              enddo
    1344 
    1345               !-------------------------
    1346               ! test energy conservation
    1347               if(enertest)then
    1348                  dEtot=0.0
    1349                  do ig = 1, ngrid
    1350                     do l = 1, nlayer
    1351                        masse = (pplev(ig,l) - pplev(ig,l+1))/g
    1352                        dEtot = dEtot + cpp*masse*zdtrain(ig,l)*area(ig)
    1353                     enddo
    1354                  enddo
    1355                  dEtot=dEtot/totarea
    1356                  print*,'In rain atmospheric energy change       =',dEtot,' W m-2'
    1357               endif
    1358               !-------------------------
    13591349
    13601350
     
    15721562         ! content of ocean gridpoints back to zero, in order
    15731563         ! to avoid rounding errors in vdifc, rain
    1574          do ig = 1, ngrid
    1575             do iq = 1, nq
    1576                if(iq.eq.igcm_h2o_vap .and. rnat(ig).eq.0)then ! if liquid water and terrain = ocean
    1577                   qsurf_hist(ig,iq) = qsurf(ig,iq)
    1578                   !qsurf(ig,iq)      = qcol(ig,iq)
    1579                   ! the value of qsurf we choose here makes NO DIFFERENCE TO ANYTHING AT ALL
    1580                else
    1581                   qsurf_hist(ig,iq) = qsurf(ig,iq)
    1582                endif
    1583             enddo
    1584          enddo
     1564         qsurf_hist(:,:) = qsurf(:,:)
    15851565
    15861566         if(ice_update)then
     
    20161996       
    20171997        if(enertest) then
    2018           if (calldifv) call writediagfi(ngridmx,"dEzdif","turbulent diffusion heating (-sensible flux)","w.m^-2",3,dEzdif)
     1998          if (calldifv) then
     1999             call writediagfi(ngridmx,"q2","turbulent kinetic energy","J.kg^-1",3,q2)
     2000             call writediagfi(ngridmx,"dEzdiff","turbulent diffusion heating (-sensible flux)","w.m^-2",3,dEzdiff)
     2001             call writediagfi(ngridmx,"dEdiff","integrated turbulent diffusion heating (-sensible flux)","w.m^-2",2,dEdiff)
     2002             call writediagfi(ngridmx,"dEdiffs","In TurbDiff (correc rad+latent heat) surf nrj change","w.m^-2",2,dEdiffs)
     2003             call writediagfi(ngridmx,"sensibFlux","sensible heat flux","w.m^-2",2,sensibFlux)
     2004          endif
    20192005          if (corrk) then
    20202006             call writediagfi(ngridmx,"dEzradsw","radiative heating","w.m^-2",3,dEzradsw)
     
    20232009          if(watercond) then
    20242010             call writediagfi(ngrid,"lscaledE","heat from largescale","W m-2",2,lscaledE)
    2025              call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE)
     2011             call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE)
     2012             call writediagfi(ngridmx,"RH","relative humidity"," ",3,RH)
     2013             call writediagfi(ngridmx,"h2o_max_col","maximum H2O column amount","kg.m^-2",2,H2Omaxcol)
    20262014          endif
    20272015        endif
     
    20542042                          'kg m^-2',2,qcol(1,iq) )
    20552043
    2056           if(water)then
    2057              call writediagfi(ngridmx,"H2Omaxcol","max. poss. H2O column","kg m^-2",2,H2Omaxcol)
    2058           endif
    2059 
    20602044          if(watercond.or.CLFvarying)then
    2061              !call writediagfi(ngrid,"CLF","H2O cloud fraction"," ",3,cloudfrac)
     2045!             call writediagfi(ngrid,"rneb_man","H2O cloud fraction (conv)"," ",3,rneb_man)
     2046!             call writediagfi(ngrid,"rneb_lsc","H2O cloud fraction (large scale)"," ",3,rneb_lsc)
     2047!             call writediagfi(ngrid,"CLF","H2O cloud fraction"," ",3,cloudfrac)
    20622048             call writediagfi(ngrid,"CLFt","H2O column cloud fraction"," ",2,totcloudfrac)
    20632049          endif
Note: See TracChangeset for help on using the changeset viewer.