atmoschem / eixport

Export Emissions to Atmospheric Models
https://atmoschem.github.io/eixport/
Other
27 stars 10 forks source link

add wrf_rh #67

Closed ibarraespinosa closed 5 months ago

ibarraespinosa commented 3 years ago

we need an RH calculator

Schuch666 commented 3 years ago

Hello @ibarraespinosa !

Try this function to calculate RH using T2, Q2 and P from WRF output:


# q  [Kg/Kg]
# t  [K]
# p  [Pa]

# P       T       Q        RH (from NCL example)
# (Pa)    (K)     (KG/KG)  (%)
# 100800  302.45  0.02038  79.8228

rh <- function(q = 0.0002038, t = 302.45, p = 100800){
  t  <- t - 273.15
  e  <- q * p / 0.622
  es <- 610.8 * exp(17.3*t /(t + 237.3))
  RH <- 100 * e / es
  if(RH > 1)
    RH = 1
  return(100 * RH)
}
rh()
# 80.76 % 
Schuch666 commented 5 months ago

Im including this function on hackWRF, but I will change many of this functions (including this) to a different package

ibarraespinosa commented 5 months ago

cool man

On Thu, Mar 21, 2024 at 1:49 PM Daniel Schuch @.***> wrote:

Im including this function on hackWRF, but I will change many of this functions (including this) to a different package

— Reply to this email directly, view it on GitHub https://github.com/atmoschem/eixport/issues/67#issuecomment-2013537729, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGRM74H7VNXTCC2FDZPF2KTYZM2WLAVCNFSM4277FIUKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TEMBRGM2TGNZXGI4Q . You are receiving this because you were mentioned.Message ID: @.***>