[MITgcm-support] CS Grid Generator and Convertor Matlab Scripts
Yuan Lian
lian at ashimaresearch.com
Wed Feb 15 18:04:51 EST 2012
Hi Chris,
Glad you figured out the problem. The C32 grids supplied in the
verifications examples may have different configuration, likely they
used different nratio, or with some extra tweaks about the cube-sphere
grid corners (some grid stretching etc). One way to ensure that the
grids were generated correctly is to compare "XG, YG ..." during grid
generation and those from the .bin files. Additionally you take a look
of the grid arrangement in "EXCH2" section in the MITgcm manual, from
which you can check if "XG" and "YG" generated by the matlab routines
make sense.
The extreme values I mentioned in the 2004 thread were caused by the
machine format, i.e., big endian and little endian. As long as your XG
and YG values are confined within the bounds (-180, 180) for XG and
(-90,90) for YG, you are good to go.
Best,
Yuan
On 2/15/12 2:32 PM, Chris Watkins wrote:
> 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
> <mailto: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
>> <mailto: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 list
>> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
>
>
> --
> Chris Watkins
>
> G+ GPlus.to/ChrisWatkins <http://gplus.to/ChrisWatkins>
>
>
>
> _______________________________________________
> 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/20120215/b52c41d4/attachment-0001.htm>
More information about the MITgcm-support
mailing list