Skip to content

Commit ae1a4ff

Browse files
author
Fredrik Jansson
committed
add Zf field to spifs.nc also for the extra columns
1 parent a1de804 commit ae1a4ff

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

splib/spcpl.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def gather_gcm_data(gcm, les_models, couple_surface, output_column_indices=None)
9898
QI = C['QI'].value_in(units.mfu), #A.value_in(units.ccu)
9999
Pf = C['Pf'].value_in(units.Pa),
100100
Ph = C['Ph'].value_in(units.Pa),
101-
# Zf = C['Zf'].value_in(units.m),
101+
Zf = C['Zf'].value_in(units.m),
102102
Zh = C['Zh'].value_in(units.m),
103103
Psurf = C['Psurf'].value_in(units.Pa),
104104
Tv = C['Tv'].value_in(units.K),
@@ -248,8 +248,9 @@ def output_column_conversion(profile):
248248

249249
# height of full levels - simply average half levels (for now)
250250
# better: use full level pressure to calculate height?
251-
# Zf = (Zh[1:] + Zh[:-1]) * .5
251+
Zf = (Zh[1:] + Zh[:-1]) * .5
252252
profile['Zh'] = Zh[1:]
253+
profile['Zf'] = Zf[:]
253254
profile['Psurf'] = profile['Ph'][-1]
254255
profile['Ph'] = profile['Ph'][1:]
255256
profile['THL'] = (profile['T'] - (sputils.rlv * (profile['QL'] + profile['QI'])) / sputils.cp) * sputils.iexner(profile['Pf'])

0 commit comments

Comments
 (0)