diff --git a/fv3core/pace/fv3core/initialization/init_utils.py b/fv3core/pace/fv3core/initialization/init_utils.py index 15a46d5d..42252e87 100644 --- a/fv3core/pace/fv3core/initialization/init_utils.py +++ b/fv3core/pace/fv3core/initialization/init_utils.py @@ -179,18 +179,6 @@ def horizontally_averaged_temperature(eta): return t_mean -def _initialize_delp(ak, bk, ps, shape): - # TODO: resolve function duplication - delp = np.zeros(shape) - delp[:, :, :-1] = ( - ak[None, None, 1:] - - ak[None, None, :-1] - + ps[:, :, None] * (bk[None, None, 1:] - bk[None, None, :-1]) - ) - - return delp - - def initialize_delp(ps, ak, bk): return ( ak[None, None, 1:] @@ -203,15 +191,6 @@ def initialize_delz(pt, peln): return constants.RDG * pt[:, :, :-1] * (peln[:, :, 1:] - peln[:, :, :-1]) -def _initialize_edge_pressure(delp, ptop, shape): - # TODO: resolve function duplication - pe = np.zeros(shape) - pe[:, :, 0] = ptop - for k in range(1, pe.shape[2]): - pe[:, :, k] = ptop + np.sum(delp[:, :, :k], axis=2) - return pe - - def initialize_edge_pressure(delp, ptop): pe = np.zeros(delp.shape) pe[:, :, 0] = ptop diff --git a/fv3core/pace/fv3core/initialization/test_cases/initialize_tc.py b/fv3core/pace/fv3core/initialization/test_cases/initialize_tc.py index f118557b..33689344 100644 --- a/fv3core/pace/fv3core/initialization/test_cases/initialize_tc.py +++ b/fv3core/pace/fv3core/initialization/test_cases/initialize_tc.py @@ -535,8 +535,8 @@ def init_tc_state( # for now, take from metric terms ak = _define_ak() bk = _define_bk() - delp = init_utils._initialize_delp(ak, bk, ps, shape) - pe = init_utils._initialize_edge_pressure(delp, tc_properties["ptop"], shape) + delp = init_utils.initialize_delp(ps, ak, bk) + pe = init_utils.initialize_edge_pressure(delp, tc_properties["ptop"]) peln = np.log(pe) pk, pkz = init_utils.initialize_kappa_pressures(pe, peln, tc_properties["ptop"])