Skip to content

Instantly share code, notes, and snippets.

@pwolfram
Forked from bradyrx/mpas_for_paraview.sh
Created May 21, 2019 21:30
Show Gist options
  • Save pwolfram/01f30dc9ca66c03e5c9a11ac53c81a9a to your computer and use it in GitHub Desktop.
Save pwolfram/01f30dc9ca66c03e5c9a11ac53c81a9a 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment