Characters, strings, netcdf, wrf and bears - oh my

From: Correia, James <james.correia_at_nyahnyahspammersnyahnyah>
Date: Wed Feb 24 2010 - 15:55:50 MST

Hi all-
I have a WRF netcdf file I am trying to fix:

Times(2,0:18) = "2050-04-02_03:00:00" is what should appear in the netcdf
file. Instead it has: Times = ""

So I wrote up some ncl code to replace the missing characters.

Times = g->Times

 xt = new((/1/),"string")
 xt = "2050-04-02_03:00:00"
Times(2,:) = stringtochar(xt)

this should work in theory but it doesn't yielding a dimension mismatch with
the stringtochar(xt) yielding 20 elements and Times having only 19.

If I truncate:
Times(2,:) = stringtochar(xt(0:18))
Then I end up with a:
fatal: subscript out of range, error in subscript #0
fatal:An error occurred reading xt
fatal:execute: Error occurred at or near line 18 in file mod.ncl

How can I solve this problem?
Jimmyc

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Feb 24 15:55:24 2010

This archive was generated by hypermail 2.1.8 : Thu Feb 25 2010 - 09:38:32 MST