Check out the NCL command line options. This allows you to set NCL
variables on the NCL command line, with something like:
ncl 'output="ps"' contour=1 script.ncl
The above effectively creates a string variable called "output" and
an integer variable called "contour" which you can reference in your
NCL script like real variables.
At the beginning of "script.ncl", you can test to see if these
variables were set on the command line. If not, then you can give
them default values.
For example, in "script.ncl":
if (.not.isvar("contour")) then
contour = 0
end if
if (.not.isvar("output")) then
output = "x11"
end if
You can set up a shell script to invoke NCL with these command line
options.
For more information, see:
http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclCLO.shtml
--Mary
On Dec 16, 2009, at 2:12 AM, Wee-Beng Tay wrote:
> Hi,
>
> I've an ocean code and I'm using NCL to draw the plots. However, I
> will like the user to be able to select some options, like
> different kinds of output, output to screen/file etc.
>
> So how can this be done?
>
> I'm thinking of doing the following:
>
> 1. my code is in fortran. there's a namelist file with variables
> like :
>
> output_type=1 or 2 (contour=1, vector =2). So the user will enter
> the selection in the namelist.
>
> 2. this will create a file in the end for the ncl script to read in.
>
> 3. based on the different options, different types, number of plots
> will be generated.
>
> Is this the way to do it? Or is there a better way?
>
> Thanks
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Dec 16 09:39:21 2009
This archive was generated by hypermail 2.1.8 : Thu Dec 17 2009 - 17:15:52 MST