Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Generating 2D meshes for mountain waves

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

yuanlian

New member
Hi, I would like to run some mountain wave simulations with customized grid resolutions. Is there any description/standard procedure to generate 2D Cartesian grids for MPAS (x-z or y-z planes)?

Thanks,
Yuan
 
I think part of my question can be answered by MPAS-Tools/mesh_tools/periodic_quad. It seems that the mountain wave test case included in MPAS atmosphere runs in 3D space (x,y,z). Is there any reason we could not run the simulation in x,z plane only?

Thanks,
Yuan
 
The mountain-wave test case is actually set up to run on a hexagonal mesh, rather than a quadrilateral mesh; so, you could start with the periodic_hex tool in the MPAS-Tools repository. The mesh that is provided with the mountain-wave test case has just 4 cells in the y-direction, and it is periodic in the y-direction, giving an approximation to an xz-plane.

If you were to try generating your own meshes using the periodic_hex tool, there are a couple of important considerations:
1) Ensure that you have at least 4 cells in the y-direction (assuming you're planning to run the simulation in the xz-plane); and
2) ensure that the orientation of the cells is correct.

The orientation of the cells produced by the periodic_hex tool is as in the attached "incorrect_mesh.png" figure. For the mountain-wave test case, specifically, you'll need to ensure that the orientation of the cells is as in the attached "correct_mesh.png" figure. Although I haven't tried this myself, you may be able to make a yz-plane mesh (with 4 cells in the x-direction) using the periodic_hex tool, then to transpose the x- and y-directions using a python script or something similar.
 

Attachments

  • incorrect_mesh.png
    incorrect_mesh.png
    24.1 KB · Views: 2,706
  • correct_mesh.png
    correct_mesh.png
    31.3 KB · Views: 2,706
Hi Michael,

Thanks for the detailed instructions. I will play around the grid generation tool periodic_hex and see how it works. Hopefully I don't run into issues with grid conversion :).

BTW, could we use quadrilateral mesh for mountain-wave type simulations? I am assuming only the post-processing tool mtn_wave_w.ncl is affected. If this is the case, I can easily write some python scripts to deal with the model outputs.

Thanks,
Yuan
 
The use of quadrilateral meshes in MPAS-Atmosphere is essentially untested at present. One of the key distinctions between quad and hex meshes from the perspective of the solver is that the former has a dual mesh with vertex degree 4, while the latter has a dual mesh with vertex degree 3 (i.e., a triangular dual mesh). We've tried to use a variable, vertexDegree, in the solver whenever computations involving the dual mesh are involved, but I wouldn't be surprised if there were some hard-coded values of 3 in the code. So, it may be best to use only hexagonal meshes (or, more generally, meshes with a triangular dual) with the current release of MPAS-Atmosphere.
 
Hi Michael,

That answers my question. I haven't seen other hardwired mesh values while I was making small modifications to the dynamical core, but they might exist somewhere. The hex mesh should work just fine.

Thanks,
Yuan
 
Just to follow up. Is there anyway to make the mountain wave simulations in parallel modes? I can't figure out how to use multiple processors without the graph partition file.

Thanks,
Yuan
 
It will be necessary to have graph.info.part.N files if you'd like to run in parallel. If you'd like, you can use the attached code to produce a graph.info file from any MPAS grid file. Once you've got the graph.info file, you can use Metis to partition that file into as many partitions as you would like, e.g.,
Code:
gpmetis -minconn -contig -niter=200 graph.info 16
where 16 is the number of partitions in this example.

Then, for the mountain wave test case, you can just add something like the following to your namelist.atmosphere file:
Code:
&decomposition
    config_block_decomp_file_prefix = 'mtn_wave_grid.graph.info.part.'
/

In case it's easier, I've also updated the download for the mountain wave test case to include a mtn_wave.graph.info file, along with several partitionings.
 

Attachments

  • graph_from_grid.c
    2.6 KB · Views: 54
Top