Changeset 622


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
Location:
trunk/LMDZ.GENERIC
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r600 r622  
    652652corresponding variable, sigma) should be used. Now done in physics, vdifc and turbdiff.
    653653 
     654== 16/04/2012 == JL
     655- Added consistency checks for calculations including water and global1d+diurnal.
     656
  • trunk/LMDZ.GENERIC/libf/phystd/callcorrk.F90

    r600 r622  
    274274           call getin("global1d",global1d)
    275275           write(*,*) "global1d = ",global1d
     276           ! Test of incompatibility:
     277           ! if global1d is true, there should not be any diurnal cycle
     278           if (global1d.and.diurnal) then
     279            print*,'if global1d is true, diurnal must be set to false'
     280            stop
     281           endif
     282
    276283           if (global1d) then
    277284             PRINT *,'Solar Zenith angle (deg.) ?'
  • trunk/LMDZ.GENERIC/libf/phystd/inifis.F

    r596 r622  
    438438         endif
    439439
    440 ! Test of incompatibility:
    441 
    442440         write(*,*) "Gravitationnal sedimentation ?"
    443441         sedimentation=.true. ! default value
    444442         call getin("sedimentation",sedimentation)
    445443         write(*,*) " sedimentation = ",sedimentation
    446 
    447 
    448 ! Test of incompatibility:
    449444
    450445         write(*,*) "Compute water cycle ?"
     
    453448         write(*,*) " water = ",water
    454449         
     450! Test of incompatibility:
     451! if water is true, there should be at least a tracer
     452         if (water.and.(.not.tracer)) then
     453           print*,'if water is ON, tracer must be ON too!'
     454           stop
     455         endif
     456
    455457         write(*,*) "Include water condensation ?"
    456458         watercond=.false. ! default value
     
    458460         write(*,*) " watercond = ",watercond
    459461
     462! Test of incompatibility:
     463! if watercond is used, then water should be used too
     464         if (watercond.and.(.not.water)) then
     465           print*,'if watercond is used, water should be used too'
     466           stop
     467         endif
     468
    460469         write(*,*) "Include water precipitation ?"
    461470         waterrain=.false. ! default value
     
    497506         call getin("Tsaldiff",Tsaldiff)
    498507         write(*,*) " Tsaldiff = ",Tsaldiff
    499 
    500 ! Test of incompatibility:
    501 ! if watercond is used, then water should be used too
    502 
    503          if (watercond.and.(.not.watercond)) then
    504            print*,'if watercond is used, water should be used too'
    505            stop
    506          endif
    507508
    508509         write(*,*) "Does user want to force cpp and mugaz?"
  • 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
  • trunk/LMDZ.GENERIC/libf/phystd/rain.F90

    r526 r622  
    5151      PARAMETER (seuil_neb=0.001)
    5252
    53 !      REAL ct                           ! Inverse of cloud precipitation time
    54 !      PARAMETER (ct=1./1800.)
    55 !      PARAMETER (ct=1./1849.479)
    56 
    57       REAL cl                           ! Precipitation threshold
    58       PARAMETER (cl=2.0e-4)
     53      REAL,PARAMETER :: cl=2.0e-4                          ! Precipitation threshold
     54      REAL,PARAMETER :: ct=1./1800.                        ! Precipitation rate
    5955
    6056      INTEGER ninter
     
    6258
    6359      logical simple                    ! Use very simple Emanuel scheme?
    64       parameter(simple=.false.)
     60      parameter(simple=.true.)
    6561
    6662      logical evap_prec                 ! Does the rain evaporate?
     
    120116         PRINT*, 'in rain.F, ninter=', ninter
    121117         PRINT*, 'in rain.F, evap_prec=', evap_prec
    122 
    123          !print*,ptimestep
    124          !print*,1./ct
    125          !if(.not.simple)then
    126          !   IF (ABS(ptimestep-1./ct).GT.0.001) THEN
    127          !      PRINT*, 'Must talk to Laurent Li!!!'
    128          !      call abort
    129          !   ENDIF
    130          !endif
    131118
    132119         firstcall = .false.
     
    245232                  zneb(i)  = MAX(rneb(i,k), seuil_neb)
    246233                  IF ((ql(i,k)/zneb(i)).gt.lconvert)THEN ! precipitate!
    247                      d_ql(i,k) = -MAX((ql(i,k)-lconvert),0.0)
     234                     d_ql(i,k) = -MAX((ql(i,k)-lconvert*zneb(i)),0.0)
    248235                     zrfl(i)   = zrfl(i) - d_ql(i,k)*l2c(i,k)/ptimestep
    249236                  ENDIF
     
    268255               DO i = 1, ngridmx
    269256                  IF (rneb(i,k).GT.0.0) THEN
    270                      zchau(i) = (1./FLOAT(ninter)) * zoliq(i)      &
     257                     zchau(i) = (ct*ptimestep/FLOAT(ninter)) * zoliq(i)      &
    271258                          * (1.0-EXP(-(zoliq(i)/zneb(i)/cl)**2)) * zfrac(i)
    272                      ! warning: this may give dodgy results for physics calls .ne. 48 per day...
    273259
    274260                     ! this is the ONLY place where zneb, ct and cl are used
Note: See TracChangeset for help on using the changeset viewer.