[ncl-talk] Query

Alan Brammer abrammer at albany.edu
Thu Aug 28 05:57:54 MDT 2014


Dear Kunali,
   The error tells you exactly what is wrong.

ncl 5> oro = in->ORO(:,:)
fatal:["Execute.c":6321]:variable (ORO) is not in file (in)
fatal:["Execute.c":8565]:Execute: Error occurred at or near line 5

You're trying to load a variable ORO from the file, but a variable by that
name does not exist in the file.  I'd recommend running  ncl_filedump
/home/kunal/14-01.nc   and check the variables in the file.
Or add print(getfilevarnames(in)) to the script after you load the file.


Once past that error, as long as oro is equal to 1 over the ocean then
you're good. Otherwise you may want an adjustment on this example from the
ncl webpage for  (oro.le.0)
 ; More advanced case mask a at locations where ma0 is not-equal-to 2

;
    out1 = *mask*( a, (ma0.ne.2), True)

ncl 6> land_only = ts
ncl 7> land_only = mask(ts,oro,1)



Good Luck,

Alan Brammer


On Thu, Aug 28, 2014 at 7:41 AM, Kunal Bali <kunal.bali9 at gmail.com> wrote:

> Hello
> I am trying to use the masking scripts for generating data only on land.
> but i am getting error. My scripts is given below.
>
> In this i am not getting the means of oro (line -5).
> Could any one suggest me to how to correct this scripts or how to
> visualize the data on land only.
>
> ncl 0> load "/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> ncl 1> load "/usr/local/lib/ncl/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> ncl 2> begin
> ncl 3> in = addfile("/home/kunal/14-01.nc","r")
> ncl 4> ts = in->TotCH4_A(:,:)
> ncl 5> oro = in->ORO(:,:)
> ncl 6> land_only = ts
> ncl 7> land_only = mask(ts,oro,1)
> ncl 8> wks = gsn_open_wks("x11","mask")
> ncl 9> gsn_define_colormap(wks,"BlAqGrYeOrRe")
> ncl 10> res = True
> ncl 11> res at cnFillOn = True
> ncl 12> res at cnLinesOn = False
> ncl 13> res at gsnSpreadColors = True
> ncl 14> res at gsnSpreadColorStart = 10
> ncl 15> res at gsnSpreadColorEnd = 96
> ncl 16> res at cnLevelSpacingF = 3
> ncl 17> res at lbLabelString = 4
> ncl 18> res at tiMainString = "Land Only"
> ncl 19> plot = gsn_csm_contour_map_ce(wks,land_onl,res)
> ncl 20> end
> fatal:["Execute.c":6321]:variable (ORO) is not in file (in)
> fatal:["Execute.c":8565]:Execute: Error occurred at or near line 5
>
>
> Thank You
> Kunal Bali
> Research Scholar
> Radio & Atmospheric Science Division
> CSIR - National Physical Laboratory
> New Delhi - 110012
>
>
>
>
>
>
> _______________________________________________
> 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/20140828/0c3308b3/attachment.html 


More information about the ncl-talk mailing list