Open fabeit opened 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.
@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.
@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
@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.
@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.
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.
@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.
@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.
@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
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
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.
@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)
@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.
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.