[ncl-talk] printing spi

Dawit Abebe dawit.kan at gmail.com
Wed Apr 5 02:20:07 MDT 2017


Hello all,

Kindly help me to fix my problem with printing SPI. I pasted below first the return of printVarSummary(spi), which seems okay. However, my attempt to print  the output (text in blue) did not work.  What was wrong?

Greatly appreciate your help.

Dawit

…………………………………….

copy_VarCoords(prc,spi(0,:,:,:))
spi at long_name = "SPI"
spi!0         = "len"
spi&len       =  len
printVarSummary(spi)


Variable: spi
Type: double
Total Size: 2757888 bytes
            344736 values
Number of Dimensions: 4
Dimensions and sizes:	[len | 7] x [time | 1368] x [lat | 4] x [lon | 9]
Coordinates: 
            len: [1..36]
            time: [ 380..41987]
            lat: [3.75..5.25]
            lon: [36.75..40.75]
Number Of Attributes: 2
  long_name :	SPI
  _FillValue :	-999


yyyymm = cd_calendar(f->time, -1) 

print(yyyymm+sprintf("%8.2f", prc)   \                                 
                +sprintf("%8.2f", spi(0,:))+sprintf("%8.2f", spi(1,:)) \  
                +sprintf("%8.2f", spi(2,:))+sprintf("%8.2f", spi(3,:)) \ 
                +sprintf("%8.2f", spi(4,:))+sprintf("%8.2f", spi(5,:)) \  
                +sprintf("%8.2f", spi(6,:)))                              
fatal:Plus: Number of dimensions do not match, can't continue
fatal:["Execute.c":8638]:Execute: Error occurred at or near line 37


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170405/b1adfa22/attachment.html 


More information about the ncl-talk mailing list