>> netcdf_mpas_test 30-Dec-2010 22:03:23 NETCDF_MPAS_TEST MATLAB version Test the NETCDF_MPAS library. NETCDF_MPAS_TEST01 NETCDF_MPAS_REPORT can read an MPAS NETCDF grid file, and print out useful information about what it contains. NETCDF_MPAS_REPORT: Report the information stored in a NETCDF file. Although we wish to examine a file containing grid data generated by MPAS, we will assume we do not have any idea of what is in the file. So we just read, inquire, and print out. The name of the file is "x1.642.grid.nc" PRIMARY PARAMETERS: The number of dimensions NDIMS = 10 The number of variables NVARS = 48 The number of global attributes NGATTS = 12 The unlimited dimension (if any) UNLIMDIMID = 9 GLOBAL ATTRIBUTES: Att --------Name-------- Type Len 0 " np" 4 1 1 " n_scvt_iterations" 4 1 2 " eps" 6 1 3 " c_lat" 6 1 4 " c_lon" 6 1 5 " width" 6 1 6 " trans_center" 6 1 7 " min_val" 6 1 8 " Convergence" 2 2 9 " Scale_eps" 2 2 10 " DensityFunction" 2 82 11 " scaled_eps" 6 1 DIMENSIONS: Dim --------Name-------- Extent 0 " nCells" 642 1 " nEdges" 1920 2 " nVertices" 1280 3 " maxEdges" 10 4 " maxEdges2" 20 5 " TWO" 2 6 " vertexDegree" 3 7 " nVertLevels" 1 8 " nTracers" 1 9 " Time" 1 (unlimited) VARIABLES: Var --------Name-------- Type Natts NdimsDim1Dim2Dim3Dim4 0 " latCell" 6 0 1 0 1 " lonCell" 6 0 1 0 2 " xCell" 6 0 1 0 3 " yCell" 6 0 1 0 4 " zCell" 6 0 1 0 5 " indexToCellID" 4 0 1 0 6 " latEdge" 6 0 1 1 7 " lonEdge" 6 0 1 1 8 " xEdge" 6 0 1 1 9 " yEdge" 6 0 1 1 10 " zEdge" 6 0 1 1 11 " indexToEdgeID" 4 0 1 1 12 " latVertex" 6 0 1 2 13 " lonVertex" 6 0 1 2 14 " xVertex" 6 0 1 2 15 " yVertex" 6 0 1 2 16 " zVertex" 6 0 1 2 17 " indexToVertexID" 4 0 1 2 18 " cellsOnEdge" 4 0 2 5 1 19 " nEdgesOnCell" 4 0 1 0 20 " nEdgesOnEdge" 4 0 1 1 21 " edgesOnCell" 4 0 2 3 0 22 " edgesOnEdge" 4 0 2 4 1 23 " weightsOnEdge" 6 0 2 4 1 24 " dvEdge" 6 0 1 1 25 " dv1Edge" 6 0 1 1 26 " dv2Edge" 6 0 1 1 27 " dcEdge" 6 0 1 1 28 " angleEdge" 6 0 1 1 29 " areaCell" 6 0 1 0 30 " areaTriangle" 6 0 1 2 31 " cellsOnCell" 4 0 2 3 0 32 " verticesOnCell" 4 0 2 3 0 33 " verticesOnEdge" 4 0 2 5 1 34 " edgesOnVertex" 4 0 2 6 2 35 " cellsOnVertex" 4 0 2 6 2 36 " kiteAreasOnVertex" 6 0 2 6 2 37 " fEdge" 6 0 1 1 38 " fVertex" 6 0 1 2 39 " h_s" 6 0 1 0 40 " u" 6 0 3 7 1 9 41 " v" 6 0 3 7 1 9 42 " h" 6 0 3 7 0 9 43 " vh" 6 0 3 7 1 9 44 " circulation" 6 0 3 7 2 9 45 " vorticity" 6 0 3 7 2 9 46 " ke" 6 0 3 7 0 9 47 " tracers" 6 0 4 8 7 0 9 NETCDF_MPAS_TEST02 NETCDF_MPAS_READ_CELLS reads a NETCDF MPAS grid file, extracts the number of cells and the coordinates of their centers. The name of the file is "x1.642.grid.nc" First 10 cell centers: 1 -0.890959 -0.078686 0.447214 2 -0.200487 -0.871668 0.447214 3 -0.000000 0.000000 1.000000 4 0.890959 0.078686 -0.447214 5 0.200487 0.871668 -0.447214 6 0.350157 -0.823037 -0.447214 7 0.767052 -0.460034 0.447214 8 -0.767052 0.460034 -0.447214 9 0.000000 0.000000 -1.000000 10 0.674551 0.587351 0.447214 Saved image as "cells.png" NETCDF_MPAS_TEST03 Read an MPAS NETCDF grid file, get cell locations and cell neighbors. Draw the lines of the triangulation. The name of the file is "x1.642.grid.nc" Found dimension nCells, extent = 642 Found dimension nEdges, extent = 1920 First 10 entries of CELLSONEDGE: 1 9 206 2 9 203 3 9 207 4 9 204 5 9 205 6 203 207 7 203 204 8 204 205 9 206 207 10 205 206 Saved image as "triangulation_edges.png" NETCDF_MPAS_TEST04 Read an MPAS NETCDF grid file, get cell locations, and cellsonvertex. Draw the faces of the triangulation. The name of the file is "x1.642.grid.nc" Found dimension nCells, extent = 642 Found dimension nVertices, extent = 1280 First 10 entries of CELLSONVERTEX: 1 1 163 164 2 1 164 165 3 1 165 166 4 1 166 167 5 1 163 167 6 2 171 172 7 2 168 172 8 2 168 169 9 2 169 170 10 2 170 171 Saved image as "triangulation_faces.png" NETCDF_MPAS_TEST Normal end of execution. 30-Dec-2010 22:03:26 >>