[ncl-talk] Error creating binary file

Rick Brownrigg brownrig at ucar.edu
Fri Feb 23 14:27:55 MST 2018


Hi Andrew,

How are you opening the file from the fortran side? The docs for
fbindirwrite state that the fortran equivalent is a file opened with
"'form=unformatted, access=direct, recl= ...'.".

If that doesn't help, I'd be happy to take a look at the file if you are
able to send it to me.

Rick

On Fri, Feb 23, 2018 at 2:03 PM, Andrew Kren - NOAA Affiliate <
andrew.kren at noaa.gov> wrote:

> Dear ncl-talk,
>
> I wrote a program to convert grib data to binary format, as needed for a
> fortran program to track cyclones. I write slp, u at 500, and v at 500 to
> binary using fbindirwrite. I ran the fortran program, which gave erroneous
> wind values. So, I checked my binary program again and printed out the wind
> for a few points and they were erroneous. Is this because the wind is
> negative at times in direction? Here are some wind values I get when
> putting into binary:
>
> (0) -3.98
>
> (1) -3.98
>
> (2) -3.98
>
> (3) -3.99
>
> (4) -3.95
>
> (5) -3.96
>
> (6) -3.96
>
> (7) -3.96
>
> (8) -3.96
>
> (9) -3.96
>
> (10) -3.95
>
> And here is what I get when I read the binary file back in after created:
>
> (0) 102011.4
>
> (1) 102011.4
>
> (2) 102011.4
>
> (3) 102011.4
>
> (4) 102011.4
>
> (5) 102011.4
>
> (6) 102011.4
>
> (7) 102011.4
>
> (8) 102011.4
>
> (9) 102011.4
>
> (10) 102011.4
>
> Am I missing something. I also attached my code. Any help is much
> appreciated!
>
> Thanks,
>
> --
> Andrew Kren
> Assistant Scientist
> CIMAS & NOAA/AOML
> 325 Broadway, Boulder, CO 80305
> (303) 497-5418
>
> _______________________________________________
> 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/20180223/57757aea/attachment.html>


More information about the ncl-talk mailing list