[MITgcm-support] Enquiries about the MITgcm tutorials
Yilang Xu
yxumendeley at gmail.com
Wed Oct 16 00:52:41 EDT 2024
Hi Juncheng,
You will need to change the dimension of the bathy.bin file to match the grid number in X and Y directions. Meanwhile, the dimension of the gridding parameters in data file should also be consistent with what you changed in SIZE.h.
One of the simple example that comes to my mind is https://github.com/MITgcm/MITgcm/tree/master/verification/isomip/input
If you are familiar with Matlab, the gendata.m in this directory should give you an understanding of the grid generation processes.
You can also use python to read in the bathy.bin. I think in your case for the baroclinic gyre example, it shall be something like below.
import numpy as np
# Specify the path to your binary file
file_path = ‘bathy.bin'
# Read the data from the file as REAL*8 (double precision float)
data = np.fromfile(file_path, dtype='float64’) # or float32
print(data.shape)
The dimension in float64 gives 1922, but in float32 it shows 3844 (correct for this case), which is also 62*62, consistent with what is defined in SIZE.h and data.
You will need to further reformat the 1D array into 2D for the bathy file.
Cheers,
Yilang
__________________________________
Yilang Xu, Ph.D.
Postdoctoral Fellow
Department of Earth & Planetary Sciences
Johns Hopkins University
yxu243 at jhu.edu <mailto:Yxu243 at jhu.edu>
> On Oct 15, 2024, at 23:13, Juncheng Zhang <juncheng.zhang at mail.utoronto.ca> wrote:
>
> Hi,
>
> I hope you are doing well.
>
> I am Juncheng, one of PhD student in University of Toronto, and I am trying to run a tutorial simulation with MITgcm, for example the Baroclinic_ocean_gyre, however, I had several questions:
> I want to change the grid numbers, I try to change the grid parameters in SIZE.h and data files, when I run the simulation, I had some error which is related to the bathy.bin file due to the changed grids. I am wondering what is a good way to change the grid numbers.
> I try to open the bathy.bin file in Jupyter Notebook, however, it can not be opened,
> Error: bathy.bin is not UTF-8 encoded saving disabled. See console for more details
> I am also curious about if I want to change the bottom topography, what should I do to modify it.
> I hope you can give me some advice to solve the issues.
>
> Thank you very much, and have a good day!
>
>
> Kind Regards
>
> Juncheng Zhang
> PhD Student,
>
> Earth, Atmospheric, and Planetary Physics
>
> Department of Physics
> University of Toronto
> McLennan Physical Laboratories
> 60 St Gorge St
> Toronto, Ontario, M5S 1A7
>
> juncheng.zhang at mail.utoronto.ca <mailto:juncheng.zhang at mail.utoronto.ca>
>
> <image001.jpg> <https://www.physics.utoronto.ca/>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20241016/58922a31/attachment-0003.html>
More information about the MITgcm-support
mailing list