Welcome to the new DiscussCESM forum!
We are still working on the website migration, so you may experience downtime during this process.

Existing users, please reset your password before logging in here: https://xenforo.cgd.ucar.edu/cesm/index.php?lost-password/

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
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.
 

cermak

Rob Cermak
New 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
New 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.
 
Top