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

Mesh generation for MPAS-A by using JIGSAW-GEO

tpm630

New member
I have some problems when trying to create MPAS mesh by using JIGSAW-GEO. My steps to generate the 60-3km/60-1km mesh are:
  1. Generate mesh file by jigsaw-geo with the following h function:
    hfun.value = res_out - (res_out - res_in) * np.exp( -( extend * (xmat + (-ctr_lon)/180 * np.pi) ** 2 + extend * (ymat - ctr_lat/180 * np.pi) ** 2) ** grad)
    where res_out, res_in = 60, 3 or 1 # outer and inner grid spacing of stretching grid (km)
    extend, grad = 4., 2.5 # extented range, gradient of ellipsoid
    ctr_lon, ctr_lat = -73, 25 # lon, lat (deg) of ellipsoid center
    xmat, ymat = np.meshgrid(np.linspace(-1. * np.pi, +1. * np.pi, 360), np.linspace( -.5 * np.pi, +.5 * np.pi, 180))
  2. Use MPAS tools to build the full MPAS mesh: including jigsaw_to_netcdf.py and MpasMeshConverter
  3. Convert the obtained file (NetCDF-4 format) into CDF-2/CDF-5 format
The obtained grid.nc passed the init_atmosphere_model pre-processing step, but the model failed to run with the error messsage:
ERROR: Both config_len_disp and nominalMinDc are <= 0.0.

Here are some variable information for my 60-3km mesh:
dimensions:
Time = UNLIMITED ; // (0 currently)
nCells = 1063495 ;
nEdges = 3190479 ;
nVertices = 2126986 ;
maxEdges = 8 ;
maxEdges2 = 16 ;
TWO = 2 ;
vertexDegree = 3 ;

// global attributes:
:eek:n_a_sphere = "YES" ;
:sphere_radius = 1. ;
:is_periodic = "NO" ;
:history = "MpasMeshConverter.x Dorian_3000m.nc Dorian_3000m.grid.nc" ;
:mesh_spec = "1.0" ;
:Conventions = "MPAS" ;
:source = "MpasMeshConverter.x" ;
:file_id = "ixt0lh0s1z" ;

(Max, Min) of dcEdge: (0.0128024, 0.000329) = (81.564094km, 2.097807km)
(Max, Min) of meshDensity: (1.0, 1.0)

Is anyone have ideas about the problem of this mesh? Thanks!
 
Hello @tpm630,

The obtained grid.nc passed the init_atmosphere_model pre-processing step, but the model failed to run with the error messsage:
ERROR: Both config_len_disp and nominalMinDc are <= 0.0.

This message is telling you that there is a missing variable which can be found by the model in two ways: from your namelist.atmosphere (config_len_disp) or from the input file itself (nominalMinDc). The jigsaw_to_netcdf.py script you mentioned doesn't set this automatically, so nominalMinDc isn't in your grid or initial-conditions files.

Given that you said you had a 60-3km mesh, the quickest way to fix this is to add config_len_disp = 3000.0 to the &nhyd group of your namelist.atmosphere. The value for this should match the "typical" minimal distance in meters between any edges in your mesh. (This value can vary from cell to cell, so I say "typical" because it may not match exactly.)

Another equal fix would be to add this value (through nominalMinDc) to your initial-conditions if you're used to editing NetCDF files.
 
Top