Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions tools/analysis/Krasting-SeaIce.csh
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,13 @@ geolon = netCDF4.Dataset('gridspec/ocean_hgrid.nc').variables['x'][1::2,1::2]
geolat = netCDF4.Dataset('gridspec/ocean_hgrid.nc').variables['y'][1::2,1::2]
area_t = netCDF4.Dataset('gridspec/ocean_hgrid.nc').variables['area'][:].reshape((geolon.shape[0],2,geolon.shape[1],2)).sum(axis=1).sum(axis=-1)

#-- Read geolon/geolat
#-- Read yh/xh
if 'area_t' in netCDF4.Dataset('${oceanstaticfile}').variables: area_varname = 'area_t'
elif 'areacello' in netCDF4.Dataset('${oceanstaticfile}').variables: area_varname = 'areacello'
else: raise Exception('Could not find an area variable in the static grid file')
fs = cdms2.open('${oceanstaticfile}')
yh = fs('area_t').getAxis(0)
xh = fs('area_t').getAxis(1)
yh = fs(area_varname).getAxis(0)
xh = fs(area_varname).getAxis(1)

#-- Read data and compute climatology
f = cdms2.open('input.xml')
Expand Down