Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shallow water and Barotropic Vorticity equation code #227

Open
wants to merge 37 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
55b85b1
Added code necessary to run shallow water and barotropic vorticity co…
sit23 May 14, 2019
dea4afd
Copied example input and diag file entries into test case, and set up…
sit23 May 14, 2019
a5a6c8e
updated experiment to get it to run, and updated leapfrog and damping…
sit23 May 14, 2019
bd7df06
Integrated barotropic vorticity equation into Isca framework too. Nee…
sit23 May 14, 2019
4c22f20
Fixed small typo in barotropic codebase object.
sit23 May 14, 2019
717a94a
Rewrite of stirring module to retain functionality, but to get rid of…
sit23 May 16, 2019
2f6acc0
Updated shallow code to include stirring, but thanks to rewrite of st…
sit23 May 16, 2019
6c696ee
Remove needless string definitions.
sit23 May 16, 2019
993966c
Adding comments to stirring file to point out origin.
sit23 May 16, 2019
4693d72
Making the wavenumber range of the forcing a namelist parameter set.
sit23 May 16, 2019
f8fcd5c
Trying to make scott and polvani 2007 esque flows.
sit23 May 16, 2019
a279626
Adding missing model files that I forgot to commit. These are necessa…
sit23 May 16, 2019
e74e5c0
Added ability to do deep velocities, I think. Seems reasonable. Now t…
sit23 May 17, 2019
172087f
Updaing shallow water code to better account for deep velocities in i…
sit23 May 31, 2019
de1f769
First lot of experiments for poster. Run at T170 and forced at small-…
sit23 May 31, 2019
c09ad56
Updating outputs for energy diagnostics.
sit23 Jun 18, 2019
c1a3f2a
Updated experiments.
sit23 Jun 29, 2019
4e46f2c
Ignorning supercomputer log files.
sit23 Jul 2, 2019
f1cc51d
Adding diagnostics for momentum budget.
sit23 Jul 2, 2019
0fd581d
Merge branch 'shallow_and_baro' of github.com:sit23/Isca into shallow…
sit23 Jul 2, 2019
ee7394d
Added daily output for more useful diagnostics.
sit23 Jul 18, 2019
bee23e0
Adding momentum budget analysis outputs.
sit23 Jul 18, 2019
cbca8c7
parameter updates.
sit23 Feb 7, 2020
bb15cef
Update shallow code to include vortex migration experiments.
sit23 Mar 19, 2020
985e952
Merge branch 'shallow_and_baro' of github.com:sit23/Isca into shallow…
sit23 Dec 10, 2020
f51205e
Merge branch 'master' into shallow_and_baro
sit23 Dec 10, 2020
d706b34
Removing unecessary experiment files.
sit23 Dec 10, 2020
809b9a3
Axisymmetric test case crashes under gfortran. This is because the dt…
sit23 Aug 27, 2021
7dc6810
Identified cause of segmentation faults as loop with wrong dimensions.
sit23 Aug 27, 2021
b6731e5
Clearing up odd optional variables in rayleigh bottom drag.
sit23 Aug 27, 2021
fece063
Changing == to .eqv. for logicals, as gfortran objects to these even …
sit23 Aug 27, 2021
07472dd
Update to trip-tests to track when compilation rather than run fails.
sit23 Sep 23, 2021
3acc1db
Merge branch 'master' into shallow_and_baro_clean
sit23 Oct 16, 2021
6e259f5
Merge branch 'master' into gfortran_fixes
sit23 Oct 16, 2021
2f3b925
Merge branch 'gfortran_fixes' into shallow_and_baro_clean_gfort
sit23 Oct 16, 2021
e099244
Moving the cb.compile step inside the main executable part of the tes…
sit23 Oct 16, 2021
a9610f5
Adding shallow water and barotropic vorticity equation test cases to …
sit23 Oct 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ coverage.xml
.pytest_cache/
test/.cache
test/results.xml
*.sh.e*
*.sh.o*

# Translations
*.mo
Expand Down
5 changes: 3 additions & 2 deletions exp/test_cases/MiMA/MiMA_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('mima_test_experiment', codebase=cb)
Expand Down Expand Up @@ -174,6 +172,9 @@
})
#Lets do a run!
if __name__=="__main__":

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
7 changes: 4 additions & 3 deletions exp/test_cases/axisymmetric/axisymmetric_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('axisymmetric_test_case', codebase=cb)
Expand Down Expand Up @@ -141,7 +139,7 @@
'rrtm_radiation_nml': {
'do_read_ozone':True,
'ozone_file':'ozone_1990',
'dt_rad': 3600. #Set RRTM radiation timestep to 3600 seconds, meaning it runs every 5 atmospheric timesteps
'dt_rad': 3600, #Set RRTM radiation timestep to 3600 seconds, meaning it runs every 5 atmospheric timesteps
},

# FMS Framework configuration
Expand Down Expand Up @@ -181,6 +179,9 @@

#Lets do a run!
if __name__=="__main__":

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import os

import numpy as np

from isca import BarotropicCodeBase, DiagTable, Experiment, Namelist, GFDL_BASE

NCORES = 8
base_dir = os.path.dirname(os.path.realpath(__file__))
# a CodeBase can be a directory on the computer,
# useful for iterative development
cb = BarotropicCodeBase.from_directory(GFDL_BASE)

# or it can point to a specific git repo and commit id.
# This method should ensure future, independent, reproducibility of results.
# cb = DryCodeBase.from_repo(repo='https://github.com/isca/isca', commit='isca1.1')

# compilation depends on computer specific settings. The $GFDL_ENV
# environment variable is used to determine which `$GFDL_BASE/src/extra/env` file
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('barotropic_stirring_test_experiment', codebase=cb)

#Tell model how to write diagnostics
diag = DiagTable()
diag.add_file('atmos_monthly', 30, 'days', time_units='days')

#Tell model which diagnostics to write
diag.add_field('barotropic_diagnostics', 'ucomp', time_avg=True)
diag.add_field('barotropic_diagnostics', 'vcomp', time_avg=True)
diag.add_field('barotropic_diagnostics', 'vor', time_avg=True)
diag.add_field('barotropic_diagnostics', 'pv', time_avg=True)
diag.add_field('barotropic_diagnostics', 'stream', time_avg=True)
diag.add_field('barotropic_diagnostics', 'trs', time_avg=True)
diag.add_field('barotropic_diagnostics', 'tr', time_avg=True)
diag.add_field('barotropic_diagnostics', 'eddy_vor', time_avg=True)
diag.add_field('barotropic_diagnostics', 'delta_u', time_avg=True)
diag.add_field('stirring_mod', 'stirring', time_avg=True)
diag.add_field('stirring_mod', 'stirring_amp', time_avg=True)
diag.add_field('stirring_mod', 'stirring_sqr', time_avg=True)

exp.diag_table = diag

#Empty the run directory ready to run
exp.clear_rundir()

#Define values for the 'core' namelist
exp.namelist = namelist = Namelist({
'main_nml':{
'days' : 30,
'hours' : 0,
'minutes': 0,
'seconds': 0,
'dt_atmos': 1200,
'calendar': 'no_calendar',
},

'atmosphere_nml':{
'print_interval': 86400,
},

'fms_io_nml':{
'threading_write' :'single',
'fileset_write': 'single'
},

'fms_nml':{
'print_memory_usage':True,
'domains_stack_size': 200000,
},

'barotropic_dynamics_nml':{
'triang_trunc' : True,
'num_lat' : 128,
'num_lon' : 256,
'num_fourier' : 85,
'num_spherical' : 86,
'fourier_inc' : 1,
'damping_option' : 'resolution_dependent',
'damping_order' : 2,
'damping_coeff' : 1.157E-4,
'damping_coeff_r': 1.929E-6,
'grid_tracer' : True,
'spec_tracer' : True,
'm_0' : 6,
'zeta_0' : 0.0,
'eddy_lat' : 45.0,
'eddy_width' : 10.0,
'robert_coeff' : 0.04,
'initial_zonal_wind' : 'zero',
},

'barotropic_physics_nml':{
},

'stirring_nml': {
'decay_time':172800,
'amplitude':3.e-11,
'lat0':45.,
'lon0':180.,
'widthy':12.,
'widthx':45.,
'B':1.0,
},

})

#Lets do a run!
if __name__=="__main__":

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
101 changes: 101 additions & 0 deletions exp/test_cases/barotropic_vorticity_equation/barotropic_vor_eq_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import os

import numpy as np

from isca import BarotropicCodeBase, DiagTable, Experiment, Namelist, GFDL_BASE

NCORES = 8
base_dir = os.path.dirname(os.path.realpath(__file__))
# a CodeBase can be a directory on the computer,
# useful for iterative development
cb = BarotropicCodeBase.from_directory(GFDL_BASE)

# or it can point to a specific git repo and commit id.
# This method should ensure future, independent, reproducibility of results.
# cb = DryCodeBase.from_repo(repo='https://github.com/isca/isca', commit='isca1.1')

# compilation depends on computer specific settings. The $GFDL_ENV
# environment variable is used to determine which `$GFDL_BASE/src/extra/env` file
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('barotropic_test_experiment', codebase=cb)

#Tell model how to write diagnostics
diag = DiagTable()
diag.add_file('atmos_monthly', 30, 'days', time_units='days')

#Tell model which diagnostics to write
diag.add_field('barotropic_diagnostics', 'ucomp', time_avg=True)
diag.add_field('barotropic_diagnostics', 'vcomp', time_avg=True)
diag.add_field('barotropic_diagnostics', 'vor', time_avg=True)
diag.add_field('barotropic_diagnostics', 'pv', time_avg=True)
diag.add_field('barotropic_diagnostics', 'stream', time_avg=True)
diag.add_field('barotropic_diagnostics', 'trs', time_avg=True)
diag.add_field('barotropic_diagnostics', 'tr', time_avg=True)
diag.add_field('barotropic_diagnostics', 'eddy_vor', time_avg=True)
diag.add_field('barotropic_diagnostics', 'delta_u', time_avg=True)

exp.diag_table = diag

#Empty the run directory ready to run
exp.clear_rundir()

#Define values for the 'core' namelist
exp.namelist = namelist = Namelist({
'main_nml':{
'days' : 30,
'hours' : 0,
'minutes': 0,
'seconds': 0,
'dt_atmos': 1200,
'calendar': 'no_calendar',
},

'atmosphere_nml':{
'print_interval': 86400,
},

'fms_io_nml':{
'threading_write' :'single',
'fileset_write': 'single'
},

'fms_nml':{
'print_memory_usage':True,
'domains_stack_size': 200000,
},

'barotropic_dynamics_nml':{
'triang_trunc' : True,
'num_lat' : 128,
'num_lon' : 256,
'num_fourier' : 85,
'num_spherical' : 86,
'fourier_inc' : 1,
'damping_option' : 'resolution_dependent',
'damping_order' : 4,
'damping_coeff' : 1.e-04,
'grid_tracer' : True,
'spec_tracer' : True,
'm_0' : 4,
'zeta_0' : 8.e-05,
'eddy_lat' : 45.0,
'eddy_width' : 15.0,
'robert_coeff' : 0.04,
},

'barotropic_physics_nml':{
},
})

#Lets do a run!
if __name__=="__main__":

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
4 changes: 2 additions & 2 deletions exp/test_cases/bucket_hydrology/bucket_model_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('bucket_test_experiment', codebase=cb)
Expand Down Expand Up @@ -179,6 +177,8 @@

#Lets do a run!
if __name__=="__main__":
cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
4 changes: 2 additions & 2 deletions exp/test_cases/frierson/frierson_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('frierson_test_experiment', codebase=cb)
Expand Down Expand Up @@ -173,6 +171,8 @@

#Lets do a run!
if __name__=="__main__":
cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
4 changes: 2 additions & 2 deletions exp/test_cases/giant_planet/giant_planet_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('giant_planet_test_experiment', codebase=cb)
Expand Down Expand Up @@ -207,6 +205,8 @@

#Lets do a run!
if __name__=="__main__":
cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
5 changes: 3 additions & 2 deletions exp/test_cases/held_suarez/held_suarez_test_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics

Expand Down Expand Up @@ -104,6 +102,9 @@

#Lets do a run!
if __name__ == '__main__':

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, num_cores=NCORES, use_restart=False)
for i in range(2, 13):
exp.run(i, num_cores=NCORES) # use the restart i-1 by default
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('realistic_continents_fixed_sst_test_experiment', codebase=cb)
Expand Down Expand Up @@ -72,6 +70,8 @@

#Lets do a run!
if __name__=="__main__":
cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
# is used to load the correct compilers. The env file is always loaded from
# $GFDL_BASE and not the checked out git repo.

cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

# create an Experiment object to handle the configuration of model parameters
# and output diagnostics
exp = Experiment('realistic_continents_qflux_test_experiment', codebase=cb)
Expand Down Expand Up @@ -72,6 +70,8 @@

#Lets do a run!
if __name__=="__main__":
cb.compile() # compile the source code to working directory $GFDL_WORK/codebase

exp.run(1, use_restart=False, num_cores=NCORES)
for i in range(2,121):
exp.run(i, num_cores=NCORES)