MPAS-Dev / MPAS-Tools

MPAS Tools Repository
Other
37 stars 63 forks source link

large variable/file support in MpasMeshConverter.x #465

Open xtian15 opened 2 years ago

xtian15 commented 2 years ago

I recently used jigsaw to generate a mesh of 10-30 million cells. When trying to write them out at netcdf formats using MpasMeshConverter.x, the job was terminated due to size limits imposed by netcdf referenced by the executable. In this case, is there anything that can be done to lift this limit inside the MpasMeshConverter.x? Thanks!

Build areaCell, areaTriangle, and kiteAreasOnVertex.
     Found 0 incomplete cells. Each is marked with an area of -1.
Build edgesOnEdge and weightsOnEdge.
Build angleEdge.
Building mesh qualities.
        Mesh contains: 0 obtuse triangles.
Writing grid dimensions
Writing grid attributes
Writing grid coordinates
Writing cell connectivity
Writing edge connectivity
Writing vertex connectivity
Writing cell parameters
Writing edge parameters
Writing vertex parameters
NetCDF: One or more variable sizes violate format constraints
NetCDF: One or more variable sizes violate format constraints
Error - 2
Traceback (most recent call last):
  File "/backup/xtian/cases/meshes/mesh-gen/gen-mesh-cellWidth.py", line 132, in <module>
    meshShapeFile(dMin=dMin, dMax=dMax)
  File "/backup/xtian/cases/meshes/mesh-gen/gen-mesh-cellWidth.py", line 117, in meshShapeFile
    cellWidth2mesh(lat, lon, cellWidth, output=gridname)
  File "/backup/xtian/cases/meshes/mesh-gen/gen-mesh-cellWidth.py", line 41, in cellWidth2mesh
    convert(xarray.open_dataset(out_basepath+'_triangles.nc'),
  File "/backup/miniconda3/envs/xtian-mpas-tools/lib/python3.10/site-packages/mpas_tools/mesh/conversion.py", line 51, in convert
    _call_subprocess(['MpasMeshConverter.x', inFileName, outFileName],
  File "/backup/miniconda3/envs/xtian-mpas-tools/lib/python3.10/site-packages/mpas_tools/mesh/conversion.py", line 219, in _call_subprocess
    subprocess.check_call(args)
  File "/backup/miniconda3/envs/xtian-mpas-tools/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['MpasMeshConverter.x', '/backup/xtian/cases/meshes/mesh-gen/VR-004-060/tmpp82hzxq1/mesh_in.nc', '/backup/xtian/cases/meshes/mesh-gen/VR-004-060/tmpp82hzxq1/mesh_out.nc']' returned non-zero exit status 2.
xylar commented 2 years ago

@xtian15, this is a big issue, I agree. I've run into this as well.

The problem is that the mesh conversion tools were build with the legacy NetCDF c++ library that hasn't gotten any further attention. The syntax for the "proper" NetCDF c++ library is totally different and would require a significant rewrite of the tools that we don't have staff time for, at least not a LANL.

xylar commented 2 years ago

@mgduda, is this anything you guys at NCAR have resources to work on?

xtian15 commented 2 years ago
  1. Any plans to remedy this limitation in the near future?
  2. Is there any workaround when you encountered this issue? Thanks!
xylar commented 2 years ago

I'm not aware of a workaround. I ended abandoning a large MPAS-Ocean mesh I was trying to work on because of this.

There is also not any concrete plan to address this from the LANL side. Let's see what @mgduda has to say.