Under the subroutines, the app_functions.py needs to be updated with the following suggestion:
subroutines/app_functions.py
# 20122023: ars599 replace the interpolate code lat and lat_v should swap
def plevinterp(var,pmod,heavy,lat,lat_v):
plev,bounds=plev19()
t,z,x,y=np.shape(var)
th,zh,xh,yh=np.shape(heavy)
if xh != x:
print 'heavyside not on same grid as variable; interpolating...'
hout=np.ma.zeros([th,zh,len(lat),yh],dtype=np.float32)
for k in range(th):
for i in range(zh):
for j in range(yh):
hint=interp1d(lat_v,heavy[k,i,:,j],kind="linear",fill_value="extrapolate")
hout[k,i,:,j]=hint(lat)
hout=np.where(hout<=0.5,0,hout)
hout=np.where(hout>0.5,1,hout)
vout=np.ma.zeros([t,len(plev),x,y],dtype=np.float32)
print 'interpolating var from model levels to plev19...'
for k in range(t):
for i in range(x):
for j in range(y):
vint=interp1d(pmod[k,:,i,j],var[k,:,i,j],kind="linear",fill_value="extrapolate")
vout[k,:,i,j]=vint(plev)
return vout/hout