Skip to content

Commit

Permalink
Add run_tests.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
dongli committed Jan 8, 2020
1 parent 8e9cccf commit 026bede
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 43 deletions.
46 changes: 46 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/bash

# Fetch submodules if needed.
git submodule update --init

# Build the model.
cd build
FC=gfortran cmake ..
make
cd ..

# Run all the tests.
if (( $# == 1 )); then
work_dir=$1
if [[ ! -d $work_dir ]]; then
mkdir -p $work_dir
fi
cp src/tests/swm/namelist.swm.rh4.360x180 $work_dir
cp src/tests/swm/namelist.swm.mz.360x180 $work_dir
cp src/tests/swm/namelist.swm.sg.360x180 $work_dir
cp src/tests/swm/namelist.swm.jz.360x180 $work_dir
cp src/tests/swm/namelist.swm.cp.360x180 $work_dir
cp build/gmcore_swm_driver.exe $work_dir
fi

cd $work_dir

echo '=========================================================================='
echo 'Rossby-Haurwitz wave test'
time ./gmcore_swm_driver.exe namelist.swm.rh4.360x180

echo '=========================================================================='
echo 'Zonal mountain wave'
time ./gmcore_swm_driver.exe namelist.swm.mz.360x180

echo '=========================================================================='
echo 'Jet zonal flow test'
time ./gmcore_swm_driver.exe namelist.swm.jz.360x180

echo '=========================================================================='
echo 'Cross pole flow test'
time ./gmcore_swm_driver.exe namelist.swm.cp.360x180

echo '=========================================================================='
echo 'Steady geostrophic flow test'
time ./gmcore_swm_driver.exe namelist.swm.sg.360x180
15 changes: 15 additions & 0 deletions src/tests/swm/namelist.swm.cp.360x180
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
&gmcore_swm_control
num_lon = 360
num_lat = 180
! mountain_zonal_flow, rossby_haurwitz_wave, jet_zonal_flow, steady_geostrophic_flow, cross_pole_flow
test_case = 'cross_pole_flow'
run_days = 10
dt_in_seconds = 300
pv_scheme = 3
split_scheme = 'csp2'
fast_cycles = 5
case_name = 'cp.u_pole.reduce.split.damp.dt300.360x180'
history_interval = '6 hours'
reduce_factors = 8, 8, 8, 6, 6, 6, 4, 4, 2
damp_orders = 4, 4, 8, 6, 6, 6, 6, 6, 6
/
12 changes: 0 additions & 12 deletions src/tests/swm/namelist.swm.jz

This file was deleted.

10 changes: 5 additions & 5 deletions src/tests/swm/namelist.swm.jz.360x180
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
&gmcore_swm_control
num_lon = 360
num_lat = 180
! mountain_zonal_flow, rossby_haurwitz_wave
! mountain_zonal_flow, rossby_haurwitz_wave, jet_zonal_flow, steady_geostrophic_flow, cross_pole_flow
test_case = 'jet_zonal_flow'
run_days = 7
dt_in_seconds = 300
pv_scheme = 3
split_scheme = 'csp2'
fast_cycles = 8
case_name = 'jz.u_pole.reduce.split.360x180'
fast_cycles = 5
case_name = 'jz.u_pole.reduce.split.damp.dt300.360x180'
history_interval = '6 hours'
reduce_factors = 8, 8, 6, 6, 4, 4, 2
damp_order = 4
reduce_factors = 8, 8, 8, 6, 6, 6, 4, 4, 2
damp_orders = 4, 4, 8, 6, 6, 6, 6, 6, 6
/
6 changes: 3 additions & 3 deletions src/tests/swm/namelist.swm.jz.720x360
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
&gmcore_swm_control
num_lon = 720
num_lat = 360
! mountain_zonal_flow, rossby_haurwitz_wave
! mountain_zonal_flow, rossby_haurwitz_wave, jet_zonal_flow, steady_geostrophic_flow, cross_pole_flow
test_case = 'jet_zonal_flow'
run_days = 7
dt_in_seconds = 150
pv_scheme = 3
split_scheme = 'csp2'
fast_cycles = 8
case_name = 'jz.u_pole.reduce.split.720x360'
case_name = 'jz.u_pole.reduce.split.damp.dt150.720x360'
history_interval = '6 hours'
reduce_factors = 8, 8, 8, 8, 6, 6, 6, 6, 4, 4, 4, 4, 2, 2
damp_order = 4
damp_orders = 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6
/
10 changes: 5 additions & 5 deletions src/tests/swm/namelist.swm.mz.180x90
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
&gmcore_swm_control
num_lon = 180
num_lat = 90
! mountain_zonal_flow, rossby_haurwitz_wave
! mountain_zonal_flow, rossby_haurwitz_wave, jet_zonal_flow, steady_geostrophic_flow, cross_pole_flow
test_case = 'mountain_zonal_flow'
run_days = 50
dt_in_seconds = 600
pv_scheme = 3
split_scheme = 'csp2'
fast_cycles = 6
case_name = 'mz.u_pole.reduce.split.damp8_uv.180x90'
fast_cycles = 5
case_name = 'mz.u_pole.reduce.split.damp.dt600.180x90'
history_interval = '6 hours'
reduce_factors = 4, 2, 2
damp_order = 8
reduce_factors = 8, 4, 2
damp_orders = 4, 6, 6
/
12 changes: 6 additions & 6 deletions src/tests/swm/namelist.swm.mz.360x180
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
&gmcore_swm_control
num_lon = 360
num_lat = 180
! mountain_zonal_flow, rossby_haurwitz_wave
! mountain_zonal_flow, rossby_haurwitz_wave, jet_zonal_flow, steady_geostrophic_flow, cross_pole_flow
test_case = 'mountain_zonal_flow'
run_days = 50
dt_in_seconds = 360
pv_scheme = 3
time_scheme = 'pc2'
dt_in_seconds = 300
split_scheme = 'csp2'
fast_cycles = 5
case_name = 'mz.u_pole.reduce.split.damp.dt360.360x180'
pv_scheme = 3
case_name = 'mz.u_pole.reduce.split.damp.dt300.360x180'
history_interval = '6 hours'
reduce_factors = 8, 8, 6, 6, 4, 4, 2
damp_order = 4
adaptive_damp = .false.
damp_orders = 4, 4, 6, 6, 6, 6, 6
/
14 changes: 7 additions & 7 deletions src/tests/swm/namelist.swm.rh4.180x90
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
&gmcore_swm_control
num_lon = 180
num_lat = 90
! mountain_zonal_flow, rossby_haurwitz_wave
! mountain_zonal_flow, rossby_haurwitz_wave, jet_zonal_flow, steady_geostrophic_flow, cross_pole_flow
test_case = 'rossby_haurwitz_wave'
run_days = 100
dt_in_seconds = 100
! split_scheme = 'csp2'
! fast_cycles = 6
dt_in_seconds = 600
split_scheme = 'csp2'
fast_cycles = 5
pv_scheme = 3
case_name = 'rh4.u_pole.reduce.damp8_uv.180x90'
case_name = 'rh4.u_pole.reduce.split.damp.180x90'
history_interval = '1 days'
reduce_factors = 4, 2, 2
damp_order = 8
reduce_factors = 8, 6, 4, 2
damp_orders = 4, 6, 6, 6
/
9 changes: 4 additions & 5 deletions src/tests/swm/namelist.swm.rh4.360x180
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
&gmcore_swm_control
num_lon = 360
num_lat = 180
! mountain_zonal_flow, rossby_haurwitz_wave
! mountain_zonal_flow, rossby_haurwitz_wave, jet_zonal_flow, steady_geostrophic_flow, cross_pole_flow
test_case = 'rossby_haurwitz_wave'
run_days = 100
dt_in_seconds = 300
split_scheme = 'csp2'
fast_cycles = 5
pv_scheme = 3
case_name = 'rh4.u_pole.midpoint.reduce.split.damp.dt360.360x180'
case_name = 'rh4.u_pole.reduce.split.damp.dt300.360x180'
history_interval = '1 days'
reduce_factors = 8, 8, 6, 6, 4, 4, 2
damp_order = 6
adaptive_damp = .false.
reduce_factors = 8, 8, 8, 6, 6, 4, 4, 2
damp_orders = 4, 4, 4, 6, 6, 6, 6, 6
/
16 changes: 16 additions & 0 deletions src/tests/swm/namelist.swm.sg.360x180
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
&gmcore_swm_control
num_lon = 360
num_lat = 180
! mountain_zonal_flow, rossby_haurwitz_wave, jet_zonal_flow, steady_geostrophic_flow, cross_pole_flow
test_case = 'steady_geostrophic_flow'
run_days = 12
time_scheme = 'pc2'
dt_in_seconds = 300
split_scheme = 'csp2'
fast_cycles = 5
pv_scheme = 3
case_name = 'sg.u_pole.reduce.split.damp.dt300.360x180'
history_interval = '6 hours'
reduce_factors = 8, 8, 6, 6, 4, 4, 2
damp_orders = 4, 4, 6, 6, 6, 6, 6
/

0 comments on commit 026bede

Please sign in to comment.