[ncl-talk] reading a file and writing the output to an array

ali mughal mughalali655 at gmail.com
Tue May 11 22:47:44 MDT 2021


Dear Ncl community

I have written a short script to read the file
https://we.tl/t-T5PZMRFStX
 and write it to an array. I am having trouble at  line 14 where I get the
following error.


filename = "Basecase.txt"
nvar=24
data = readAsciiTable(filename, nvar, "double", -1)
temp=reshape(data,(/24,27090/))

Array = new((/24,129,210/),float)

do it = 0, nvar-1,24
temp1=temp(it,:)

temp2=reshape(temp1,(/129,210/))

Array(:,:,it)=temp2
end do


*Error*
fatal:Assignment type mismatch, right hand side can't be coerced to type of
left hand side
fatal:["Execute.c":8578]:Execute: Error occurred at or near line 13 in file
test2.ncl
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.ucar.edu/pipermail/ncl-talk/attachments/20210512/965e925c/attachment.html>


More information about the ncl-talk mailing list