[ncl-talk] convert the time "since seconds" to month-year

Amal Inge amalingenieur89 at gmail.com
Tue Dec 11 11:33:01 MST 2018


Thanks Rick, it works now but it's not reading the tickmarks it  gives me
this warning:
warning:tmXValues is not a valid resource in xy_xy at this time
warning:tmXLabels is not a valid resource in xy_xy at this time
warning:tmXValues is not a valid resource in xy_xy at this time
warning:tmXLabels is not a valid resource in xy_xy at this time

the plot attached

Le mar. 11 déc. 2018 à 18:53, Rick Brownrigg <brownrig at ucar.edu> a écrit :

> Did you add this line ath the top, as per the documentation?
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"
>
>  https://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml
>
>
>
>
>
> On Tue, Dec 11, 2018 at 10:21 AM Amal Inge <amalingenieur89 at gmail.com>
> wrote:
>
>> hi Carl,
>> i made some modification in the script attached but I had this error;
>>
>> fatal:syntax error: line 49 in file xy.ncl before or near ; sets the
>> correct time labels
>>
>> time_axis_labels(x, res, restime) ; sets the correct time labels
>> ^
>>
>> fatal:syntax error: possibly an undefined procedure
>> fatal:Syntax Error in block, block not executed
>> fatal:error at line 52 in file xy.ncl
>>
>>
>>
>> Le mar. 11 déc. 2018 à 14:47, Carl Schreck <cjschrec at ncsu.edu> a écrit :
>>
>>> Please see
>>> https://www.ncl.ucar.edu/Document/Functions/User_contributed/time_axis_labels.shtml
>>> and the examples therein.
>>>
>>> Does it work if you uncomment line 49? If not, can you be more specific
>>> on what "doesn't work"?
>>>
>>> On Tue, Dec 11, 2018 at 3:24 AM Amal Inge <amalingenieur89 at gmail.com>
>>> wrote:
>>>
>>>>
>>>> Dear NCL experts,
>>>>
>>>> I want to plot a time series of monthly data of nc file with the script
>>>> attached but it didn't work, i think that I should convert the time "since
>>>> seconds" to month-year.
>>>> how could i do this please?
>>>>
>>>> many thanks
>>>> Amal
>>>>
>>>> netcdf dox01_med_0-52 {
>>>> dimensions:
>>>>     time = UNLIMITED ; // (215 currently)
>>>>     lev = 13 ;
>>>>     lat = 253 ;
>>>>     lon = 670 ;
>>>> variables:
>>>>     double time(time) ;
>>>>         time:axis = "T" ;
>>>>         time:calendar = "standard" ;
>>>>         time:units = "seconds since 1970-01-01 00:00:00" ;
>>>>         time:long_name = "time" ;
>>>>         time:standard_name = "time" ;
>>>>     float lev(lev) ;
>>>>         lev:_CoordinateZisPositive = "down" ;
>>>>         lev:_CoordinateAxisType = "Height" ;
>>>>         lev:axis = "Z" ;
>>>>         lev:positive = "down" ;
>>>>         lev:units = "m" ;
>>>>         lev:long_name = "depth" ;
>>>>         lev:standard_name = "depth" ;
>>>>     float lat(lat) ;
>>>>         lat:axis = "Y" ;
>>>>         lat:units = "degrees_north" ;
>>>>         lat:long_name = "latitude" ;
>>>>         lat:standard_name = "latitude" ;
>>>>     float lon(lon) ;
>>>>         lon:axis = "X" ;
>>>>         lon:units = "degrees_east" ;
>>>>         lon:long_name = "longitude" ;
>>>>         lon:standard_name = "longitude" ;
>>>>     float dox(time, lev, lat, lon) ;
>>>>         dox:missing_value = 1.e+20f ;
>>>>         dox:_ChunkSizes = 1, 22, 84, 161 ;
>>>>         dox:units = "millimol m-3" ;
>>>>         dox:long_name = "Mole concentration of Dissolved Molecular
>>>> Oxygen in sea water" ;
>>>>         dox:standard_name =
>>>> "mole_concentration_of_dissolved_molecular_oxygen_in_sea_water" ;
>>>>         dox:_FillValue = 1.e+20f ;
>>>>
>>>> // global attributes:
>>>>         :creation_date = "Tue Dec  4 23:27:50 CET 2018" ;
>>>>         :Conventions = "None" ;
>>>>         :source_file = "dox_med_0-52.nc" ;
>>>>         :title = "NCL Efficient Approach to netCDF Creation" ;
>>>> }
>>>>
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> ncl-talk at ucar.edu
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>>
>>>
>>>
>>> --
>>>
>>> <https://ncics.org/> *Carl J. Schreck III, PhD*
>>> *Research Scholar*
>>> North Carolina State University <http://ncsu.edu/>
>>> North Carolina Institute for Climate Studies (NCICS)
>>> <https://ncics.org/>
>>> 151 Patton Ave, Asheville, NC 28801
>>> e: cjschrec at ncsu.edu
>>> o: +1 828 257 3140 <(828)%20257-3140>
>>> c: +1 828 484 1702 <(828)%20484-1702>
>>> Publications
>>> <http://scholar.google.com/citations?hl=en&user=th8ONEcAAAAJ&view_op=list_works&sortby=pubdate>
>>> ncics.org/mjo
>>> CycloneCenter.org <https://www.cyclonecenter.org/>
>>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> 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/20181211/a8a02a87/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xy.eps
Type: image/x-eps
Size: 159750 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20181211/a8a02a87/attachment.bin>


More information about the ncl-talk mailing list