Open hinnes97 opened 1 year ago
Thanks for alerting us to this issue. Looking into this, it is clear that a bug was introduced in the cntnm_progr code in 2004 when MT_CKD_1.2 was released. Before that, the relevant line was: WK(1) = VMRH2O WTOT but after that it became: WK(1) = VMRH2O W_dry without any other changes. So, somehow VMRH2O, which clearly is defined as with respect to total air, was mistakenly utilized as though it was with respect to dry air (as it is throughout LBLRTM and MT_CKD). It's unclear why the coder made an exception to the standard definition of mixing ratio in LBLRTM-related codes to have this variable otherwise defined, but once that exception was made the rest of that code should have remained consistent with that definition. It isn't, so users of our standalone continuum code (which is not part of LBLRTM) would have slightly incorrect optical depths, as this comment points out.
There is no issue with LBLRTM calculations since this bug is not part of LBLRTM.
The commenter's suggestion for a fix is exactly what is needed -- basically changing the code back to what it was prior to MT_CKD_1.2. We'll do that in the next release.
Thanks for your help.
Summary of issue
In
cntnm_progr.f90
, the variablevmrh2o
is referred to as a mixing ratio with respect to the total column density: https://github.com/AER-RC/MT_CKD/blob/f6edc93bc608b01029c373d84012c1575d1e58b6/src/cntnm_progr.f90#L187-L188 The variableW_dry
is defined consitently with this definition as: https://github.com/AER-RC/MT_CKD/blob/f6edc93bc608b01029c373d84012c1575d1e58b6/src/cntnm_progr.f90#L213 However, later it is written: https://github.com/AER-RC/MT_CKD/blob/f6edc93bc608b01029c373d84012c1575d1e58b6/src/cntnm_progr.f90#L235 where wk(1) is supposed to be the column density of water vapour. This implies thath2ovmr
is a mixing ratio with respect to the dry column mass, but taken with the line above this suggestswk(1) = w_dry*h2ovmr = wtot*vmrh2o*(1-vmrh2o)
, which I think leads to an underestimation in the water column density.Resulting errors in optical depths
This leads to problems in the LBLRTM
cntnm.f90
, becauseWTOT
(the total column density) is redefined as the sum ofwk
entries:leading to it being underestimated, and lower than the value of
WTOT
incntnm_progr.f90
, or the value derived using the ideal gas law $p/kT \times \text{path length}$. This then affects the value ofh2o_fac
, which is supposed to be the total $\text{H}_2\text{O}$ column density aswk(1)/WTOT
, but is now not equal tovmr_h2o
becausewk(1)
andWTOT
have both been underestimated.This doesn't affect the coefficients in
WATER.COEF
because they are both divided by and multpilied through byh2o_fac
at various points in the code. However, it does affect the optical depths inCNTNM.OPTDPT
since these rely on the continuum coefficients being multiplied bywk(1)
.Proposed solution
TL;DR, I think this can be solved by changing:
WK(1) = VMRH2O * W_dry
toWK(1) = VMRH2O * WTOT
. Using this change, I can get agreement between optical depths calculated withWATER.COEF
coefficients, those inCNTNM.OPTDPT
and those derived from the netcdf fileabsco-ref_wv-mt-ckd.nc