[ncl-talk] Calculating Barotropic streamfunction and AMOC using data with missing values?
Michael Hemming
michael.hemming at mpimet.mpg.de
Tue Sep 2 05:16:05 MDT 2014
Hello,
I have been struggling to calculate Barotropic streamfunction and AMOC
using online examples and function but I have recently been told it is
due to the fact that the data I use contains missing values, therefore
all values are set to the missing value.
How can I somehow ignore the missing values during calculation?
Here is my code for the bartropic streamfunction:
----------------------------------------------------------------------------------------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
;##########################################################################
;##########################################################################
;-------------------------Barotropic Plots---------------------------------
;--------------------------------------------------------------------------
;##########################################################################
;##########################################################################
;----------Load in data
;ICON
noshupw = addfile ("con.ym.atlbox.noshift.100y.nc", "r")
u = noshupw->u_vint_acc
u&lon = u&lon-360 ; Fix the longitudes to be < 360
lat = noshupw->lat
v = noshupw->v_acc
printVarSummary(u)
printVarSummary(v)
dimUV= dimsizes(barai)
klev = 20 ; number of levels in total
sf = v(:,{klev},:,:)
vp = v(:,{klev},:,:)
sf at long_name = "stream function"
vp at long_name = "velocity potential"
sf at units = "m^2/s"
vp at units = "m^2/s"
printVarSummary(sf)
printVarSummary(vp)
uv2sfvpg(u,v,sf,vp)
----------------------------------------------------------------------------------------------------------------------------------------------------
and my AMOC code is largely based on the online example moc_1.ncl
thanks,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140902/40629996/attachment.html
More information about the ncl-talk
mailing list