[MITgcm-support] How to open and read '.bin' file?

Xiaohui Yan xyan044 at uottawa.ca
Wed Jul 23 21:02:43 EDT 2014


Hi Matt,

Thank you very much, your method is really helpful and works pretty easily.
By the way, is there a way to check if the precision is single or double?

Thanks,
Yan

Xiaohui Yan
MASc Student
Génie Civil | Civil Engineering
Université d'Ottawa | University of Ottawa
Ottawa, Ontario K1N6N5, Canada
E-mail: xyan044 at uottawa.ca



On Tue, Jul 22, 2014 at 7:22 PM, Matthew Mazloff <mmazloff at ucsd.edu> wrote:

> Hi Yan
>
> If you have matlab you can do:
>
> fid = fopen('bathymetry.bin','r','b');
> Q = fread(fid,inf,'double'); %unless its single precision…I don't know
> fclose(fid)
> Q = reshape(Q,[NX,NY]);
> imagesc(Q');axis xy; colorbar
>
> Matt
>
>
>
> On Jul 22, 2014, at 7:41 AM, Xiaohui Yan <xyan044 at uottawa.ca> wrote:
>
> Hi,
>
> I'm a new learner of MITgcm, I'm studying example 3.12 <Global Ocean
> Simulation at 4 Resolution> now, but how can I open and have a look at the
> ".bin" file (such the "bathymetry.bin" file)?
>
> Thank you!
>
> Yan
>  _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20140723/5ac798d7/attachment.htm>


More information about the MITgcm-support mailing list