Changeset 597


Ignore:
Timestamp:
Mar 26, 2012, 6:16:12 PM (13 years ago)
Author:
jleconte
Message:

Corrects a bug on potential temperature calculation in physic

Location:
trunk/LMDZ.GENERIC
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r596 r597  
    639639- Cleaned continuum part in optc*
    640640- Added .def files for a typical 1d earth case in deftank (dry case for the moment)
     641- Corrects a bug on potential temperature calculation in physic
  • trunk/LMDZ.GENERIC/libf/phystd/physiq.F90

    r596 r597  
    1      subroutine physiq(ngrid,nlayer,nq,   &
     1      subroutine physiq(ngrid,nlayer,nq,   &
    22                  firstcall,lastcall,      &
    33                  pday,ptime,ptimestep,    &
     
    202202      real OSR_nu(ngridmx,L_NSPECTV)! Outgoing SW radition in each band (Normalized to the band width (W/m2/cm-1)
    203203 
    204       real sensibFlux(ngridmx)   ! turbulent flux given by the atm to the surface
     204      real,save :: sensibFlux(ngridmx)   ! turbulent flux given by the atm to the surface
    205205 
    206       save fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn,OLR_nu,OSR_nu,sensibFlux
     206      save fluxsurf_lw,fluxsurf_sw,fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn,OLR_nu,OSR_nu
    207207
    208208
     
    226226      real zdvdif(ngridmx,nlayermx),zdudif(ngridmx,nlayermx)  ! (m.s-2)
    227227      real zdhdif(ngridmx,nlayermx), zdtsdif(ngridmx)         ! (K/s)
     228      real zdtdif(ngridmx,nlayermx)                           ! (K/s)
    228229      real zdvadj(ngridmx,nlayermx),zduadj(ngridmx,nlayermx)  ! (m.s-2)
    229230      real zdhadj(ngridmx,nlayermx)                           ! (K/s)
     
    267268      character*2 str2
    268269      character*5 str5
    269       real zdtdif(ngridmx,nlayermx), zdtadj(ngridmx,nlayermx)
     270      real zdtadj(ngridmx,nlayermx)
    270271      real zdtdyn(ngridmx,nlayermx),ztprevious(ngridmx,nlayermx)
    271272      save ztprevious
     
    285286      real tau_col(ngridmx)
    286287      save tau_col
    287 
     288     
    288289!     included by RW to reduce insanity of code
    289290      real ISR,ASR,OLR,GND,DYN,GSR,Ts1,Ts2,Ts3,TsS
     
    311312!     included by RW to account for surface cooling by evaporation
    312313      real dtsurfh2olat(ngridmx)
     314
    313315
    314316!     to test energy conservation (RW+JL)
     
    388390      real reffH2O(ngridmx,nlayermx)
    389391      real reffcol(ngridmx,2)
    390 
    391392
    392393!     included by RW for sourceevol
     
    550551
    551552            if(ngrid.eq.1)then
    552                qzero1D               = 20.0
     553               qzero1D               = 10000.0
    553554               qsurf(1,igcm_h2o_vap) = qzero1D
    554555               do l=1, nlayer
     
    633634
    634635
    635          
    636       do l=1,nlayer
     636      do l=1,nlayer         
    637637         do ig=1,ngrid
    638638            zpopsk(ig,l)=(pplay(ig,l)/pplev(ig,1))**rcp
     639            zh(ig,l)=pt(ig,l)/zpopsk(ig,l)
    639640         enddo
    640641      enddo
     
    938939                  masse = (pplev(ig,l) - pplev(ig,l+1))/g
    939940                  dEtot = dEtot + cpp*masse*zdtdif(ig,l)*area(ig)
    940                   dEzdif (ig,l)= cpp*masse*(zdtdif(ig,l))*area(ig)
     941                  dEzdif (ig,l)= cpp*masse*(zdtdif(ig,l))
    941942               enddo
     943               dEzdif(ig,1)= dEzdif(ig,1)+ sensibFlux(ig)! subtract flux to the ground
    942944               dEtot = dEtot + sensibFlux(ig)*area(ig)! subtract flux to the ground
    943945               dEtots = dEtots + capcal(ig)*zdtsdif(ig)*area(ig)-zflubid(ig)*area(ig)-sensibFlux(ig)*area(ig)
     
    947949            dEtots = dEtots/totarea
    948950            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'
     951            if (UseTurbDiff) then
     952               print*,'In TurbDiff sensible flux (atm=>surf) =',AtmToSurf_TurbFlux,' W m-2'
     953               print*,'In TurbDiff non-cons atm nrj change   =',dEtot,' W m-2'
     954               print*,'In TurbDiff (correc rad+latent heat) surf nrj change =',dEtots,' W m-2'
     955            else
     956               print*,'In vdifc sensible flux (atm=>surf)    =',AtmToSurf_TurbFlux,' W m-2'
     957               print*,'In vdifc non-cons atm nrj change      =',dEtot,' W m-2'
     958               print*,'In vdifc (correc rad+latent heat) surf nrj change =',dEtots,' W m-2'
     959            end if
    952960! JL12 note that the black body radiative flux emitted by the surface has been updated by the implicit scheme
    953961!    but not given back elsewhere
     
    16091617         enddo
    16101618         dEtots=dEtots/totarea
    1611          print*,'Surface energy change=',dEtots,' W m-2'
     1619         print*,'Surface energy change                 =',dEtots,' W m-2'
    16121620      endif
    16131621!-------------------------
     
    19922000        call writediagfi(ngrid,"ps","Surface pressure","Pa",2,ps)
    19932001        call writediagfi(ngrid,"temp","temperature","K",3,zt)
     2002        call writediagfi(ngrid,"teta","potential temperature","K",3,zh)
    19942003        call writediagfi(ngrid,"u","Zonal wind","m.s-1",3,zu)
    19952004        call writediagfi(ngrid,"v","Meridional wind","m.s-1",3,zv)
Note: See TracChangeset for help on using the changeset viewer.