-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
1,891 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,207 @@ | ||
# Makefile for Clawpack code in this directory. | ||
# This version only sets the local files and frequently changed | ||
# options, and then includes the standard makefile pointed to by CLAWMAKE. | ||
CLAWMAKE = $(CLAW)/clawutil/src/Makefile.common | ||
|
||
# See the above file for details and a list of make options, or type | ||
# make .help | ||
# at the unix prompt. | ||
|
||
|
||
# Adjust these variables if desired: | ||
# ---------------------------------- | ||
|
||
CLAW_PKG = geoclaw # Clawpack package to use | ||
EXE = xgeoclaw # Executable to create | ||
SETRUN_FILE = setrun.py # File containing function to make data | ||
OUTDIR = _output # Directory for output | ||
SETPLOT_FILE = setplot.py # File containing function to set plots | ||
PLOTDIR = _plots # Directory for plots | ||
|
||
RESTART = False | ||
|
||
# Environment variable FC should be set to fortran compiler, e.g. gfortran | ||
|
||
# Compiler flags can be specified here or set as an environment variable | ||
FFLAGS ?= | ||
|
||
# Include flags for LAPACK linking | ||
UNAME = $(shell uname) | ||
ifeq ($(UNAME), Darwin) | ||
ifndef LFLAGS | ||
LFLAGS = -framework accelerate $(FFLAGS) | ||
else | ||
LFLAGS += -framework accelerate $(FFLAGS) | ||
endif | ||
else ifeq ($(shell hostname), sandy.ices.utexas.edu) | ||
# Created using Intel MKL Link Line Advisor | ||
# http:https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor/ | ||
FFLAGS += -I$(MKLROOT)/include | ||
ifndef LFLAGS | ||
LFLAGS = -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_lp64.a $(MKLROOT)/lib/intel64/libmkl_core.a $(MKLROOT)/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm $(FFLAGS) | ||
else | ||
LFLAGS += -Wl,--start-group $(MKLROOT)/lib/intel64/libmkl_intel_ilp64.a $(MKLROOT)/lib/intel64/libmkl_core.a $(MKLROOT)/lib/intel64/libmkl_sequential.a -Wl,--end-group -lpthread -lm $(FFLAGS) | ||
endif | ||
else ifeq ($(UNAME), Linux) | ||
ifndef LFLAGS | ||
LFLAGS = -llapack $(FFLAGS) | ||
else | ||
LFLAGS += -llapack $(FFLAGS) | ||
endif | ||
endif | ||
|
||
# --------------------------------- | ||
# List of sources for this program: | ||
# --------------------------------- | ||
|
||
AMRLIB = $(CLAW)/amrclaw/src/2d | ||
GEOLIB = $(CLAW)/geoclaw/src/2d/shallow | ||
|
||
MODULES = \ | ||
$(GEOLIB)/utility_module.f90 \ | ||
$(AMRLIB)/amr_module.f90 \ | ||
$(GEOLIB)/geoclaw_module.f90 \ | ||
$(AMRLIB)/regions_module.f90 \ | ||
$(AMRLIB)/gauges_module.f90 \ | ||
$(GEOLIB)/topo_module.f90 \ | ||
$(GEOLIB)/refinement_module.f90 \ | ||
$(GEOLIB)/fixedgrids_module.f90 \ | ||
$(GEOLIB)/fgmax_module.f90 \ | ||
$(GEOLIB)/holland_storm_module.f90 \ | ||
$(GEOLIB)/constant_storm_module.f90 \ | ||
$(GEOLIB)/stommel_storm_module.f90 \ | ||
$(GEOLIB)/storm_module.f90 \ | ||
$(GEOLIB)/friction_module.f90 \ | ||
$(GEOLIB)/multilayer/multilayer_module.f90 \ | ||
./qinit_module.f90 | ||
|
||
SOURCES = \ | ||
$(GEOLIB)/multilayer/setprob.f90 \ | ||
./qinit.f90 \ | ||
$(GEOLIB)/multilayer/setaux.f90 \ | ||
$(GEOLIB)/multilayer/b4step2.f90 \ | ||
$(GEOLIB)/multilayer/dumpgauge.f \ | ||
$(GEOLIB)/topo_update.f90 \ | ||
$(GEOLIB)/multilayer/getmaxspeed.f90 \ | ||
$(GEOLIB)/multilayer/stepgrid.f \ | ||
$(GEOLIB)/multilayer/valout.f \ | ||
$(GEOLIB)/multilayer/src2.f90 \ | ||
$(GEOLIB)/movetopo.f \ | ||
$(GEOLIB)/cellgridintegrate2.f \ | ||
$(GEOLIB)/topointegral.f \ | ||
$(GEOLIB)/bilinearintegral.f \ | ||
$(CLAW)/riemann/src/rpn2_layered_shallow_water.f90 \ | ||
$(CLAW)/riemann/src/rpt2_layered_shallow_water.f90 \ | ||
$(CLAW)/riemann/src/geoclaw_riemann_utils.f \ | ||
$(GEOLIB)/src1d.f90 \ | ||
$(GEOLIB)/step2.f90 \ | ||
$(GEOLIB)/flux2fw.f \ | ||
$(GEOLIB)/qad.f \ | ||
$(GEOLIB)/filval.f90 \ | ||
$(GEOLIB)/filpatch.f90 \ | ||
$(AMRLIB)/prefilp.f90 \ | ||
$(AMRLIB)/trimbd.f \ | ||
$(AMRLIB)/bound.f \ | ||
$(AMRLIB)/intfil.f \ | ||
$(GEOLIB)/bc2amr.f \ | ||
$(GEOLIB)/update.f \ | ||
$(GEOLIB)/flag2refine2.f90 \ | ||
$(AMRLIB)/flagregions2.f90 \ | ||
$(GEOLIB)/allowflag.f90 \ | ||
$(GEOLIB)/upbnd.f \ | ||
$(GEOLIB)/tick.f \ | ||
$(GEOLIB)/setgrd.f \ | ||
$(GEOLIB)/gfixup.f \ | ||
$(GEOLIB)/ginit.f \ | ||
$(GEOLIB)/advanc.f \ | ||
$(GEOLIB)/amr2.f90 \ | ||
$(GEOLIB)/fgmax_read.f90 \ | ||
$(GEOLIB)/fgmax_frompatch.f90 \ | ||
$(GEOLIB)/fgmax_interpolate.f90 \ | ||
$(GEOLIB)/fgmax_values.f90 \ | ||
$(GEOLIB)/fgmax_finalize.f90 \ | ||
$(AMRLIB)/quick_sort1.f \ | ||
$(AMRLIB)/estdt.f \ | ||
$(AMRLIB)/check4nans.f90 \ | ||
$(AMRLIB)/spest2.f \ | ||
$(AMRLIB)/init_iflags.f \ | ||
$(AMRLIB)/igetsp.f \ | ||
$(AMRLIB)/reclam.f \ | ||
$(AMRLIB)/birect.f \ | ||
$(AMRLIB)/cleanup.f \ | ||
$(AMRLIB)/colate2.f \ | ||
$(AMRLIB)/errest.f \ | ||
$(AMRLIB)/prepregstep.f \ | ||
$(AMRLIB)/prepbigstep.f \ | ||
$(AMRLIB)/bufnst2.f \ | ||
$(AMRLIB)/flagger.f \ | ||
$(AMRLIB)/flagregions.f \ | ||
$(AMRLIB)/errf1.f \ | ||
$(AMRLIB)/fixcapaq.f \ | ||
$(AMRLIB)/flglvl2.f \ | ||
$(AMRLIB)/fluxad.f \ | ||
$(AMRLIB)/fluxsv.f \ | ||
$(AMRLIB)/grdfit2.f \ | ||
$(AMRLIB)/moment.f \ | ||
$(AMRLIB)/nestck2.f \ | ||
$(AMRLIB)/prepc.f \ | ||
$(AMRLIB)/prepf.f \ | ||
$(AMRLIB)/projec2.f \ | ||
$(AMRLIB)/signs.f \ | ||
$(AMRLIB)/findcut.f \ | ||
$(AMRLIB)/smartbis.f \ | ||
$(AMRLIB)/putnod.f \ | ||
$(AMRLIB)/putsp.f \ | ||
$(AMRLIB)/regrid.f \ | ||
$(AMRLIB)/setuse.f \ | ||
$(AMRLIB)/stst1.f \ | ||
$(AMRLIB)/nodget.f \ | ||
$(AMRLIB)/basic.f \ | ||
$(AMRLIB)/outval.f \ | ||
$(AMRLIB)/copysol.f \ | ||
$(AMRLIB)/outvar.f \ | ||
$(AMRLIB)/outmsh.f \ | ||
$(AMRLIB)/outtre.f \ | ||
$(AMRLIB)/domain.f \ | ||
$(AMRLIB)/cellave.f \ | ||
$(AMRLIB)/fdisc.f \ | ||
$(AMRLIB)/fss.f \ | ||
$(AMRLIB)/zeroin.f \ | ||
$(AMRLIB)/setflags.f \ | ||
$(AMRLIB)/shiftset2.f \ | ||
$(AMRLIB)/conck.f \ | ||
$(AMRLIB)/domshrink.f \ | ||
$(AMRLIB)/domprep.f \ | ||
$(AMRLIB)/domup.f \ | ||
$(AMRLIB)/domcopy.f \ | ||
$(AMRLIB)/setdomflags.f \ | ||
$(AMRLIB)/setIndices.f \ | ||
$(AMRLIB)/coarseGridFlagSet.f \ | ||
$(AMRLIB)/addflags.f \ | ||
$(AMRLIB)/baseCheck.f \ | ||
$(AMRLIB)/drivesort.f \ | ||
$(AMRLIB)/flagcheck.f \ | ||
$(AMRLIB)/domgrid.f \ | ||
$(AMRLIB)/setPhysBndryFlags.f \ | ||
$(AMRLIB)/griddomup.f \ | ||
$(AMRLIB)/griddomcopy.f \ | ||
$(AMRLIB)/griddomshrink.f \ | ||
$(AMRLIB)/coarsen.f \ | ||
$(AMRLIB)/auxcoarsen.f \ | ||
$(AMRLIB)/intcopy.f \ | ||
$(AMRLIB)/preintcopy.f \ | ||
$(AMRLIB)/icall.f \ | ||
$(AMRLIB)/preicall.f \ | ||
$(AMRLIB)/inlinelimiter.f \ | ||
$(AMRLIB)/cstore.f \ | ||
$(AMRLIB)/saveqc.f \ | ||
$(AMRLIB)/check.f \ | ||
$(AMRLIB)/restrt.f \ | ||
$(AMRLIB)/opendatafile.f \ | ||
$(AMRLIB)/init_alloc.f90 \ | ||
$(AMRLIB)/restrt_alloc.f90 \ | ||
$(AMRLIB)/resize_alloc.f90 | ||
|
||
#------------------------------------------------------------------- | ||
# Include Makefile containing standard definitions and make options: | ||
include $(CLAWMAKE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
.. _geoclaw_examples_multilayer_plane_wave: | ||
|
||
Basic 2D Multi-Layer Shallow Water Examples | ||
=========================================== | ||
|
||
These examples include simple setups for plane wave tests of the 2-layer | ||
shallow water equations with a plane wave initial condition and a jump in | ||
bathymetry. The location and angles of the plane wave and bathymetry jump are | ||
controlled via the *setrun.py* file. Additionally the ability to run with a | ||
similar topography but a gaussian hump as the initial condition has also been | ||
included. To run the basic plane-wave example use:: | ||
|
||
make .plots | ||
|
||
Running the *run_tests.py* script will execute a family of different setups for | ||
both plane-waves incident at different angles to the grid and topography and a | ||
set of the ``bubble tests``. The basics of the Riemann solvers involved in | ||
these examples can be found in [1]. | ||
|
||
1. Mandli, K. T. A Numerical Method for the Two Layer Shallow Water Equations with Dry States. Ocean Modelling 72, 80–91 (2013). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
subroutine qinit(meqn,mbc,mx,my,xlower,ylower,dx,dy,q,maux,aux) | ||
|
||
use qinit_module, only: qinit_type, add_perturbation | ||
use multilayer_module, only: num_layers, rho, eta_init | ||
|
||
implicit none | ||
|
||
! Subroutine arguments | ||
integer, intent(in) :: meqn,mbc,mx,my,maux | ||
real(kind=8), intent(in) :: xlower,ylower,dx,dy | ||
real(kind=8), intent(inout) :: q(meqn,1-mbc:mx+mbc,1-mbc:my+mbc) | ||
real(kind=8), intent(inout) :: aux(maux,1-mbc:mx+mbc,1-mbc:my+mbc) | ||
|
||
! Locals | ||
integer :: i,j,m,layer_index | ||
real(kind=8) :: eta_below | ||
|
||
! Set flat state based on eta_init | ||
q = 0.d0 | ||
do j=1,my | ||
do i=1,mx | ||
! Start with bottom layer and work up, set surface below for h | ||
eta_below = aux(1,i,j) | ||
do m=num_layers,1,-1 | ||
layer_index = 3 * (m-1) + 1 | ||
q(layer_index,i,j) = max(0.d0,eta_init(m) - eta_below) | ||
eta_below = q(layer_index,i,j) + eta_below | ||
q(layer_index,i,j) = q(layer_index,i,j) * rho(m) | ||
enddo | ||
enddo | ||
enddo | ||
|
||
! Add perturbation to initial conditions | ||
if (qinit_type > 0) then | ||
call add_perturbation(meqn,mbc,mx,my,xlower,ylower,dx,dy,q,maux,aux) | ||
endif | ||
|
||
if (.false.) then | ||
open(23, file='fort.aux',status='unknown',form='formatted') | ||
print *,'Writing out aux arrays' | ||
print *,' ' | ||
do j=1,my | ||
do i=1,mx | ||
write(23,*) i,j,(q(m,i,j),m=1,meqn) | ||
enddo | ||
enddo | ||
close(23) | ||
endif | ||
|
||
end subroutine qinit |
Oops, something went wrong.