Changeset 1254 for trunk/LMDZ.GENERIC/libf
- Timestamp:
- May 12, 2014, 10:54:58 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/libf/phystd/watercommon_h.F90
r1123 r1254 49 49 ! JL12 variables for tetens formula 50 50 real,parameter :: Pref_solid_liquid=611.14 51 real,parameter :: Trefvap orization=35.8652 real,parameter :: Trefsub limation=7.6651 real,parameter :: Trefvap=35.86 52 real,parameter :: Trefsub=7.66 53 53 real,parameter :: Tmin=8. 54 real,parameter :: r3vap orization=17.26955 real,parameter :: r3sub limation=21.87554 real,parameter :: r3vap=17.269 55 real,parameter :: r3sub=21.875 56 56 57 57 ! checked vs. old watersat data 14/05/2012 by JL. 58 58 59 59 if (T.gt.T_h2O_ice_liq) then 60 psat = Pref_solid_liquid*Exp(r3vap orization*(T-T_h2O_ice_liq)/(T-Trefvaporization)) ! liquid / vapour61 else if (T.lt.Tmin) then 62 63 ! psat = Pref_solid_liquid*Exp(r3sublimation*(Tmin-T_h2O_ice_liq)/(Tmin-Trefsublimation)) ! min psat64 ! Ehouarn: gfortran says: Error: Result of EXP underflows its kind,65 ! so set psat to the smallest possible value instead60 psat = Pref_solid_liquid*Exp(r3vap*(T-T_h2O_ice_liq)/(T-Trefvap)) ! liquid / vapour 61 else if (T.lt.Tmin) then 62 print*, "careful, T<Tmin in psat water" 63 ! psat = Pref_solid_liquid*Exp(r3sub*(Tmin-T_h2O_ice_liq)/(Tmin-Trefsub)) ! min psat 64 ! Ehouarn: gfortran says: Error: Result of EXP underflows its kind, 65 ! so set psat to the smallest possible value instead 66 66 psat=tiny(psat) 67 67 else 68 psat = Pref_solid_liquid*Exp(r3sub limation*(T-T_h2O_ice_liq)/(T-Trefsublimation)) ! solid / vapour68 psat = Pref_solid_liquid*Exp(r3sub*(T-T_h2O_ice_liq)/(T-Trefsub)) ! solid / vapour 69 69 endif 70 70 if(psat.gt.p) then … … 105 105 ! JL12 variables for tetens formula 106 106 real,parameter :: Pref_solid_liquid=611.14 107 real,parameter :: Trefvap orization=35.86107 real,parameter :: Trefvap=35.86 108 108 real,parameter :: Tmin=8. 109 real,parameter :: Trefsub limation=7.66110 real,parameter :: r3vap orization=17.269111 real,parameter :: r3sub limation=21.875109 real,parameter :: Trefsub=7.66 110 real,parameter :: r3vap=17.269 111 real,parameter :: r3sub=21.875 112 112 113 113 real :: dummy 114 114 115 115 if (psat.gt.p) then 116 117 118 116 dqsat=0. 117 return 118 endif 119 119 120 120 if (T.gt.T_h2O_ice_liq) then 121 dummy = r3vap orization*(T_h2O_ice_liq-Trefvaporization)/(T-Trefvaporization)**2 ! liquid / vapour122 else if (T.lt.Tmin) then 123 124 dummy = r3sub limation*(T_h2O_ice_liq-Trefsublimation)/(Tmin-Trefsublimation)**2 ! solid / vapour121 dummy = r3vap*(T_h2O_ice_liq-Trefvap)/(T-Trefvap)**2 ! liquid / vapour 122 else if (T.lt.Tmin) then 123 print*, "careful, T<Tmin in Lcp psat water" 124 dummy = r3sub*(T_h2O_ice_liq-Trefsub)/(Tmin-Trefsub)**2 ! solid / vapour 125 125 else 126 dummy = r3sub limation*(T_h2O_ice_liq-Trefsublimation)/(T-Trefsublimation)**2 ! solid / vapour126 dummy = r3sub*(T_h2O_ice_liq-Trefsub)/(T-Trefsub)**2 ! solid / vapour 127 127 endif 128 128 129 129 dqsat=RLVTT/RCPD*qsat*(p/(p-(1.-epsi)*psat))*dummy 130 130 dlnpsat=RLVTT/RCPD*dummy 131 131 return 132 132 end subroutine Lcpdqsat_water … … 155 155 ! input 156 156 real p 157 real ra 157 158 158 159 ! output … … 161 162 ! JL12 variables for tetens formula 162 163 real,parameter :: Pref_solid_liquid=611.14 163 real,parameter :: Trefvaporization=35.86 164 real,parameter :: Trefsublimation=7.66 165 real,parameter :: r3vaporization=17.269 166 real,parameter :: r3sublimation=21.875 164 real,parameter :: Trefvap=35.86 165 real,parameter :: Trefsub=7.66 166 real,parameter :: r3vap=17.269 167 real,parameter :: r3sub=21.875 168 169 ra = p/Pref_solid_liquid 167 170 168 171 if (p.lt.Pref_solid_liquid) then ! solid / vapour 169 Tsat =(T_h2O_ice_liq*r3sub limation- Trefsublimation*Log(p/Pref_solid_liquid))/(r3sublimation-Log(p/Pref_solid_liquid))172 Tsat =(T_h2O_ice_liq*r3sub-Trefsub*Log(ra))/(r3sub-Log(ra)) 170 173 else ! liquid / vapour 171 Tsat =(T_h2O_ice_liq*r3vap orization- Trefvaporization*Log(p/Pref_solid_liquid))/(r3vaporization-Log(p/Pref_solid_liquid))174 Tsat =(T_h2O_ice_liq*r3vap-Trefvap*Log(ra))/(r3vap-Log(ra)) 172 175 endif 173 176 … … 202 205 ! JL12 variables for tetens formula 203 206 double precision,parameter :: Pref_solid_liquid=611.14d0 204 double precision,parameter :: Trefvap orization=35.86D0205 double precision,parameter :: Trefsub limation=7.66d0207 double precision,parameter :: Trefvap=35.86D0 208 double precision,parameter :: Trefsub=7.66d0 206 209 double precision,parameter :: Tmin=8.d0 207 double precision,parameter :: r3vap orization=17.269d0208 double precision,parameter :: r3sub limation=21.875d0210 double precision,parameter :: r3vap=17.269d0 211 double precision,parameter :: r3sub=21.875d0 209 212 210 213 ! checked vs. old watersat data 14/05/2012 by JL. 211 214 212 215 if (T.gt.T_h2O_ice_liq) then 213 psat = Pref_solid_liquid*Exp(r3vap orization*(T-T_h2O_ice_liq)/(T-Trefvaporization)) ! liquid / vapour214 else if (T.lt.Tmin) then 215 216 psat = Pref_solid_liquid*Exp(r3vap*(T-T_h2O_ice_liq)/(T-Trefvap)) ! liquid / vapour 217 else if (T.lt.Tmin) then 218 print*, "careful, T<Tmin in psat water" 216 219 ! psat = Pref_solid_liquid*Exp(r3sublimation*(Tmin-T_h2O_ice_liq)/(Tmin-Trefsublimation)) ! min psat 217 220 ! Ehouarn: gfortran says: Error: Result of EXP underflows its kind, … … 219 222 psat=tiny(psat) 220 223 else 221 psat = Pref_solid_liquid*Exp(r3sub limation*(T-T_h2O_ice_liq)/(T-Trefsublimation)) ! solid / vapour224 psat = Pref_solid_liquid*Exp(r3sub*(T-T_h2O_ice_liq)/(T-Trefsub)) ! solid / vapour 222 225 endif 223 226 if(psat.gt.p) then … … 258 261 ! JL12 variables for tetens formula 259 262 double precision,parameter :: Pref_solid_liquid=611.14d0 260 double precision,parameter :: Trefvap orization=35.86d0263 double precision,parameter :: Trefvap=35.86d0 261 264 double precision,parameter :: Tmin=8.d0 262 double precision,parameter :: Trefsub limation=7.66d0263 double precision,parameter :: r3vap orization=17.269d0264 double precision,parameter :: r3sub limation=21.875d0265 double precision,parameter :: Trefsub=7.66d0 266 double precision,parameter :: r3vap=17.269d0 267 double precision,parameter :: r3sub=21.875d0 265 268 266 269 double precision :: dummy 267 270 268 271 if (psat.gt.p) then 269 270 271 272 dqsat=0.d0 273 return 274 endif 272 275 273 276 if (T.gt.T_h2O_ice_liq) then 274 dummy = r3vap orization*(T_h2O_ice_liq-Trefvaporization)/(T-Trefvaporization)**2 ! liquid / vapour275 else if (T.lt.Tmin) then 276 277 dummy = r3sub limation*(T_h2O_ice_liq-Trefsublimation)/(Tmin-Trefsublimation)**2 ! solid / vapour277 dummy = r3vap*(T_h2O_ice_liq-Trefvap)/(T-Trefvap)**2 ! liquid / vapour 278 else if (T.lt.Tmin) then 279 print*, "careful, T<Tmin in Lcp psat water" 280 dummy = r3sub*(T_h2O_ice_liq-Trefsub)/(Tmin-Trefsub)**2 ! solid / vapour 278 281 else 279 dummy = r3sub limation*(T_h2O_ice_liq-Trefsublimation)/(T-Trefsublimation)**2 ! solid / vapour282 dummy = r3sub*(T_h2O_ice_liq-Trefsub)/(T-Trefsub)**2 ! solid / vapour 280 283 endif 281 284 282 285 dqsat=RLVTT/RCPD*qsat*(p/(p-(1.d0-epsi)*psat))*dummy 283 286 dlnpsat=RLVTT/RCPD*dummy 284 287 return 285 288 end subroutine Lcpdqsat_waterDP
Note: See TracChangeset
for help on using the changeset viewer.