[ncl-talk] about variables
Rick Brownrigg
brownrig at ucar.edu
Mon Dec 15 10:25:40 MST 2014
A minor correction to my previous reply: you may need to move the
assignment to plev after the call to filevardef.
On Mon, Dec 15, 2014 at 10:22 AM, Rick Brownrigg <brownrig at ucar.edu> wrote:
>
> Hi Mark,
>
> I think you need to write:
>
> write_file->plev = 50000.0
>
> to make plev a file-variable, as opposed to a local variable.
>
> HTH...
> Rick
>
>
> On Sat, Dec 13, 2014 at 3:59 AM, Mark Chan <cym263 at yahoo.com> wrote:
>
>> Dear NCL users,
>>
>> A variable "plev2" is defined as in the below:
>>
>> plev2=3.0
>> plev2 at axis=(/"Z"/)
>> plev2 at positive=(/"Down"/)
>> plev2 at units=(/"Pa"/)
>> plev2 at standard_name=(/"air_pressure"/)
>> plev2 at long_name=(/"pressure"/)
>> plev2!0 = "ncl_scalar"
>>
>> Then another variable "plev" would be defined, with the same attribute as
>> "plev2", but its value is different.
>>
>> plev=50000.0
>> filevardef(write_file,"plev",typeof(plev2),"ncl_scalar")
>> filevarattdef(write_file,"plev", plev2)
>>
>> write_file->zg500=ZG500(limTime(0):limTime(1),0,limS_N(0):limS_N(1), \
>> limW_E(0):limW_E(1))
>>
>> However, the variable "plev" did not get the value as 50000.0 here.
>> I would appreciate your help very much!
>>
>> With my best regards,
>>
>> Mark
>>
>>
>> _______________________________________________
>> 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/20141215/af903723/attachment.html
More information about the ncl-talk
mailing list