[MITgcm-support] CS Grid Generator and Convertor Matlab Scripts

Chris Watkins chris at tw1.me.uk
Wed Feb 15 17:32:21 EST 2012


Hi Yuan,

Thanks for sticking with me!

I may have solved one problem. I found your thread from 2004
http://mitgcm.org/pipermail/mitgcm-support/2004-December/002791.html and
have amended gengrid_fn.m as you detailed there (such as changing
write_tiles to write_tile). When I run gendrids.m I now get files of the
right size. So convertMITgrid.m will read and process them.

Your post seems to suggest that there are problems with the tile00*.mitgrid
files outputted. How did you solve that? I have compared the files for C32
that I have outputted to the ones supplied in the verification examples and
they are not the same. The values for xc and dxf, for example, are in very
good agreement however the values for yg and dxv are not. I guess they are
being written to the file in a different order for some reason. Did you
manage to solve this issue?

Thanks for all your help.

Regards,

Chris



On 15 February 2012 21:46, Yuan Lian <lian at ashimaresearch.com> wrote:

>  Hi Chris,
>
> OK, if I understand correctly, the "rdda" gave you the error message "Not
> enough data was available to be read: off EOF?". Can you try to read some
> .bin files using the fopen function directly?
>
> For example:
>
> fid=fopen('LONG.bin','r','b'); long=fread(fid,'real*8'); nrec=length(long);
>
> "nrec" is the number of records you have in "LONG.bin", which should be
> exactly nx*6*nx. For instance, if you generated C16, then
> nrec=1536=16*6*16. If nrec gives a different number then there is something
> wrong with the grid generation routines (as far as I can tell, they should
> work).
>
> Please let me know what you find.
>
> Best,
> Yuan
>
>
>
> On 2/15/12 12:49 PM, Chris Watkins wrote:
>
> Hi Yuan,
>
>  I don't think this is it. I have given it a go but it still has the same
> errors. I am convinced it is seeing the DXC.bin etc files as
> convertMITgrid.m gives the error "Not enough data was available to be read:
> off EOF?" which means that it opened the file but its size is smaller than
> prod(sz).
>
>  Regards,
>
>  Chris
>
>
>
> On 15 February 2012 19:41, Yuan Lian <lian at ashimaresearch.com> wrote:
>
>>  Hi Chris,
>>
>> It appears that you didn't define the path that contains the .bin file
>> correctly. What worked for me is to use the following
>>
>> sz=[nx nx 6];
>> prm=[1 2 3];
>>
>> chdatapath=input('full path to load data /~/ : ','s');
>> path(chdatapath,path);
>>
>> Once you set the path correctly you can load the .bin files regardless
>> where they are. Hope this helps.
>>
>> Best,
>> Yuan
>>
>>
>
> _______________________________________________
> MITgcm-support mailing listMITgcm-support at mitgcm.orghttp://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>


-- 
Chris Watkins

G+ GPlus.to/ChrisWatkins <http://gplus.to/ChrisWatkins>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20120215/2cc649d6/attachment.htm>


More information about the MITgcm-support mailing list