[ncl-talk] Calculating Barotropic streamfunction and AMOC using data with missing values?
Mary Haley
haley at ucar.edu
Fri Sep 5 11:59:35 MDT 2014
Hi Michael,
I'm hoping Dennis will weigh in here.
You really don't want to use the spherical harmonic routines on missing
data. Normally I would say you need to regrid the data or use
poisson_grid_fill first so you can get rid of missing values, but given
that this is UV data, I don't think this is your best option.
--Mary
On Tue, Sep 2, 2014 at 5:16 AM, Michael Hemming <
michael.hemming at mpimet.mpg.de> wrote:
> 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
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140905/2dc16355/attachment.html
More information about the ncl-talk
mailing list