[MITgcm-support] Barotropic ocean gyre tutorial

Jeremy Miller jeremysharonmiller at gmail.com
Thu Apr 1 03:22:15 EDT 2021


Dear MITGCM forum,

I am Jeremy Miller, I am new to MITgcm and I've been going through the
tutorials. I have a question about the "Barotropic Ocean Gyre" tutorial
(section 4.1).

I managed to compile and run the code, and re-produce the first two plots
shown in section 4.1.5 for  wind stress of τ = τ0 cos( πy/Ly), for both the
advection and non-advection cases (with the provided input binary files).
I ran into problems when trying to produce the third plot, for the case
where τ = τ0 sin( πy/Ly). I am a python user, so I translated gendata.m
into python to write the input binary files 'windx_cosy.bin'
'windx_siny.bin' (see the file gendata_tut4.1py attached).  As explained in
section 3.9 I've included the snippet

if sys.byteorder == 'little': tau_2.byteswap(True)

where "tau2" is the array to be output. There was no issue in the cosine
wind stress, and I managed to reproduce the results that I got with the
original 'windx_cosy.bin' provided in the tutorial. However, with the sine
wind stress case, the output in 'Eta.0000077760.001.001' is all zeros.

When I attempt to read  'windx_siny.bin' with python into a new array
called tau2_1. I get absurdly big numbers back, which do not match the
original array tau2 that I created. If I Remove the snippet " if
sys.byteorder == 'little': tau_2.byteswap(True) ", in the python gendata
code, tau2_1 and tau2 match. But, then when I run the code again, the
file output.txt contains a long list of NaNs.

I have also included the python code used to generate the plots in the file
tut_4.1_plots.py

Look forward to hearing from you.
Yours sincerely
Jeremy Miller
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20210401/d5faa17e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tut_4.1_plots.py
Type: text/x-python
Size: 1016 bytes
Desc: not available
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20210401/d5faa17e/attachment.py>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gendata_tut4.1.py
Type: text/x-python
Size: 1307 bytes
Desc: not available
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20210401/d5faa17e/attachment-0001.py>


More information about the MITgcm-support mailing list