[ncl-talk] Help : Error when extracting time from wrfout file
Bill Ladwig
ladwig at ucar.edu
Mon Jan 9 10:09:41 MST 2017
Hi Sundar J,
It appears your WRF output files have multiple times per file. The error
message is complaining about this line:
day = systemfunc("echo "+times +"|cut -c9-10")
Since the times variable is an array that has multiple times, the statement
can't run. You'll need to do another loop around the code that's parsing
the day, month, year, hr values to handle one time value at a time.
do i = 0, numTimesPerFile-1
day = systemfunc("echo "+ times(i) + "|cut -c9-10")
...
end do
Hope this helps,
Bill
On Sun, Jan 8, 2017 at 2:04 AM, Sundar J <wrf.guy at gmail.com> wrote:
> Hi all,
>
> This is my first try to generate MSLP chart with ncl. With the same data I
> used to plot mslp using python earlier. Therefore, there is no issue with
> the wrfout file.
>
> I am on Ubuntu 6.10 with ncl version 6.3.0 installed (from the repo). I
> had a script which does the plotting of sea level pressure. Evertime I run
> the script I complain about the requirement of 'element'. The complete
> erroe message produced in terminal is:-
>
> Copyright (C) 1995-2015 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.3.0
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
>
>
> Variable: times
> Type: string
> Total Size: 104 bytes
> 13 values
> Number of Dimensions: 1
> Dimensions and sizes: [13]
> Coordinates:
> Number Of Attributes: 2
> description : times in file
> _FillValue : missing
> (0) 2016-03-31_00:00:00
> (1) 2016-03-31_06:00:00
> (2) 2016-03-31_12:00:00
> (3) 2016-03-31_18:00:00
> (4) 2016-04-01_00:00:00
> (5) 2016-04-01_06:00:00
> (6) 2016-04-01_12:00:00
> (7) 2016-04-01_18:00:00
> (8) 2016-04-02_00:00:00
> (9) 2016-04-02_06:00:00
> (10) 2016-04-02_12:00:00
> (11) 2016-04-02_18:00:00
> (12) 2016-04-03_00:00:00
>
> Variable: times
> Type: string
> Total Size: 104 bytes
> 13 values
> Number of Dimensions: 1
> Dimensions and sizes: [13]
> Coordinates:
> Number Of Attributes: 2
> _FillValue : missing
> description : times in file
> fatal:Number of elements of dimension (0) of argument (0) is (13) in
> function (systemfunc), expected (1) elements
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 50 in
> file sea-levs.ncl
>
>
> The script I used is attached for your reference. It would be nice if any
> one can point me in the right direction to solve the issue. I am unable to
> move forward beyond this issue.
>
> Regards.
>
> _______________________________________________
> 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/20170109/803796f4/attachment.html
More information about the ncl-talk
mailing list