Skip to content

Commit 91ab64c

Browse files
committed
radiation always divided by 3600 (accumulated over 1hour) and TP is multiplied by timestep to get full budget when timesteps are > 1
1 parent 8a8f4ae commit 91ab64c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

TopoPyScale/topo_scale.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def pt_downscale_interp(row, ds_plev_pt, ds_surf_pt, meta):
184184
else:
185185
down_pt['precip_lapse_rate'] = down_pt.t * 0 + 1
186186

187-
down_pt['tp'] = down_pt.precip_lapse_rate * surf_interp.tp * 1 / meta.get('tstep') * 10 ** 3 # Convert to mm/hr
187+
down_pt['tp'] = down_pt.precip_lapse_rate * surf_interp.tp * 1 * meta.get('tstep') * 10 ** 3 # Convert to mm/hr
188188
down_pt['theta'] = np.arctan2(-down_pt.u, -down_pt.v)
189189
down_pt['theta_neg'] = (down_pt.theta < 0) * (down_pt.theta + 2 * np.pi)
190190
down_pt['theta_pos'] = (down_pt.theta >= 0) * down_pt.theta
@@ -252,7 +252,7 @@ def pt_downscale_radiations(row, ds_solar, horizon_da, meta, output_dir):
252252
surf_interp['cse'] = 0.23 + x1 * (surf_interp.vp / surf_interp.t2m) ** (1 / x2)
253253
# Calculate the "cloud" emissivity, UNIT OF STRD (Jjoel_testJun2023/m2)
254254

255-
tstep_seconds = pd.Timedelta(f"{meta.get('tstep')}H").seconds
255+
tstep_seconds = 3600
256256

257257
surf_interp['cle'] = (surf_interp.strd / tstep_seconds) / (sbc * surf_interp.t2m ** 4) - \
258258
surf_interp['cse']

0 commit comments

Comments
 (0)