Skip to content

Instantly share code, notes, and snippets.

@bradyrx
Last active May 21, 2019 21:33
Show Gist options
  • Save bradyrx/0d4959dd16ed92fde75ca332de0cf5d8 to your computer and use it in GitHub Desktop.
Save bradyrx/0d4959dd16ed92fde75ca332de0cf5d8 to your computer and use it in GitHub Desktop.
extracts just the needed variables to trigger the Paraview reader to recognize it as an MPAS file
#!/bin/bash
GridVars=latCell,lonCell,maxLevelCell,nEdgesOnCell,xCell,yCell,zCell,dcEdge,dvEdge,indexToEdgeID,latEdge,lonEdge,nEdgesOnEdge,xEdge,yEdge,zEdge,areaTriangle,indexToVertexID,latVertex,lonVertex,xVertex,yVertex,zVertex,edgesOnVertex,cellsOnVertex,indexToCellID,indexToEdgeID,indexToVertexID,cellsOnEdge,edgesOnCell,edgesOnEdge,cellsOnCell,refBottomDepth,verticesOnCell,verticesOnEdge,bottomDepth
ncks -d Time,0 -v ${GridVars} file1.nc file2.nc
ncks -A -v ${GridVars} mpas_grid.nc mpas_file.nc
@pwolfram
Copy link

Thanks @bradyrx!

@bradyrx
Copy link
Author

bradyrx commented May 21, 2019

@pwolfram, This adds verticesOnEdge and bottomDepth to the required ParaView reader fields so that you can use this mesh with paraview_vtk_extractor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment