Vertical interpolation of Relative Humidity
name: General Issue (FA)
about: Use this template for reporting an anomaly.
Please make sure that this is a bug. As per our GitHub Policy, we only address code/doc bugs, performance issues and build/installation issues on GitHub.
System information
- OS Platform and Distribution (e.g., Linux Ubuntu 16.04): any
- Maja installed from (source or binary): binaries
- Maja version (use command below): 4.5.3 (applies to former versions)
- Maja commit sha (if Maja is installed from source):
- Python version (From binpkg or custom):
- Complementary info (i.e. GCC/Compiler version)
Describe the current behavior
The interpolation of the CAMS RH profile provided for 22 pressure level to vertical model levels matching CAMS Mixing Ratios seems to exclude the n'th first and last pressure levels, according to the following portion of code (in 'Code/Core/Data/IO/vnsCAMSFileHandler.cxx'):
for (unsigned int i = 0; i < p_NbNonInterpolable;++i)
{
l_RHml.push_back(p_RH[0]);
}
for (unsigned int i = p_NbNonInterpolable; i < p_ModelLevels.size()-p_NbNonInterpolable;++i)
{
l_RHml.push_back(Interpolate1D(p_pressureLevels,p_RH, p_RH.GetSize(),p_ModelLevels[i]));
}
for (unsigned int i = p_ModelLevels.size()-p_NbNonInterpolable; i < p_ModelLevels.size();++i)
{
l_RHml.push_back(p_RH[p_RH.GetSize()-1]);
}
with 'p_NbNonInterpolable' = 20 (value found in the XML meta-data file generated by cams_download)
It may well be a misunderstanding of the code from my side, but as I see it, the first and last 20 levels are set to either the first or last value of the RH profile.
If CAMS provides MR profiles at 137 levels, only 97 values in-between are interpolated. It's getting worst with fewer model levels, and falls down to an error if model levels < 40.
Describe the expected behavior
All the values of the RH profile should be used for the interpolation (unless RH<0 or RH>100). There's certainly a good reason for this implementation, and I'd like to know it.
Urgency/Criticity
- Urgency (Select Low/Medium/High): Medium
- Criticity (Select Low/Medium/High): Medium
Code to reproduce the issue
Any context with option --cams
Correction
May not lead to correction if justified.