Re: SOME PROBLEM FOR NCL

From: Dennis Shea (shea AT XXXXXX)
Date: Sun Mar 07 2004 - 17:32:23 MST


>
>dear ncl friends:
> i have some problem :i have download Version 4.2.0.a031 to my PC ,and the work
station in my office is equipped with Version 4.2.0.a030 .
> in the work station :my writing-data ncl file is written
with"fbindirwrite("U850ISO",uano)",and then in the fortran file i use"
read(9,rec=irec) ((uano(i,j),j=1,iy),i=1,id) "to get the data i have written in
the .ncl file ,i can get the right result.
> however, in my PC,I use the same .ncl file for the same data,but i have to
use " read(9,rec=irec) (uano(i,j),i=1,id),j=1,iy)" when i read it in my fortran
programm,or i will get the wrong result.
> i don't know why ?is there some difference between the two version ,or
something else reasons?

---

Binary files are not necessarily portable across operating systems.

Some operating systems (OS) generate "big-endian" binary. This means that the Most Significant Byte (MSB) is the left-most byte. Some OSs that fall into this category include: SGI, IBM-AIX, HP-UX, Macintosh, and Solaris.

Other OSs place the MSB as the rightmost byte. These are called "little-endian". Some OSs that fall into this category include: Linux, Digital UNIX, Intel ABI, OS/2 and Windows

--- *Currently*, NCL has no built-in capability to switch individual records. However, the contributed.ncl library distributed with NCL has a procedure which can be used to create a new file with the byte order changed. Since you are using fortran direct access read, you must use the "fbindirSwap" procedure.

load ".../contributed.ncl" begin fili = "input_file" ; binary input file filo = "output_file" ; binary output file fbindirSwap (fili, (/iy,id/),"float", filo) ; each record is (iy,id) end

[The above could alse be done interactively.]

good luck Dennis Shea

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



This archive was generated by hypermail 2b29 : Mon Mar 08 2004 - 08:58:28 MST