diff --git a/gcm_toolkit/core/const.py b/gcm_toolkit/core/const.py index 7234f66..7f2d610 100644 --- a/gcm_toolkit/core/const.py +++ b/gcm_toolkit/core/const.py @@ -64,7 +64,7 @@ R_p="R_p", Kappa="Kappa", cp="cp", - R_s="R_s", + R="R", # specific gas constant p_ref="p_ref", p0="p0", dt="dt", diff --git a/gcm_toolkit/mitgcm/utils.py b/gcm_toolkit/mitgcm/utils.py index a5a6172..e1ad52b 100755 --- a/gcm_toolkit/mitgcm/utils.py +++ b/gcm_toolkit/mitgcm/utils.py @@ -87,12 +87,10 @@ def convert_winds_and_t(dsi, temp_dim, w_dim): ) # calculate scale height - h_val = dsi.attrs[c["R_s"]] / dsi.attrs[c["g"]] * dsi[temp_dim] + h_val = dsi.attrs[c["R"]] / dsi.attrs[c["g"]] * dsi[temp_dim] # calculate geometric height - rho = ( - dsi[c["Z"]] / dsi.attrs[c["R_s"]] / dsi[temp_dim] - ) # ideal gas equation + rho = dsi[c["Z"]] / dsi.attrs[c["R"]] / dsi[temp_dim] # ideal gas equation dzdp = -1 / rho / dsi.attrs[c["g"]] # hydrostatic eq. dsi[c["Z_geo"]] = dzdp.cumulative_integrate(coord=c["Z"]) @@ -159,7 +157,7 @@ def mitgcm_postprocessing(dsi, outdir=None, datafile=None): get_parameter(datafile, "atm_p0", 1.0e5) ), # reference pressure in pa c["cp"]: cp, # heat cap at constant pres - c["R_s"]: rs, # specific gas constant + c["R"]: rs, # specific gas constant c[ "Kappa" ]: kappa, # ratio of heat cap at constant pres to specific gas constant diff --git a/gcm_toolkit/utils/manipulations.py b/gcm_toolkit/utils/manipulations.py index 664ba1d..e5159ec 100644 --- a/gcm_toolkit/utils/manipulations.py +++ b/gcm_toolkit/utils/manipulations.py @@ -222,7 +222,7 @@ def _calc_hydrostat_eq(dsi, temp_key): Helper function that calculated rho and dz/dp based on the ideal gas equation and on hydrostatic eq. """ - rho = dsi[c["Z"]] / dsi.attrs[c["R_s"]] / dsi[temp_key] + rho = dsi[c["Z"]] / dsi.attrs[c["R"]] / dsi[temp_key] dzdp = -1 / rho / dsi.attrs[c["g"]] return dzdp, rho @@ -305,7 +305,7 @@ def m_add_theta(dsi, var_key_out=None, temp_key="T"): A dataArray with reduced dimensionality, containing the potential temperature """ theta = dsi[c[temp_key]] * (dsi.attrs[c["p_ref"]] / dsi[c["Z"]]) ** ( - dsi.attrs[c["R_s"]] / dsi.attrs[c["cp"]] + dsi.attrs[c["R"]] / dsi.attrs[c["cp"]] ) if var_key_out is not None: