Re: netcdf to binary question

From: Adam Phillips <asphilli_at_nyahnyahspammersnyahnyah>
Date: Fri, 29 Jun 2007 14:52:23 -0600

Hi Erik,

I am guessing that NCL does not like the "-" in the variable name. Try
encasing the array name in $" "$:
t15 = fi->$"temperature_at_1-5m"$

The $ sign tells ncl to evaluate a string as a variable name, and the
quotes convert temperature_at_1-5m to a string so we can use the $ signs..

Good luck,
Adam

Erik Noble wrote:
> I wrote a code to turn a netCDF file into a binary file.
>
> I resulted with two errors:
>
> fatal:syntax error: line 12 in file net2bin.ncl before or near m
> t15 = fi->temperature_at_1-5m
> ---------------------------------^
>
> fatal:syntax error: line 16 in file net2bin.ncl before or near m
> sh15= fi->specific_humidity_at_1-5m
> ---------------------------------------^
>
> fatal:Syntax Error in block, block not executed
> fatal:error at line 46 in file net2bin.ncl
>
>
> But these two variables in my netCDF file are:
>
> float temperature_at_1-5m(time, latitude, longitude) ;
> temperature_at_1-5m:_FillValue = -1.073742e+09f ;
> temperature_at_1-5m:name = "temperature_at_1-5m" ;
> temperature_at_1-5m:long_name = "TEMPERATURE AT 1.5M" ;
> temperature_at_1-5m:units = "K" ;
> temperature_at_1-5m:standard_name = "temperature_at_1-5m" ;
> temperature_at_1-5m:cell_methods = "time: mean" ;
> temperature_at_1-5m:axis = "TXY" ;
>
> and
>
> float specific_humidity_at_1-5m(time, latitude, longitude) ;
> specific_humidity_at_1-5m:_FillValue = -1.073742e+09f ;
> specific_humidity_at_1-5m:name = "specific_humidity_at_1-5m" ;
> specific_humidity_at_1-5m:long_name = "SPECIFIC HUMIDITY AT 1.5M" ;
> specific_humidity_at_1-5m:units = "1" ;
> specific_humidity_at_1-5m:standard_name =
> "specific_humidity_at_1-5m" ;
> specific_humidity_at_1-5m:cell_methods = "time: mean" ;
> specific_humidity_at_1-5m:axis = "TXY" ;
>
>
> DOES NCL have a problem with "m" in a variable name?
> -Erik
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
--------------------------------------------------------------
Adam Phillips			             asphilli_at_ucar.edu
National Center for Atmospheric Research   tel: (303) 497-1726
ESSL/CGD/CAS                               fax: (303) 497-1333
P.O. Box 3000				
Boulder, CO 80307-3000	  http://www.cgd.ucar.edu/cas/asphilli
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Jun 29 2007 - 14:52:23 MDT

This archive was generated by hypermail 2.2.0 : Mon Jul 02 2007 - 07:40:50 MDT