Ignore:
Timestamp:
Aug 29, 2018, 4:41:34 PM (6 years ago)
Author:
jleconte
Message:

29/08/2018 == JL

-watersat was used only in vdifc and thus it was not consistent with other routines (turbdiff, rain, largescale...) which used Psat_water from watercommon.
This is now harmonized. ALl routines use Psat_water. Watersat.F has been removed, but the routine is now in watercommon for archival purpose. It is not used anymore.
-also changed the number of chars for tname in the dyn3D/infotrac.F90 to be able to run rcm1d.

File:
1 edited

Legend:

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

    r1830 r1993  
    55      use ioipsl_getin_p_mod, only: getin_p
    66      use watercommon_h, only : RLVTT, RCPD, RVTMP2,  &
    7           T_h2O_ice_clouds,T_h2O_ice_liq,Psat_waterDP,Lcpdqsat_waterDP
     7          T_h2O_ice_clouds,T_h2O_ice_liq,Psat_water,Lcpdqsat_water
    88      USE tracer_h
    99      IMPLICIT none
     
    5050      ! JL13: if "careful, T<Tmin in psat water" appears often, you may want to stabilise the model by
    5151      !                   decreasing alpha and increasing nitermax accordingly
    52       DOUBLE PRECISION zt(ngrid), zq(ngrid)
     52      DOUBLE PRECISION zq(ngrid)
    5353      DOUBLE PRECISION zcond(ngrid),zcond_iter
    5454      DOUBLE PRECISION zdelq(ngrid)
    55       DOUBLE PRECISION zqs(ngrid), zdqs(ngrid)
    56       DOUBLE PRECISION local_p,psat_tmp,dlnpsat_tmp,Lcp
     55      DOUBLE PRECISION zqs(ngrid)
     56      real zt(ngrid),local_p,psat_tmp,dlnpsat_tmp,Lcp,zqs_temp,zdqs
    5757     
    5858! evaporation calculations
     
    106106!           zt(i)=15.   ! check too low temperatures
    107107         endif
    108          call Psat_waterDP(zt(i),local_p,psat_tmp,zqs(i))
     108         call Psat_water(zt(i),local_p,psat_tmp,zqs_temp)
     109         zqs(i)=zqs_temp
    109110 
    110111         zdelq(i) = MAX(MIN(ratqs * zq(i),1.-zq(i)),1.d-12)
     
    127128            zcond(i) = 0.0d0
    128129            Do nn=1,nitermax 
    129                call Psat_waterDP(zt(i),local_p,psat_tmp,zqs(i))
    130                call Lcpdqsat_waterDP(zt(i),local_p,psat_tmp,zqs(i),zdqs(i),dlnpsat_tmp)
    131                zcond_iter = alpha*(zx_q(i)-zqs(i))/(1.d0+zdqs(i))         
     130               call Psat_water(zt(i),local_p,psat_tmp,zqs_temp)
     131               zqs(i)=zqs_temp
     132               call Lcpdqsat_water(zt(i),local_p,psat_tmp,zqs_temp,zdqs,dlnpsat_tmp)
     133               zcond_iter = alpha*(zx_q(i)-zqs(i))/(1.d0+zdqs)     
    132134                  !zcond can be negative here
    133135               zx_q(i) = zx_q(i) - zcond_iter
     
    150152            zcond(i) = 0.0d0
    151153            Do nn=1,nitermax 
    152                call Lcpdqsat_waterDP(zt(i),local_p,psat_tmp,zqs(i),zdqs(i),dlnpsat_tmp)
    153                zcond_iter = MAX(0.0d0,alpha*(zx_q(i)-zqs(i))/(1.d0+zdqs(i)))       
     154               call Lcpdqsat_water(zt(i),local_p,psat_tmp,zqs(i),zdqs,dlnpsat_tmp)
     155               zcond_iter = MAX(0.0d0,alpha*(zx_q(i)-zqs(i))/(1.d0+zdqs))         
    154156                  !zcond always postive! cannot evaporate clouds!
    155157                  !this is why we must reevaporate before largescale
     
    159161!              if (ABS(zcond_iter/alpha).lt.qthreshold) exit
    160162               zt(i) = zt(i) + zcond_iter*Lcp*rneb(i,k)
    161                call Psat_waterDP(zt(i),local_p,psat_tmp,zqs(i))
     163               call Psat_water(zt(i),local_p,psat_tmp,zqs_temp)
     164               zqs(i)=zqs_temp
    162165               if (nn.eq.nitermax) print*,'itermax in largescale'
    163166            End do ! niter
     
    172175         pdqvaplsc(1:ngrid,k)  = dqevap(1:ngrid,k) - zcond(1:ngrid)
    173176         pdqliqlsc(1:ngrid,k) = - pdqvaplsc(1:ngrid,k)
    174          pdtlsc(1:ngrid,k)  = pdqliqlsc(1:ngrid,k)*real(Lcp)
     177         pdtlsc(1:ngrid,k)  = pdqliqlsc(1:ngrid,k)*Lcp
    175178
    176179   Enddo ! k= nlayer, 1, -1
Note: See TracChangeset for help on using the changeset viewer.