diff --git a/examples/boussinesq/skamarock_klemp_compressible.py b/examples/boussinesq/skamarock_klemp_compressible.py index 8105b7b8..c15daff8 100644 --- a/examples/boussinesq/skamarock_klemp_compressible.py +++ b/examples/boussinesq/skamarock_klemp_compressible.py @@ -71,7 +71,7 @@ def skamarock_klemp_compressible_bouss( # I/O output = OutputParameters( - dirname=dirname, dumpfreq=dumpfreq, dump_vtus=True, dump_nc=True, + dirname=dirname, dumpfreq=dumpfreq, dump_vtus=True, dump_nc=False, ) # list of diagnostic fields, each defined in a class in diagnostics.py diagnostic_fields = [CourantNumber(), Divergence(), Perturbation('b')] diff --git a/examples/compressible_euler/dcmip_3_1_meanflow_quads.py b/examples/compressible_euler/dcmip_3_1_gravity_wave.py similarity index 85% rename from examples/compressible_euler/dcmip_3_1_meanflow_quads.py rename to examples/compressible_euler/dcmip_3_1_gravity_wave.py index a0ca9899..2fccfbe3 100644 --- a/examples/compressible_euler/dcmip_3_1_meanflow_quads.py +++ b/examples/compressible_euler/dcmip_3_1_gravity_wave.py @@ -14,29 +14,28 @@ ) from gusto import ( Domain, IO, OutputParameters, SemiImplicitQuasiNewton, SSPRK3, DGUpwind, - TrapeziumRule, SUPGOptions, CompressibleKineticEnergy, PotentialEnergy, - CompressibleParameters, CompressibleEulerEquations, CompressibleSolver, + TrapeziumRule, SUPGOptions, lonlatr_from_xyz, CompressibleParameters, + CompressibleEulerEquations, CompressibleSolver, ZonalComponent, compressible_hydrostatic_balance, Perturbation, GeneralCubedSphereMesh, - lonlatr_from_xyz ) -dcmip_3_1_meanflow_defaults = { +dcmip_3_1_gravity_wave_defaults = { 'ncells_per_edge': 8, 'nlayers': 10, - 'dt': 100.0, + 'dt': 50.0, 'tmax': 3600., 'dumpfreq': 9, - 'dirname': 'dcmip_3_1_meanflow' + 'dirname': 'dcmip_3_1_gravity_wave' } -def dcmip_3_1_meanflow( - ncells_per_edge=dcmip_3_1_meanflow_defaults['ncells_per_edge'], - nlayers=dcmip_3_1_meanflow_defaults['nlayers'], - dt=dcmip_3_1_meanflow_defaults['dt'], - tmax=dcmip_3_1_meanflow_defaults['tmax'], - dumpfreq=dcmip_3_1_meanflow_defaults['dumpfreq'], - dirname=dcmip_3_1_meanflow_defaults['dirname'] +def dcmip_3_1_gravity_wave( + ncells_per_edge=dcmip_3_1_gravity_wave_defaults['ncells_per_edge'], + nlayers=dcmip_3_1_gravity_wave_defaults['nlayers'], + dt=dcmip_3_1_gravity_wave_defaults['dt'], + tmax=dcmip_3_1_gravity_wave_defaults['tmax'], + dumpfreq=dcmip_3_1_gravity_wave_defaults['dumpfreq'], + dirname=dcmip_3_1_gravity_wave_defaults['dirname'] ): # ------------------------------------------------------------------------ # @@ -89,12 +88,10 @@ def dcmip_3_1_meanflow( # I/O output = OutputParameters( - dirname=dirname, - dumpfreq=dumpfreq, + dirname=dirname, dumpfreq=dumpfreq, dump_vtus=False, dump_nc=True ) diagnostic_fields = [ - Perturbation('theta'), Perturbation('rho'), - CompressibleKineticEnergy(), PotentialEnergy(eqns) + Perturbation('theta'), Perturbation('rho'), ZonalComponent('u'), ] io = IO(domain, output, diagnostic_fields=diagnostic_fields) @@ -197,38 +194,38 @@ def dcmip_3_1_meanflow( '--ncells_per_edge', help="The number of cells per panel edge of the cubed-sphere.", type=int, - default=dcmip_3_1_meanflow_defaults['ncells_per_edge'] + default=dcmip_3_1_gravity_wave_defaults['ncells_per_edge'] ) parser.add_argument( '--nlayers', help="The number of layers for the mesh.", type=int, - default=dcmip_3_1_meanflow_defaults['nlayers'] + default=dcmip_3_1_gravity_wave_defaults['nlayers'] ) parser.add_argument( '--dt', help="The time step in seconds.", type=float, - default=dcmip_3_1_meanflow_defaults['dt'] + default=dcmip_3_1_gravity_wave_defaults['dt'] ) parser.add_argument( "--tmax", help="The end time for the simulation in seconds.", type=float, - default=dcmip_3_1_meanflow_defaults['tmax'] + default=dcmip_3_1_gravity_wave_defaults['tmax'] ) parser.add_argument( '--dumpfreq', help="The frequency at which to dump field output.", type=int, - default=dcmip_3_1_meanflow_defaults['dumpfreq'] + default=dcmip_3_1_gravity_wave_defaults['dumpfreq'] ) parser.add_argument( '--dirname', help="The name of the directory to write to.", type=str, - default=dcmip_3_1_meanflow_defaults['dirname'] + default=dcmip_3_1_gravity_wave_defaults['dirname'] ) args, unknown = parser.parse_known_args() - dcmip_3_1_meanflow(**vars(args)) + dcmip_3_1_gravity_wave(**vars(args)) diff --git a/examples/compressible_euler/test_compressible_euler_examples.py b/examples/compressible_euler/test_compressible_euler_examples.py index 7c43e591..384824e1 100644 --- a/examples/compressible_euler/test_compressible_euler_examples.py +++ b/examples/compressible_euler/test_compressible_euler_examples.py @@ -10,10 +10,10 @@ def make_dirname(test_name): return f'pytest_{test_name}' -def test_dcmip_3_1_meanflow(): - from dcmip_3_1_meanflow_quads import dcmip_3_1_meanflow - test_name = 'dcmip_3_1_meanflow' - dcmip_3_1_meanflow( +def test_dcmip_3_1_gravity_wave(): + from dcmip_3_1_gravity_wave import dcmip_3_1_gravity_wave + test_name = 'dcmip_3_1_gravity_wave' + dcmip_3_1_gravity_wave( ncells_per_edge=4, nlayers=4, dt=100, @@ -24,8 +24,8 @@ def test_dcmip_3_1_meanflow(): @pytest.mark.parallel(nprocs=2) -def test_dcmip_3_1_meanflow_parallel(): - test_dcmip_3_1_meanflow() +def test_dcmip_3_1_gravity_wave_parallel(): + test_dcmip_3_1_gravity_wave() def test_dry_bryan_fritsch(): diff --git a/examples/shallow_water/linear_williamson_2.py b/examples/shallow_water/linear_williamson_2.py index 5bad2e54..9d022bf1 100644 --- a/examples/shallow_water/linear_williamson_2.py +++ b/examples/shallow_water/linear_williamson_2.py @@ -12,7 +12,8 @@ from gusto import ( Domain, IO, OutputParameters, SemiImplicitQuasiNewton, DefaultTransport, ForwardEuler, SteadyStateError, ShallowWaterParameters, - LinearShallowWaterEquations, GeneralIcosahedralSphereMesh + LinearShallowWaterEquations, GeneralIcosahedralSphereMesh, + ZonalComponent, MeridionalComponent, RelativeVorticity ) linear_williamson_2_defaults = { @@ -63,9 +64,11 @@ def linear_williamson_2( # I/O output = OutputParameters( - dirname=dirname, dumpfreq=dumpfreq, + dirname=dirname, dumpfreq=dumpfreq, dump_nc=False, dump_vtus=True ) - diagnostic_fields = [SteadyStateError('u'), SteadyStateError('D')] + diagnostic_fields = [SteadyStateError('u'), SteadyStateError('D'), + ZonalComponent('u'), MeridionalComponent('u'), + RelativeVorticity()] io = IO(domain, output, diagnostic_fields=diagnostic_fields) # Transport schemes diff --git a/examples/shallow_water/moist_convective_williamson_2.py b/examples/shallow_water/moist_convective_williamson_2.py index 261bd3d1..07fc7e96 100644 --- a/examples/shallow_water/moist_convective_williamson_2.py +++ b/examples/shallow_water/moist_convective_williamson_2.py @@ -17,12 +17,10 @@ from gusto import ( Domain, IO, OutputParameters, SemiImplicitQuasiNewton, SSPRK3, DGUpwind, TrapeziumRule, ShallowWaterParameters, ShallowWaterEquations, - CourantNumber, RelativeVorticity, PotentialVorticity, - SteadyStateError, ShallowWaterKineticEnergy, ShallowWaterPotentialEnergy, - ShallowWaterPotentialEnstrophy, lonlatr_from_xyz, DG1Limiter, InstantRain, - MoistConvectiveSWSolver, ForwardEuler, SWSaturationAdjustment, - WaterVapour, CloudWater, Rain, GeneralIcosahedralSphereMesh, - xyz_vector_from_lonlatr + ZonalComponent, MeridionalComponent, SteadyStateError, lonlatr_from_xyz, + DG1Limiter, InstantRain, MoistConvectiveSWSolver, ForwardEuler, + RelativeVorticity, SWSaturationAdjustment, WaterVapour, CloudWater, Rain, + GeneralIcosahedralSphereMesh, xyz_vector_from_lonlatr ) moist_convect_williamson_2_defaults = { @@ -93,15 +91,13 @@ def moist_convect_williamson_2( # IO output = OutputParameters( - dirname=dirname, dumpfreq=dumpfreq, dump_nc=True, dump_vtus=True, + dirname=dirname, dumpfreq=dumpfreq, dump_nc=False, dump_vtus=True, dumplist_latlon=['D', 'D_error'] ) diagnostic_fields = [ - CourantNumber(), RelativeVorticity(), PotentialVorticity(), - ShallowWaterKineticEnergy(), ShallowWaterPotentialEnergy(parameters), - ShallowWaterPotentialEnstrophy(), SteadyStateError('u'), - SteadyStateError('D'), SteadyStateError('water_vapour'), - SteadyStateError('cloud_water') + SteadyStateError('u'), SteadyStateError('D'), + SteadyStateError('water_vapour'), ZonalComponent('u'), + MeridionalComponent('u'), RelativeVorticity() ] io = IO(domain, output, diagnostic_fields=diagnostic_fields) diff --git a/examples/shallow_water/moist_thermal_williamson_5.py b/examples/shallow_water/moist_thermal_williamson_5.py index 3d0159d2..9ce7da77 100644 --- a/examples/shallow_water/moist_thermal_williamson_5.py +++ b/examples/shallow_water/moist_thermal_williamson_5.py @@ -23,7 +23,8 @@ Domain, IO, OutputParameters, Timestepper, RK4, DGUpwind, ShallowWaterParameters, ShallowWaterEquations, Sum, lonlatr_from_xyz, InstantRain, SWSaturationAdjustment, WaterVapour, - CloudWater, Rain, GeneralIcosahedralSphereMesh + CloudWater, Rain, GeneralIcosahedralSphereMesh, RelativeVorticity, + ZonalComponent, MeridionalComponent ) moist_thermal_williamson_5_defaults = { @@ -106,9 +107,11 @@ def moist_thermal_williamson_5( # I/O output = OutputParameters( dirname=dirname, dumplist_latlon=['D'], dumpfreq=dumpfreq, - dump_vtus=False, dump_nc=True + dump_vtus=True, dump_nc=False, + dumplist=['D', 'b', 'water_vapour', 'cloud_water'] ) - diagnostic_fields = [Sum('D', 'topography')] + diagnostic_fields = [Sum('D', 'topography'), RelativeVorticity(), + ZonalComponent('u'), MeridionalComponent('u')] io = IO(domain, output, diagnostic_fields=diagnostic_fields) # Physics ------------------------------------------------------------------ diff --git a/examples/shallow_water/thermal_williamson_2.py b/examples/shallow_water/thermal_williamson_2.py index 2dc77192..fe489ee3 100644 --- a/examples/shallow_water/thermal_williamson_2.py +++ b/examples/shallow_water/thermal_williamson_2.py @@ -77,6 +77,7 @@ def thermal_williamson_2( # IO output = OutputParameters( dirname=dirname, dumpfreq=dumpfreq, dumplist_latlon=['D', 'D_error'], + dump_vtus=False, dump_nc=True ) diagnostic_fields = [ diff --git a/examples/shallow_water/williamson_5.py b/examples/shallow_water/williamson_5.py index d4479112..cdb2b58a 100644 --- a/examples/shallow_water/williamson_5.py +++ b/examples/shallow_water/williamson_5.py @@ -13,7 +13,8 @@ from gusto import ( Domain, IO, OutputParameters, SemiImplicitQuasiNewton, SSPRK3, DGUpwind, TrapeziumRule, ShallowWaterParameters, ShallowWaterEquations, Sum, - lonlatr_from_xyz, GeneralIcosahedralSphereMesh + lonlatr_from_xyz, GeneralIcosahedralSphereMesh, ZonalComponent, + MeridionalComponent, RelativeVorticity ) williamson_5_defaults = { @@ -75,9 +76,10 @@ def williamson_5( # I/O output = OutputParameters( dirname=dirname, dumplist_latlon=['D'], dumpfreq=dumpfreq, - dump_vtus=True, dump_nc=False + dump_vtus=True, dump_nc=False, dumplist=['D', 'topography'] ) - diagnostic_fields = [Sum('D', 'topography')] + diagnostic_fields = [Sum('D', 'topography'), RelativeVorticity(), + MeridionalComponent('u'), ZonalComponent('u')] io = IO(domain, output, diagnostic_fields=diagnostic_fields) # Transport schemes diff --git a/figures/compressible_euler/dcmip_3_1_gravity_wave_final.png b/figures/compressible_euler/dcmip_3_1_gravity_wave_final.png new file mode 100644 index 00000000..d9864b82 Binary files /dev/null and b/figures/compressible_euler/dcmip_3_1_gravity_wave_final.png differ diff --git a/figures/compressible_euler/dcmip_3_1_gravity_wave_initial.png b/figures/compressible_euler/dcmip_3_1_gravity_wave_initial.png new file mode 100644 index 00000000..f6febb2e Binary files /dev/null and b/figures/compressible_euler/dcmip_3_1_gravity_wave_initial.png differ diff --git a/figures/shallow_water/linear_williamson_2_final.png b/figures/shallow_water/linear_williamson_2_final.png new file mode 100644 index 00000000..bd326d3e Binary files /dev/null and b/figures/shallow_water/linear_williamson_2_final.png differ diff --git a/figures/shallow_water/linear_williamson_2_initial.png b/figures/shallow_water/linear_williamson_2_initial.png new file mode 100644 index 00000000..992d3b5b Binary files /dev/null and b/figures/shallow_water/linear_williamson_2_initial.png differ diff --git a/figures/shallow_water/moist_convective_williamson_2_final.png b/figures/shallow_water/moist_convective_williamson_2_final.png new file mode 100644 index 00000000..c85b8241 Binary files /dev/null and b/figures/shallow_water/moist_convective_williamson_2_final.png differ diff --git a/figures/shallow_water/moist_convective_williamson_2_initial.png b/figures/shallow_water/moist_convective_williamson_2_initial.png new file mode 100644 index 00000000..07e171d2 Binary files /dev/null and b/figures/shallow_water/moist_convective_williamson_2_initial.png differ diff --git a/figures/shallow_water/moist_thermal_williamson_5_final.png b/figures/shallow_water/moist_thermal_williamson_5_final.png new file mode 100644 index 00000000..cc63024a Binary files /dev/null and b/figures/shallow_water/moist_thermal_williamson_5_final.png differ diff --git a/figures/shallow_water/moist_thermal_williamson_5_initial.png b/figures/shallow_water/moist_thermal_williamson_5_initial.png new file mode 100644 index 00000000..3d9c8486 Binary files /dev/null and b/figures/shallow_water/moist_thermal_williamson_5_initial.png differ diff --git a/figures/shallow_water/shallow_water_1d_wave.png b/figures/shallow_water/shallow_water_1d_wave.png new file mode 100644 index 00000000..8496e625 Binary files /dev/null and b/figures/shallow_water/shallow_water_1d_wave.png differ diff --git a/figures/shallow_water/thermal_williamson_2_final.png b/figures/shallow_water/thermal_williamson_2_final.png new file mode 100644 index 00000000..705a1f43 Binary files /dev/null and b/figures/shallow_water/thermal_williamson_2_final.png differ diff --git a/figures/shallow_water/thermal_williamson_2_initial.png b/figures/shallow_water/thermal_williamson_2_initial.png new file mode 100644 index 00000000..0f53c1da Binary files /dev/null and b/figures/shallow_water/thermal_williamson_2_initial.png differ diff --git a/figures/shallow_water/williamson_2_final.png b/figures/shallow_water/williamson_2_final.png new file mode 100644 index 00000000..77fbdc8b Binary files /dev/null and b/figures/shallow_water/williamson_2_final.png differ diff --git a/figures/shallow_water/williamson_2_initial.png b/figures/shallow_water/williamson_2_initial.png new file mode 100644 index 00000000..dee71602 Binary files /dev/null and b/figures/shallow_water/williamson_2_initial.png differ diff --git a/figures/shallow_water/williamson_5_final.png b/figures/shallow_water/williamson_5_final.png new file mode 100644 index 00000000..dc23560b Binary files /dev/null and b/figures/shallow_water/williamson_5_final.png differ diff --git a/figures/shallow_water/williamson_5_initial.png b/figures/shallow_water/williamson_5_initial.png new file mode 100644 index 00000000..ae18f58f Binary files /dev/null and b/figures/shallow_water/williamson_5_initial.png differ