ADCIRC: Difference between revisions
mNo edit summary |
(→Importing the fort.14 mesh grid: plot look) |
||
Line 34: | Line 34: | ||
v.in.adcirc_grid -p in="$file" out="submesh_${base}_pts" --quiet | v.in.adcirc_grid -p in="$file" out="submesh_${base}_pts" --quiet | ||
done | done | ||
</pre> | |||
Here is a loop for displaying 80 sub-meshes, with random dark colors: | |||
<pre> | |||
for PE in {00..79} ; do | |||
echo -n "[$PE]" | |||
R=`expr $RANDOM / 256` | |||
G=`expr $RANDOM / 256` | |||
B=`expr $RANDOM / 256` | |||
d.vect "submesh_$PE" color="$R:$G:$B" | |||
done | |||
d.vect US_medium_shoreline@sbss color=black #width=2 | |||
d.vect $STNMAP color=black fcolor=red size=8 icon=basic/circle | |||
</pre> | </pre> | ||
Revision as of 06:04, 17 July 2019
Interfacing with the ADCIRC coastal ocean model
Grid preparation
OceanMesh2D
OceanMesh2D is an open source (GPL3) generator of 2D triangular meshes suitable for use with ADCIRC. It likes to work in lat/lon coordinate system.
You can output your DEM as NetCDF format with r.out.gdal.
You can create a domain boundary polyline with r.contour. You can then output the domain boundary polyline either as Shapefiles with v.out.ogr, or as two column x,y ASCII data with the v.out.ascii.mat addon module for GRASS 6.
Post processing output data
Importing the fort.14 mesh grid
The v.in.adcirc_grid addon module for GRASS 6 will import a 3D triangular mesh from the ADCIRC coastal ocean model into a GRASS vector map.
If you wish to have a look at where the sub-domains of a parallel run are, you can use the following Bash script:
mkdir fort14s for DIR in PE00?? ; do cp -a $DIR/fort.14 fort14s/${DIR}.14 done cd fort14s for file in *.14 ; do base=`echo "$file" | sed -e 's/PE00//' -e 's/\.14//'` echo -n "[$base]" v.in.adcirc_grid in="$file" out="submesh_$base" --quiet v.in.adcirc_grid -p in="$file" out="submesh_${base}_pts" --quiet done
Here is a loop for displaying 80 sub-meshes, with random dark colors:
for PE in {00..79} ; do echo -n "[$PE]" R=`expr $RANDOM / 256` G=`expr $RANDOM / 256` B=`expr $RANDOM / 256` d.vect "submesh_$PE" color="$R:$G:$B" done d.vect US_medium_shoreline@sbss color=black #width=2 d.vect $STNMAP color=black fcolor=red size=8 icon=basic/circle
Importing unit 61, 62, 63, 64 results
- addme: bash code + r.in.xyz + r.surf.nnbathy
d.barb addon module for GRASS 6 for rendering u,v vector arrows