str_get_field function

From: Guo Zhang <wswzg6666_at_nyahnyahspammersnyahnyah>
Date: Tue Mar 27 2012 - 23:40:31 MDT

Hi, I'm trying to plot a bar chart uing example bar_13.ncl at http://www.ncl.ucar.edu/Applications/bar.shtml. It seems I got  field 2 returning to colomn 3 using str_get_field function. Can anyone tell me how to fix it? Thanks.   Guo Zhang   My data is as below: winter         min     max     mean Rnet    -15.40  -4.23   -9.80 H       -24.37  -7.04   -12.84 LE      -20.14  2.32    -8.30 G       -0.11   0.43    0.14   Rnet    0.80    8.62    5.97 H       -25.91  -9.00   -17.62 LE      -16.02  2.50    -6.26 G       3.03    3.22    3.14    'do i=0,nmons-1     do j=0,nmodels-1       istart = ((nmodels+1)*i)+j+2    ; the +1 is the title       do k=0,2         data(i,j,k) = tofloat(str_get_field(lines(istart),k+2," "))       print(data)  ; print data here       end do     end do   end do'   fatal:tofloat: A bad value was passed to (string) tofloat, input strings must contain numeric digits, replacing with missing value Variable: data Type: float Total Size: 120 bytes             30 values Number of Dimensions: 3 Dimensions and sizes:   [2] x [5] x [3] Coordinates: Number Of Attributes: 1   _FillValue :  9.96921e+36 (0,0,0) -4.23 (0,0,1) -9.8 (0,0,2) 9.96921e+36 (0,1,0) -7.04 (0,1,1) -12.84 (0,1,2) 9.96921e+36 (0,2,0) 2.32 (0,2,1) -8.3 (0,2,2) 9.96921e+36 (0,3,0) 0.43 (0,3,1) 0.14 (0,3,2) 9.96921e+36 (0,4,0) 9.96921e+36 (0,4,1) 9.96921e+36 (0,4,2) 9.96921e+36 (1,0,0) 8.62 (1,0,1) 5.97 (1,0,2) 9.96921e+36 (1,1,0) -9 (1,1,1) -17.62 (1,1,2) 9.96921e+36 (1,2,0) 2.5 (1,2,1) -6.26 (1,2,2) 9.96921e+36 (1,3,0) 3.22 (1,3,1) 3.14 (1,3,2) 9.96921e+36 (1,4,0) 9.96921e+36 (1,4,1) 9.96921e+36 (1,4,2) 9.96921e+36 fatal:Variable (base_plot) is undefined fatal:Execute: Error occurred at or near line 225 in file bar.ncl

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Mar 27 23:40:43 2012

This archive was generated by hypermail 2.1.8 : Mon Apr 09 2012 - 13:43:03 MDT