Re: To call a ncl script within another

From: Dave Allured - NOAA Affiliate <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 28 2013 - 12:14:10 MDT

NCL has very good support for user-written functions and procedures.
Please see the appropriate documentation:

http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclStatements.shtml#Procedures

--Dave
Please reply to user list only!

On Thu, Mar 28, 2013 at 11:27 AM, Noel Aloysius <noel.aloysius@gmail.com> wrote:
> Hi NCL-talk,
>
> I have written a script to perform some analysis. Now I want to create
> several plots. I want to keep the analysis and plotting part separately.
> I would like to know how to call the plot scripts, like the one below, saved
> as a separate file (say plot1.ncl) within my main script.
>
> Thanks,
>
> ;---------------------- plot1.ncl
>
> ffig = diro + "Natgrid_interpolation_test_fig_v1"
> wks = gsn_open_wks(type, ffig)
> nplots = 1
> plot = new(nplots, graphic)
> gsn_define_colormap(wks, "ncl_default")
> maps = NewList("fifo")
>
> res1 = True ; plot mods
> desired
> res1@gsnDraw = False
> res1@gsnFrame = False
> res1@gsnMaximize = True
>
> res1@gsnStringFontHeightF = 0.0125
> res1@gsnSpreadColors = True
> res1@gsnAddCyclic = False
>
> res1@cnFillMode = "RasterFill"
> res1@cnFillOn = True
> res1@cnLinesOn = False
> res1@cnLineLabelsOn = False
>
> res1@mpFillOn = False
> res1@mpOutlineBoundarySets = "National"
> res1@mpPerimOn = True
> res1@mpDataBaseVersion = "MediumRes"
> res1@mpDataSetName = "Earth..4"
> res1@mpOceanFillColor = 1
>
> plot = gsn_csm_contour_map(wks,xannet, res1)
>
> ; draw region of interest
> lnres1 = True
> lnres1@gsLineColor = "black"
> lnres1@gsLineDashPattern = 0
> lnres1@gsLineThicknessF = 2.0
> ListPush(maps, gsn_add_shapefile_polylines(wks,plot,fshp1,lnres1))
>
> draw(wks)
> frame(wks)
>
> ;--------------------------------------------
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Mar 28 12:14:21 2013

This archive was generated by hypermail 2.1.8 : Tue Apr 02 2013 - 21:23:48 MDT