[MITgcm-support] file runoff-360x180x12.bin

Dimitris Menemenlis dmenemenlis at gmail.com
Fri Jan 25 11:29:27 EST 2019


There is also a matlab function:
https://github.com/MITgcm/MITgcm/blob/master/utils/matlab/cs_grid/read_cs/readbin.m
that does same thing as 4 lines below:

fld = readbin('runoff-360x180x12.bin’,[360 180 12]);


Dimitris

> On Jan 25, 2019, at 1:28 AM, Martin Losch <Martin.Losch at awi.de> wrote:
> 
> Hi Vincent,
> 
> any file that the MITgcm reads is an ieee-be unblocked binary file, that means that you can just read it without any information about the shape. In this case in matlab you would do this (assuming that it is single precision “real*4":
> 
> fid = fopen('runoff-360x180x12.bin’,’r’,’ieee-be’);
> fld = fread(fid,inf,’real*4’);
> fclose(fid);
> 
> then you need to reshape it to 360x180x12. I think in matlab it is like this: newfld=reshape(fld,[360,180,12]); 
> 
> Martin
> 
> 
>> On 25. Jan 2019, at 09:05, Vincent Le Fouest <vincent.lefouest at gmail.com> wrote:
>> 
>> Dear all,
>> 
>> I am looking for some Matlab or Ferret code to read properly the binary file runoff-360x180x12.bin, or any netcdf version of the file.
>> 
>> Kind regards and thank you in advance for any tip you may provide,
>> 
>> Vincent
>> 
>> 
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org
>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support



More information about the MITgcm-support mailing list