/[lmdze]/trunk/phylmd/FCTTRE.f90
ViewVC logotype

Diff of /trunk/phylmd/FCTTRE.f90

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/libf/phylmd/FCTTRE.f90 revision 3 by guez, Wed Feb 27 13:16:39 2008 UTC trunk/Sources/phylmd/FCTTRE.f revision 221 by guez, Thu Apr 20 14:44:47 2017 UTC
# Line 1  Line 1 
1  module FCTTRE  module FCTTRE
2    
3    ! From phylmd/FCTTRE.inc,v 1.2 2004/06/22 11:45:32    ! From phylmd/FCTTRE.inc, version 1.2, 2004/06/22 11:45:32
4    
5    !      This COMDECK includes the Thermodynamical functions for the cy39    ! This module includes the thermodynamical functions for the cycle
6    !       ECMWF Physics package.    ! 39 ECMWF physics package. Consistent with "SUPHEC_M" basic
7    !       Consistent with YOMCST Basic physics constants, assuming the    ! physical constants, assuming the partial pressure of water vapour
8    !       partial pressure of water vapour is given by a first order    ! is given by a first order Taylor expansion of "Qs(T)" with respect
9    !       Taylor expansion of Qs(T) w.r.t. to Temperature, using constants    ! to temperature, using constants in "yoethf_m".
   !       in YOETHF  
10    
11    implicit none    ! Probably from Buck, 1981, Journal of Applied Meteorology, volume
12      ! 20, number 12, page 1527.
13    
14    LOGICAL, PARAMETER:: thermcep=.TRUE.    implicit none
15    
16  contains  contains
17    
18    REAL function FOEEW ( PTARG,PDELARG )    elemental REAL function FOEEW(T, ICE)
19    
20      use yoethf, only: R3LES, R3IES, R4LES, R4IES      use yoethf_m, only: R3LES, R3IES, R4LES, R4IES
21      use YOMCST, only: rtt      use SUPHEC_M, only: rtt
22    
23      REAL, intent(in):: PTARG, PDELARG      REAL, intent(in):: T
24        logical, intent(in):: ICE ! else liquid
25    
26      !-----------------------      !-----------------------
27    
28      FOEEW = EXP ((R3LES*(1.-PDELARG)+R3IES*PDELARG) * (PTARG-RTT) &      FOEEW = exp(merge(R3IES / (T - R4IES), R3lES / (T - R4lES), ice) &
29           / (PTARG-(R4LES*(1.-PDELARG)+R4IES*PDELARG)) )           * (T - RTT))
30    
31    end function FOEEW    end function FOEEW
32    
33    !******************************************    !******************************************
34    
35    REAL function FOEDE(PTARG,PDELARG,P5ARG,PQSARG,PCOARG)    REAL function FOEDE(T, ICE, P5ARG, QS, PCOARG)
36    
37      use yoethf, only: R4LES, R4IES      use yoethf_m, only: R4LES, R4IES
38    
39      REAL, intent(in):: PTARG, PDELARG      REAL, intent(in):: T
40      real, intent(in):: P5ARG, PQSARG, PCOARG      logical, intent(in):: ICE ! else liquid
41        real, intent(in):: P5ARG, QS, PCOARG
42    
43      !-----------------------      !-----------------------
44    
45      FOEDE = PQSARG*PCOARG*P5ARG / (PTARG-(R4LES*(1.-PDELARG)+R4IES*PDELARG))**2      FOEDE = QS * PCOARG * P5ARG / (T - merge(R4IES, R4lES, ice))**2
46    
47    end function FOEDE    end function FOEDE
48    
   !******************************************  
   
   REAL function qsats(ptarg)  
   
     REAL, intent(in):: PTARG  
   
     !-----------------------  
   
     qsats = 100.0 * 0.622 * 10.0 &  
          ** (2.07023 - 0.00320991 * ptarg &  
          - 2484.896 / ptarg + 3.56654 * LOG10(ptarg))  
   
   end function qsats  
   
   !******************************************  
   
   REAL function qsatl(ptarg)  
   
     REAL, intent(in):: PTARG  
   
     !-----------------------  
   
     qsatl = 100.0 * 0.622 * 10.0 &  
          ** (23.8319 - 2948.964 / ptarg &  
          - 5.028 * LOG10(ptarg) &  
          - 29810.16 * EXP( - 0.0699382 * ptarg) &  
          + 25.21935 * EXP( - 2999.924 / ptarg))  
   
   end function qsatl  
   
   !******************************************  
   
   REAL function dqsats(ptarg,pqsarg)  
   
     use YOMCST, only: RLVTT, rcpd  
   
     REAL, intent(in):: PTARG, pqsarg  
   
     !-----------------------  
   
     dqsats = RLVTT/RCPD*pqsarg * (3.56654/ptarg &  
          +2484.896*LOG(10.)/ptarg**2 &  
          -0.00320991*LOG(10.))  
   
   end function dqsats  
   
   !******************************************  
   
   REAL function dqsatl(ptarg,pqsarg)  
   
     use YOMCST, only: RLVTT, rcpd  
   
     REAL, intent(in):: PTARG, pqsarg  
   
     !-----------------------  
   
     dqsatl = RLVTT/RCPD*pqsarg*LOG(10.)* &  
          (2948.964/ptarg**2-5.028/LOG(10.)/ptarg &  
          +25.21935*2999.924/ptarg**2*EXP(-2999.924/ptarg) &  
          +29810.16*0.0699382*EXP(-0.0699382*ptarg))  
   
   end function dqsatl  
   
49  end module FCTTRE  end module FCTTRE

Legend:
Removed from v.3  
changed lines
  Added in v.221

  ViewVC Help
Powered by ViewVC 1.1.21