[ncl-talk] convert string to fortran character

Zhifeng Yang yangzf01 at gmail.com
Mon Nov 4 19:40:53 MST 2019


Hi
I am reading wrf output which has variable Times as character. When I read
it using NCL, the Times variable is still character, not string. I want to
change the Times variable using NCL. For example,

Variable: times

Type: character

Total Size: 19 bytes

            19 values

Number of Dimensions: 2

Dimensions and sizes: [Time | 1] x [DateStrLen | 19]

Coordinates:

Number Of Attributes: 0

(0,0) 2

(0,1) 0

(0,2) 1

(0,3) 4

(0,4) -

(0,5) 0

(0,6) 5

(0,7) -

(0,8) 2

(0,9) 5

(0,10) _

(0,11) 0

(0,12) 0

(0,13) :

(0,14) 0

(0,15) 0

(0,16) :

(0,17) 0

(0,18) 0

I want to change 4 to 5. I tried

times(0, 3) = "5"
"5" is a string, not a character. I got the following error.

fatal:Assignment type mismatch, right hand side can't be coerced to type of
left hand side

Do you have any suggestions? Thank you

Zhifeng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20191104/fbfaace7/attachment.html>


More information about the ncl-talk mailing list