NCL cannot read binary data generated in Windows?

From: Xiucheng Wang <xcwang_at_nyahnyahspammersnyahnyah>
Date: Tue, 11 Dec 2007 22:51:39 +0800

Hi,everyone,
   I generate a binary file "number.bin" in Windows XP,which contains 20 short integer numbers 1,2,3,4,...,20. Then I upload it to an IBM690 machine with AIX 5.11.
   If I use the following NCL program to read number.bin
      begin
         a=fbindirread("numberw.bin",0,(/2,2,5/),"short")
         print(a)
      end
   it will display the false results like this:
     Variable: a
     Type: short
     Total Size: 40 bytes
            20 values
     Number of Dimensions: 3
     Dimensions and sizes: [2] x [2] x [5]
     Coordinates:
       (0,0,0) 256
       (0,0,1) 512
       (0,0,2) 768
       (0,0,3) 1024
       (0,0,4) 1280
       (0,1,0) 1536
        ...
   Then I modify the program like this:
       begin
        setfileoption("bin","ReadByteOrder","LittleEndian")
        a=fbindirread("numberw.bin",0,(/2,2,5/),"short")
        print(a)
       end
    then the program can not be built corecctly.That is the error information:
      fatal:syntax error: line 3 in file number.ncl before or near \n
       -----------------------------------------------------^
      fatal:syntax error: possibly an undefined procedure
      fatal:Syntax Error in block, block not executed


  who know how to read this binary data? Thanks a lot! The file "number.bin" is attached!

   

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Tue Dec 11 2007 - 07:51:39 MST

This archive was generated by hypermail 2.2.0 : Tue Dec 11 2007 - 14:19:21 MST