Scheduled Downtime
On Tuesday 24 October 2023 @ 5pm MT the forums will be in read only mode in preparation for the downtime. On Wednesday 25 October 2023 @ 5am MT, this website will be down for maintenance and expected to return online later in the morning.
Normal Operations
The forums are back online with normal operations. If you notice any issues or errors related to the forums, please reach out to help@ucar.edu

regional MOM6 - first steps

egiarolla

Emanuel Giarolla
New Member
Hi everyone

I’m looking for any test-case, or simple experiment, to take the first steps on MOM6-regional modelling.

What I’ve done so far is (thanks to some of the “CESM 2020 MOM6 Webinar Series” presentations, especially the Kate Hedstrom’s).

Since last year we’ve been performing some global MOM6+SIS2 experiments with different horizontal grids. We are also switching MOM5+SIS to MOM6+SIS2 in our most recent coupled Atmosphere-Land-Ocean-SeaIce model. Initial tests have shown promising results.

But a regional approach of MOM6 I've never tried so far.

Thank you, Emanuel
 

cermak

Rob Cermak
Member
Here are three options to produce a topog.nc file for a MOM6 grid:
  • FRE-NCtools: You will need to create an ocean depth layer file first before make_topog will work. I have been pulling together a parallel example for generating a grid & topog using gridtools vs. FRE-NCtools. I will see if I can get this comparison pulled together in release 0.3.1 of the gridtools library.
  • Python Gridtools:
OBC/IC work for gridtools is in the queue. Thanks for providing those links. A separate post also pointed to some OBC/IC work using SODA files by Liz Drenkard. This should be enough for us to get started. It may be a couple weeks before we can pull initial tools together.

If you run into troubles using the software above, please post here again.
 

cermak

Rob Cermak
Member
Maybe this will get you started on creating at least a topography for your MOM6 model grid: Build and Edit a MOM6 Grid in Jupyter — Gridtools library 0.3.1+194d7b2 documentation

In a future release, the plan is to update computeBathymetricRoughness so we do not have to fudge the diagnosed grid by shifting it a 1/2 grid cell from q-points to h-points. It is a splendid routine, but there are a good deal of additional improvements to make.

If you do not need roughness, see if you can follow the mkGridsExample03FRE.py that generates a topographic field from a subset of GEBCO 2020 using the FRE-NCtools software via gridtools following this partial guide. [Of course, I did just see GEBCO 2021 is now available.] The trick with FRE-NCtools is you need (1) a vertical grid -- the one in the example(03FRE) is ARBITRARY and (2) meet the conditions for an input file to make_topog:

# The program make_topog requires:
# - missing_value must exist and be of type NC_DOUBLE, NC_FLOAT, NC_INT, NC_SHORT or NC_CHAR
# - variable with topo/bathy info must be NC_DOUBLE, NC_FLOAT or NC_INT
# - a vertical grid: ocean_vgrid.nc

The guide is unfinished as we were sidetracked by a bug/sideeffect of xarray 0.19.0 and its impact on the gridtools library.

Still in the queue is the OBC/IC work.

I would avoid regridTopo for now. An interim fix for computeBathymetricRoughness will also fix regridTopo. The routine regridTopo currently leaves a halo effect around the outer edge of the grid which is also very pronounced at the corners.

1628877845242.png

1628877885769.png
1628877915136.png
 

egiarolla

Emanuel Giarolla
New Member
Dear Rob,

Thank you for your posts. I noticed that mom6gridtools is well documented and it will really help us with the grid generation process.
In the following days I’ll try to follow the tutorial steps and generate that example grid. Next, I’ll try to make some changes in order to generate a customized grid, e.g., covering an oceanic region next to the Brazilian coast (which is our area of interest). I’ll let you know about my progress in this process.

I still have some questions about MOM6 regional modeling that, maybe, you could also help. As an example, I’ll list 2 of our basic questions here.

  1. Suppose that I already have my MOM6 ocean grid files all set. And suppose that I’ll use as open boundary conditions (OBC) the data from SODA. If SODA has T, S, etc in a z-grid, while the regional MOM6 adopts a lagrangian vertical coordinate approach, in which coordinate should I build my OBC netcdf file? If I build my OBC file in a z-grid, will MOM6 understand it?
  2. Suppose that my ocean grid has 4 open boundaries, where I set:
OBC_NUMBER_OF_SEGMENTS = 4
OBC_SEGMENT_001 = "J=N,I=N:0,FLATHER"
OBC_SEGMENT_002 = "J=0,I=0:N,FLATHER"
OBC_SEGMENT_003 = "I=N,J=0:N,FLATHER"
OBC_SEGMENT_004 = "I=0,J=N:0,FLATHER"
OBC_SEGMENT_001_DATA = “TEMP=file:xyz_%y.nc(theta),SALT=...”
OBC_SEGMENT_003_DATA = "U=value:0.0,V=value:0.0,SSH=value:0.0

The question is (it sounds like a silly question): where do I include this information? In the MOM_input or input.mml files?
 
1. Yes, MOM6 will do the vertical remapping for your OBC files. There are Python tools under ESMG on GitHub for creating the OBC files.

2. Those lines go in MOM_input. You can see examples in ESMG/ESMG-configs on github for various OBC toy problems.
 

egiarolla

Emanuel Giarolla
New Member
Thank you all for all your answers! They really helped!

Rob, I've been practising the tool you indicated, the mom6gridtools. I successfully followed all the steps of the tutorial and generated that test grid.
The only issue I had was when I tried to generate other ocean grid in the South Atlantic, near the Brazilian coast.
Apparently the "grid center" box was not accepting negative latitude values.
I would like to set my grid center in, say, 30 S.
Did I make any mistakes?

Screen Shot 2021-09-21 at 15.26.03.png
 

cermak

Rob Cermak
Member
Yes, the Latitude limit in the application is incorrectly set from 0 to 90. It should be -90 to +90. So, the dilemma is if the fix below properly works or there are other parts of the code that need to be updated. I will add this to our TODO list to address in next release of the library ([Bug]: Grid center latitude does not support southern hemisphere · Issue #16 · ESMG/gridtools).

See if the suggested change below allows you to create a southern hemispheric grid. There could be other problems beyond this change to the control. After editing the code, you will need to restart the kernel for the python/jupyter notebook.


Code:
# Change start=0.0 to start=-90.0

def initializeWidgets(self):
        # Widgets
        
        ....
        self.gridCenterY = pn.widgets.Spinner(name='Grid Center(Latitude or Y)', value=40.0, step=0.1, start=0.0, end=90.0, width=100)
        ....
 

egiarolla

Emanuel Giarolla
New Member
Thank you Rob, I'll try this solution and then let you know.
Beside this, I would like to mention that I really like this gridtools library. It is a powerful tool, and its tutorial is well written and clear. I recommend it.
 

egiarolla

Emanuel Giarolla
New Member
Here are three options to produce a topog.nc file for a MOM6 grid:
  • FRE-NCtools: You will need to create an ocean depth layer file first before make_topog will work. I have been pulling together a parallel example for generating a grid & topog using gridtools vs. FRE-NCtools. I will see if I can get this comparison pulled together in release 0.3.1 of the gridtools library.
  • Python Gridtools:
OBC/IC work for gridtools is in the queue. Thanks for providing those links. A separate post also pointed to some OBC/IC work using SODA files by Liz Drenkard. This should be enough for us to get started. It may be a couple weeks before we can pull initial tools together.

If you run into troubles using the software above, please post here again.
Hello Rob,

We built a regional test grid on the Brazilian coast. A 1-month run with this grid occurred without any problems. But we didn’t define the open boundaries conditions in that run, so the model interpreted the open boundaries as closed boundaries.

The problem is when we try to set variables such as T, S, u, v, for the open boundaries.

Errors occur not only when we define constant values for the borders, but also when we ask the model to read fields we generated using those scripts we talked about before.

As I mentioned before, If you know where I can find an example of a regional MOM6 experiment run, including e.g. input and output files, please let me know. Maybe comparing the grid and configuration files (e.g. MOM_input and others), of an experiment which works, with ours, would be helpful to figure out what we are doing wrong in our simulation tests. Besides, perhaps the MOM6 version we are trying to use for our regional experiments is not correct or incomplete, I don't know...
 

nlaureanti

Nicole C. Laureanti
New Member
A pretty simple domain with OBCs is here: ESMG-configs/ocean_only/dumbbell at dev/esmg · ESMG/ESMG-configs
The idea is that you run the experiment in the z directory first, run some scripts to make the OBC files, then you can run the z_sub case. You first run
extract_obc.bash, then extract_obc.py, both in the z directory.

If you want help with your setup, can you tell us what errors you were getting? Maybe show plots?
Dear Kate,

I've noticed that in this example, you admit the same timestep (300s) in the run as in the boundary files. Is this always necessary?

I meant, can we choose a different timestep for the boundaries, or is it always the same as in the run? How can we do this?
 
Hi Nicole,

It is not at all necessary for the OBCs to have the same update frequency as your model. The dumbbell plan was to start with the same timestep and go to less frequent updates to see when the child model would diverge from the parent. Unfortunately, it diverged without even subsampling the OBC info! Anyway, for the Arctic, we are using 5-daily SODA fields for the OBCs and that seems to be working reasonably well. The FMS layer is handling the time interpolation and MOM6 is handling the vertical interpolation.
 
Top