EDmodel / ED2

Ecosystem Demography Model
79 stars 113 forks source link

Why is specific humidity limited at 0.032? #29

Open fabeit opened 9 years ago

fabeit commented 9 years ago

I am wondering what is the reason for setting maximum specific humidity to 0.032. I understand that the dewpoint at 32°C and 1000hPa corresponds to .032. However in my data set I have cases in which I have a specific humidity higher than .032 but my relative humidity is less than 100%. Perhaps there is some physics law that I am not aware of so I apologize in advance this sounds like a silly question.what is the reason for using a "static" specific humidity at these conditions?

These are some examples in my data set, I have used David LeBauer R script to calculate relative humidity.

temp[y] [1] 34.01617 33.94131 34.24038 34.61071 35.38662 34.64257 34.05575 34.26895 35.48477 35.56072 [11] 32.82665 33.30193 36.37802 34.32531 35.53552 34.27352 35.56439 36.65029 34.24539 pres[y] [1] 958.2904 961.2945 966.2562 958.0849 961.8770 959.6063 953.5177 955.0603 956.4476 953.5868 [11] 903.1379 903.8415 950.6209 950.8947 950.8907 953.0804 950.4606 946.3468 947.5901 qair[y] [1] 0.03300236 0.03323020 0.03360319 0.03318560 0.03589034 0.03456816 0.03369993 0.03337700 [9] 0.03615537 0.03616529 0.03308699 0.03325040 0.03340801 0.03428431 0.03527325 0.03384901 [17] 0.03507772 qair2rh(qair[y],temp[y],pres[y]) [1] 0.9350099 0.9482467 0.9476671 0.9092553 0.9441408 0.9461811 0.9475259 0.9290256 0.9404769 [10] 0.9339865 0.9443846 0.9246411 0.8235791 0.9466251 0.9101225 0.9397065 0.9033312 0.8702408

mpaiao commented 9 years ago

Saturation specific humidity increases with increasing temperature and decreasing pressure, so this is probably why you are relative humidity below 100%. Also, saturation is usually estimated through empirical equations, so if David LeBauer used different equations than ED, they may not match perfectly though they should still be close.

I don't think there is a strong reason for 0.032kg/kg, for most cases this ~0.010kg/kg higher than the maximum humidity measured in lowlands, but the value is less extreme at very high elevation. Since we've used ED in regional runs that included the Andes, this may be the reason we set to 0.032.

dlebauer commented 9 years ago

@fabeuw which script are you using?

Are you referring to the qair2rh function in PEcAn? If so ... the question (seems its a bug) should go there, but please see the 'reporting a bug' documentation.

Mostly, instead of printing out, e.g. temp[y], try dput(temp) to convert your object into a string that can be easily copy-pasted back when debugging.

But to clarify (from ?qair2rh) my goal was to implement the equations from Bolton 1980 "The computation of Equivalent Potential Temperature" found on the UCAR CEOP documentation.

mpaiao commented 9 years ago

@dlebauer I don't think there is anything wrong with qair2rh. I tried the same input that @fabeuw shared, but using ED's equations and got very similar numbers:

c(0.93548858964889, 0.948720540260325, 0.948187104692371, 0.909810742450337, 0.944843363852721, 0.946763926917076, 0.948017111952061, 0.929539675114957, 0.941192627063771, 0.934710420241989, 0.944691137772848, 0.925009029396357, 0.824340536978163, 0.947157635582847, 0.910823726145034, 0.940227267948437, 0.904031850909612)

The small differences are probably be due to different empirical equations for saturation vapour pressure. For reference, the equations in ED came from Murphy and Koop (2005), http://dx.doi.org/10.1256/qj.04.94

fabeit commented 9 years ago

@dlebauer Let me clarify, there is nothing wrong with the qair2rh procedure. I wanted to calculate relative humidity to see if in fact my data had more than 100% relative humidity, and in fact it does in certain points.

But mainly I was wondering about the cases where specific humidity is higher than 0.032 but relative humidity is lower than 100%, so in theory is should be ok but possibly this cases are unlikely in the real world as @mpaiao mentioned? And how to deal with these cases.

mpaiao commented 9 years ago

@fabeuw My suggestion is to use NCEP reanalysis for humidity. The problems you are finding in Sheffield's data for Africa are the same we found for South America.

There is a pre-processor for NCEP reanalyses that comes as part of the ED distribution, ED2/RAPP. I haven't used it for years but the steps are described in https://github.com/EDmodel/ED2/wiki/Rapp; they may not be up to date, but I'm happy to help if I can.

rgknox commented 9 years ago

We might want to bump up the sanity check. 32g/kg equates to a dew-point of roughly 33.5C, there are cities in the world that have experienced +30C dewpoints. While it may be unlikely that the earth has experienced 33.5 yet, it may be something that could be experienced in many decades or a century out.

fabeit commented 9 years ago

@mpaiao @rgknox Now just to clarify, in both threads regarding this issue with specific humidity (the other is here https://github.com/EDmodel/ED2/issues/28) I have seen that you talked about g/kg and kg/kg. From what I understand S.Hum. is dimensionless, so it should be kg/kg, this is just for clarification because the reanalysis data units are " kg kg-1" which I think it means kg/kg.

mpaiao commented 9 years ago

@fabeuw The input and output for ED should be kg_H2O/kg_moist_air, but it is common amongst meteorologists to use g/kg just because the numbers look nicer. Specific humidity looks dimensionless but it is important to remember that the masses refer to different gases; this matters for unit conversion. For example, if you use another dataset that provides mixing ratio (kg_H2O/kg_dry_air), then you must convert to specific humidity (1/specific_humidity = 1/mixing_ratio + 1). Also, sometimes humidity is given in mol_H2O/mol_dry_air, then you must scale by the ratio between molar masses then convert to specific humidity.

fabeit commented 9 years ago

@mpaiao Now just out of curiosity I have compared the Princeton Global Forcings specific humidity with NCEP and this is what the distribution looks like. Clearly the PGF is much higher, but this is for multiple years of NCEP and only one year of PGF but it will be similar even if I included more years of PGF. I find it strange that there's no mention of potential pitfalls in their data, if people use this dataset to make any conclusions it might be biased.

summary(pgf) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.01314 0.01661 0.01887 0.02001 0.02307 0.03288 summary(ncep) Min. 1st Qu. Median Mean 3rd Qu. Max. 0.00000 0.01121 0.01499 0.01353 0.01681 0.03343

mpaiao commented 9 years ago

Are these statistics for a large area, or for a specific point? Which type of ecosystem (rainforest, dry forest?). PGF is certainly very high, but if your summary is for rainforest only, then NCEP is biased low, the mean is more typical of savannahs than forests. Just for reference, these are summaries from towers at 3 sites in South America:

Very wet rainforest (Paracou) :

   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
0.01168 0.01618 0.01672 0.01668 0.01724 0.02141 

Subtropical savannah (Pe-de-Gigante):

    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
0.002605 0.009315 0.011850 0.012100 0.015110 0.020310 

Semi-arid scrubland (Petrolina):

    Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
0.004589 0.010610 0.012220 0.012230 0.013860 0.020300 
dlebauer commented 9 years ago

To generalize what @mpaiao said about bias ... since NCEP is at 2.5 degrees, relative to the site level observations, the mean for all met variables will be biased toward the mean*. In a grid cell that contains rainforest and savannah, I expect the humidity would be biased low for the forest but high for the savanna.

* Variance will also be biased toward the mean variance.

fabeit commented 9 years ago

@dlebauer @mpaiao really good points. My analysis was for a larger area that went from 0N-5N, 14E-18E, so I just picked one cell for each reanalysis and redid the calculations (just one year, don't have all the data). My reference point is 2.5N,16.5E, which is in the center of the PGF cell but the NCEP cells didn't quite line up with the 0 lat and 15E (even though they are supposed to start at 0.0 and -90.0 according to specs) I think you would consider this tropical wet forest (evergreen). Now PGF seems more likely but still higher and have big Max values, that's why my ED run was crashing.

summary(pgf) for only one cell
Min. 1st Qu.       Median     Mean   3rd Qu.   Max. 
0.00949 0.01487 0.01698 0.01804 0.02099 0.02946 

summary(ncep) calculated with rh2qair function from @mdietze 
   Min. 1st Qu.  Median      Mean    3rd Qu.    Max. 
0.01080 0.01533 0.01602 0.01605 0.01684 0.02020 
summary(ncep) calculated w/ qair2rh function from  @dlebauer solved for qair 
   Min. 1st Qu.  Median      Mean     3rd Qu.   Max. 
0.01083 0.01544 0.01614 0.01617 0.01695 0.02034 

and these are the ones for the congo basin I posted earlier

summary(pgf)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.01314 0.01661 0.01887 0.02001 0.02307 0.03288
summary(ncep)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.00000 0.01121 0.01499 0.01353 0.01681 0.03343

Here you can see where the two cells fall. (red=PGF, yellow=NCEP) metcompare

mpaiao commented 9 years ago

@fabeuw They are closer, but I still think PGF is high, at least based on the mean, and that this particular area is somewhat at higher elevation (thus probably cooler) than most of the Amazon.