diff --git a/compass/ocean/tests/global_ocean/__init__.py b/compass/ocean/tests/global_ocean/__init__.py index ccfedae661..109277df28 100644 --- a/compass/ocean/tests/global_ocean/__init__.py +++ b/compass/ocean/tests/global_ocean/__init__.py @@ -5,6 +5,8 @@ QU240DynamicAdjustment from compass.ocean.tests.global_ocean.mesh.ec30to60.dynamic_adjustment import \ EC30to60DynamicAdjustment +from compass.ocean.tests.global_ocean.mesh.arm10to60.dynamic_adjustment \ + import ARM10to60DynamicAdjustment from compass.ocean.tests.global_ocean.mesh.so12to60.dynamic_adjustment import \ SO12to60DynamicAdjustment from compass.ocean.tests.global_ocean.mesh.wc14.dynamic_adjustment import \ @@ -149,6 +151,29 @@ def __init__(self, mpas_core): test_group=self, mesh=mesh, init=init, dynamic_adjustment=dynamic_adjustment)) + # ARM10to60: just the version without cavities + for mesh_name in ['ARM10to60']: + mesh = Mesh(test_group=self, mesh_name=mesh_name) + self.add_test_case(mesh) + + init = Init(test_group=self, mesh=mesh, + initial_condition='PHC', + with_bgc=False) + self.add_test_case(init) + time_integrator = 'split_explicit' + self.add_test_case( + PerformanceTest( + test_group=self, mesh=mesh, init=init, + time_integrator=time_integrator)) + dynamic_adjustment = ARM10to60DynamicAdjustment( + test_group=self, mesh=mesh, init=init, + time_integrator=time_integrator) + self.add_test_case(dynamic_adjustment) + self.add_test_case( + FilesForE3SM( + test_group=self, mesh=mesh, init=init, + dynamic_adjustment=dynamic_adjustment)) + # SOwISC12to60: just the version with cavities for now for mesh_name in ['SOwISC12to60']: mesh = Mesh(test_group=self, mesh_name=mesh_name) diff --git a/compass/ocean/tests/global_ocean/mesh/__init__.py b/compass/ocean/tests/global_ocean/mesh/__init__.py index 33f234dd54..34d981118e 100644 --- a/compass/ocean/tests/global_ocean/mesh/__init__.py +++ b/compass/ocean/tests/global_ocean/mesh/__init__.py @@ -1,6 +1,7 @@ from compass.testcase import TestCase from compass.ocean.tests.global_ocean.mesh.qu240 import QU240Mesh from compass.ocean.tests.global_ocean.mesh.ec30to60 import EC30to60Mesh +from compass.ocean.tests.global_ocean.mesh.arm10to60 import ARM10to60Mesh from compass.ocean.tests.global_ocean.mesh.so12to60 import SO12to60Mesh from compass.ocean.tests.global_ocean.mesh.wc14 import WC14Mesh from compass.ocean.tests.global_ocean.configure import configure_global_ocean @@ -32,7 +33,7 @@ def __init__(self, test_group, mesh_name): The name of the mesh """ name = 'mesh' - subdir = '{}/{}'.format(mesh_name, name) + subdir = f'{mesh_name}/{name}' super().__init__(test_group=test_group, name=name, subdir=subdir) if mesh_name in 'QU240': self.mesh_step = QU240Mesh(self, mesh_name, @@ -46,6 +47,9 @@ def __init__(self, test_group, mesh_name): elif mesh_name in 'ECwISC30to60': self.mesh_step = EC30to60Mesh(self, mesh_name, with_ice_shelf_cavities=True) + elif mesh_name in 'ARM10to60': + self.mesh_step = ARM10to60Mesh(self, mesh_name, + with_ice_shelf_cavities=False) elif mesh_name in 'SOwISC12to60': self.mesh_step = SO12to60Mesh(self, mesh_name, with_ice_shelf_cavities=True) @@ -53,7 +57,7 @@ def __init__(self, test_group, mesh_name): self.mesh_step = WC14Mesh(self, mesh_name, with_ice_shelf_cavities=False) else: - raise ValueError('Unknown mesh name {}'.format(mesh_name)) + raise ValueError(f'Unknown mesh name {mesh_name}') self.add_step(self.mesh_step) diff --git a/compass/ocean/tests/global_ocean/mesh/arm10to60/Americas_land_mask.geojson b/compass/ocean/tests/global_ocean/mesh/arm10to60/Americas_land_mask.geojson new file mode 100644 index 0000000000..28e9da4447 --- /dev/null +++ b/compass/ocean/tests/global_ocean/mesh/arm10to60/Americas_land_mask.geojson @@ -0,0 +1,49 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "name": "Americas land mask", + "component": "ocean", + "object": "region", + "author": "Mark Petersen" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -38.67187499999999, + -55.578344672182055 + ], + [ + -24.960937499999996, + -55.578344672182055 + ], + [ + -34.453125, + 53.12040528310657 + ], + [ + -59.765625, + 53.12040528310657 + ], + [ + -131.8359375, + 49.15296965617042 + ], + [ + -132.1875, + -56.55948248376223 + ], + [ + -38.67187499999999, + -55.578344672182055 + ] + ] + ] + } + } + ] +} diff --git a/compass/ocean/tests/global_ocean/mesh/arm10to60/Atlantic_region.geojson b/compass/ocean/tests/global_ocean/mesh/arm10to60/Atlantic_region.geojson new file mode 100644 index 0000000000..7738f9689b --- /dev/null +++ b/compass/ocean/tests/global_ocean/mesh/arm10to60/Atlantic_region.geojson @@ -0,0 +1,141 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "name": "Atlantic region", + "component": "ocean", + "object": "region", + "author": "Mark Petersen" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -68.203125, + -78.1344931829381 + ], + [ + 26.015625, + -77.8418477505252 + ], + [ + 23.5546875, + -26.431228064506424 + ], + [ + 21.4453125, + 26.745610382199022 + ], + [ + 34.80468749999999, + 30.14512718337613 + ], + [ + 40.078125, + 33.7243396617476 + ], + [ + 37.6171875, + 39.36827914916014 + ], + [ + 28.4765625, + 40.17887331434696 + ], + [ + 25.3125, + 43.58039085560784 + ], + [ + 28.828124999999996, + 54.77534585936447 + ], + [ + 41.8359375, + 64.01449619484472 + ], + [ + 65.7421875, + 76.434603583513 + ], + [ + 67.8515625, + 84.95930495623836 + ], + [ + -70.3125, + 84.89714695160268 + ], + [ + -126.21093749999999, + 75.05035357407698 + ], + [ + -112.5, + 60.58696734225869 + ], + [ + -104.4140625, + 51.39920565355378 + ], + [ + -101.953125, + 29.38217507514529 + ], + [ + -97.734375, + 18.145851771694467 + ], + [ + -93.515625, + 16.97274101999902 + ], + [ + -88.24218749999999, + 14.604847155053898 + ], + [ + -85.25390625, + 11.695272733029402 + ], + [ + -82.6171875, + 9.44906182688142 + ], + [ + -80.5078125, + 8.407168163601076 + ], + [ + -79.1015625, + 8.928487062665504 + ], + [ + -76.9921875, + 7.536764322084078 + ], + [ + -62.22656249999999, + -2.108898659243126 + ], + [ + -70.6640625, + -52.696361078274464 + ], + [ + -64.3359375, + -67.60922060496382 + ], + [ + -68.203125, + -78.1344931829381 + ] + ] + ] + } + } + ] +} diff --git a/compass/ocean/tests/global_ocean/mesh/arm10to60/Europe_Africa_land_mask.geojson b/compass/ocean/tests/global_ocean/mesh/arm10to60/Europe_Africa_land_mask.geojson new file mode 100644 index 0000000000..d50ff4c965 --- /dev/null +++ b/compass/ocean/tests/global_ocean/mesh/arm10to60/Europe_Africa_land_mask.geojson @@ -0,0 +1,69 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "name": "Europe Africa land mask", + "component": "ocean", + "object": "region", + "author": "Mark Petersen" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 15.1171875, + 58.07787626787517 + ], + [ + 8.4375, + 49.61070993807422 + ], + [ + 0.703125, + 43.068887774169625 + ], + [ + -5.2734375, + 39.095962936305476 + ], + [ + -3.1640625, + 20.96143961409684 + ], + [ + 2.109375, + -33.43144133557529 + ], + [ + 55.54687499999999, + -31.653381399663985 + ], + [ + 53.0859375, + 60.58696734225869 + ], + [ + 33.046875, + 63.704722429433225 + ], + [ + 24.2578125, + 68.00757101804004 + ], + [ + 17.2265625, + 65.07213008560697 + ], + [ + 15.1171875, + 58.07787626787517 + ] + ] + ] + } + } + ] +} diff --git a/compass/ocean/tests/global_ocean/mesh/arm10to60/__init__.py b/compass/ocean/tests/global_ocean/mesh/arm10to60/__init__.py new file mode 100644 index 0000000000..f2c69a8347 --- /dev/null +++ b/compass/ocean/tests/global_ocean/mesh/arm10to60/__init__.py @@ -0,0 +1,172 @@ +import numpy as np +import matplotlib.pyplot as plt +import cartopy.crs as ccrs +import cartopy.feature as cfeature + +import mpas_tools.mesh.creation.mesh_definition_tools as mdt +from mpas_tools.mesh.creation.signed_distance import \ + signed_distance_from_geojson, mask_from_geojson +from geometric_features import read_feature_collection +from mpas_tools.cime.constants import constants +from mpas_tools.viz.colormaps import register_sci_viz_colormaps + +from compass.ocean.tests.global_ocean.mesh.mesh import MeshStep + + +class ARM10to60Mesh(MeshStep): + """ + A step for creating SOwISC12to60 meshes + """ + def __init__(self, test_case, mesh_name, with_ice_shelf_cavities): + """ + Create a new step + + Parameters + ---------- + test_case : compass.ocean.tests.global_ocean.Mesh + The test case this step belongs to + + mesh_name : str + The name of the mesh + + with_ice_shelf_cavities : bool + Whether the mesh includes ice-shelf cavities + """ + + super().__init__(test_case, mesh_name, with_ice_shelf_cavities, + package=self.__module__, + mesh_config_filename='arm10to60.cfg') + + inputs = ['Americas_land_mask.geojson', + 'Atlantic_region.geojson', + 'Europe_Africa_land_mask.geojson'] + for filename in inputs: + self.add_input_file(filename=filename, + package=self.__module__) + + def build_cell_width_lat_lon(self): + """ + Create cell width array for this mesh on a regular latitude-longitude + grid + + Returns + ------- + cellWidth : numpy.array + m x n array of cell width in km + + lon : numpy.array + longitude in degrees (length n and between -180 and 180) + + lat : numpy.array + longitude in degrees (length m and between -90 and 90) + """ + + dlon = 0.1 + dlat = dlon + earth_radius = constants['SHR_CONST_REARTH'] + print('\nCreating cellWidth on a lat-lon grid of: {0:.2f} x {0:.2f} ' + 'degrees'.format(dlon, dlat)) + print('This can be set higher for faster test generation\n') + nlon = int(360. / dlon) + 1 + nlat = int(180. / dlat) + 1 + lon = np.linspace(-180., 180., nlon) + lat = np.linspace(-90., 90., nlat) + km = 1.0e3 + + print('plotting ...') + plt.switch_backend('Agg') + register_sci_viz_colormaps() + fig = plt.figure() + plt.clf() + fig.set_size_inches(10.0, 10.0) + register_sci_viz_colormaps() + + # Create cell width vs latitude for Atlantic and Pacific basins + qu1 = np.ones(lat.size) + ec30to60 = mdt.EC_CellWidthVsLat(lat) + rrs10to30 = mdt.RRS_CellWidthVsLat(lat, 30, 10) + atl_nh = rrs10to30 + atl_vs_lat = mdt.mergeCellWidthVsLat(lat, ec30to60, atl_nh, 0, 6) + pac_nh = mdt.mergeCellWidthVsLat(lat, 30 * qu1, rrs10to30, 50, 10) + pac_vs_lat = mdt.mergeCellWidthVsLat(lat, ec30to60, pac_nh, 0, 6) + + # Expand from 1D to 2D + _, atl_grid = np.meshgrid(lon, atl_vs_lat) + _, pac_grid = np.meshgrid(lon, pac_vs_lat) + + # Signed distance of Atlantic region + fc = read_feature_collection('Atlantic_region.geojson') + signed_distance = signed_distance_from_geojson( + fc, lon, lat, earth_radius, max_length=0.25) + + # Merge Atlantic and Pacific distributions smoothly + transition_width = 500.0 * km + mask_smooth = 0.5 * (1 + np.tanh(signed_distance / transition_width)) + cell_width_smooth = \ + pac_grid * mask_smooth + atl_grid * (1 - mask_smooth) + + # Merge Atlantic and Pacific distributions with step function + mask_sharp = 0.5 * (1 + np.sign(signed_distance)) + cell_width_sharp = pac_grid * mask_sharp + atl_grid * (1 - mask_sharp) + + # Create a land mask that is 1 over land + fc = read_feature_collection('Americas_land_mask.geojson') + americas_land_mask = mask_from_geojson(fc, lon, lat) + fc = read_feature_collection('Europe_Africa_land_mask.geojson') + europe_africa_land_mask = mask_from_geojson(fc, lon, lat) + land_mask = np.fmax(americas_land_mask, europe_africa_land_mask) + + # Merge: step transition over land, smooth transition over water + cell_width = \ + cell_width_sharp * land_mask + cell_width_smooth * (1 - land_mask) + + ax = plt.subplot(4, 2, 1) + ax.plot(lat, atl_vs_lat, label='Atlantic') + ax.plot(lat, pac_vs_lat, label='Pacific') + ax.grid(True) + plt.title('Grid cell size [km] versus latitude') + plt.legend() + + var_names = [ + 'signed_distance', + 'mask_smooth', + 'cell_width_smooth', + 'mask_sharp', + 'cell_width_sharp', + 'land_mask', + 'cell_width'] + j = 2 + for var_name in var_names: + _plot_cartopy(j, var_name, vars()[var_name], '3Wbgy5') + j += 1 + fig.canvas.draw() + plt.tight_layout() + + plt.savefig('mesh_construction.png') + + return cell_width, lon, lat + + +def _plot_cartopy(plot_number, var_name, var, map_name): + ax = plt.subplot(4, 2, plot_number, projection=ccrs.PlateCarree()) + ax.set_global() + im = ax.imshow(var, + origin='lower', + transform=ccrs.PlateCarree(), + extent=[-180, 180, -90, 90], cmap=map_name, + zorder=0) + ax.add_feature(cfeature.LAND, edgecolor='black', zorder=1) + gl = ax.gridlines( + crs=ccrs.PlateCarree(), + draw_labels=True, + linewidth=1, + color='gray', + alpha=0.5, + linestyle='-', zorder=2) + ax.coastlines() + gl.top_labels = False + gl.bottom_labels = False + gl.right_labels = False + gl.left_labels = False + plt.colorbar(im, shrink=.9) + plt.title(var_name) diff --git a/compass/ocean/tests/global_ocean/mesh/arm10to60/arm10to60.cfg b/compass/ocean/tests/global_ocean/mesh/arm10to60/arm10to60.cfg new file mode 100644 index 0000000000..ef1f297469 --- /dev/null +++ b/compass/ocean/tests/global_ocean/mesh/arm10to60/arm10to60.cfg @@ -0,0 +1,57 @@ +# Options related to the vertical grid +[vertical_grid] + +# the type of vertical grid +grid_type = tanh_dz + +# Number of vertical levels +vert_levels = 64 + +# Depth of the bottom of the ocean +bottom_depth = 6000.0 + +# The minimum layer thickness +min_layer_thickness = 2.0 + +# The maximum layer thickness +max_layer_thickness = 210.0 + + +# options for global ocean testcases +[global_ocean] + +## config options related to the initial_state step +# number of cores to use +init_cores = 36 +# minimum of cores, below which the step fails +init_min_cores = 8 +# maximum memory usage allowed (in MB) +init_max_memory = 1000 + +## config options related to the forward steps +# number of cores to use +forward_cores = 720 +# minimum of cores, below which the step fails +forward_min_cores = 144 +# maximum memory usage allowed (in MB) +forward_max_memory = 1000 + +## metadata related to the mesh +# the prefix (e.g. QU, EC, WC, SO) +prefix = ARM +# a description of the mesh and initial condition +mesh_description = MPAS Arctic Regional Mesh (ARM) for E3SM version + ${e3sm_version}, with ${min_res}-km resolution in the Arctic + and ${levels} vertical levels + +# E3SM version that the mesh is intended for +e3sm_version = 2 +# The revision number of the mesh, which should be incremented each time the +# mesh is revised +mesh_revision = 1 +# the minimum (finest) resolution in the mesh +min_res = 10 +# the maximum (coarsest) resolution in the mesh, can be the same as min_res +max_res = 60 +# The URL of the pull request documenting the creation of the mesh +pull_request = https://github.com/MPAS-Dev/compass/pull/414 diff --git a/compass/ocean/tests/global_ocean/mesh/arm10to60/dynamic_adjustment/__init__.py b/compass/ocean/tests/global_ocean/mesh/arm10to60/dynamic_adjustment/__init__.py new file mode 100644 index 0000000000..b40dd9199c --- /dev/null +++ b/compass/ocean/tests/global_ocean/mesh/arm10to60/dynamic_adjustment/__init__.py @@ -0,0 +1,240 @@ +from compass.ocean.tests.global_ocean.dynamic_adjustment import \ + DynamicAdjustment +from compass.ocean.tests.global_ocean.forward import ForwardStep + + +class ARM10to60DynamicAdjustment(DynamicAdjustment): + """ + A test case performing dynamic adjustment (dissipating fast-moving waves) + from an initial condition on the ARM10to60 MPAS-Ocean mesh + + Attributes + ---------- + restart_filenames : list of str + A list of restart files from each dynamic-adjustment step + """ + + def __init__(self, test_group, mesh, init, time_integrator): + """ + Create the test case + + Parameters + ---------- + test_group : compass.ocean.tests.global_ocean.GlobalOcean + The global ocean test group that this test case belongs to + + mesh : compass.ocean.tests.global_ocean.mesh.Mesh + The test case that produces the mesh for this run + + init : compass.ocean.tests.global_ocean.init.Init + The test case that produces the initial condition for this run + + time_integrator : {'split_explicit', 'RK4'} + The time integrator to use for the forward run + """ + if time_integrator != 'split_explicit': + raise ValueError('{} dynamic adjustment not defined for {}'.format( + mesh.mesh_name, time_integrator)) + + restart_times = ['0001-01-01_06:00:00', '0001-01-01_12:00:00', + '0001-01-02_00:00:00', '0001-01-03_00:00:00', + '0001-01-04_00:00:00', '0001-01-07_00:00:00', + '0001-01-31_00:00:00'] + restart_filenames = [ + 'restarts/rst.{}.nc'.format(restart_time.replace(':', '.')) + for restart_time in restart_times] + + super().__init__(test_group=test_group, mesh=mesh, init=init, + time_integrator=time_integrator, + restart_filenames=restart_filenames) + + module = self.__module__ + + shared_options = \ + {'config_AM_globalStats_enable': '.true.', + 'config_AM_globalStats_compute_on_startup': '.true.', + 'config_AM_globalStats_write_on_startup': '.true.', + 'config_use_activeTracers_surface_restoring': '.true.'} + + # first step + step_name = 'damped_adjustment_1' + step = ForwardStep(test_case=self, mesh=mesh, init=init, + time_integrator=time_integrator, name=step_name, + subdir=step_name) + + namelist_options = { + 'config_run_duration': "'00-00-00_06:00:00'", + 'config_dt': "'00:00:30'", + 'config_btr_dt': "'00:00:01.5'", + 'config_Rayleigh_friction': '.true.', + 'config_Rayleigh_damping_coeff': '1.0e-3'} + namelist_options.update(shared_options) + step.add_namelist_options(namelist_options) + + stream_replacements = { + 'output_interval': '00-00-10_00:00:00', + 'restart_interval': '00-00-00_06:00:00'} + step.add_streams_file(module, 'streams.template', + template_replacements=stream_replacements) + + step.add_output_file(filename='../{}'.format(restart_filenames[0])) + self.add_step(step) + + # second step + step_name = 'damped_adjustment_2' + step = ForwardStep(test_case=self, mesh=mesh, init=init, + time_integrator=time_integrator, name=step_name, + subdir=step_name) + + namelist_options = { + 'config_run_duration': "'00-00-00_06:00:00'", + 'config_dt': "'00:01:00'", + 'config_btr_dt': "'00:00:03'", + 'config_Rayleigh_friction': '.true.', + 'config_Rayleigh_damping_coeff': '4.0e-4', + 'config_do_restart': '.true.', + 'config_start_time': "'{}'".format(restart_times[0])} + namelist_options.update(shared_options) + step.add_namelist_options(namelist_options) + + stream_replacements = { + 'output_interval': '00-00-10_00:00:00', + 'restart_interval': '00-00-00_06:00:00'} + step.add_streams_file(module, 'streams.template', + template_replacements=stream_replacements) + + step.add_input_file(filename='../{}'.format(restart_filenames[0])) + step.add_output_file(filename='../{}'.format(restart_filenames[1])) + self.add_step(step) + + # third step + step_name = 'damped_adjustment_3' + step = ForwardStep(test_case=self, mesh=mesh, init=init, + time_integrator=time_integrator, name=step_name, + subdir=step_name) + + namelist_options = { + 'config_run_duration': "'00-00-00_12:00:00'", + 'config_dt': "'00:02:00'", + 'config_btr_dt': "'00:00:06'", + 'config_Rayleigh_friction': '.true.', + 'config_Rayleigh_damping_coeff': '1.0e-4', + 'config_do_restart': '.true.', + 'config_start_time': "'{}'".format(restart_times[1])} + namelist_options.update(shared_options) + step.add_namelist_options(namelist_options) + + stream_replacements = { + 'output_interval': '00-00-10_00:00:00', + 'restart_interval': '00-00-00_12:00:00'} + step.add_streams_file(module, 'streams.template', + template_replacements=stream_replacements) + + step.add_input_file(filename='../{}'.format(restart_filenames[1])) + step.add_output_file(filename='../{}'.format(restart_filenames[2])) + self.add_step(step) + + # fourth step + step_name = 'damped_adjustment_4' + step = ForwardStep(test_case=self, mesh=mesh, init=init, + time_integrator=time_integrator, name=step_name, + subdir=step_name) + + namelist_options = { + 'config_run_duration': "'00-00-01_00:00:00'", + 'config_dt': "'00:03:00'", + 'config_btr_dt': "'00:00:09'", + 'config_Rayleigh_friction': '.true.', + 'config_Rayleigh_damping_coeff': '4.0e-5', + 'config_do_restart': '.true.', + 'config_start_time': "'{}'".format(restart_times[2])} + namelist_options.update(shared_options) + step.add_namelist_options(namelist_options) + + stream_replacements = { + 'output_interval': '00-00-10_00:00:00', + 'restart_interval': '00-00-01_00:00:00'} + step.add_streams_file(module, 'streams.template', + template_replacements=stream_replacements) + + step.add_input_file(filename='../{}'.format(restart_filenames[2])) + step.add_output_file(filename='../{}'.format(restart_filenames[3])) + self.add_step(step) + + # fifth step + step_name = 'damped_adjustment_5' + step = ForwardStep(test_case=self, mesh=mesh, init=init, + time_integrator=time_integrator, name=step_name, + subdir=step_name) + + namelist_options = { + 'config_run_duration': "'00-00-01_00:00:00'", + 'config_dt': "'00:05:00'", + 'config_btr_dt': "'00:00:12'", + 'config_Rayleigh_friction': '.true.', + 'config_Rayleigh_damping_coeff': '2.0e-5', + 'config_do_restart': '.true.', + 'config_start_time': "'{}'".format(restart_times[3])} + namelist_options.update(shared_options) + step.add_namelist_options(namelist_options) + + stream_replacements = { + 'output_interval': '00-00-10_00:00:00', + 'restart_interval': '00-00-01_00:00:00'} + step.add_streams_file(module, 'streams.template', + template_replacements=stream_replacements) + + step.add_input_file(filename='../{}'.format(restart_filenames[3])) + step.add_output_file(filename='../{}'.format(restart_filenames[4])) + self.add_step(step) + + # sixth step + step_name = 'damped_adjustment_6' + step = ForwardStep(test_case=self, mesh=mesh, init=init, + time_integrator=time_integrator, name=step_name, + subdir=step_name) + + namelist_options = { + 'config_run_duration': "'00-00-03_00:00:00'", + 'config_dt': "'00:07:30'", + 'config_btr_dt': "'00:00:15'", + 'config_do_restart': '.true.', + 'config_start_time': "'{}'".format(restart_times[4])} + namelist_options.update(shared_options) + step.add_namelist_options(namelist_options) + + stream_replacements = { + 'output_interval': '00-00-10_00:00:00', + 'restart_interval': '00-00-03_00:00:00'} + step.add_streams_file(module, 'streams.template', + template_replacements=stream_replacements) + + step.add_input_file(filename='../{}'.format(restart_filenames[4])) + step.add_output_file(filename='../{}'.format(restart_filenames[5])) + self.add_step(step) + + # final step + step_name = 'simulation' + step = ForwardStep(test_case=self, mesh=mesh, init=init, + time_integrator=time_integrator, name=step_name, + subdir=step_name) + + namelist_options = { + 'config_run_duration': "'00-00-24_00:00:00'", + 'config_do_restart': '.true.', + 'config_start_time': "'{}'".format(restart_times[5])} + namelist_options.update(shared_options) + step.add_namelist_options(namelist_options) + + stream_replacements = { + 'output_interval': '00-00-10_00:00:00', + 'restart_interval': '00-00-06_00:00:00'} + step.add_streams_file(module, 'streams.template', + template_replacements=stream_replacements) + + step.add_input_file(filename='../{}'.format(restart_filenames[5])) + step.add_output_file(filename='../{}'.format(restart_filenames[6])) + step.add_output_file(filename='output.nc') + self.add_step(step) + + self.restart_filenames = restart_filenames diff --git a/compass/ocean/tests/global_ocean/mesh/arm10to60/dynamic_adjustment/streams.template b/compass/ocean/tests/global_ocean/mesh/arm10to60/dynamic_adjustment/streams.template new file mode 100644 index 0000000000..31a4652e75 --- /dev/null +++ b/compass/ocean/tests/global_ocean/mesh/arm10to60/dynamic_adjustment/streams.template @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/compass/ocean/tests/global_ocean/mesh/arm10to60/namelist.split_explicit b/compass/ocean/tests/global_ocean/mesh/arm10to60/namelist.split_explicit new file mode 100644 index 0000000000..f58f61981c --- /dev/null +++ b/compass/ocean/tests/global_ocean/mesh/arm10to60/namelist.split_explicit @@ -0,0 +1,9 @@ +config_time_integrator = 'split_explicit' +config_dt = '00:12:00' +config_btr_dt = '00:00:30' +config_run_duration = '0000_01:00:00' +config_write_output_on_startup = false. +config_mom_del2 = 400 +config_mom_del4 = 7.7e9 +config_hmix_scaleWithMesh = .true. +config_use_GM = .true.