[ncl-talk] Removing repeated times from concatenated files in an NCL script
Alan Brammer
abrammer at albany.edu
Thu Feb 25 14:04:36 MST 2016
One question is why are there repeat times?
But you could see if any time before the current are equal to the current.
do t=0,dimsizes(Times)-1
if( t .gt. 0 .and. any( Times(:t-1).eq.Times(t) ) )then ;; first check, prevents a subscript error
continue
end if
… rest of your plotting loop.
end do
Alan
##############################
Alan Brammer,
Post-Doc Researcher
Department of Atmospheric and Environmental Sciences,
University at Albany, State University of New York, Albany, NY, 12222
abrammer at albany.edu
##############################
> On 25 Feb 2016, at 15:35, Carlos J. Valle-Diaz <cj.vallediaz at gmail.com> wrote:
>
> Hello,
>
> I'm doing some NCL plots to WRF output files. I concatenated the wrfout files to have them as one. But, in that concatenated file I have times that are repeated and are plotted twice. Is there a way to write in the script to not count those repeated times?
>
> Example -> When I print out the Times in the file (by typing ncdump -v Times wrfout_d03_2011-07-12.nc <http://wrfout_d03_2011-07-12.nc/>) I get:
>
> Times =
> "2011-07-12_00:00:00",
> "2011-07-12_01:00:00",
> "2011-07-12_02:00:00",
> "2011-07-12_03:00:00",
> "2011-07-12_04:00:00",
> "2011-07-12_05:00:00",
> "2011-07-12_06:00:00",
> "2011-07-12_07:00:00",
> "2011-07-12_08:00:00",
> "2011-07-12_09:00:00",
> "2011-07-12_10:00:00",
> "2011-07-12_11:00:00",
> "2011-07-12_12:00:00",
> "2011-07-12_13:00:00",
> "2011-07-12_14:00:00",
> "2011-07-12_15:00:00",
> "2011-07-12_16:00:00",
> "2011-07-12_17:00:00",
> "2011-07-12_18:00:00",
> "2011-07-12_19:00:00",
> "2011-07-12_20:00:00",
> "2011-07-12_21:00:00",
> "2011-07-12_22:00:00",
> "2011-07-12_21:00:00",
> "2011-07-12_22:00:00",
> "2011-07-12_23:00:00",
> "2011-07-13_00:00:00",
> "2011-07-13_01:00:00",
> "2011-07-13_02:00:00",
> "2011-07-13_03:00:00",
> "2011-07-13_04:00:00",
> "2011-07-13_05:00:00",
> "2011-07-13_06:00:00",
> "2011-07-13_07:00:00",
> "2011-07-13_08:00:00",
> "2011-07-13_09:00:00",
> "2011-07-13_10:00:00",
> "2011-07-13_11:00:00",
> "2011-07-13_12:00:00" ;
>
> where "2011-07-12_21:00:00", "2011-07-12_22:00:00", occur twice.
>
> Thank you for the attention and help,
> --
> Carlos J. Valle Diaz
> Ph.D. Chemistry Student
> University of Puerto Rico Rio Piedras Campus
> Department of Graduate Chemistry and Environmental Sciences
> cj.vallediaz at gmail.com <mailto:cj.vallediaz at gmail.com>
> Tel. 787-764-0000 x88192
> _______________________________________________
> 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/20160225/031660f3/attachment.html
More information about the ncl-talk
mailing list