Re: How to modiy Times varable in wrfout*.nc

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon May 20 2013 - 16:27:46 MDT

I think the problem is simply that "Times" is of type character, and "str_get_cols" returns type string.

Try using the "tochar" function to force the string to be a char:

      Times(:,0:0) = tochar(str_get_cols(Times_1,0,0))

--Mary

On May 19, 2013, at 11:40 AM, Nguyễn Quang Long wrote:

> netcdf_in = addfile("./wrfout_d01_2011-03-08_00:00:00.nc","w")
>
> Times = netcdf_in->Times
> print(Times)
> Time_1 = wrf_times_c( Times, 0 ) + 7
> Time_1@units="hours since 2011-03-08 00:00:00"
> Time_1@calendar="standard"
> Time_1@long_name="Time"
> Time_1@description="Time"
> print(Time_1)
>
>
> Times_1 = cd_string(Time_1,"%Y-%N-%D %H:%M:%S")
> print(Times_1)
>
> ////// This line print correct time i want, but when i assign TImes_1 to Times, it got this problem "Assignment type mismatch, right hand side can't be coerced to type of left hand side"
> Times(:,0:0) = str_get_cols(Times_1,0,0)
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon May 20 16:28:07 2013

This archive was generated by hypermail 2.1.8 : Thu May 30 2013 - 11:38:10 MDT