NW Washington Outer Coast modeling in 2020

Modeling performed by the UW Tsunami Modeling Group, http://depts.washington.edu/ptha/index.html

fgmax regions: Flattery, Ozette, LaPush fgmax regions

Archives:

This README and all of the code mentioned below is archived in the tar file 2020_NWWA_L1_XL1_AKmaxWA_code.tar.gz available by request from Washington Geological Survey.

The input_file, topofiles, and dtopofiles directories are archived in the tar file 2020_NWWA_L1_XL1_AKmaxWA_data.tar.gz available by request from Washington Geological Survey, or these large data files can be obtained by other means described below.

The GeoClaw simulation results from running these codes are archived in the tar file 2020_NWWA_L1_XL1_AKmaxWA_results.tar.gz available by request from Washington Geological Survey.

Directory structure

Within Runs are directories for each fgmax location, and within each of these there are subdirectories for each event: CSZ_XL1, CSZ_L1, and AK.

Topography files:

The topo/topofiles directory contains topo files and also .kml and .png files that show the areas covered by each.

Note: These large files are not included in the tar file but can be found at http://depts.washington.edu/ptha/topo/, along with the scripts used to create some of them.

The bash script topo/topofiles/wget_topofiles.sh can be used to download them all.

Earthquake source (dtopo) files:

The dtopo/dtopofiles directory contains dtopo files used to specify the sea floor displacement that generates the tsunami.

Note: These large files are not included in the tar file but can be found at http://depts.washington.edu/ptha/dtopo/, along with the scripts used to create some of them.

The bash script dtopo/dtopofiles/wget_dtopofiles.sh can be used to download them all.

Input files:

Other large input files needed for GeoClaw runs are found in topo/input_files.

The fgmax points for each region are specified by the files

Ruled rectangles used in guiding adaptive mesh refinement are found in

All of these files are created by the notebook

Setting up a run

The location directory

A directory for an fgmax region (location) has a name like Flattery. This directory contains a subdirectory for each event, such as CSZ_L1.

These files are created by the Jupyter notebook make_input_files_2020.ipynb, or by a Python script make_input_files_2020.py created from this notebook (see below). Several figures (and png files) are also created. These are made in the main directory and then moved to input_files for safe keeping.

The event directory

Within an event directory, such as Flattery/CSZ_L1_v570, there are the following files:

Note: In addition to event directories for each earthquake source, there is also a directory make_B0 for each location. This is set up to do a short run with no source in order to save values of the topography B0 before co-seismic subsidence at each fgmax point, which is used in post-processing the fgmax results and producing plots and .nc files. The results are processed by topo/make_B0.py and stored in topo/input_files/LOC_B0.txt for each location LOC.

Important parameters to modify for a new loc/event

If copying these files to a new directory to create a different event at this location, the following parameters in params.py are particularly important to modify:

Custom Fortran code

The only custom Fortran code used for this project (rather than the standard Clawpack v5.7.0 code) was the set_eta_init subroutine defined in

This routine was used for the CSZ events to initialize Lake Ozette to 9.2 m above MHW, as discussed in the report.

Post processing

Some other parameters in params.py are only used in post-processing, see comments in this file.

After running GeoClaw, the results are in _output by default. This contains time frame results at the times listed in the fort.t* files, and also the fgmax results, in the file:

This file lists only the fgmax points, one per line. (Note this is a new format from that used in GeoClaw before v5.7.0.)

The files can be post-processed using the following files, which are the same for all locations/events and found in common_python:

To turn a notebook into a python script

To turn a notebook (e.g. process_fgmax.ipynb) into a python script that can be used to process the data without opening the notebook, do the following:

jupyter nbconvert --to python process_fgmax.ipynb

python process_fgmax.py

For make_input_files.py you can also do this:

`jupyter nbconvert --to python --TagRemovePreprocessor.enabled=True --TagRemovePreprocessor.remove_cell_tags="['hide-py']" make_input_files.ipynb`

This will suppress cells tagged hide-py and remove the cells that make plots, only producing the input files themselves. (Also removes the magic command.)

This will only work if jupyter nbconvert --version shows version >= 5.3.0.

Move the resulting make_input_files.py to input_files if you want to be able to run this script and make the files in place, useful when running on a remote cluster.

To turn a notebook into an html file

To turn a notebook (e.g. process_fgmax.ipynb) into an html file showing for archiving or sharing, do the following:

Note that the --execute flag will cause it to execute the notebook before converting. If the output is already in the notebook or you want to create an html file of the input cells alone, leave this out.

If a cell times out, you can add the argument --ExecutePreprocessor.timeout=-1 for unlimited timeout.

To run on CU cluster

The directory cu_cluster contains slurm scripts for compiling, running the code, making plots, and executing the post-processing scripts.

git pull  # get recent changes

In event directory:

modify Makefile to set SCRATCH properly

submit job to run geoclaw:

`sbatch path-to/cu_cluster/run_geoclaw24.sbatch  # using 24 threads`

If doing a restart, use full path to scratch directory for checkpt file.

In scratch directory:

_plots should now exist with time frame plots, along with the results of the post-processing.

If not, one of the other scripts can be used:

Transfer plots and other output files:

We used a bash script like

executed from the event directory (after fixing the path and identifier) in order to transfer plots and output files to the UW web server for displaying plots and facilitating downloading of output files.