[ncl-talk] Reading in .ieeer8 file and plotting it with NCL

Dennis Shea shea at ucar.edu
Thu Jan 5 11:26:25 MST 2017


  ntim = 12

  nlat = 320

  mlon = 384

  dims = (/ntim,nlat,mlon/)    ; dims(3)

  filb = "binary_file_name"

  dirb = "/dir/where_binary_file/located/"

  pthb = dirb+filb


*  setfileoption*("bin","ReadByteOrder","BigEndian")

  sss = *fbindirread*(pthb, 0, dims, "double")

  fx  = *fbindirread*(pthb, 1, dims, "double")



On Thu, Jan 5, 2017 at 10:21 AM, Hughlett, Taylor M <taylor.hughlett at uta.edu
> wrote:

> Hi Dave,
>
> Thank you so much for the information. I was able to track down the file
> that has all of the descriptions I required, and am now working on reading
> it in using NCL!
>
> Cheers,
> Taylor M Hughlett, Ph.D.
> UTA Earth and Environmental Sciences
> 500 Yates St.
> Geoscience Bldg Rm 117
> Arlington, TX 76013-0049
>
> From: Dave Allured - NOAA Affiliate <dave.allured at noaa.gov>
> Date: Wednesday, January 4, 2017 at 6:52 PM
> To: "Hughlett, Taylor M" <taylor.hughlett at uta.edu>
> Cc: "ncl-talk at ucar.edu" <ncl-talk at ucar.edu>
> Subject: Re: [ncl-talk] Reading in .ieeer8 file and plotting it with NCL
>
> Taylor,
>
> > 2. How do I know what data is stored on the file prior
> > to reading it in (i.e. Variables)? Or is this even possible?
>
> Files called "binary" without additional qualification can only be
> understood by formal documentation, or by at least a minimal description
> from the person who created the file.  You need to get this description
> from the source of your data.  Typically there is no descriptive metadata
> stored inside such files, and the assumption is that this description is
> somewhere external.
>
> The description should include file layout details such as array sizes,
> positions, dimension order of storage, elemental data type, byte order,
> fortran write mode if any, and record structure if any.  The description
> should also include what variables and possibly metadata are stored.  If
> the layout details are hard to get, it can sometimes help to find out just
> what software created the file.
>
> The suffix .ieeer8 says to me, "8-byte reals", because only fortran uses
> the type name "real" instead of "float" or "floating point".  A fuller type
> description is "8-byte IEEE floating point values", but that is just a
> guess.  If correct, that would be NCL data type "double", and that does not
> answer any of the other questions about file layout.
>
> --Dave
>
>
> On Wed, Jan 4, 2017 at 1:47 PM, Dennis Shea <shea at ucar.edu> wrote:
>
>> Were the data records written by fortran or
>>         See: http://www.atmos.washington.edu/~salathe/osx_unix/endian.htm
>> l
>>
>> or ?????
>>
>> [0]
>> The problem with binary is that someone must describe how the data was
>> written. Fortran's default (sequential) binary has **hidden record
>> separators**. The user could also open a binary with "access=direct". This
>> means 'flat' binary files (no record separators.
>>
>> [1]
>> Were the binary files created on a big- or little-endian system? See:
>> https://en.wikipedia.org/wiki/Endianness
>>
>> [2]
>> Likely, fbindirread *or* fbinrecread would work. However, without more
>> knowledge not much more can be said.
>>
>> [3]
>> One major reason for the creation of HDF and netCDF to allow the files to
>> be 'blindly' examined via a suite of standard function functions.
>>
>>
>>
>> On Wed, Jan 4, 2017 at 1:30 PM, Hughlett, Taylor M <
>> taylor.hughlett at uta.edu> wrote:
>>
>>> Good afternoon everyone,
>>>
>>> I am attempting to read in a .ieeer8 file using NCL so that it can be
>>> plotted.
>>>
>>> I am completely new with binary files, so bear with me.
>>>
>>> I understand that this is a binary file, so visualization and reading it
>>> is much more complicated than it would be with netCDF’s.
>>>
>>> After having looked over the instructions on the NCL site, I am still
>>> having some confusion with how to get started.
>>>
>>> Specifically, I have these questions:
>>>
>>>    1. Will the fbindirread work to read in a .ieeer8 file (I am
>>>    assuming the file is fortran as it is a restart file for CESM1’s POP2)?
>>>    2. How do I know what data is stored on the file prior to reading it
>>>    in (i.e. Variables)? Or is this even possible?
>>>
>>> Any help would be greatly appreciated with this, and I am happy to
>>> provide more information if it is required.
>>>
>>> Thanks,
>>> Taylor M Hughlett, Ph.D.
>>> UTA Earth and Environmental Sciences
>>> 500 Yates St.
>>> Geoscience Bldg Rm 117
>>> Arlington, TX 76013-0049
>>>
>>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170105/24a1ce7f/attachment.html 


More information about the ncl-talk mailing list