Skip to content

Commit

Permalink
Merge pull request #197 from blychs/hotfix/_camx_mm
Browse files Browse the repository at this point in the history
Hotfix/_camx_mm consistent with _wrfchem_mm
  • Loading branch information
zmoon authored Oct 7, 2024
2 parents 8772910 + 4ea34c3 commit 7c5ee66
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions monetio/models/_camx_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def open_mfdataset(
dset = add_met_data_3D(dset, dset_met)
if "alt_agl_m_mid" in dset.variables:
var_list = var_list + ["alt_agl_m_mid"]
if "layer_height_agl" in dset.variables:
var_list = var_list + ["layer_height_agl"]
if "dz_m" in dset.variables:
var_list = var_list + ["dz_m"]
if "pres_pa_mid" in dset.variables:
var_list = var_list + ["pres_pa_mid"]
if "temperature_k" in dset.variables:
Expand Down Expand Up @@ -458,6 +458,12 @@ def _calc_midlayer_height_agl(dset):
alt_agl_m_mid[:, :, :, :] = mid_layer_height
alt_agl_m_mid.attrs["var_desc"] = "Layer height above ground level at midpoint"
alt_agl_m_mid.attrs["long_name"] = "Height AGL at midpoint"

dz_m = xr.zeros_like(layer_height_agl)
dz_m[:, 0, :, :] = layer_height_agl[:, 0, :, :].values
dz_m[:, 1:, :, :] = layer_height_agl[:, 1, :, :].values - layer_height_agl[:, :-1, :, :].values
dz_m.attrs["long_name"] = "dz in meters"
dz_m.attrs["var_desc"] = "Layer thickness in meters"
return alt_agl_m_mid, layer_height_agl


Expand Down

0 comments on commit 7c5ee66

Please sign in to comment.