================ Preparing Meshes ================ For quasiuniform meshes, users generally only need to prepare mesh decomposition files - files that describe the decomposition of the SCVT mesh across processors - when running MPAS-A using multiple MPI tasks. * **Variable-resolution SCVT meshes** The area of mesh refinement may be rotated to any part of the sphere using a program, "grid rotate,"** described in :ref:`Relocating Refinement Regions on the Sphere`. Obtain this utility from `MPAS-Atmosphere Meshes <./../../access_code/meshes.html>`_. * **Limited-area simulations** The limited-area mesh may be produced by subsetting the elements in an existing SCVT mesh, as described in :ref:`Creating Limited-area SCVT Meshes`. | `See MPAS Mesh Specification `_ for additional details | | Graph Partitioning with METIS ============================= **To run MPAS in parallel, a mesh decomposition file is required.** This file includes an appropriate number of partitions - equal to the number of MPI tasks that will be used. A limited number of mesh decomposition files (*graph.info.part.\**) are provided with each mesh, as is the mesh connectivity file (*graph.info*). If a pre-computed decomposition file matches the number of MPI tasks to be used to run MPAS, then there is no need to run METIS. To create new mesh decomposition files for some particular number of MPI tasks, only the *graph.info* file is required. The supported method for partitioning a *graph.info* file uses the `METIS software `_. The serial graph partitioning program, METIS (rather than ParMETIS or hMETIS), should be sufficient for quickly partitioning any mesh usable by MPAS. After installing METIS, a *graph.info* file can be partitioned into *N* partitions by running .. code-block:: > gpmetis -minconn -contig -niter=200 graph.info N | where *N* is the required number of partitions. The resulting file, *graph.info.part.N*, can then be copied into the MPAS *run* directory before running the model with *N* MPI tasks. | | | .. _Relocating Refinement Regions on the Sphere: Relocating Refinement Regions on the Sphere =========================================== **The grid_rotate program is used to rotate an MPAS mesh file**, moving a refinement region from one geographic location to another, so that the mesh can be re-used for different applications. This utility saves computational resources, since generating an SCVT - particularly one with a large number of generating points or a high degree of refinement - can take considerable time. | **To build the "grid_rotate" program,** #. Edit the *Makefile* to set the Fortran compiler to be used. #. If the *NETCDF* environment variable points to a netCDF installation that was built with a separate Fortran interface library, add *-lnetcdff* just before *-lnetcdf* in the *Makefile*. #. Run ``make`` to create a *grid_rotate* executable file. | Besides the MPAS grid file to be rotated, *grid_rotate* requires a namelist file, *namelist.input*, which specifies the rotation to be applied to the mesh. **The namelist.input variables specific to "grid_rotate" are summarized in the table below.** | .. csv-table:: config_original_latitude_degrees, original latitude of any point on the sphere config_original_longitude_degrees, original longitude of any point on the sphere config_new_latitude_degrees, latitude to which the original point should be shifted config_new_longitude_degrees, longitude to which the original point should be shifted config_birdseye_rotation_counter_clockwise_degrees, rotation about a vector from the sphere center through the original point | Essentially, one chooses any point on the sphere, decides to where that point should be shifted, and specifies any change to the orientation (i.e., rotation) of the mesh about that point. After the rotation parameters are set in *namelist.input*, *grid_rotate* program is run with two command-line options specifying the original grid file name and the name of the rotated grid file to be produced, e.g., .. code-block:: > grid_rotate grid.nc grid_SE_Asia_refinement.nc | The original grid file will not be altered, and a new rotated grid file will be created. The NCL script *mesh.ncl* may be used to plot either of the original or rotated grid files after setting the name of the grid file in the script. .. warning:: The *grid_rotate* program initializes the new, rotated grid file to a copy of the original grid file. If the original grid file has only read permission (i.e., no write permission), then so will the copy, and consequently, the *grid_rotate* program will fail when attempting to update the fields in the copy. | | | .. _Creating Limited-area SCVT Meshes: Creating Limited-area SCVT Meshes ================================= The process of creating a limited-area (regional) mesh for MPAS-Atmosphere involves #. selecting any existing mesh - either a quasi-uniform mesh, or a variable-resolution mesh that has been rotated as in :ref:`Relocating Refinement Regions on the Sphere` #. describing the geographical region to be extracted from that mesh, and #. running the limited-area Python program to extract all cells, edges, and vertices in the designated region. | The result is a new netCDF mesh file that can be used to make a limited-area simulation as described in `Regional Simulations <./model_options.html#regional-simulation>`_. | `See MPAS-A Meshes <./../../access_code/meshes.html>`_ **to obtain the limited-area Python program.** Although the set of required Python packages may change over time, the program currently requires the *numpy* and *netCDF4* packages, in addition to other standard packages. | | | | | | .. rst-class:: horizbuttons-next-m * `Next: Configuring Model Input and Output -> <./configuring_io.html>`_ |