From b4a38366532bf65f527c3e56d9944306816472c2 Mon Sep 17 00:00:00 2001 From: hollyhan Date: Fri, 20 May 2022 09:51:14 -0600 Subject: [PATCH 01/43] Create ismip6_run_ais testgroup in compass/landice --- compass/landice/__init__.py | 2 + .../landice/tests/ismip6_run_ais/__init__.py | 28 ++++ .../ismip6_run_ais/projection/__init__.py | 49 +++++++ .../ismip6_run_ais/projection/streams.landice | 132 ++++++++++++++++++ .../landice/tests/ismip6_run_ais/run_model.py | 130 +++++++++++++++++ 5 files changed, 341 insertions(+) create mode 100644 compass/landice/tests/ismip6_run_ais/__init__.py create mode 100644 compass/landice/tests/ismip6_run_ais/projection/__init__.py create mode 100644 compass/landice/tests/ismip6_run_ais/projection/streams.landice create mode 100644 compass/landice/tests/ismip6_run_ais/run_model.py diff --git a/compass/landice/__init__.py b/compass/landice/__init__.py index 137df3a3b9..61e5935d51 100644 --- a/compass/landice/__init__.py +++ b/compass/landice/__init__.py @@ -9,6 +9,7 @@ from compass.landice.tests.humboldt import Humboldt from compass.landice.tests.hydro_radial import HydroRadial from compass.landice.tests.ismip6_forcing import Ismip6Forcing +from compass.landice.tests.ismip6_run_ais import Ismip6RunAIS from compass.landice.tests.kangerlussuaq import Kangerlussuaq from compass.landice.tests.koge_bugt_s import KogeBugtS from compass.landice.tests.mismipplus import MISMIPplus @@ -38,6 +39,7 @@ def __init__(self): self.add_test_group(Humboldt(mpas_core=self)) self.add_test_group(HydroRadial(mpas_core=self)) self.add_test_group(Ismip6Forcing(mpas_core=self)) + self.add_test_group(Ismip6RunAIS(mpas_core=self)) self.add_test_group(Kangerlussuaq(mpas_core=self)) self.add_test_group(KogeBugtS(mpas_core=self)) self.add_test_group(MISMIPplus(mpas_core=self)) diff --git a/compass/landice/tests/ismip6_run_ais/__init__.py b/compass/landice/tests/ismip6_run_ais/__init__.py new file mode 100644 index 0000000000..00c55dc142 --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/__init__.py @@ -0,0 +1,28 @@ +from compass.testgroup import TestGroup +from compass.landice.tests.ismip6_run_ais.projection import Projection + +class Ismip6RunAIS(TestGroup): + """ + Todo: add 'high' in mesh_type + Todo: add the attributes, fix doc string + A test group for Antarctica forward simulation testcases + + Attributes + ---------- + meshdirs : dict + """ + def __init__(self, mpas_core): + """ + mpas_core : compass.landice.Landice + the MPAS core that this test group belongs to + """ + super().__init__(mpas_core=mpas_core, name='ismip6_run_ais') + + self.mishdirs = { + 'mid': 'Antarctic_8to80km', + 'high': 'Antarctic_1to10km' + } + + for mesh_type in ['mid']: + self.add_test_case( + Projection(test_group=self, mesh_type=mesh_type)) \ No newline at end of file diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py new file mode 100644 index 0000000000..9699757185 --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -0,0 +1,49 @@ +from compass.testcase import TestCase +from compass.landice.tests.ismip6_run_ais import RunModel +from compass.validate import compare_variables + + +class Projection(TestCase): + """ + Todo: fix the doc string + Todo: humboldt doc string is wrong. should be fixed (trevor) + A test case for performing two MALI runs of a humboldt setup, one with one + core and one with four. The test case verifies that the results of the + two runs are identical or close to identical. The FO velocity solver is + not bit for bit across decompositions, so identical results are not + expected when it is used. + """ + + def __init__(self, test_group, mesh_type): + """ + Create the test case + + Parameters + ---------- + test_group : compass.landice.tests.ismip6_run_ais.Ismip6RunAIS + The test group that this test case belongs to + + mesh_type : {'mid', 'high'} + The resolution or type of mesh of the test case + + """ + name = 'projection' + + # build dir name. + subdir = f'{test_group.meshdirs[mesh_type]}/{name}' + + super().__init__(test_group=test_group, name=name, + subdir=subdir) + + self.add_step(RunModel(test_case=self, mesh_type=mesh_type)) + + def validate(self): + """ + Test cases can override this method to perform validation of variables + and timers + """ + var_list = ['thickness'] + filename = f'{self.steps["run_model"].subdir}/output.nc' + compare_variables(test_case=self, + variables=var_list, + filename1=filename) diff --git a/compass/landice/tests/ismip6_run_ais/projection/streams.landice b/compass/landice/tests/ismip6_run_ais/projection/streams.landice new file mode 100644 index 0000000000..7577034c2b --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/projection/streams.landice @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/compass/landice/tests/ismip6_run_ais/run_model.py b/compass/landice/tests/ismip6_run_ais/run_model.py new file mode 100644 index 0000000000..7c7a1455c3 --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/run_model.py @@ -0,0 +1,130 @@ +from compass.model import run_model, make_graph_file +from compass.step import Step + + +class RunModel(Step): + """ + Todo: fix doc string + Todo: set up cores and min cores dictionary for different res mesh file + Todo: hard code the filenames in stream.landice + A step for performing forward MALI runs as part of Antarctica test cases. + + Attributes + ---------- + mesh_file : str + The name of the mesh file being used + + mesh_type : str + The resolution or mesh type of the test case + """ + + def __init__(self, test_case, mesh_type, name='run_model'): + """ + Create a new test case + + Parameters + ---------- + mesh_file : str + The name of the mesh file being used + + mesh_type : {'high', 'mid'} + The resolution or mesh type of the test case + """ + + self.mesh_file = None + self.mesh_type = mesh_type + + super().__init__(test_case=test_case, name=name) + + def setup(self, velo_solver="FO"): + config = self.config + section = config['ismip6_run_ais'] + calving_law = section.get('calving_law') + damage = section.get('damage') + procs = section.get('procs') + + if calving_law not in ['none', 'floating', 'eigencalving', + 'specified_calving_velocity', + 'von_Mises_stress', + 'damagecalving', 'ismip6_retreat']: + raise ValueError("Value of calving_law must be one of {'none', " + "'floating', " \ + "'eigencalving', 'specified_calving_velocity', " \ + "'von_Mises_stress', 'damagecalving', " + "'ismip6_retreat'}") + + self.add_input_file(filename='albany_input.yaml', + package='compass.landice.tests.ismip6_run_ais', + copy=True) + + self.add_model_as_input() + + self.add_output_file(filename='output.nc') + + if self.mesh_type == 'high': + self.mesh_file = 'Antarctic_1to10km_20220407.nc' + elif self.mesh_type == 'mid': + self.mesh_file = 'Antarctic_8to80km_20220407.nc' + + self.add_input_file(filename=self.mesh_file, target=self.mesh_file, + database='') + + self.add_namelist_file( + 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', + out_name='namelist.landice') + options = {'config_velocity_solver': f"'{velo_solver}'", + 'config_calving': f"'{calving_law}'"} + + if damage == 'threshold': + options['config_calculate_damage'] = '.true.' + options['config_damage_calving_method'] = "'threshold'" + options['config_damage_calving_threshold'] = '0.5' + + # now add accumulated options to namelist + self.add_namelist_options(options=options, + out_name='namelist.landice') + + period_endyear = section.get("period_endyear") + model = section.get("model") + scenario = section.get("scenario") + base_path_forcing = section.get('base_path_forcing') + fname_basal_coeff = section.get('fname_basal_coeff') + + target = f'{base_path_forcing}/ocean_forcing/thermal_forcing/' \ + f'{model}_{scenario}/1995-{period_endyear}' + self.add_input_file(filename='thermal_forcing.nc', + target=target) + target = f'{base_path_forcing}/atmosphere_forcing/' \ + f'{model}_{scenario}/1995-{period_endyear}' + self.add_input_file(filename='smb.nc', + target=target) + target = f'{base_path_forcing}/ocean_forcing/basal_melt/' \ + f'parametrizations/{fname_basal_coeff}' + self.add_input_file(filename='basal_coeff.nc', + target=target) + target = f'{base_path_forcing}/ocean_forcing/shelf_melt_offset/' \ + f'{model}_{scenario}/1995-{period_endyear}' + self.add_input_file(filename='shelf_melt_offset.nc', + target=target) + + stream_replacements = {'input_file_ais': self.mesh_file, + 'file_ais_TF_forcing': 'thermal_forcing.nc', + 'file_ais_SMB_forcing': 'smb.nc', + 'file_ais_basal_param': 'basal_coeff.nc', + 'file_ais_shelf_melt_offset': 'shelf_melt_' + 'offset.nc' + } + + self.add_streams_file( + 'compass.landice.tests.ismip6_run_ais', 'streams.landice.template', + out_name='streams.landice', + template_replacements=stream_replacements) + + def run(self): + """ + Run this step of the test case + """ + make_graph_file(mesh_filename=self.mesh_file, + graph_filename='graph.info') + run_model(step=self, namelist='namelist.landice', + streams='streams.landice') From fa78729d5745ea1848b416ddca3b46120618aa85 Mon Sep 17 00:00:00 2001 From: hollyhan Date: Mon, 23 May 2022 12:10:14 -0700 Subject: [PATCH 02/43] Fix input file target string Also fix doc string --- .../landice/tests/ismip6_run_ais/__init__.py | 12 ++++------ .../ismip6_run_ais/projection/__init__.py | 10 ++------ .../landice/tests/ismip6_run_ais/run_model.py | 23 ++++++++++++------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/__init__.py b/compass/landice/tests/ismip6_run_ais/__init__.py index 00c55dc142..b5c7e38e08 100644 --- a/compass/landice/tests/ismip6_run_ais/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/__init__.py @@ -3,8 +3,6 @@ class Ismip6RunAIS(TestGroup): """ - Todo: add 'high' in mesh_type - Todo: add the attributes, fix doc string A test group for Antarctica forward simulation testcases Attributes @@ -18,11 +16,11 @@ def __init__(self, mpas_core): """ super().__init__(mpas_core=mpas_core, name='ismip6_run_ais') - self.mishdirs = { - 'mid': 'Antarctic_8to80km', - 'high': 'Antarctic_1to10km' + self.meshdirs = { + 'mid': 'Antarctica_8to80km', + 'high': 'Antarctica_1to10km' } - for mesh_type in ['mid']: + for mesh_type in ['mid','high']: self.add_test_case( - Projection(test_group=self, mesh_type=mesh_type)) \ No newline at end of file + Projection(test_group=self, mesh_type=mesh_type)) diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py index 9699757185..6bb80d07f4 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -1,17 +1,11 @@ from compass.testcase import TestCase -from compass.landice.tests.ismip6_run_ais import RunModel +from compass.landice.tests.ismip6_run_ais.run_model import RunModel from compass.validate import compare_variables class Projection(TestCase): """ - Todo: fix the doc string - Todo: humboldt doc string is wrong. should be fixed (trevor) - A test case for performing two MALI runs of a humboldt setup, one with one - core and one with four. The test case verifies that the results of the - two runs are identical or close to identical. The FO velocity solver is - not bit for bit across decompositions, so identical results are not - expected when it is used. + A test case for performing forward MALI runs of ISMIP6 Antaractic setup """ def __init__(self, test_group, mesh_type): diff --git a/compass/landice/tests/ismip6_run_ais/run_model.py b/compass/landice/tests/ismip6_run_ais/run_model.py index 7c7a1455c3..16b236d9ac 100644 --- a/compass/landice/tests/ismip6_run_ais/run_model.py +++ b/compass/landice/tests/ismip6_run_ais/run_model.py @@ -1,12 +1,11 @@ +import os from compass.model import run_model, make_graph_file from compass.step import Step class RunModel(Step): """ - Todo: fix doc string Todo: set up cores and min cores dictionary for different res mesh file - Todo: hard code the filenames in stream.landice A step for performing forward MALI runs as part of Antarctica test cases. Attributes @@ -39,6 +38,7 @@ def __init__(self, test_case, mesh_type, name='run_model'): def setup(self, velo_solver="FO"): config = self.config section = config['ismip6_run_ais'] + base_path_mali=section.get('base_path_mali') calving_law = section.get('calving_law') damage = section.get('damage') procs = section.get('procs') @@ -62,12 +62,16 @@ def setup(self, velo_solver="FO"): self.add_output_file(filename='output.nc') if self.mesh_type == 'high': - self.mesh_file = 'Antarctic_1to10km_20220407.nc' + self.mesh_file = 'Antarctic_1to10km.nc' elif self.mesh_type == 'mid': self.mesh_file = 'Antarctic_8to80km_20220407.nc' - self.add_input_file(filename=self.mesh_file, target=self.mesh_file, - database='') + self.add_input_file(filename=self.mesh_file, + target=os.path.join(base_path_mali, + self.mesh_file)) + +# self.add_input_file(filename=self.mesh_file, target=self.mesh_file, +# database='') self.add_namelist_file( 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', @@ -91,11 +95,13 @@ def setup(self, velo_solver="FO"): fname_basal_coeff = section.get('fname_basal_coeff') target = f'{base_path_forcing}/ocean_forcing/thermal_forcing/' \ - f'{model}_{scenario}/1995-{period_endyear}' + f'{model}_{scenario}/1995-{period_endyear}/' \ + f'processed_TF_{model}_{scenario}_{period_endyear}.nc' self.add_input_file(filename='thermal_forcing.nc', target=target) target = f'{base_path_forcing}/atmosphere_forcing/' \ - f'{model}_{scenario}/1995-{period_endyear}' + f'{model}_{scenario}/1995-{period_endyear}/' \ + f'processed_SMB_{model}_{scenario}_{period_endyear}.nc' self.add_input_file(filename='smb.nc', target=target) target = f'{base_path_forcing}/ocean_forcing/basal_melt/' \ @@ -103,7 +109,8 @@ def setup(self, velo_solver="FO"): self.add_input_file(filename='basal_coeff.nc', target=target) target = f'{base_path_forcing}/ocean_forcing/shelf_melt_offset/' \ - f'{model}_{scenario}/1995-{period_endyear}' + f'{model}_{scenario}/1995-{period_endyear}/' \ + f'processed_shelfmelt_offset_{model}_{scenario}.nc' self.add_input_file(filename='shelf_melt_offset.nc', target=target) From 2e3576d4fe8e7bed013f0a3ad130ea69338e8ee9 Mon Sep 17 00:00:00 2001 From: hollyhan Date: Mon, 23 May 2022 12:58:00 -0700 Subject: [PATCH 03/43] Fix PEP8 issues --- compass/landice/tests/ismip6_run_ais/__init__.py | 3 ++- compass/landice/tests/ismip6_run_ais/run_model.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/__init__.py b/compass/landice/tests/ismip6_run_ais/__init__.py index b5c7e38e08..ec77a039e5 100644 --- a/compass/landice/tests/ismip6_run_ais/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/__init__.py @@ -1,6 +1,7 @@ from compass.testgroup import TestGroup from compass.landice.tests.ismip6_run_ais.projection import Projection + class Ismip6RunAIS(TestGroup): """ A test group for Antarctica forward simulation testcases @@ -21,6 +22,6 @@ def __init__(self, mpas_core): 'high': 'Antarctica_1to10km' } - for mesh_type in ['mid','high']: + for mesh_type in ['mid', 'high']: self.add_test_case( Projection(test_group=self, mesh_type=mesh_type)) diff --git a/compass/landice/tests/ismip6_run_ais/run_model.py b/compass/landice/tests/ismip6_run_ais/run_model.py index 16b236d9ac..4bc6ae94d1 100644 --- a/compass/landice/tests/ismip6_run_ais/run_model.py +++ b/compass/landice/tests/ismip6_run_ais/run_model.py @@ -38,7 +38,7 @@ def __init__(self, test_case, mesh_type, name='run_model'): def setup(self, velo_solver="FO"): config = self.config section = config['ismip6_run_ais'] - base_path_mali=section.get('base_path_mali') + base_path_mali = section.get('base_path_mali') calving_law = section.get('calving_law') damage = section.get('damage') procs = section.get('procs') @@ -48,8 +48,8 @@ def setup(self, velo_solver="FO"): 'von_Mises_stress', 'damagecalving', 'ismip6_retreat']: raise ValueError("Value of calving_law must be one of {'none', " - "'floating', " \ - "'eigencalving', 'specified_calving_velocity', " \ + "'floating', " + "'eigencalving', 'specified_calving_velocity', " "'von_Mises_stress', 'damagecalving', " "'ismip6_retreat'}") @@ -134,4 +134,4 @@ def run(self): make_graph_file(mesh_filename=self.mesh_file, graph_filename='graph.info') run_model(step=self, namelist='namelist.landice', - streams='streams.landice') + streams='streams.landice') From 5a0d9e2db5a4006c65d4285338dadbb3a4aad423 Mon Sep 17 00:00:00 2001 From: hollyhan Date: Wed, 25 May 2022 09:04:59 -0700 Subject: [PATCH 04/43] Create nested dictionary for different-resolution meshes --- .../landice/tests/ismip6_run_ais/run_model.py | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/run_model.py b/compass/landice/tests/ismip6_run_ais/run_model.py index 4bc6ae94d1..4c37ea549c 100644 --- a/compass/landice/tests/ismip6_run_ais/run_model.py +++ b/compass/landice/tests/ismip6_run_ais/run_model.py @@ -5,7 +5,6 @@ class RunModel(Step): """ - Todo: set up cores and min cores dictionary for different res mesh file A step for performing forward MALI runs as part of Antarctica test cases. Attributes @@ -61,15 +60,27 @@ def setup(self, velo_solver="FO"): self.add_output_file(filename='output.nc') - if self.mesh_type == 'high': - self.mesh_file = 'Antarctic_1to10km.nc' - elif self.mesh_type == 'mid': - self.mesh_file = 'Antarctic_8to80km_20220407.nc' + # Todo: confirm the number of cores needed for the high mesh + # We estimate that 200-1000 cells should be allocated for one core + res_param = { + 'high': {'mesh_file': 'Antarctic_1to10km.nc', + 'cores': 25000, + 'min_cores': 5000}, + 'mid': {'mesh_file': 'Antarctic_8to80km_20220407.nc', + 'cores': 400, + 'min_cores': 80} + } + + res_param = res_param[self.mesh_type] + self.mesh_file = res_param['mesh_file'] + self.cores = res_param['cores'] + self.min_cores = res_param['min_cores'] self.add_input_file(filename=self.mesh_file, target=os.path.join(base_path_mali, self.mesh_file)) + # Todo: upload the AIS meshes to the database # self.add_input_file(filename=self.mesh_file, target=self.mesh_file, # database='') From 66fce2f0208db65497f77eced290829c4857ad4b Mon Sep 17 00:00:00 2001 From: hollyhan Date: Thu, 26 May 2022 13:33:18 -0700 Subject: [PATCH 05/43] Add a config file to the test group directory --- .../tests/ismip6_run_ais/ismip6_run_ais.cfg | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg new file mode 100644 index 0000000000..d5040f6e13 --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -0,0 +1,27 @@ +# config options for ismip6 antarctic ice sheet data set +[ismip6_run_ais] + +# Base path to the input ismip6 ocean and smb forcing files. User has to supply. +base_path_forcing = NotAvailable + +# Base path to the the MALI mesh. User has to supply. +base_path_mali = NotAvailable + +# Forcing end year of the ISMIP6 data. User has to supply. +# Available end years are 2100 and 2300. +period_endyear = NotAvailable + +# Name of climate model name used to generate ISMIP6 forcing data. User has to supply. +# Available model names are the following: CCSM4, CESM2-WACCM, CSIRO-Mk3-6-0, HadGEM2-ES, NorESM1-M, UKESM1-0-LL +model = NotAvailable + +# Scenarios used by climate model. User has to supply. +# Available scenarios are the following: RCP26, RCP26-repeat, RCP85, SSP126, SSP585 +scenario = NotAvailable + +# filename for the basal parametrization coefficients. +fname_basal_coeff = NotAvailable + +# calving law +calving_law = none + From 9b330edb6731cd4c46345ab2aa807d7a100fffed Mon Sep 17 00:00:00 2001 From: hollyhan Date: Thu, 26 May 2022 13:39:52 -0700 Subject: [PATCH 06/43] Add namelist.landice and albany_input.yaml file to test group directory --- .../tests/ismip6_run_ais/albany_input.yaml | 278 ++++++++++++++++++ .../tests/ismip6_run_ais/namelist.landice | 193 ++++++++++++ 2 files changed, 471 insertions(+) create mode 100644 compass/landice/tests/ismip6_run_ais/albany_input.yaml create mode 100644 compass/landice/tests/ismip6_run_ais/namelist.landice diff --git a/compass/landice/tests/ismip6_run_ais/albany_input.yaml b/compass/landice/tests/ismip6_run_ais/albany_input.yaml new file mode 100644 index 0000000000..3e2ffcd60f --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/albany_input.yaml @@ -0,0 +1,278 @@ +%YAML 1.1 +--- +ANONYMOUS: +# In order to use ML, change Tpetra to Epetra in the following line, +# and "Preconditioner Type: MueLu" to " Preconditioner Type: ML" several lines below + Build Type: Tpetra + + Problem: + LandIce Field Norm: + sliding_velocity_basalside: + Regularization Type: Given Value + Regularization Value: 1.0e-4 + LandIce BCs: + BC 0: + Basal Friction Coefficient: + Type: Power Law + Power Exponent: 1.0 + Effective Pressure Type: Hydrostatic + +# Discretization Description + Discretization: + #Exodus Output File Name: albany_output.exo + + Piro: +# Nonlinear Solver Information + NOX: + Nonlinear Solver: Line Search Based + Line Search: + Full Step: + Full Step: 1.0e+00 + Method: Backtrack + Solver Options: + Status Test Check Type: Minimal + Status Tests: + Test Type: Combo + Combo Type: OR + Number of Tests: 2 + Test 0: + Test Type: NormF + Norm Type: Two Norm + Scale Type: Scaled + Tolerance: 1.0e-05 + Test 1: + Test Type: MaxIters + Maximum Iterations: 50 + Printing: + Output Precision: 3 + Output Processor: 0 + Output Information: + Error: true + Warning: true + Outer Iteration: true + Parameters: false + Details: false + Linear Solver Details: false + Stepper Iteration: true + Stepper Details: true + Stepper Parameters: true + + Direction: + Method: Newton + Newton: + Forcing Term Method: Constant + Rescue Bad Newton Solve: true + Linear Solver: + Write Linear System: false + Tolerance: 1.0e-8 + + Stratimikos Linear Solver: + Stratimikos: + +# Linear Solver Information + Linear Solver Type: Belos + Linear Solver Types: + AztecOO: + Forward Solve: + AztecOO Settings: + Aztec Solver: GMRES + Convergence Test: r0 + Size of Krylov Subspace: 200 + Output Frequency: 20 + Max Iterations: 200 + Belos: + Solver Type: Block GMRES + Solver Types: + Block GMRES: + Output Frequency: 20 + Output Style: 1 + Verbosity: 33 + Maximum Iterations: 200 + Block Size: 1 + Num Blocks: 200 + Flexible Gmres: false + VerboseObject: + Output File: none + Verbosity Level: low + +# Preconditioner Information + Preconditioner Type: MueLu + Preconditioner Types: + + Ifpack: + Overlap: 1 + Prec Type: ILU + Ifpack Settings: + 'fact: level-of-fill': 0 + + Ifpack2: + Overlap: 1 + Prec Type: ILUT + + MueLu: + Matrix: + PDE equations: 2 + Factories: + myLineDetectionFact: + factory: LineDetectionFactory + 'linedetection: orientation': coordinates + mySemiCoarsenPFact1: + factory: SemiCoarsenPFactory + 'semicoarsen: coarsen rate': 14 + UncoupledAggregationFact2: + factory: UncoupledAggregationFactory + 'aggregation: ordering': graph + 'aggregation: max selected neighbors': 0 + 'aggregation: min agg size': 3 + 'aggregation: phase3 avoid singletons': true + MyCoarseMap2: + factory: CoarseMapFactory + Aggregates: UncoupledAggregationFact2 + myTentativePFact2: + 'tentative: calculate qr': true + factory: TentativePFactory + Aggregates: UncoupledAggregationFact2 + CoarseMap: MyCoarseMap2 + mySaPFact2: + 'sa: eigenvalue estimate num iterations': 10 + 'sa: damping factor': 1.33333e+00 + factory: SaPFactory + P: myTentativePFact2 + myTransferCoordinatesFact: + factory: CoordinatesTransferFactory + CoarseMap: MyCoarseMap2 + Aggregates: UncoupledAggregationFact2 + myTogglePFact: + factory: TogglePFactory + 'semicoarsen: number of levels': 2 + TransferFactories: + P1: mySemiCoarsenPFact1 + P2: mySaPFact2 + Ptent1: mySemiCoarsenPFact1 + Ptent2: myTentativePFact2 + Nullspace1: mySemiCoarsenPFact1 + Nullspace2: myTentativePFact2 + myRestrictorFact: + factory: TransPFactory + P: myTogglePFact + myToggleTransferCoordinatesFact: + factory: ToggleCoordinatesTransferFactory + Chosen P: myTogglePFact + TransferFactories: + Coordinates1: mySemiCoarsenPFact1 + Coordinates2: myTransferCoordinatesFact + myRAPFact: + factory: RAPFactory + P: myTogglePFact + R: myRestrictorFact + TransferFactories: + For Coordinates: myToggleTransferCoordinatesFact + myRepartitionHeuristicFact: + factory: RepartitionHeuristicFactory + A: myRAPFact + 'repartition: min rows per proc': 3000 + 'repartition: max imbalance': 1.327e+00 + 'repartition: start level': 1 + myZoltanInterface: + factory: ZoltanInterface + A: myRAPFact + Coordinates: myToggleTransferCoordinatesFact + number of partitions: myRepartitionHeuristicFact + myRepartitionFact: + factory: RepartitionFactory + A: myRAPFact + Partition: myZoltanInterface + 'repartition: remap parts': true + number of partitions: myRepartitionHeuristicFact + myRebalanceProlongatorFact: + factory: RebalanceTransferFactory + type: Interpolation + P: myTogglePFact + Coordinates: myToggleTransferCoordinatesFact + Nullspace: myTogglePFact + myRebalanceRestrictionFact: + factory: RebalanceTransferFactory + type: Restriction + R: myRestrictorFact + myRebalanceAFact: + factory: RebalanceAcFactory + A: myRAPFact + TransferFactories: { } + mySmoother1: + factory: TrilinosSmoother + type: LINESMOOTHING_BANDEDRELAXATION + 'smoother: pre or post': both + ParameterList: + 'relaxation: type': Gauss-Seidel + 'relaxation: sweeps': 1 + 'relaxation: damping factor': 1.0 + mySmoother3: + factory: TrilinosSmoother + type: RELAXATION + 'smoother: pre or post': both + ParameterList: + 'relaxation: type': Gauss-Seidel + 'relaxation: sweeps': 1 + 'relaxation: damping factor': 1.0 + mySmoother4: + factory: TrilinosSmoother + type: RELAXATION + 'smoother: pre or post': pre + ParameterList: + 'relaxation: type': Gauss-Seidel + 'relaxation: sweeps': 4 + 'relaxation: damping factor': 1.0 + Hierarchy: + max levels: 7 + 'coarse: max size': 2000 + verbosity: None + Finest: + Smoother: mySmoother1 + CoarseSolver: mySmoother4 + P: myRebalanceProlongatorFact + Nullspace: myRebalanceProlongatorFact + CoarseNumZLayers: myLineDetectionFact + LineDetection_Layers: myLineDetectionFact + LineDetection_VertLineIds: myLineDetectionFact + A: myRebalanceAFact + Coordinates: myRebalanceProlongatorFact + Importer: myRepartitionFact + All: + startLevel: 1 + Smoother: mySmoother4 + CoarseSolver: mySmoother4 + P: myRebalanceProlongatorFact + Nullspace: myRebalanceProlongatorFact + CoarseNumZLayers: myLineDetectionFact + LineDetection_Layers: myLineDetectionFact + LineDetection_VertLineIds: myLineDetectionFact + A: myRebalanceAFact + Coordinates: myRebalanceProlongatorFact + Importer: myRepartitionFact + + ML: + Base Method Defaults: none + ML Settings: + default values: SA + ML output: 0 + 'repartition: enable': 1 + 'repartition: max min ratio': 1.327e+00 + 'repartition: min per proc': 600 + 'repartition: Zoltan dimensions': 2 + 'repartition: start level': 4 + 'semicoarsen: number of levels': 2 + 'semicoarsen: coarsen rate': 14 + 'smoother: sweeps': 4 + 'smoother: type': Gauss-Seidel + 'smoother: Chebyshev eig boost': 1.2e+00 + 'smoother: sweeps (level 0)': 1 + 'smoother: type (level 0)': line Gauss-Seidel + 'smoother: line GS Type': standard + 'smoother: damping factor': 1.0e+00 + 'smoother: pre or post': both + 'coarse: type': Gauss-Seidel + 'coarse: sweeps': 4 + 'coarse: max size': 2000 + 'coarse: pre or post': pre + max levels: 7 + diff --git a/compass/landice/tests/ismip6_run_ais/namelist.landice b/compass/landice/tests/ismip6_run_ais/namelist.landice new file mode 100644 index 0000000000..f16adb219d --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/namelist.landice @@ -0,0 +1,193 @@ +&velocity_solver + config_velocity_solver = 'FO' + config_sia_tangent_slope_calculation = 'from_vertex_barycentric' + config_flowParamA_calculation = 'constant' + config_do_velocity_reconstruction_for_external_dycore = .false. + config_simple_velocity_type = 'uniform' + config_use_glp = .true. + config_beta_thawed_only = .false. + config_unrealistic_velocity = 0.01592356685 + config_nonconvergence_error = .true. + config_effective_pressure_max = 1.0e36 +/ +&advection + config_thickness_advection = 'fo' + config_tracer_advection = 'none' + config_restore_thickness_after_advection = .false. + config_zero_sfcMassBalApplied_over_bare_land = .true. +/ +&solidearth + config_uplift_method = 'none' + config_slm_coupling_interval = '0002-00-00_00:00:00' + config_MALI_to_SLM_weights_file = 'mpas_to_grid.nc' + config_SLM_to_MALI_weights_file = 'grid_to_mpas.nc' +/ +&calving + config_calving = 'none' + config_use_Albany_flowA_eqn_for_vM = .false. + config_calving_topography = -500.0 + config_calving_thickness = 100.0 + config_calving_eigencalving_parameter_source = 'data' + config_calving_eigencalving_parameter_scalar_value = 3.5e16 + config_calving_specified_source = 'const' + config_calving_velocity_const = 0.0 + config_data_calving = .false. + config_calving_timescale = 0.0 + config_restore_calving_front = .true. + config_remove_icebergs = .true. + config_remove_small_islands = .true. + config_calving_speed_limit = 100.0 + config_grounded_von_Mises_threshold_stress = 1.0e6 + config_floating_von_Mises_threshold_stress = 1.0e6 + config_grounded_von_Mises_threshold_stress_source = 'scalar' + config_floating_von_Mises_threshold_stress_source = 'scalar' + config_finalize_damage_after_advection = .true. + config_preserve_damage = .false. + config_calculate_damage = .false. + config_damage_preserve_threshold = 0.0 + config_damage_calving_threshold = 1.0 + config_damage_stiffness_min = 0.1 + config_damage_rheology_coupling = .false. + config_damage_gl_setting = 'nye' + config_damage_calving_method = 'none' + config_damagecalvingParameter = 1.0e-4 + config_ismip6_retreat_k = -170.0 + config_calving_error_threshold = 0.1 + config_distribute_unablatedVolumeDynCell = .false. +/ +&thermal_solver + config_thermal_solver = 'none' + config_thermal_calculate_bmb = .true. + config_temperature_init = 'file' + config_thermal_thickness = 0.0 + config_surface_air_temperature_source = 'file' + config_surface_air_temperature_value = 273.15 + config_surface_air_temperature_lapse_rate = 0.01 + config_basal_heat_flux_source = 'file' + config_basal_heat_flux_value = 0.0 + config_temp_diffusive_factor = 1.0e-5 + config_max_water_fraction = 1.0e-2 +/ +&iceshelf_melt + config_basal_mass_bal_float = 'ismip6' + config_bmlt_float_flux = 0.0 + config_bmlt_float_xlimit = 0.0 + config_basal_mass_bal_seroussi_amplitude = 0.0 + config_basal_mass_bal_seroussi_period = 1.0 + config_basal_mass_bal_seroussi_phase = 0.0 + config_temperature_profile_melt_scale_factor = 6.0 + config_temperature_profile_sill_elevation = -700.0 + config_temperature_profile_plume_thickness = 30.0 + config_temperature_profile_draft_slope = 1.0e-2 + config_temperature_profile_thermocline_upper_depth = -200.0 + config_temperature_profile_thermocline_upper_temp = -1.0 + config_temperature_profile_thermocline_lower_depth = -600.0 + config_temperature_profile_thermocline_lower_temp = 1.2 + config_temperature_profile_variability_amplitude = 0.0 + config_temperature_profile_variability_period = 1.0 + config_temperature_profile_variability_phase = 0.0 + config_temperature_profile_GL_depth_fraction = 0.25 + config_front_mass_bal_grounded = 'none' + config_beta_ocean_thermal_forcing = 1.18 + config_add_ocean_thermal_forcing = 0.0 + config_alpha_subglacial_discharge = 0.39 + config_subglacial_discharge_coefficient = 3.0e-4 + config_subglacial_discharge_intercept = 0.15 + config_uniform_face_melt_rate = 0.0 +/ +&physical_parameters + config_ice_density = 910.0 + config_ocean_density = 1028.0 + config_sea_level = 0.0 + config_default_flowParamA = 3.1709792e-24 + config_flowLawExponent = 3.0 + config_dynamic_thickness = 11.0 +/ +&time_integration + config_dt = '0001-00-00_00:00:00' + config_time_integration = 'forward_euler' + config_adaptive_timestep = .true. + config_min_adaptive_timestep = 60.0 + config_max_adaptive_timestep = 1.575e10 + config_adaptive_timestep_CFL_fraction = 0.8 + config_adaptive_timestep_calvingCFL_fraction = 1.0 + config_adaptive_timestep_include_DCFL = .false. + config_adaptive_timestep_include_calving = .true. + config_adaptive_timestep_force_interval = '0001-00-00_00:00:00' +/ +&time_management + config_do_restart = .false. + config_restart_timestamp_name = 'restart_timestamp' + config_start_time = '2015-01-01_00:00:00' + config_stop_time = '2100-01-01_00:00:00' + config_run_duration = 'none' + config_calendar_type = 'gregorian_noleap' +/ +&io + config_stats_interval = 0 + config_write_stats_on_startup = .false. + config_stats_cell_ID = 1 + config_write_output_on_startup = .true. + config_pio_num_iotasks = 4 + config_pio_stride = 64 + config_year_digits = 4 + config_output_external_velocity_solver_data = .false. + config_write_albany_ascii_mesh = .false. +/ +&decomposition + config_num_halos = 3 + config_block_decomp_file_prefix = 'graph.info.part.' + config_number_of_blocks = 0 + config_explicit_proc_decomp = .false. + config_proc_decomp_file_prefix = 'graph.info.part.' +/ +&debug + config_print_thickness_advection_info = .true. + config_print_calving_info = .true. + config_print_thermal_info = .false. + config_always_compute_fem_grid = .false. + config_print_velocity_cleanup_details = .false. +/ +&subglacial_hydro + config_SGH = .false. + config_ocean_connection_N = .false. + config_SGH_adaptive_timestep_fraction = 1.0 + config_SGH_max_adaptive_timestep = 3.15e9 + config_SGH_tangent_slope_calculation = 'from_normal_slope' + config_SGH_pressure_calc = 'cavity' + config_SGH_alpha = 1.25 + config_SGH_beta = 1.5 + config_SGH_conduc_coeff = 0.001 + config_SGH_conduc_coeff_drowned = 0.0 + config_SGH_till_drainage = 0.0 + config_SGH_till_max = 0.0 + config_SGH_advection = 'fo' + config_SGH_bed_roughness = 0.5 + config_SGH_bed_roughness_max = 0.1 + config_SGH_creep_coefficient = 0.04 + config_SGH_englacial_porosity = 0.01 + config_SGH_chnl_active = .false. + config_SGH_chnl_include_DCFL = .false. + config_SGH_chnl_alpha = 1.25 + config_SGH_chnl_beta = 1.5 + config_SGH_chnl_conduc_coeff = 0.1 + config_SGH_chnl_creep_coefficient = 0.04 + config_SGH_incipient_channel_width = 2.0 + config_SGH_include_pressure_melt = .false. + config_SGH_shmip_forcing = 'none' + config_SGH_basal_melt = 'file' +/ +&AM_globalStats + config_AM_globalStats_enable = .false. + config_AM_globalStats_compute_interval = '0000-00-00_01:00:00' + config_AM_globalStats_stream_name = 'globalStatsOutput' + config_AM_globalStats_compute_on_startup = .true. + config_AM_globalStats_write_on_startup = .true. +/ +&AM_regionalStats + config_AM_regionalStats_enable = .false. + config_AM_regionalStats_compute_interval = '0000-00-00_01:00:00' + config_AM_regionalStats_stream_name = 'regionalStatsOutput' + config_AM_regionalStats_compute_on_startup = .true. + config_AM_regionalStats_write_on_startup = .true. +/ From 98d89bff53af00c8ab1566b6d91e79ac1f84c4e4 Mon Sep 17 00:00:00 2001 From: hollyhan Date: Thu, 26 May 2022 13:41:03 -0700 Subject: [PATCH 07/43] Edit output interval to 1 year in streams.landice --- compass/landice/tests/ismip6_run_ais/projection/streams.landice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip6_run_ais/projection/streams.landice b/compass/landice/tests/ismip6_run_ais/projection/streams.landice index 7577034c2b..70ae7bbb85 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/streams.landice +++ b/compass/landice/tests/ismip6_run_ais/projection/streams.landice @@ -9,7 +9,7 @@ type="input;output" filename_template="rst.$Y.nc" filename_interval="output_interval" - output_interval="0100-00-00_00:00:00" + output_interval="0001-00-00_00:00:00" reference_time="1995-01-01_00:00:00" clobber_mode="truncate" precision="double" From e544d58a157121f08e185ae7d07384fe24de25c7 Mon Sep 17 00:00:00 2001 From: hollyhan Date: Fri, 27 May 2022 10:57:35 -0700 Subject: [PATCH 08/43] Add regionaMask.nc file as input --- compass/landice/tests/ismip6_run_ais/run_model.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/compass/landice/tests/ismip6_run_ais/run_model.py b/compass/landice/tests/ismip6_run_ais/run_model.py index 4c37ea549c..93c5cfa9df 100644 --- a/compass/landice/tests/ismip6_run_ais/run_model.py +++ b/compass/landice/tests/ismip6_run_ais/run_model.py @@ -64,15 +64,18 @@ def setup(self, velo_solver="FO"): # We estimate that 200-1000 cells should be allocated for one core res_param = { 'high': {'mesh_file': 'Antarctic_1to10km.nc', + 'mask_file': 'regionMask_AIS_1to10km.nc', 'cores': 25000, 'min_cores': 5000}, 'mid': {'mesh_file': 'Antarctic_8to80km_20220407.nc', + 'mask_file': 'regionMask_AIS_8to10km.nc', 'cores': 400, 'min_cores': 80} } res_param = res_param[self.mesh_type] self.mesh_file = res_param['mesh_file'] + self.mask_file = res_param['mask_file'] self.cores = res_param['cores'] self.min_cores = res_param['min_cores'] @@ -84,6 +87,10 @@ def setup(self, velo_solver="FO"): # self.add_input_file(filename=self.mesh_file, target=self.mesh_file, # database='') + # Todo: create a region mask file in the AIS mesh test group +# self.add_input_file(filename='regionMask.nc', target=self.mask_file, +# database='') + self.add_namelist_file( 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', out_name='namelist.landice') @@ -126,6 +133,7 @@ def setup(self, velo_solver="FO"): target=target) stream_replacements = {'input_file_ais': self.mesh_file, + 'input_file_region_mask': self.mask_file, 'file_ais_TF_forcing': 'thermal_forcing.nc', 'file_ais_SMB_forcing': 'smb.nc', 'file_ais_basal_param': 'basal_coeff.nc', From ca011e111a8e03212f7c2d8ca7d96873876ff026 Mon Sep 17 00:00:00 2001 From: hollyhan Date: Fri, 27 May 2022 11:00:07 -0700 Subject: [PATCH 09/43] Add streams.landice as a template --- .../streams.landice => streams.landice.template} | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) rename compass/landice/tests/ismip6_run_ais/{projection/streams.landice => streams.landice.template} (90%) diff --git a/compass/landice/tests/ismip6_run_ais/projection/streams.landice b/compass/landice/tests/ismip6_run_ais/streams.landice.template similarity index 90% rename from compass/landice/tests/ismip6_run_ais/projection/streams.landice rename to compass/landice/tests/ismip6_run_ais/streams.landice.template index 70ae7bbb85..f764cda4bb 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/streams.landice +++ b/compass/landice/tests/ismip6_run_ais/streams.landice.template @@ -10,7 +10,7 @@ filename_template="rst.$Y.nc" filename_interval="output_interval" output_interval="0001-00-00_00:00:00" - reference_time="1995-01-01_00:00:00" + reference_time="2015-01-01_00:00:00" clobber_mode="truncate" precision="double" input_interval="initial_only"/> @@ -18,7 +18,7 @@ @@ -31,7 +31,7 @@ filename_template="{{ file_ais_TF_forcing }}" input_interval="0001-00-00_00:00:00" record_interval="0001-00-00_00:00:00" - reference_time="1950-01-01_00:00:00" + reference_time="2015-01-01_00:00:00" runtime_format="single_file"> @@ -63,7 +63,7 @@ filename_template="{{ file_ais_SMB_forcing }}" input_interval="0001-00-00_00:00:00" record_interval="0001-00-00_00:00:00" - reference_time="1950-01-01_00:00:00" + reference_time="2015-01-01_00:00:00" runtime_format="single_file"> @@ -72,7 +72,7 @@ type="output" filename_template="output.nc" output_interval="0000-00-01_00:00:00" - reference_time="1950-01-01_00:00:00" + reference_time="2015-01-01_00:00:00" clobber_mode="truncate"> @@ -97,7 +97,7 @@ filename_interval="none" clobber_mode="overwrite" output_interval="0000-00-00_01:00:00" - reference_time="2007-01-01_00:00:00" + reference_time="2015-01-01_00:00:00" packages="globalStatsAMPKG" runtime_format="single_file"> @@ -106,6 +106,7 @@ + @@ -114,7 +115,7 @@ filename_template="output/regionalStats.nc" filename_interval="none" clobber_mode="overwrite" - reference_time="1950-01-01_00:00:00" + reference_time="2015-01-01_00:00:00" output_interval="0000-00-00_01:00:00" packages="regionalStatsAMPKG" runtime_format="single_file"> From 13c541c8833c0784f6b324345e572081ecf90f20 Mon Sep 17 00:00:00 2001 From: hollyhan Date: Fri, 27 May 2022 14:53:56 -0600 Subject: [PATCH 10/43] Include output variables required by the ISMIP6 protocol in streams.landice --- .../ismip6_run_ais/streams.landice.template | 50 ++++++++++++++----- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/streams.landice.template b/compass/landice/tests/ismip6_run_ais/streams.landice.template index f764cda4bb..950569149a 100644 --- a/compass/landice/tests/ismip6_run_ais/streams.landice.template +++ b/compass/landice/tests/ismip6_run_ais/streams.landice.template @@ -10,7 +10,7 @@ filename_template="rst.$Y.nc" filename_interval="output_interval" output_interval="0001-00-00_00:00:00" - reference_time="2015-01-01_00:00:00" + reference_time="1995-01-01_00:00:00" clobber_mode="truncate" precision="double" input_interval="initial_only"/> @@ -31,7 +31,7 @@ filename_template="{{ file_ais_TF_forcing }}" input_interval="0001-00-00_00:00:00" record_interval="0001-00-00_00:00:00" - reference_time="2015-01-01_00:00:00" + reference_time="1995-01-01_00:00:00" runtime_format="single_file"> @@ -63,7 +63,7 @@ filename_template="{{ file_ais_SMB_forcing }}" input_interval="0001-00-00_00:00:00" record_interval="0001-00-00_00:00:00" - reference_time="2015-01-01_00:00:00" + reference_time="1995-01-01_00:00:00" runtime_format="single_file"> @@ -71,33 +71,59 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + @@ -115,7 +141,7 @@ filename_template="output/regionalStats.nc" filename_interval="none" clobber_mode="overwrite" - reference_time="2015-01-01_00:00:00" + reference_time="1995-01-01_00:00:00" output_interval="0000-00-00_01:00:00" packages="regionalStatsAMPKG" runtime_format="single_file"> From 647f5ff34c564e169663f1c3a0e511b3f65fa76e Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 27 Oct 2022 12:57:42 -0700 Subject: [PATCH 11/43] Update config files to contents used for actual ISMIP6 runs --- .../tests/ismip6_run_ais/albany_input.yaml | 9 +- .../tests/ismip6_run_ais/namelist.landice | 195 ++++-------------- .../ismip6_run_ais/streams.landice.template | 140 +++++++------ 3 files changed, 115 insertions(+), 229 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/albany_input.yaml b/compass/landice/tests/ismip6_run_ais/albany_input.yaml index 3e2ffcd60f..ac988df20f 100644 --- a/compass/landice/tests/ismip6_run_ais/albany_input.yaml +++ b/compass/landice/tests/ismip6_run_ais/albany_input.yaml @@ -12,10 +12,15 @@ ANONYMOUS: Regularization Value: 1.0e-4 LandIce BCs: BC 0: + Cubature Degree: 8 Basal Friction Coefficient: Type: Power Law - Power Exponent: 1.0 - Effective Pressure Type: Hydrostatic + Power Exponent: 0.2 + Mu Type: Field + Effective Pressure Type: Constant + Effective Pressure: 1.0 + # Zero Effective Pressure On Floating Ice At Nodes: true + Zero Beta On Floating Ice: true # Discretization Description Discretization: diff --git a/compass/landice/tests/ismip6_run_ais/namelist.landice b/compass/landice/tests/ismip6_run_ais/namelist.landice index f16adb219d..9da525a423 100644 --- a/compass/landice/tests/ismip6_run_ais/namelist.landice +++ b/compass/landice/tests/ismip6_run_ais/namelist.landice @@ -1,193 +1,76 @@ -&velocity_solver config_velocity_solver = 'FO' - config_sia_tangent_slope_calculation = 'from_vertex_barycentric' - config_flowParamA_calculation = 'constant' config_do_velocity_reconstruction_for_external_dycore = .false. - config_simple_velocity_type = 'uniform' - config_use_glp = .true. - config_beta_thawed_only = .false. - config_unrealistic_velocity = 0.01592356685 - config_nonconvergence_error = .true. - config_effective_pressure_max = 1.0e36 -/ -&advection + config_unrealistic_velocity = 00.00159 ! 50 km/yr + config_nonconvergence_error = .false. + config_thickness_advection = 'fo' - config_tracer_advection = 'none' - config_restore_thickness_after_advection = .false. - config_zero_sfcMassBalApplied_over_bare_land = .true. -/ -&solidearth - config_uplift_method = 'none' - config_slm_coupling_interval = '0002-00-00_00:00:00' - config_MALI_to_SLM_weights_file = 'mpas_to_grid.nc' - config_SLM_to_MALI_weights_file = 'grid_to_mpas.nc' -/ -&calving + config_tracer_advection = 'fo' + config_calving = 'none' - config_use_Albany_flowA_eqn_for_vM = .false. - config_calving_topography = -500.0 - config_calving_thickness = 100.0 - config_calving_eigencalving_parameter_source = 'data' - config_calving_eigencalving_parameter_scalar_value = 3.5e16 - config_calving_specified_source = 'const' - config_calving_velocity_const = 0.0 - config_data_calving = .false. - config_calving_timescale = 0.0 + config_calculate_damage = .true. + config_damage_calving_threshold = 0.95 + config_damage_calving_method = 'none' + config_calving_speed_limit = 0.00063492063 config_restore_calving_front = .true. config_remove_icebergs = .true. config_remove_small_islands = .true. - config_calving_speed_limit = 100.0 - config_grounded_von_Mises_threshold_stress = 1.0e6 - config_floating_von_Mises_threshold_stress = 1.0e6 - config_grounded_von_Mises_threshold_stress_source = 'scalar' - config_floating_von_Mises_threshold_stress_source = 'scalar' - config_finalize_damage_after_advection = .true. - config_preserve_damage = .false. - config_calculate_damage = .false. - config_damage_preserve_threshold = 0.0 - config_damage_calving_threshold = 1.0 - config_damage_stiffness_min = 0.1 - config_damage_rheology_coupling = .false. - config_damage_gl_setting = 'nye' - config_damage_calving_method = 'none' - config_damagecalvingParameter = 1.0e-4 - config_ismip6_retreat_k = -170.0 - config_calving_error_threshold = 0.1 - config_distribute_unablatedVolumeDynCell = .false. -/ -&thermal_solver - config_thermal_solver = 'none' + config_distribute_unablatedVolumeDynCell = .true. + config_calving_error_threshold = 100000.0 + + config_thermal_solver = 'temperature' config_thermal_calculate_bmb = .true. config_temperature_init = 'file' config_thermal_thickness = 0.0 config_surface_air_temperature_source = 'file' - config_surface_air_temperature_value = 273.15 - config_surface_air_temperature_lapse_rate = 0.01 config_basal_heat_flux_source = 'file' - config_basal_heat_flux_value = 0.0 - config_temp_diffusive_factor = 1.0e-5 - config_max_water_fraction = 1.0e-2 -/ -&iceshelf_melt + config_basal_mass_bal_float = 'ismip6' - config_bmlt_float_flux = 0.0 - config_bmlt_float_xlimit = 0.0 - config_basal_mass_bal_seroussi_amplitude = 0.0 - config_basal_mass_bal_seroussi_period = 1.0 - config_basal_mass_bal_seroussi_phase = 0.0 - config_temperature_profile_melt_scale_factor = 6.0 - config_temperature_profile_sill_elevation = -700.0 - config_temperature_profile_plume_thickness = 30.0 - config_temperature_profile_draft_slope = 1.0e-2 - config_temperature_profile_thermocline_upper_depth = -200.0 - config_temperature_profile_thermocline_upper_temp = -1.0 - config_temperature_profile_thermocline_lower_depth = -600.0 - config_temperature_profile_thermocline_lower_temp = 1.2 - config_temperature_profile_variability_amplitude = 0.0 - config_temperature_profile_variability_period = 1.0 - config_temperature_profile_variability_phase = 0.0 - config_temperature_profile_GL_depth_fraction = 0.25 config_front_mass_bal_grounded = 'none' - config_beta_ocean_thermal_forcing = 1.18 config_add_ocean_thermal_forcing = 0.0 - config_alpha_subglacial_discharge = 0.39 - config_subglacial_discharge_coefficient = 3.0e-4 - config_subglacial_discharge_intercept = 0.15 - config_uniform_face_melt_rate = 0.0 -/ -&physical_parameters + config_ice_density = 910.0 config_ocean_density = 1028.0 config_sea_level = 0.0 - config_default_flowParamA = 3.1709792e-24 config_flowLawExponent = 3.0 - config_dynamic_thickness = 11.0 -/ -&time_integration - config_dt = '0001-00-00_00:00:00' + config_dynamic_thickness = 10.0 + + config_dt = '0000-01-00_00:00:00' config_time_integration = 'forward_euler' config_adaptive_timestep = .true. - config_min_adaptive_timestep = 60.0 - config_max_adaptive_timestep = 1.575e10 + config_adaptive_timestep_calvingCFL_fraction = 0.8 + config_adaptive_timestep_include_calving = .true. + config_min_adaptive_timestep = 60 + config_max_adaptive_timestep = 3.154e7 config_adaptive_timestep_CFL_fraction = 0.8 - config_adaptive_timestep_calvingCFL_fraction = 1.0 config_adaptive_timestep_include_DCFL = .false. - config_adaptive_timestep_include_calving = .true. config_adaptive_timestep_force_interval = '0001-00-00_00:00:00' -/ -&time_management - config_do_restart = .false. + + config_do_restart = .true. config_restart_timestamp_name = 'restart_timestamp' - config_start_time = '2015-01-01_00:00:00' - config_stop_time = '2100-01-01_00:00:00' - config_run_duration = 'none' + config_start_time ='file' + config_stop_time = '2300-01-01_00:00:00' config_calendar_type = 'gregorian_noleap' -/ -&io + config_stats_interval = 0 config_write_stats_on_startup = .false. config_stats_cell_ID = 1 config_write_output_on_startup = .true. - config_pio_num_iotasks = 4 - config_pio_stride = 64 - config_year_digits = 4 - config_output_external_velocity_solver_data = .false. - config_write_albany_ascii_mesh = .false. -/ -&decomposition - config_num_halos = 3 - config_block_decomp_file_prefix = 'graph.info.part.' - config_number_of_blocks = 0 - config_explicit_proc_decomp = .false. - config_proc_decomp_file_prefix = 'graph.info.part.' -/ -&debug - config_print_thickness_advection_info = .true. - config_print_calving_info = .true. - config_print_thermal_info = .false. - config_always_compute_fem_grid = .false. - config_print_velocity_cleanup_details = .false. -/ -&subglacial_hydro - config_SGH = .false. + config_pio_num_iotasks = 5 + config_pio_stride = 36 + + config_always_compute_fem_grid = .true. + config_ocean_connection_N = .false. - config_SGH_adaptive_timestep_fraction = 1.0 - config_SGH_max_adaptive_timestep = 3.15e9 - config_SGH_tangent_slope_calculation = 'from_normal_slope' - config_SGH_pressure_calc = 'cavity' - config_SGH_alpha = 1.25 - config_SGH_beta = 1.5 - config_SGH_conduc_coeff = 0.001 - config_SGH_conduc_coeff_drowned = 0.0 - config_SGH_till_drainage = 0.0 - config_SGH_till_max = 0.0 - config_SGH_advection = 'fo' - config_SGH_bed_roughness = 0.5 - config_SGH_bed_roughness_max = 0.1 - config_SGH_creep_coefficient = 0.04 - config_SGH_englacial_porosity = 0.01 - config_SGH_chnl_active = .false. - config_SGH_chnl_include_DCFL = .false. - config_SGH_chnl_alpha = 1.25 - config_SGH_chnl_beta = 1.5 - config_SGH_chnl_conduc_coeff = 0.1 - config_SGH_chnl_creep_coefficient = 0.04 - config_SGH_incipient_channel_width = 2.0 - config_SGH_include_pressure_melt = .false. - config_SGH_shmip_forcing = 'none' - config_SGH_basal_melt = 'file' -/ -&AM_globalStats - config_AM_globalStats_enable = .false. - config_AM_globalStats_compute_interval = '0000-00-00_01:00:00' + config_SGH = .false. + + config_AM_globalStats_enable = .true. + config_AM_globalStats_compute_interval = 'output_interval' config_AM_globalStats_stream_name = 'globalStatsOutput' config_AM_globalStats_compute_on_startup = .true. config_AM_globalStats_write_on_startup = .true. -/ -&AM_regionalStats - config_AM_regionalStats_enable = .false. - config_AM_regionalStats_compute_interval = '0000-00-00_01:00:00' + + config_AM_regionalStats_enable = .true. + config_AM_regionalStats_compute_interval = 'output_interval' config_AM_regionalStats_stream_name = 'regionalStatsOutput' config_AM_regionalStats_compute_on_startup = .true. config_AM_regionalStats_write_on_startup = .true. -/ diff --git a/compass/landice/tests/ismip6_run_ais/streams.landice.template b/compass/landice/tests/ismip6_run_ais/streams.landice.template index 950569149a..d2b6bc35df 100644 --- a/compass/landice/tests/ismip6_run_ais/streams.landice.template +++ b/compass/landice/tests/ismip6_run_ais/streams.landice.template @@ -1,19 +1,24 @@ + + + input_interval="initial_only" + type="input"/> + output_interval="0001-00-00_00:00:00" + reference_time="2000-01-01_00:00:00" + filename_template="rst.$Y-$M-$D.nc" + input_interval="initial_only" + type="input;output" + input_interal="initial_only"/> + + + - - - - - - - - - - + reference_time="2000-01-01_00:00:00" + filename_interval="005-00-00_00:00:00" + filename_template="output/output_state_$Y.nc" + type="output"> + - + + + - + - + - - + + + - + + - + + + + + - + - - + + + + + + - - - - - + + - - + - - - - - - - + + + From d711084669283273708c7d2efdde098552e9e357 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 27 Oct 2022 21:01:36 -0700 Subject: [PATCH 12/43] Revamp test case to just set up dirs using specified input files --- .../landice/tests/ismip6_run_ais/__init__.py | 3 +- .../tests/ismip6_run_ais/ismip6_run_ais.cfg | 29 +--- .../ismip6_run_ais/projection/__init__.py | 18 +- .../landice/tests/ismip6_run_ais/run_model.py | 156 ------------------ .../tests/ismip6_run_ais/set_up_experiment.py | 115 +++++++++++++ .../ismip6_run_ais/streams.landice.template | 11 +- 6 files changed, 142 insertions(+), 190 deletions(-) delete mode 100644 compass/landice/tests/ismip6_run_ais/run_model.py create mode 100644 compass/landice/tests/ismip6_run_ais/set_up_experiment.py diff --git a/compass/landice/tests/ismip6_run_ais/__init__.py b/compass/landice/tests/ismip6_run_ais/__init__.py index ec77a039e5..7501fca0d1 100644 --- a/compass/landice/tests/ismip6_run_ais/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/__init__.py @@ -21,7 +21,8 @@ def __init__(self, mpas_core): 'mid': 'Antarctica_8to80km', 'high': 'Antarctica_1to10km' } + self.mesh_types = ['8km'] - for mesh_type in ['mid', 'high']: + for mesh_type in self.mesh_types: self.add_test_case( Projection(test_group=self, mesh_type=mesh_type)) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index d5040f6e13..f1e7132304 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -1,27 +1,14 @@ # config options for ismip6 antarctic ice sheet data set [ismip6_run_ais] -# Base path to the input ismip6 ocean and smb forcing files. User has to supply. -base_path_forcing = NotAvailable +# Base path to the processed input ismip6 ocean and smb forcing files. User has to supply. +forcing_basepath = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res/tier1_experiments -# Base path to the the MALI mesh. User has to supply. -base_path_mali = NotAvailable +# Path to the initial condition file. User has to supply. +init_cond_path = /global/cscratch1/sd/hoffman2/AIS8km/q15GLP_optimizationResult_20220906/2022-10-26_PROJECTIONS_noCalving/historical/AIS8km_relaxation2000_20221016.nc -# Forcing end year of the ISMIP6 data. User has to supply. -# Available end years are 2100 and 2300. -period_endyear = NotAvailable - -# Name of climate model name used to generate ISMIP6 forcing data. User has to supply. -# Available model names are the following: CCSM4, CESM2-WACCM, CSIRO-Mk3-6-0, HadGEM2-ES, NorESM1-M, UKESM1-0-LL -model = NotAvailable - -# Scenarios used by climate model. User has to supply. -# Available scenarios are the following: RCP26, RCP26-repeat, RCP85, SSP126, SSP585 -scenario = NotAvailable - -# filename for the basal parametrization coefficients. -fname_basal_coeff = NotAvailable - -# calving law -calving_law = none +# Path to the file for the basal melt parametrization coefficients. +melt_params_path = /global/cscratch1/sd/hoffman2/AIS8km/q15GLP_optimizationResult_20220906/2022-10-26_PROJECTIONS_noCalving/historical/basin_and_coeff_gamma0_DeltaT_quadratic_non_local.nc +# Path to the region mask file +region_mask_path = /global/cscratch1/sd/hoffman2/AIS8km/q15GLP_optimizationResult_20220906/2022-10-26_PROJECTIONS_noCalving/historical/AIS_8to30km_r01_20220607.regionMask_ismip6.nc diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py index 6bb80d07f4..599d72f411 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -1,5 +1,6 @@ from compass.testcase import TestCase -from compass.landice.tests.ismip6_run_ais.run_model import RunModel +from compass.landice.tests.ismip6_run_ais.set_up_experiment \ + import SetUpExperiment from compass.validate import compare_variables @@ -21,15 +22,18 @@ def __init__(self, test_group, mesh_type): The resolution or type of mesh of the test case """ - name = 'projection' - - # build dir name. - subdir = f'{test_group.meshdirs[mesh_type]}/{name}' + name = 'ismip6AE' super().__init__(test_group=test_group, name=name, - subdir=subdir) + subdir=name) + + experiments = ['ctrlAE', 'expAE01', 'expAE02', 'expAE03', 'expAE04', 'expAE05', 'expAE06'] + for exp in experiments: + name = f'{exp}' + self.add_step( + SetUpExperiment(test_case=self, name=name, subdir=name, exp=exp)) + - self.add_step(RunModel(test_case=self, mesh_type=mesh_type)) def validate(self): """ diff --git a/compass/landice/tests/ismip6_run_ais/run_model.py b/compass/landice/tests/ismip6_run_ais/run_model.py deleted file mode 100644 index 93c5cfa9df..0000000000 --- a/compass/landice/tests/ismip6_run_ais/run_model.py +++ /dev/null @@ -1,156 +0,0 @@ -import os -from compass.model import run_model, make_graph_file -from compass.step import Step - - -class RunModel(Step): - """ - A step for performing forward MALI runs as part of Antarctica test cases. - - Attributes - ---------- - mesh_file : str - The name of the mesh file being used - - mesh_type : str - The resolution or mesh type of the test case - """ - - def __init__(self, test_case, mesh_type, name='run_model'): - """ - Create a new test case - - Parameters - ---------- - mesh_file : str - The name of the mesh file being used - - mesh_type : {'high', 'mid'} - The resolution or mesh type of the test case - """ - - self.mesh_file = None - self.mesh_type = mesh_type - - super().__init__(test_case=test_case, name=name) - - def setup(self, velo_solver="FO"): - config = self.config - section = config['ismip6_run_ais'] - base_path_mali = section.get('base_path_mali') - calving_law = section.get('calving_law') - damage = section.get('damage') - procs = section.get('procs') - - if calving_law not in ['none', 'floating', 'eigencalving', - 'specified_calving_velocity', - 'von_Mises_stress', - 'damagecalving', 'ismip6_retreat']: - raise ValueError("Value of calving_law must be one of {'none', " - "'floating', " - "'eigencalving', 'specified_calving_velocity', " - "'von_Mises_stress', 'damagecalving', " - "'ismip6_retreat'}") - - self.add_input_file(filename='albany_input.yaml', - package='compass.landice.tests.ismip6_run_ais', - copy=True) - - self.add_model_as_input() - - self.add_output_file(filename='output.nc') - - # Todo: confirm the number of cores needed for the high mesh - # We estimate that 200-1000 cells should be allocated for one core - res_param = { - 'high': {'mesh_file': 'Antarctic_1to10km.nc', - 'mask_file': 'regionMask_AIS_1to10km.nc', - 'cores': 25000, - 'min_cores': 5000}, - 'mid': {'mesh_file': 'Antarctic_8to80km_20220407.nc', - 'mask_file': 'regionMask_AIS_8to10km.nc', - 'cores': 400, - 'min_cores': 80} - } - - res_param = res_param[self.mesh_type] - self.mesh_file = res_param['mesh_file'] - self.mask_file = res_param['mask_file'] - self.cores = res_param['cores'] - self.min_cores = res_param['min_cores'] - - self.add_input_file(filename=self.mesh_file, - target=os.path.join(base_path_mali, - self.mesh_file)) - - # Todo: upload the AIS meshes to the database -# self.add_input_file(filename=self.mesh_file, target=self.mesh_file, -# database='') - - # Todo: create a region mask file in the AIS mesh test group -# self.add_input_file(filename='regionMask.nc', target=self.mask_file, -# database='') - - self.add_namelist_file( - 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', - out_name='namelist.landice') - options = {'config_velocity_solver': f"'{velo_solver}'", - 'config_calving': f"'{calving_law}'"} - - if damage == 'threshold': - options['config_calculate_damage'] = '.true.' - options['config_damage_calving_method'] = "'threshold'" - options['config_damage_calving_threshold'] = '0.5' - - # now add accumulated options to namelist - self.add_namelist_options(options=options, - out_name='namelist.landice') - - period_endyear = section.get("period_endyear") - model = section.get("model") - scenario = section.get("scenario") - base_path_forcing = section.get('base_path_forcing') - fname_basal_coeff = section.get('fname_basal_coeff') - - target = f'{base_path_forcing}/ocean_forcing/thermal_forcing/' \ - f'{model}_{scenario}/1995-{period_endyear}/' \ - f'processed_TF_{model}_{scenario}_{period_endyear}.nc' - self.add_input_file(filename='thermal_forcing.nc', - target=target) - target = f'{base_path_forcing}/atmosphere_forcing/' \ - f'{model}_{scenario}/1995-{period_endyear}/' \ - f'processed_SMB_{model}_{scenario}_{period_endyear}.nc' - self.add_input_file(filename='smb.nc', - target=target) - target = f'{base_path_forcing}/ocean_forcing/basal_melt/' \ - f'parametrizations/{fname_basal_coeff}' - self.add_input_file(filename='basal_coeff.nc', - target=target) - target = f'{base_path_forcing}/ocean_forcing/shelf_melt_offset/' \ - f'{model}_{scenario}/1995-{period_endyear}/' \ - f'processed_shelfmelt_offset_{model}_{scenario}.nc' - self.add_input_file(filename='shelf_melt_offset.nc', - target=target) - - stream_replacements = {'input_file_ais': self.mesh_file, - 'input_file_region_mask': self.mask_file, - 'file_ais_TF_forcing': 'thermal_forcing.nc', - 'file_ais_SMB_forcing': 'smb.nc', - 'file_ais_basal_param': 'basal_coeff.nc', - 'file_ais_shelf_melt_offset': 'shelf_melt_' - 'offset.nc' - } - - self.add_streams_file( - 'compass.landice.tests.ismip6_run_ais', 'streams.landice.template', - out_name='streams.landice', - template_replacements=stream_replacements) - - def run(self): - """ - Run this step of the test case - """ - make_graph_file(mesh_filename=self.mesh_file, - graph_filename='graph.info') - run_model(step=self, namelist='namelist.landice', - streams='streams.landice') diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py new file mode 100644 index 0000000000..875d616155 --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -0,0 +1,115 @@ +import os +from compass.model import run_model, make_graph_file +from compass.step import Step +import shutil, glob, sys + + +class SetUpExperiment(Step): + """ + A step for setting up an ISMIP6 experiment + + Attributes + ---------- + mesh_file : str + The name of the mesh file being used + + mesh_type : str + The resolution or mesh type of the test case + """ + + def __init__(self, test_case, name, subdir, exp): + """ + Set up a new experiment + + Parameters + ---------- + mesh_file : str + The name of the mesh file being used + + mesh_type : {'high', 'mid'} + The resolution or mesh type of the test case + + exp : experiment + """ + + self.exp = exp + + super().__init__(test_case=test_case, name=name) + + def setup(self): + config = self.config + section = config['ismip6_run_ais'] + forcing_basepath = section.get('forcing_basepath') + init_cond_path = section.get('init_cond_path') + init_cond_fname = os.path.split(init_cond_path)[-1] + melt_params_path = section.get('melt_params_path') + melt_params_fname = os.path.split(melt_params_path)[-1] + region_mask_path = section.get('region_mask_path') + region_mask_fname = os.path.split(region_mask_path)[-1] + + # Copy files we'll need from local paths specified in cfg file + shutil.copy(init_cond_path, self.work_dir) + shutil.copy(melt_params_path, self.work_dir) + shutil.copy(region_mask_path, self.work_dir) + + # Find and copy correct forcing files + smb_search_path = os.path.join(forcing_basepath, self.exp, 'processed_SMB_*_smbNeg_over_bareland.nc') + fcgFileList = glob.glob(smb_search_path) + if len(fcgFileList) == 1: + smb_path = fcgFileList[0] + smb_fname = os.path.split(smb_path)[-1] + shutil.copy(smb_path, self.work_dir) + else: + sys.exit(f"ERROR: Did not find exactly one matching SMB file at {smb_search_path}: {fcgFileList}") + + tf_search_path = os.path.join(forcing_basepath, self.exp, 'processed_TF_*.nc') + fcgFileList = glob.glob(tf_search_path) + if len(fcgFileList) == 1: + tf_path = fcgFileList[0] + tf_fname = os.path.split(tf_path)[-1] + shutil.copy(tf_path, self.work_dir) + else: + sys.exit(f"ERROR: Did not find exactly one matching TF file at {tf_search_path}: {fcgFileList}") + + # Make stream modifications based on files that were determined above + stream_replacements = { + 'input_file_init_cond': init_cond_fname , + 'input_file_region_mask': region_mask_fname , + 'input_file_melt_params': melt_params_fname, + 'input_file_SMB_forcing': smb_fname, + 'input_file_TF_forcing': tf_fname + } + self.add_streams_file( + 'compass.landice.tests.ismip6_run_ais', 'streams.landice.template', + out_name='streams.landice', + template_replacements=stream_replacements) + + # Set up namelist and customize as needed + self.add_namelist_file( + 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', + out_name='namelist.landice') + #options = {'config_velocity_solver': f"'{velo_solver}'", + # 'config_calving': f"'{calving_law}'"} + + # now add accumulated options to namelist + #self.add_namelist_options(options=options, + # out_name='namelist.landice') + + + self.add_input_file(filename='albany_input.yaml', + package='compass.landice.tests.ismip6_run_ais', + copy=True) + + #make_graph_file(mesh_filename=self.mesh_file, + # graph_filename='graph.info') + + self.add_model_as_input() + + def run(self): + """ + Run this step of the test case + """ + #make_graph_file(mesh_filename=self.mesh_file, + # graph_filename='graph.info') + #run_model(step=self, namelist='namelist.landice', + # streams='streams.landice') diff --git a/compass/landice/tests/ismip6_run_ais/streams.landice.template b/compass/landice/tests/ismip6_run_ais/streams.landice.template index d2b6bc35df..5731959e9b 100644 --- a/compass/landice/tests/ismip6_run_ais/streams.landice.template +++ b/compass/landice/tests/ismip6_run_ais/streams.landice.template @@ -5,7 +5,7 @@ type="none"/> @@ -32,7 +32,7 @@ @@ -42,7 +42,7 @@ @@ -53,7 +53,7 @@ @@ -110,7 +110,8 @@ - + + From 9951d7ddad37d097a1908c1bc5ff1cd60e6c92f4 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 27 Oct 2022 21:38:55 -0700 Subject: [PATCH 13/43] Add hist run and adjust files and namelist for it Also symlink result of hist run into all projection runs --- .../ismip6_run_ais/projection/__init__.py | 2 +- .../tests/ismip6_run_ais/set_up_experiment.py | 46 +++++++++++++------ 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py index 599d72f411..a557b4f2b4 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -27,7 +27,7 @@ def __init__(self, test_group, mesh_type): super().__init__(test_group=test_group, name=name, subdir=name) - experiments = ['ctrlAE', 'expAE01', 'expAE02', 'expAE03', 'expAE04', 'expAE05', 'expAE06'] + experiments = ['hist', 'ctrlAE', 'expAE01', 'expAE02', 'expAE03', 'expAE04', 'expAE05', 'expAE06'] for exp in experiments: name = f'{exp}' self.add_step( diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 875d616155..c6e8466875 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -37,6 +37,12 @@ def __init__(self, test_case, name, subdir, exp): super().__init__(test_case=test_case, name=name) def setup(self): + + if self.exp == 'hist': + exp_fcg = 'ctrlAE' + else: + exp_fcg = self.exp + config = self.config section = config['ismip6_run_ais'] forcing_basepath = section.get('forcing_basepath') @@ -48,12 +54,13 @@ def setup(self): region_mask_fname = os.path.split(region_mask_path)[-1] # Copy files we'll need from local paths specified in cfg file - shutil.copy(init_cond_path, self.work_dir) + if self.exp == 'hist': + shutil.copy(init_cond_path, self.work_dir) shutil.copy(melt_params_path, self.work_dir) shutil.copy(region_mask_path, self.work_dir) # Find and copy correct forcing files - smb_search_path = os.path.join(forcing_basepath, self.exp, 'processed_SMB_*_smbNeg_over_bareland.nc') + smb_search_path = os.path.join(forcing_basepath, exp_fcg, 'processed_SMB_*_smbNeg_over_bareland.nc') fcgFileList = glob.glob(smb_search_path) if len(fcgFileList) == 1: smb_path = fcgFileList[0] @@ -62,7 +69,7 @@ def setup(self): else: sys.exit(f"ERROR: Did not find exactly one matching SMB file at {smb_search_path}: {fcgFileList}") - tf_search_path = os.path.join(forcing_basepath, self.exp, 'processed_TF_*.nc') + tf_search_path = os.path.join(forcing_basepath, exp_fcg, 'processed_TF_*.nc') fcgFileList = glob.glob(tf_search_path) if len(fcgFileList) == 1: tf_path = fcgFileList[0] @@ -73,12 +80,18 @@ def setup(self): # Make stream modifications based on files that were determined above stream_replacements = { - 'input_file_init_cond': init_cond_fname , - 'input_file_region_mask': region_mask_fname , - 'input_file_melt_params': melt_params_fname, 'input_file_SMB_forcing': smb_fname, 'input_file_TF_forcing': tf_fname } + if self.exp == 'hist': + stream_replacements['input_file_init_cond'] = init_cond_fname + stream_replacements['input_file_region_mask'] = region_mask_fname + stream_replacements['input_file_melt_params'] = melt_params_fname + else: + stream_replacements['input_file_init_cond'] = 'USE_RESTART_FILE_INSTEAD' + stream_replacements['input_file_region_mask'] = 'USE_RESTART_FILE_INSTEAD' + stream_replacements['input_file_melt_params'] = 'USE_RESTART_FILE_INSTEAD' + self.add_streams_file( 'compass.landice.tests.ismip6_run_ais', 'streams.landice.template', out_name='streams.landice', @@ -88,20 +101,27 @@ def setup(self): self.add_namelist_file( 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', out_name='namelist.landice') - #options = {'config_velocity_solver': f"'{velo_solver}'", - # 'config_calving': f"'{calving_law}'"} - # now add accumulated options to namelist - #self.add_namelist_options(options=options, - # out_name='namelist.landice') + if self.exp == 'hist': + options = {'config_do_restart': ".false.", + 'config_start_time': "'2000-01-01_00:00:00'", + 'config_stop_time': "'2015-01-01_00:00:00'"} + + self.add_namelist_options(options=options, + out_name='namelist.landice') + # For all projection runs, symlink the restart info for the historical run + if not self.exp == 'hist': + os.symlink("../hist/restart_timestamp", os.path.join(self.work_dir, 'restart_timestamp')) + os.symlink("../hist/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) + # add the albany_input.yaml file self.add_input_file(filename='albany_input.yaml', package='compass.landice.tests.ismip6_run_ais', copy=True) - #make_graph_file(mesh_filename=self.mesh_file, - # graph_filename='graph.info') + make_graph_file(mesh_filename=init_cond_path, + graph_filename='graph.info') self.add_model_as_input() From b1ed37c397a305e710bc2d9292761cae14ef0e69 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 27 Oct 2022 22:57:54 -0700 Subject: [PATCH 14/43] Add graph files and slurm file Also update some paths on Cori --- .../tests/ismip6_run_ais/ismip6_run_ais.cfg | 7 ++++-- .../tests/ismip6_run_ais/set_up_experiment.py | 24 ++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index f1e7132304..72155677e7 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -8,7 +8,10 @@ forcing_basepath = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300 init_cond_path = /global/cscratch1/sd/hoffman2/AIS8km/q15GLP_optimizationResult_20220906/2022-10-26_PROJECTIONS_noCalving/historical/AIS8km_relaxation2000_20221016.nc # Path to the file for the basal melt parametrization coefficients. -melt_params_path = /global/cscratch1/sd/hoffman2/AIS8km/q15GLP_optimizationResult_20220906/2022-10-26_PROJECTIONS_noCalving/historical/basin_and_coeff_gamma0_DeltaT_quadratic_non_local.nc +melt_params_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/basin_and_coeff_gamma0_DeltaT_quadratic_non_local.nc # Path to the region mask file -region_mask_path = /global/cscratch1/sd/hoffman2/AIS8km/q15GLP_optimizationResult_20220906/2022-10-26_PROJECTIONS_noCalving/historical/AIS_8to30km_r01_20220607.regionMask_ismip6.nc +region_mask_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/AIS_8to30km_r01_20220607.regionMask_ismip6.nc + +# Path to the directory containing graph files +graph_files_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027 diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index c6e8466875..69a90ee78b 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -2,6 +2,8 @@ from compass.model import run_model, make_graph_file from compass.step import Step import shutil, glob, sys +from jinja2 import Template +from importlib import resources class SetUpExperiment(Step): @@ -52,6 +54,7 @@ def setup(self): melt_params_fname = os.path.split(melt_params_path)[-1] region_mask_path = section.get('region_mask_path') region_mask_fname = os.path.split(region_mask_path)[-1] + graph_files_path = section.get('graph_files_path') # Copy files we'll need from local paths specified in cfg file if self.exp == 'hist': @@ -120,9 +123,24 @@ def setup(self): package='compass.landice.tests.ismip6_run_ais', copy=True) - make_graph_file(mesh_filename=init_cond_path, - graph_filename='graph.info') - + # copy graph files + # may be possible to use compass functionality, but wasn't working in this way + #make_graph_file(mesh_filename=init_cond_path, + # graph_filename='graph.info') + graphFileList = glob.glob(os.path.join(graph_files_path, 'graph.info*')) + for gf in graphFileList: + shutil.copy(gf, self.work_dir) + + # provide an example submit script + template = Template(resources.read_text( + 'compass.landice.tests.ismip6_run_ais', + 'slurm.run')) + slurm_replacements = {'EXP': self.exp} + rendered_text = template.render(slurm_replacements) + with open(os.path.join(self.work_dir, 'slurm.run'), "w") as fh: + fh.write(rendered_text) + + # link in exe self.add_model_as_input() def run(self): From 8ff6082626e25ca5af4f2d208c1bf7246f4e177c Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 27 Oct 2022 23:12:08 -0700 Subject: [PATCH 15/43] Add ismip6 mesh res indicator to run dir names --- compass/landice/tests/ismip6_run_ais/__init__.py | 10 +++------- .../tests/ismip6_run_ais/projection/__init__.py | 11 ++++++----- .../landice/tests/ismip6_run_ais/set_up_experiment.py | 6 ++++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/__init__.py b/compass/landice/tests/ismip6_run_ais/__init__.py index 7501fca0d1..03b952579b 100644 --- a/compass/landice/tests/ismip6_run_ais/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/__init__.py @@ -17,12 +17,8 @@ def __init__(self, mpas_core): """ super().__init__(mpas_core=mpas_core, name='ismip6_run_ais') - self.meshdirs = { - 'mid': 'Antarctica_8to80km', - 'high': 'Antarctica_1to10km' - } - self.mesh_types = ['8km'] + self.mesh_res = ['08'] - for mesh_type in self.mesh_types: + for res in self.mesh_res: self.add_test_case( - Projection(test_group=self, mesh_type=mesh_type)) + Projection(test_group=self, mesh_res=res)) diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py index a557b4f2b4..2666862acd 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -9,7 +9,7 @@ class Projection(TestCase): A test case for performing forward MALI runs of ISMIP6 Antaractic setup """ - def __init__(self, test_group, mesh_type): + def __init__(self, test_group, mesh_res): """ Create the test case @@ -27,13 +27,14 @@ def __init__(self, test_group, mesh_type): super().__init__(test_group=test_group, name=name, subdir=name) - experiments = ['hist', 'ctrlAE', 'expAE01', 'expAE02', 'expAE03', 'expAE04', 'expAE05', 'expAE06'] + experiments = ['hist', 'ctrlAE', 'expAE01', 'expAE02', 'expAE03', + 'expAE04', 'expAE05', 'expAE06'] for exp in experiments: name = f'{exp}' self.add_step( - SetUpExperiment(test_case=self, name=name, subdir=name, exp=exp)) - - + SetUpExperiment(test_case=self, name=name, + subdir=f"{exp}_{mesh_res}", exp=exp, + mesh_res=mesh_res)) def validate(self): """ diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 69a90ee78b..7a951fc4c2 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -19,7 +19,7 @@ class SetUpExperiment(Step): The resolution or mesh type of the test case """ - def __init__(self, test_case, name, subdir, exp): + def __init__(self, test_case, name, subdir, exp, mesh_res): """ Set up a new experiment @@ -36,7 +36,9 @@ def __init__(self, test_case, name, subdir, exp): self.exp = exp - super().__init__(test_case=test_case, name=name) + self.mesh_res = mesh_res + + super().__init__(test_case=test_case, name=name, subdir=subdir) def setup(self): From 6e050886ef51776c330c624bf5ecca58e2c20163 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 28 Oct 2022 00:53:30 -0700 Subject: [PATCH 16/43] Use different fcg intervals for ctrl/hist vs. projections --- compass/landice/tests/ismip6_run_ais/set_up_experiment.py | 4 ++++ compass/landice/tests/ismip6_run_ais/streams.landice.template | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 7a951fc4c2..01d4996652 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -96,6 +96,10 @@ def setup(self): stream_replacements['input_file_init_cond'] = 'USE_RESTART_FILE_INSTEAD' stream_replacements['input_file_region_mask'] = 'USE_RESTART_FILE_INSTEAD' stream_replacements['input_file_melt_params'] = 'USE_RESTART_FILE_INSTEAD' + if self.exp == 'hist' or self.exp == 'ctrlAE': + stream_replacements['forcing_interval'] = 'initial_only' + else: + stream_replacements['forcing_interval'] = '0001-00-00_00:00:00' self.add_streams_file( 'compass.landice.tests.ismip6_run_ais', 'streams.landice.template', diff --git a/compass/landice/tests/ismip6_run_ais/streams.landice.template b/compass/landice/tests/ismip6_run_ais/streams.landice.template index 5731959e9b..e4a8465583 100644 --- a/compass/landice/tests/ismip6_run_ais/streams.landice.template +++ b/compass/landice/tests/ismip6_run_ais/streams.landice.template @@ -33,7 +33,7 @@ type="input" mode="forward;analysis" filename_template="{{ input_file_SMB_forcing }}" - input_interval="0001-00-00_00:00:00" + input_interval="{{ forcing_interval }}" reference_time="2000-01-01_00:00:00" runtime_format="single_file"> @@ -43,7 +43,7 @@ type="input" mode="forward;analysis" filename_template="{{ input_file_TF_forcing }}" - input_interval="0001-00-00_00:00:00" + input_interval="{{ forcing_interval }}" reference_time="2000-01-01_00:00:00" runtime_format="single_file"> From 79ba477f8bcaa0998d6846315a27db96da19b0dc Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 28 Oct 2022 02:00:33 -0700 Subject: [PATCH 17/43] Don't symlink restart_timestamp --- .../landice/tests/ismip6_run_ais/set_up_experiment.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 01d4996652..4fe7799bf8 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -119,10 +119,13 @@ def setup(self): self.add_namelist_options(options=options, out_name='namelist.landice') - # For all projection runs, symlink the restart info for the historical run + # For all projection runs, symlink the restart file for the historical run + # don't symlink restart_timestamp or you'll have a mighty mess if not self.exp == 'hist': - os.symlink("../hist/restart_timestamp", os.path.join(self.work_dir, 'restart_timestamp')) - os.symlink("../hist/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) + os.symlink(f"../hist_{self.mesh_res}/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) + with open(os.path.join(self.work_dir, "restart_timestamp"), "w") as text_file: + text_file.write("2015-01-01_00:00:00") + # add the albany_input.yaml file self.add_input_file(filename='albany_input.yaml', From 77bc631e3c9e33d2cd3d9f25ef52c2df4e74deb2 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 28 Oct 2022 02:02:07 -0700 Subject: [PATCH 18/43] Finalize initial condition file on Cori --- compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index 72155677e7..207956e7e6 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -5,7 +5,7 @@ forcing_basepath = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res/tier1_experiments # Path to the initial condition file. User has to supply. -init_cond_path = /global/cscratch1/sd/hoffman2/AIS8km/q15GLP_optimizationResult_20220906/2022-10-26_PROJECTIONS_noCalving/historical/AIS8km_relaxation2000_20221016.nc +init_cond_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/relaxation_0TGmelt_10yr_muCap/AIS_8to30km_r01_20220906.smooth3.basinsFineTuned_carvedRonne_CIRWIP_relaxation_0TGmelt_10yr_muCap.nc # Path to the file for the basal melt parametrization coefficients. melt_params_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/basin_and_coeff_gamma0_DeltaT_quadratic_non_local.nc From 7488d2c0bbf9af2c93ac986afd71354d585df423 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 28 Oct 2022 08:19:13 -0700 Subject: [PATCH 19/43] Add missing slurm batch script and correct pio tasks --- .../tests/ismip6_run_ais/namelist.landice | 4 ++-- .../landice/tests/ismip6_run_ais/slurm.run | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 compass/landice/tests/ismip6_run_ais/slurm.run diff --git a/compass/landice/tests/ismip6_run_ais/namelist.landice b/compass/landice/tests/ismip6_run_ais/namelist.landice index 9da525a423..8268381da9 100644 --- a/compass/landice/tests/ismip6_run_ais/namelist.landice +++ b/compass/landice/tests/ismip6_run_ais/namelist.landice @@ -55,8 +55,8 @@ config_write_stats_on_startup = .false. config_stats_cell_ID = 1 config_write_output_on_startup = .true. - config_pio_num_iotasks = 5 - config_pio_stride = 36 + config_pio_num_iotasks = 10 + config_pio_stride = 32 config_always_compute_fem_grid = .true. diff --git a/compass/landice/tests/ismip6_run_ais/slurm.run b/compass/landice/tests/ismip6_run_ais/slurm.run new file mode 100644 index 0000000000..d219b1c2e9 --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/slurm.run @@ -0,0 +1,19 @@ +#!/bin/bash +#SBATCH --job-name={{ EXP }} +#SBATCH --account=m1795 +#SBATCH --nodes=5 +#SBATCH --tasks-per-node=64 +#SBATCH --exclusive +#SBATCH --time=12:00:00 +#SBATCH --qos=premium +#SBATCH --constraint=haswell + +LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"` +mkdir $LOGDIR +cp log* $LOGDIR + +# CHANGE THIS TO YOUR COMPASS LOAD SCRIPT! +source /global/cscratch1/sd/hoffman2/AIS8km/compass/load_dev_compass_1.2.0-alpha.1_cori-haswell_gnu_mpt_albany.sh +date +srun -n 320 --cpu-bind=cores --hint=nomultithread ./landice_model +date From c0693e49962da4b2deb7ae415eb8b1e7a81c8c15 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 4 Nov 2022 10:47:21 -0700 Subject: [PATCH 20/43] add tier 2a runs --- compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg | 2 +- .../landice/tests/ismip6_run_ais/projection/__init__.py | 4 ++++ .../landice/tests/ismip6_run_ais/set_up_experiment.py | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index 207956e7e6..cfd28a1776 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -2,7 +2,7 @@ [ismip6_run_ais] # Base path to the processed input ismip6 ocean and smb forcing files. User has to supply. -forcing_basepath = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res/tier1_experiments +forcing_basepath = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res # Path to the initial condition file. User has to supply. init_cond_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/relaxation_0TGmelt_10yr_muCap/AIS_8to30km_r01_20220906.smooth3.basinsFineTuned_carvedRonne_CIRWIP_relaxation_0TGmelt_10yr_muCap.nc diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py index 2666862acd..57c426abce 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -29,6 +29,10 @@ def __init__(self, test_group, mesh_res): experiments = ['hist', 'ctrlAE', 'expAE01', 'expAE02', 'expAE03', 'expAE04', 'expAE05', 'expAE06'] + for i in range(7, 10+1): + #for i in range(7, 14+1): + experiments.append(f'expAE{i:02}') + for exp in experiments: name = f'{exp}' self.add_step( diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 4fe7799bf8..bae4e7d619 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -58,6 +58,15 @@ def setup(self): region_mask_fname = os.path.split(region_mask_path)[-1] graph_files_path = section.get('graph_files_path') + # Figure out if the forcing is in tier1 or tier2 subdir + if 'exp' in self.exp: + if int(self.exp[-2:]) >= 7: + forcing_basepath = os.path.join(forcing_basepath, 'tier2_experiments') + else: + forcing_basepath = os.path.join(forcing_basepath, 'tier1_experiments') + else: + forcing_basepath = os.path.join(forcing_basepath, 'tier1_experiments') + # Copy files we'll need from local paths specified in cfg file if self.exp == 'hist': shutil.copy(init_cond_path, self.work_dir) From be7fb505595d75c79453f8c32ad806a94f995b33 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 4 Nov 2022 11:50:44 -0700 Subject: [PATCH 21/43] Generalize to work for 4 or 8 km --- .../landice/tests/ismip6_run_ais/__init__.py | 6 +--- .../tests/ismip6_run_ais/ismip6_run_ais.cfg | 7 ++++ .../ismip6_run_ais/projection/__init__.py | 8 ++--- .../tests/ismip6_run_ais/set_up_experiment.py | 32 +++++++++---------- .../landice/tests/ismip6_run_ais/slurm.04.run | 18 +++++++++++ .../{slurm.run => slurm.08.run} | 5 ++- 6 files changed, 45 insertions(+), 31 deletions(-) create mode 100644 compass/landice/tests/ismip6_run_ais/slurm.04.run rename compass/landice/tests/ismip6_run_ais/{slurm.run => slurm.08.run} (57%) diff --git a/compass/landice/tests/ismip6_run_ais/__init__.py b/compass/landice/tests/ismip6_run_ais/__init__.py index 03b952579b..d78054b6dd 100644 --- a/compass/landice/tests/ismip6_run_ais/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/__init__.py @@ -17,8 +17,4 @@ def __init__(self, mpas_core): """ super().__init__(mpas_core=mpas_core, name='ismip6_run_ais') - self.mesh_res = ['08'] - - for res in self.mesh_res: - self.add_test_case( - Projection(test_group=self, mesh_res=res)) + self.add_test_case(Projection(test_group=self)) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index cfd28a1776..25be2c89dd 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -1,6 +1,13 @@ # config options for ismip6 antarctic ice sheet data set [ismip6_run_ais] +# Resolution that will be set up. Should be one of 08, 04 with leading 0. The paths below must manually be set to be consistent +mesh_res = 04 + +# COMPASS load script path +# This is user-specific. +compass_load_path = /global/cscratch1/sd/hoffman2/AIS8km/compass/load_dev_compass_1.2.0-alpha.1_cori-haswell_gnu_mpt_albany.sh + # Base path to the processed input ismip6 ocean and smb forcing files. User has to supply. forcing_basepath = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py index 57c426abce..bd6c4c0a59 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -9,7 +9,7 @@ class Projection(TestCase): A test case for performing forward MALI runs of ISMIP6 Antaractic setup """ - def __init__(self, test_group, mesh_res): + def __init__(self, test_group): """ Create the test case @@ -18,9 +18,6 @@ def __init__(self, test_group, mesh_res): test_group : compass.landice.tests.ismip6_run_ais.Ismip6RunAIS The test group that this test case belongs to - mesh_type : {'mid', 'high'} - The resolution or type of mesh of the test case - """ name = 'ismip6AE' @@ -37,8 +34,7 @@ def __init__(self, test_group, mesh_res): name = f'{exp}' self.add_step( SetUpExperiment(test_case=self, name=name, - subdir=f"{exp}_{mesh_res}", exp=exp, - mesh_res=mesh_res)) + subdir=f"{exp}", exp=exp)) def validate(self): """ diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index bae4e7d619..2fd1bdf2f7 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -12,36 +12,26 @@ class SetUpExperiment(Step): Attributes ---------- - mesh_file : str - The name of the mesh file being used - - mesh_type : str - The resolution or mesh type of the test case """ - def __init__(self, test_case, name, subdir, exp, mesh_res): + def __init__(self, test_case, name, subdir, exp): """ Set up a new experiment Parameters ---------- - mesh_file : str - The name of the mesh file being used - - mesh_type : {'high', 'mid'} - The resolution or mesh type of the test case exp : experiment """ self.exp = exp - self.mesh_res = mesh_res - super().__init__(test_case=test_case, name=name, subdir=subdir) def setup(self): + print(f" Setting up experiment {self.exp}") + if self.exp == 'hist': exp_fcg = 'ctrlAE' else: @@ -49,6 +39,8 @@ def setup(self): config = self.config section = config['ismip6_run_ais'] + mesh_res = section.get('mesh_res') + compass_load_path = section.get('compass_load_path') forcing_basepath = section.get('forcing_basepath') init_cond_path = section.get('init_cond_path') init_cond_fname = os.path.split(init_cond_path)[-1] @@ -120,18 +112,23 @@ def setup(self): 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', out_name='namelist.landice') + if mesh_res == '04': + options = {'config_pio_num_iotasks': '60', + 'config_pio_stride': '64'} + self.add_namelist_options(options=options, + out_name='namelist.landice') + if self.exp == 'hist': options = {'config_do_restart': ".false.", 'config_start_time': "'2000-01-01_00:00:00'", 'config_stop_time': "'2015-01-01_00:00:00'"} - self.add_namelist_options(options=options, out_name='namelist.landice') # For all projection runs, symlink the restart file for the historical run # don't symlink restart_timestamp or you'll have a mighty mess if not self.exp == 'hist': - os.symlink(f"../hist_{self.mesh_res}/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) + os.symlink(f"../hist_{mesh_res}/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) with open(os.path.join(self.work_dir, "restart_timestamp"), "w") as text_file: text_file.write("2015-01-01_00:00:00") @@ -152,8 +149,9 @@ def setup(self): # provide an example submit script template = Template(resources.read_text( 'compass.landice.tests.ismip6_run_ais', - 'slurm.run')) - slurm_replacements = {'EXP': self.exp} + f'slurm.{mesh_res}.run')) + slurm_replacements = {'EXP': self.exp, + 'LOAD_SCRIPT': compass_load_path} rendered_text = template.render(slurm_replacements) with open(os.path.join(self.work_dir, 'slurm.run'), "w") as fh: fh.write(rendered_text) diff --git a/compass/landice/tests/ismip6_run_ais/slurm.04.run b/compass/landice/tests/ismip6_run_ais/slurm.04.run new file mode 100644 index 0000000000..2af599ba85 --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/slurm.04.run @@ -0,0 +1,18 @@ +#!/bin/bash +#SBATCH --job-name={{ EXP }} +#SBATCH --account=m1795 +#SBATCH --nodes=60 +#SBATCH --tasks-per-node=64 +#SBATCH --exclusive +#SBATCH --time=12:00:00 +#SBATCH --qos=regular +#SBATCH --constraint=haswell + +LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"` +mkdir $LOGDIR +cp log* $LOGDIR + +source {{ LOAD_SCRIPT }} +date +srun -n 3840 --cpu-bind=cores --hint=multithread ./landice_model +date diff --git a/compass/landice/tests/ismip6_run_ais/slurm.run b/compass/landice/tests/ismip6_run_ais/slurm.08.run similarity index 57% rename from compass/landice/tests/ismip6_run_ais/slurm.run rename to compass/landice/tests/ismip6_run_ais/slurm.08.run index d219b1c2e9..a1b78bb03b 100644 --- a/compass/landice/tests/ismip6_run_ais/slurm.run +++ b/compass/landice/tests/ismip6_run_ais/slurm.08.run @@ -12,8 +12,7 @@ LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"` mkdir $LOGDIR cp log* $LOGDIR -# CHANGE THIS TO YOUR COMPASS LOAD SCRIPT! -source /global/cscratch1/sd/hoffman2/AIS8km/compass/load_dev_compass_1.2.0-alpha.1_cori-haswell_gnu_mpt_albany.sh +source {{ LOAD_SCRIPT }} date -srun -n 320 --cpu-bind=cores --hint=nomultithread ./landice_model +srun -n 320 --cpu-bind=cores --hint=multithread ./landice_model date From ccd27b2098295421d564bbf3534cb23fe94bdc9e Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Sun, 6 Nov 2022 08:06:04 -0800 Subject: [PATCH 22/43] Minor tweaks for cleaner setup --- compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg | 2 +- compass/landice/tests/ismip6_run_ais/set_up_experiment.py | 4 ++-- compass/landice/tests/ismip6_run_ais/slurm.08.run | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index 25be2c89dd..475bc73f5f 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -2,7 +2,7 @@ [ismip6_run_ais] # Resolution that will be set up. Should be one of 08, 04 with leading 0. The paths below must manually be set to be consistent -mesh_res = 04 +mesh_res = 08 # COMPASS load script path # This is user-specific. diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 2fd1bdf2f7..9850c201c8 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -128,7 +128,7 @@ def setup(self): # For all projection runs, symlink the restart file for the historical run # don't symlink restart_timestamp or you'll have a mighty mess if not self.exp == 'hist': - os.symlink(f"../hist_{mesh_res}/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) + os.symlink(f"../hist/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) with open(os.path.join(self.work_dir, "restart_timestamp"), "w") as text_file: text_file.write("2015-01-01_00:00:00") @@ -150,7 +150,7 @@ def setup(self): template = Template(resources.read_text( 'compass.landice.tests.ismip6_run_ais', f'slurm.{mesh_res}.run')) - slurm_replacements = {'EXP': self.exp, + slurm_replacements = {'EXP': f'{self.exp}_{mesh_res}', 'LOAD_SCRIPT': compass_load_path} rendered_text = template.render(slurm_replacements) with open(os.path.join(self.work_dir, 'slurm.run'), "w") as fh: diff --git a/compass/landice/tests/ismip6_run_ais/slurm.08.run b/compass/landice/tests/ismip6_run_ais/slurm.08.run index a1b78bb03b..5a3eedc217 100644 --- a/compass/landice/tests/ismip6_run_ais/slurm.08.run +++ b/compass/landice/tests/ismip6_run_ais/slurm.08.run @@ -4,8 +4,8 @@ #SBATCH --nodes=5 #SBATCH --tasks-per-node=64 #SBATCH --exclusive -#SBATCH --time=12:00:00 -#SBATCH --qos=premium +#SBATCH --time=15:00:00 +#SBATCH --qos=regular #SBATCH --constraint=haswell LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"` From d8c510e253626497ddcc64af2e0bec53aade2a7d Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Tue, 15 Nov 2022 14:55:37 -0800 Subject: [PATCH 23/43] Add changes for Tier 2b experiments These are ones that use a calving mask, so there is an additional input as well as different streams and nl options to adjust. --- .../ismip6_run_ais/projection/__init__.py | 5 ++-- .../tests/ismip6_run_ais/set_up_experiment.py | 27 +++++++++++++++++++ .../ismip6_run_ais/streams.landice.template | 11 ++++++++ 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py index bd6c4c0a59..4e327a9023 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -24,10 +24,11 @@ def __init__(self, test_group): super().__init__(test_group=test_group, name=name, subdir=name) + # tier 1 experiments = ['hist', 'ctrlAE', 'expAE01', 'expAE02', 'expAE03', 'expAE04', 'expAE05', 'expAE06'] - for i in range(7, 10+1): - #for i in range(7, 14+1): + # tier 2 + for i in range(7, 14+1): experiments.append(f'expAE{i:02}') for exp in experiments: diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 9850c201c8..30d3915029 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -84,6 +84,21 @@ def setup(self): else: sys.exit(f"ERROR: Did not find exactly one matching TF file at {tf_search_path}: {fcgFileList}") + # copy calving mask files for exp11-14 + useCalvingMask = False + if exp_fcg[-2:].isdigit(): + exp_num = int(exp_fcg[-2:]) + if exp_num >= 11: + mask_search_path = os.path.join(forcing_basepath, exp_fcg, 'Antarctica_8to30km_ice_shelf_collapse_mask_*.nc') + fcgFileList = glob.glob(mask_search_path) + if len(fcgFileList) == 1: + mask_path = fcgFileList[0] + mask_fname = os.path.split(mask_path)[-1] + shutil.copy(mask_path, self.work_dir) + useCalvingMask = True + else: + sys.exit(f"ERROR: Did not find exactly one matching calving mask file at {mask_search_path}: {fcgFileList}") + # Make stream modifications based on files that were determined above stream_replacements = { 'input_file_SMB_forcing': smb_fname, @@ -101,6 +116,13 @@ def setup(self): stream_replacements['forcing_interval'] = 'initial_only' else: stream_replacements['forcing_interval'] = '0001-00-00_00:00:00' + if useCalvingMask: + stream_replacements['input_file_calving_mask_active'] = 'input' + stream_replacements['input_file_calving_mask_forcing_name'] = mask_fname + else: + stream_replacements['input_file_calving_mask_active'] = 'none' + stream_replacements['input_file_calving_mask_forcing_name'] = 'UNUSED' + self.add_streams_file( 'compass.landice.tests.ismip6_run_ais', 'streams.landice.template', @@ -125,6 +147,11 @@ def setup(self): self.add_namelist_options(options=options, out_name='namelist.landice') + if useCalvingMask: + options = {'config_calving': "'mask'"} + self.add_namelist_options(options=options, + out_name='namelist.landice') + # For all projection runs, symlink the restart file for the historical run # don't symlink restart_timestamp or you'll have a mighty mess if not self.exp == 'hist': diff --git a/compass/landice/tests/ismip6_run_ais/streams.landice.template b/compass/landice/tests/ismip6_run_ais/streams.landice.template index e4a8465583..2c81455934 100644 --- a/compass/landice/tests/ismip6_run_ais/streams.landice.template +++ b/compass/landice/tests/ismip6_run_ais/streams.landice.template @@ -61,6 +61,16 @@ + + + + + From 254fb0f7ec1047f326e05a205628a4a6e3f4ac67 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 21 Nov 2022 09:02:44 -0800 Subject: [PATCH 24/43] Update for runs with calving mask after recent MALI updates Recent MALI updates reorganized the implementation of the calving mask and restore calving front functionality. This commit adjusts the ismip6 run setup to account for that. Also modify the way the previous commit adds the calving mask stream to do it the way compass intends. --- .../tests/ismip6_run_ais/namelist.landice | 2 ++ .../tests/ismip6_run_ais/set_up_experiment.py | 17 +++++++++-------- .../ismip6_run_ais/streams.landice.template | 10 ---------- .../tests/ismip6_run_ais/streams.mask_calving | 11 +++++++++++ 4 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 compass/landice/tests/ismip6_run_ais/streams.mask_calving diff --git a/compass/landice/tests/ismip6_run_ais/namelist.landice b/compass/landice/tests/ismip6_run_ais/namelist.landice index 8268381da9..f1fe888330 100644 --- a/compass/landice/tests/ismip6_run_ais/namelist.landice +++ b/compass/landice/tests/ismip6_run_ais/namelist.landice @@ -7,6 +7,8 @@ config_tracer_advection = 'fo' config_calving = 'none' + config_apply_calving_mask = .false. + config_restore_calving_front_prevent_retreat = .false. config_calculate_damage = .true. config_damage_calving_threshold = 0.95 config_damage_calving_method = 'none' diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 30d3915029..b91f046f3b 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -116,19 +116,19 @@ def setup(self): stream_replacements['forcing_interval'] = 'initial_only' else: stream_replacements['forcing_interval'] = '0001-00-00_00:00:00' - if useCalvingMask: - stream_replacements['input_file_calving_mask_active'] = 'input' - stream_replacements['input_file_calving_mask_forcing_name'] = mask_fname - else: - stream_replacements['input_file_calving_mask_active'] = 'none' - stream_replacements['input_file_calving_mask_forcing_name'] = 'UNUSED' - self.add_streams_file( 'compass.landice.tests.ismip6_run_ais', 'streams.landice.template', out_name='streams.landice', template_replacements=stream_replacements) + if useCalvingMask: + mask_stream_replacements['input_file_calving_mask_forcing_name'] = mask_fname + self.add_streams_file( + 'compass.landice.tests.ismip6_run_ais', 'streams.mask_calving', + out_name='streams.landice', + template_replacements=mask_stream_replacements) + # Set up namelist and customize as needed self.add_namelist_file( 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', @@ -148,7 +148,8 @@ def setup(self): out_name='namelist.landice') if useCalvingMask: - options = {'config_calving': "'mask'"} + options = {'config_calving': "'none'", + 'config_apply_calving_mask': ".true."} self.add_namelist_options(options=options, out_name='namelist.landice') diff --git a/compass/landice/tests/ismip6_run_ais/streams.landice.template b/compass/landice/tests/ismip6_run_ais/streams.landice.template index 2c81455934..a5dd330d8d 100644 --- a/compass/landice/tests/ismip6_run_ais/streams.landice.template +++ b/compass/landice/tests/ismip6_run_ais/streams.landice.template @@ -61,16 +61,6 @@ - - - - + + + + From 923217df0eb2de3a405e1206ae32f0f7f2483936 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 21 Nov 2022 09:13:12 -0800 Subject: [PATCH 25/43] Create the ability to use vM calving and apply it for the 4km config --- .../tests/ismip6_run_ais/ismip6_run_ais.cfg | 3 ++ .../tests/ismip6_run_ais/set_up_experiment.py | 34 +++++++++++++++---- .../tests/ismip6_run_ais/streams.mask_calving | 4 ++- .../tests/ismip6_run_ais/streams.vM_params | 13 +++++++ 4 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 compass/landice/tests/ismip6_run_ais/streams.vM_params diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index 475bc73f5f..371f57b677 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -20,5 +20,8 @@ melt_params_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300 # Path to the region mask file region_mask_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/AIS_8to30km_r01_20220607.regionMask_ismip6.nc +# Path to the file containing the von Mises parameter fields groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. Only required for configurations that use von Mises calving (currently 4 km only) +von_mises_parameter_path = UNKNOWN + # Path to the directory containing graph files graph_files_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027 diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index b91f046f3b..37169506dc 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -32,11 +32,6 @@ def setup(self): print(f" Setting up experiment {self.exp}") - if self.exp == 'hist': - exp_fcg = 'ctrlAE' - else: - exp_fcg = self.exp - config = self.config section = config['ismip6_run_ais'] mesh_res = section.get('mesh_res') @@ -50,6 +45,17 @@ def setup(self): region_mask_fname = os.path.split(region_mask_path)[-1] graph_files_path = section.get('graph_files_path') + if self.exp == 'hist': + exp_fcg = 'ctrlAE' + else: + exp_fcg = self.exp + + # We chose to use vM calving at 4km but restore calving at 8km + if mesh_res == '04': + use_vM_calving = True + else: + use_vM_calving = False + # Figure out if the forcing is in tier1 or tier2 subdir if 'exp' in self.exp: if int(self.exp[-2:]) >= 7: @@ -123,12 +129,20 @@ def setup(self): template_replacements=stream_replacements) if useCalvingMask: - mask_stream_replacements['input_file_calving_mask_forcing_name'] = mask_fname + mask_stream_replacements = {'input_file_calving_mask_forcing_name': mask_fname} self.add_streams_file( 'compass.landice.tests.ismip6_run_ais', 'streams.mask_calving', out_name='streams.landice', template_replacements=mask_stream_replacements) + if use_vM_calving: + vM_param_path = section.get('von_mises_parameter_path') + vM_stream_replacements = {'input_file_VM_params': vM_param_path} + self.add_streams_file( + 'compass.landice.tests.ismip6_run_ais', 'streams.vM_params', + out_name='streams.landice', + template_replacements=vM_stream_replacements) + # Set up namelist and customize as needed self.add_namelist_file( 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', @@ -147,6 +161,14 @@ def setup(self): self.add_namelist_options(options=options, out_name='namelist.landice') + if use_vM_calving: + options = {'config_calving': "'von_Mises_stress'", + 'config_restore_calving_front': ".false.", + 'config_floating_von_Mises_threshold_stress_source': "'data'", + 'config_grounded_von_Mises_threshold_stress_source': "'data'"} + self.add_namelist_options(options=options, + out_name='namelist.landice') + if useCalvingMask: options = {'config_calving': "'none'", 'config_apply_calving_mask': ".true."} diff --git a/compass/landice/tests/ismip6_run_ais/streams.mask_calving b/compass/landice/tests/ismip6_run_ais/streams.mask_calving index b3744dc99f..d4418a653f 100644 --- a/compass/landice/tests/ismip6_run_ais/streams.mask_calving +++ b/compass/landice/tests/ismip6_run_ais/streams.mask_calving @@ -1,3 +1,5 @@ + + - + diff --git a/compass/landice/tests/ismip6_run_ais/streams.vM_params b/compass/landice/tests/ismip6_run_ais/streams.vM_params new file mode 100644 index 0000000000..f7ce35a840 --- /dev/null +++ b/compass/landice/tests/ismip6_run_ais/streams.vM_params @@ -0,0 +1,13 @@ + + + + + + + + From 8566f5201a70d1c48d41326559d3903f93c21870 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Sun, 12 Feb 2023 19:53:47 -0800 Subject: [PATCH 26/43] Make list of experiments to set up defined in cfg --- .../tests/ismip6_run_ais/ismip6_run_ais.cfg | 6 ++ .../ismip6_run_ais/projection/__init__.py | 59 ++++++++++++------- 2 files changed, 44 insertions(+), 21 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index 371f57b677..fc8e5b07d6 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -1,6 +1,12 @@ # config options for ismip6 antarctic ice sheet data set [ismip6_run_ais] +# list of experiments to set up. +# Can be "tier1", "tier2", "all", or a comma-delimited list of runs +# "tier1" is expAE01-expAE06 plus hist and ctrlAE +# "tier2" is expAE07-expAE14 +exp_list = tier1 + # Resolution that will be set up. Should be one of 08, 04 with leading 0. The paths below must manually be set to be consistent mesh_res = 08 diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run_ais/projection/__init__.py index 4e327a9023..a76e6d7bce 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run_ais/projection/__init__.py @@ -3,6 +3,8 @@ import SetUpExperiment from compass.validate import compare_variables +import os + class Projection(TestCase): """ @@ -24,26 +26,41 @@ def __init__(self, test_group): super().__init__(test_group=test_group, name=name, subdir=name) - # tier 1 - experiments = ['hist', 'ctrlAE', 'expAE01', 'expAE02', 'expAE03', - 'expAE04', 'expAE05', 'expAE06'] - # tier 2 - for i in range(7, 14+1): - experiments.append(f'expAE{i:02}') - - for exp in experiments: - name = f'{exp}' - self.add_step( - SetUpExperiment(test_case=self, name=name, - subdir=f"{exp}", exp=exp)) - - def validate(self): + def configure(self): """ - Test cases can override this method to perform validation of variables - and timers + Set up the desired ISMIP6 experiments. + + Read the list from the config of which experiemnts the + user wants to set up. Call thee add_step method and add the + experiment to steps_to_run. Those operations are typically done + in the constructor, but they are done here so that the list to set up + can be adjusted in the config, and the config is not available until + this point. """ - var_list = ['thickness'] - filename = f'{self.steps["run_model"].subdir}/output.nc' - compare_variables(test_case=self, - variables=var_list, - filename1=filename) + exp_list = self.config.get('ismip6_run_ais', 'exp_list') + if exp_list == "tier1": + exp_list = ['hist', 'ctrlAE'] + \ + [f'expAE{i:02}' for i in range(1, 7)] + elif exp_list == "tier2": + exp_list = [f'expAE{i:02}' for i in range(7, 15)] + elif exp_list == "all": + exp_list = ['hist', 'ctrlAE'] + \ + [f'expAE{i:02}' for i in range(1, 15)] + else: + exp_list = exp_list.split(",") + + for exp in exp_list: + if os.path.exists(os.path.join(self.work_dir, exp)): + print(f"WARNING: {exp} path already exists; skipping. " + "Please remove the directory " + f"{os.path.join(self.work_dir, exp)} and execute " + "'compass setup' again to set this experiment up.") + else: + self.add_step( + SetUpExperiment(test_case=self, name=exp, + subdir=exp, exp=exp)) + self.steps_to_run.append(exp) + + # no run() method is needed + + # no validate() method is needed From 10f672990c415823d686abb86f664849fc4eb704 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 13 Feb 2023 19:59:45 -0800 Subject: [PATCH 27/43] Make resolutions in cfg integers instead of strings --- .../landice/tests/ismip6_run_ais/ismip6_run_ais.cfg | 6 ++++-- .../tests/ismip6_run_ais/set_up_experiment.py | 12 ++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index fc8e5b07d6..2f7056b9ca 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -7,8 +7,10 @@ # "tier2" is expAE07-expAE14 exp_list = tier1 -# Resolution that will be set up. Should be one of 08, 04 with leading 0. The paths below must manually be set to be consistent -mesh_res = 08 +# Resolution that will be set up, in km. Should be one of 4, 8, as those are +# the two resolutions currently supported. +# The paths below must manually be set to be consistent. +mesh_res = 8 # COMPASS load script path # This is user-specific. diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 37169506dc..67cbae5562 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -34,7 +34,7 @@ def setup(self): config = self.config section = config['ismip6_run_ais'] - mesh_res = section.get('mesh_res') + mesh_res = section.getint('mesh_res') compass_load_path = section.get('compass_load_path') forcing_basepath = section.get('forcing_basepath') init_cond_path = section.get('init_cond_path') @@ -51,7 +51,7 @@ def setup(self): exp_fcg = self.exp # We chose to use vM calving at 4km but restore calving at 8km - if mesh_res == '04': + if mesh_res == 4: use_vM_calving = True else: use_vM_calving = False @@ -118,7 +118,7 @@ def setup(self): stream_replacements['input_file_init_cond'] = 'USE_RESTART_FILE_INSTEAD' stream_replacements['input_file_region_mask'] = 'USE_RESTART_FILE_INSTEAD' stream_replacements['input_file_melt_params'] = 'USE_RESTART_FILE_INSTEAD' - if self.exp == 'hist' or self.exp == 'ctrlAE': + if self.exp in ['hist', 'ctrlAE']: stream_replacements['forcing_interval'] = 'initial_only' else: stream_replacements['forcing_interval'] = '0001-00-00_00:00:00' @@ -148,7 +148,7 @@ def setup(self): 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', out_name='namelist.landice') - if mesh_res == '04': + if mesh_res == 4: options = {'config_pio_num_iotasks': '60', 'config_pio_stride': '64'} self.add_namelist_options(options=options, @@ -199,8 +199,8 @@ def setup(self): # provide an example submit script template = Template(resources.read_text( 'compass.landice.tests.ismip6_run_ais', - f'slurm.{mesh_res}.run')) - slurm_replacements = {'EXP': f'{self.exp}_{mesh_res}', + f'slurm.{mesh_res:02d}.run')) + slurm_replacements = {'EXP': f'{self.exp}_{mesh_res:02d}', 'LOAD_SCRIPT': compass_load_path} rendered_text = template.render(slurm_replacements) with open(os.path.join(self.work_dir, 'slurm.run'), "w") as fh: From 4ba358232b1863745e03570ce862c8d5dff667d9 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 13 Feb 2023 20:04:40 -0800 Subject: [PATCH 28/43] Remove references to compass load script They can be referenced as a relative path instead. --- compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg | 4 ---- compass/landice/tests/ismip6_run_ais/set_up_experiment.py | 4 +--- compass/landice/tests/ismip6_run_ais/slurm.04.run | 2 +- compass/landice/tests/ismip6_run_ais/slurm.08.run | 2 +- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg index 2f7056b9ca..fc28866165 100644 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg @@ -12,10 +12,6 @@ exp_list = tier1 # The paths below must manually be set to be consistent. mesh_res = 8 -# COMPASS load script path -# This is user-specific. -compass_load_path = /global/cscratch1/sd/hoffman2/AIS8km/compass/load_dev_compass_1.2.0-alpha.1_cori-haswell_gnu_mpt_albany.sh - # Base path to the processed input ismip6 ocean and smb forcing files. User has to supply. forcing_basepath = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py index 67cbae5562..4447fe41af 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run_ais/set_up_experiment.py @@ -35,7 +35,6 @@ def setup(self): config = self.config section = config['ismip6_run_ais'] mesh_res = section.getint('mesh_res') - compass_load_path = section.get('compass_load_path') forcing_basepath = section.get('forcing_basepath') init_cond_path = section.get('init_cond_path') init_cond_fname = os.path.split(init_cond_path)[-1] @@ -200,8 +199,7 @@ def setup(self): template = Template(resources.read_text( 'compass.landice.tests.ismip6_run_ais', f'slurm.{mesh_res:02d}.run')) - slurm_replacements = {'EXP': f'{self.exp}_{mesh_res:02d}', - 'LOAD_SCRIPT': compass_load_path} + slurm_replacements = {'EXP': f'{self.exp}_{mesh_res:02d}'} rendered_text = template.render(slurm_replacements) with open(os.path.join(self.work_dir, 'slurm.run'), "w") as fh: fh.write(rendered_text) diff --git a/compass/landice/tests/ismip6_run_ais/slurm.04.run b/compass/landice/tests/ismip6_run_ais/slurm.04.run index 2af599ba85..3412ea0798 100644 --- a/compass/landice/tests/ismip6_run_ais/slurm.04.run +++ b/compass/landice/tests/ismip6_run_ais/slurm.04.run @@ -12,7 +12,7 @@ LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"` mkdir $LOGDIR cp log* $LOGDIR -source {{ LOAD_SCRIPT }} +source ../load_compass_env.sh date srun -n 3840 --cpu-bind=cores --hint=multithread ./landice_model date diff --git a/compass/landice/tests/ismip6_run_ais/slurm.08.run b/compass/landice/tests/ismip6_run_ais/slurm.08.run index 5a3eedc217..2a1bc1659d 100644 --- a/compass/landice/tests/ismip6_run_ais/slurm.08.run +++ b/compass/landice/tests/ismip6_run_ais/slurm.08.run @@ -12,7 +12,7 @@ LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"` mkdir $LOGDIR cp log* $LOGDIR -source {{ LOAD_SCRIPT }} +source ../load_compass_env.sh date srun -n 320 --cpu-bind=cores --hint=multithread ./landice_model date From a7ec870d380f323a048024ee6ffaa80ac1a82010 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 13 Mar 2023 10:18:55 -0700 Subject: [PATCH 29/43] Major reorganization Make testgroup=ismip6_run, testcase=ismip6_ais_proj2300. This will allow other ISMIP6 experiments (e.g. Greenland) to be other test cases in this test group. I moved all modules and resources into the testcase level. If other testcases are added, it may be possible to generalize some pieces and move them to the testgroup level, but it also may turn out easier to have dedicated version for each ensemble. --- compass/landice/__init__.py | 4 +- compass/landice/tests/ismip6_run/__init__.py | 22 +++ .../ismip6_ais_proj2300}/__init__.py | 28 ++-- .../ismip6_ais_proj2300}/albany_input.yaml | 133 +++++++++--------- .../ismip6_ais_proj2300.cfg | 39 +++++ .../ismip6_ais_proj2300}/namelist.landice | 0 .../ismip6_ais_proj2300}/set_up_experiment.py | 128 ++++++++++------- .../ismip6_ais_proj2300}/slurm.04.run | 0 .../ismip6_ais_proj2300}/slurm.08.run | 0 .../streams.landice.template | 0 .../ismip6_ais_proj2300}/streams.mask_calving | 0 .../ismip6_ais_proj2300}/streams.vM_params | 0 .../landice/tests/ismip6_run_ais/__init__.py | 20 --- .../tests/ismip6_run_ais/ismip6_run_ais.cfg | 31 ---- 14 files changed, 224 insertions(+), 181 deletions(-) create mode 100644 compass/landice/tests/ismip6_run/__init__.py rename compass/landice/tests/{ismip6_run_ais/projection => ismip6_run/ismip6_ais_proj2300}/__init__.py (71%) rename compass/landice/tests/{ismip6_run_ais => ismip6_run/ismip6_ais_proj2300}/albany_input.yaml (82%) create mode 100644 compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg rename compass/landice/tests/{ismip6_run_ais => ismip6_run/ismip6_ais_proj2300}/namelist.landice (100%) rename compass/landice/tests/{ismip6_run_ais => ismip6_run/ismip6_ais_proj2300}/set_up_experiment.py (67%) rename compass/landice/tests/{ismip6_run_ais => ismip6_run/ismip6_ais_proj2300}/slurm.04.run (100%) rename compass/landice/tests/{ismip6_run_ais => ismip6_run/ismip6_ais_proj2300}/slurm.08.run (100%) rename compass/landice/tests/{ismip6_run_ais => ismip6_run/ismip6_ais_proj2300}/streams.landice.template (100%) rename compass/landice/tests/{ismip6_run_ais => ismip6_run/ismip6_ais_proj2300}/streams.mask_calving (100%) rename compass/landice/tests/{ismip6_run_ais => ismip6_run/ismip6_ais_proj2300}/streams.vM_params (100%) delete mode 100644 compass/landice/tests/ismip6_run_ais/__init__.py delete mode 100644 compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg diff --git a/compass/landice/__init__.py b/compass/landice/__init__.py index 61e5935d51..88844c50fa 100644 --- a/compass/landice/__init__.py +++ b/compass/landice/__init__.py @@ -9,7 +9,7 @@ from compass.landice.tests.humboldt import Humboldt from compass.landice.tests.hydro_radial import HydroRadial from compass.landice.tests.ismip6_forcing import Ismip6Forcing -from compass.landice.tests.ismip6_run_ais import Ismip6RunAIS +from compass.landice.tests.ismip6_run import Ismip6Run from compass.landice.tests.kangerlussuaq import Kangerlussuaq from compass.landice.tests.koge_bugt_s import KogeBugtS from compass.landice.tests.mismipplus import MISMIPplus @@ -39,7 +39,7 @@ def __init__(self): self.add_test_group(Humboldt(mpas_core=self)) self.add_test_group(HydroRadial(mpas_core=self)) self.add_test_group(Ismip6Forcing(mpas_core=self)) - self.add_test_group(Ismip6RunAIS(mpas_core=self)) + self.add_test_group(Ismip6Run(mpas_core=self)) self.add_test_group(Kangerlussuaq(mpas_core=self)) self.add_test_group(KogeBugtS(mpas_core=self)) self.add_test_group(MISMIPplus(mpas_core=self)) diff --git a/compass/landice/tests/ismip6_run/__init__.py b/compass/landice/tests/ismip6_run/__init__.py new file mode 100644 index 0000000000..f4faaa4f4c --- /dev/null +++ b/compass/landice/tests/ismip6_run/__init__.py @@ -0,0 +1,22 @@ +from compass.landice.tests.ismip6_run.ismip6_ais_proj2300 import ( + Ismip6AisProj2300, +) +from compass.testgroup import TestGroup + + +class Ismip6Run(TestGroup): + """ + A test group for automated setup of a suite of standardized + ISMIP6 simulations + + Attributes + ---------- + """ + def __init__(self, mpas_core): + """ + mpas_core : compass.landice.Landice + the MPAS core that this test group belongs to + """ + super().__init__(mpas_core=mpas_core, name='ismip6_run') + + self.add_test_case(Ismip6AisProj2300(test_group=self)) diff --git a/compass/landice/tests/ismip6_run_ais/projection/__init__.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py similarity index 71% rename from compass/landice/tests/ismip6_run_ais/projection/__init__.py rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py index a76e6d7bce..c4ea323adb 100644 --- a/compass/landice/tests/ismip6_run_ais/projection/__init__.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py @@ -1,14 +1,16 @@ -from compass.testcase import TestCase -from compass.landice.tests.ismip6_run_ais.set_up_experiment \ - import SetUpExperiment -from compass.validate import compare_variables - import os +from compass.landice.tests.ismip6_run.ismip6_ais_proj2300.set_up_experiment import ( # noqa + SetUpExperiment, +) +from compass.testcase import TestCase -class Projection(TestCase): + +class Ismip6AisProj2300(TestCase): """ - A test case for performing forward MALI runs of ISMIP6 Antaractic setup + A test case for automated setup of a suite of standardized + simulations for ISMIP6-Projections2300-Antarctica + See: https://www.climate-cryosphere.org/wiki/index.php?title=ISMIP6-Projections2300-Antarctica) # noqa """ def __init__(self, test_group): @@ -17,18 +19,18 @@ def __init__(self, test_group): Parameters ---------- - test_group : compass.landice.tests.ismip6_run_ais.Ismip6RunAIS + test_group : compass.landice.tests.ismip6_run.Ismip6Run The test group that this test case belongs to """ - name = 'ismip6AE' + name = 'ismip6_ais_proj2300' super().__init__(test_group=test_group, name=name, subdir=name) def configure(self): """ - Set up the desired ISMIP6 experiments. + Set up the desired ISMIP6 AIS 2300 experiments. Read the list from the config of which experiemnts the user wants to set up. Call thee add_step method and add the @@ -37,7 +39,10 @@ def configure(self): can be adjusted in the config, and the config is not available until this point. """ - exp_list = self.config.get('ismip6_run_ais', 'exp_list') + + # user can specify any of: 'all', 'tier1', 'tier2', or a + # comma-delimited list (or a single experiment) + exp_list = self.config.get('ismip6_run_ais_2300', 'exp_list') if exp_list == "tier1": exp_list = ['hist', 'ctrlAE'] + \ [f'expAE{i:02}' for i in range(1, 7)] @@ -59,7 +64,6 @@ def configure(self): self.add_step( SetUpExperiment(test_case=self, name=exp, subdir=exp, exp=exp)) - self.steps_to_run.append(exp) # no run() method is needed diff --git a/compass/landice/tests/ismip6_run_ais/albany_input.yaml b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/albany_input.yaml similarity index 82% rename from compass/landice/tests/ismip6_run_ais/albany_input.yaml rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/albany_input.yaml index ac988df20f..eb6d99d9fe 100644 --- a/compass/landice/tests/ismip6_run_ais/albany_input.yaml +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/albany_input.yaml @@ -1,8 +1,8 @@ %YAML 1.1 --- ANONYMOUS: -# In order to use ML, change Tpetra to Epetra in the following line, -# and "Preconditioner Type: MueLu" to " Preconditioner Type: ML" several lines below +# In order to use ML, change Tpetra to Epetra in the following line, +# and "Preconditioner Type: MueLu" to " Preconditioner Type: ML" several lines below Build Type: Tpetra Problem: @@ -16,7 +16,7 @@ ANONYMOUS: Basal Friction Coefficient: Type: Power Law Power Exponent: 0.2 - Mu Type: Field + Mu Type: Field Effective Pressure Type: Constant Effective Pressure: 1.0 # Zero Effective Pressure On Floating Ice At Nodes: true @@ -25,33 +25,33 @@ ANONYMOUS: # Discretization Description Discretization: #Exodus Output File Name: albany_output.exo - - Piro: + + Piro: # Nonlinear Solver Information - NOX: + NOX: Nonlinear Solver: Line Search Based - Line Search: - Full Step: + Line Search: + Full Step: Full Step: 1.0e+00 Method: Backtrack - Solver Options: + Solver Options: Status Test Check Type: Minimal - Status Tests: + Status Tests: Test Type: Combo Combo Type: OR Number of Tests: 2 - Test 0: + Test 0: Test Type: NormF Norm Type: Two Norm Scale Type: Scaled Tolerance: 1.0e-05 - Test 1: + Test 1: Test Type: MaxIters Maximum Iterations: 50 - Printing: + Printing: Output Precision: 3 Output Processor: 0 - Output Information: + Output Information: Error: true Warning: true Outer Iteration: true @@ -62,24 +62,24 @@ ANONYMOUS: Stepper Details: true Stepper Parameters: true - Direction: + Direction: Method: Newton - Newton: + Newton: Forcing Term Method: Constant Rescue Bad Newton Solve: true Linear Solver: Write Linear System: false Tolerance: 1.0e-8 - - Stratimikos Linear Solver: + + Stratimikos Linear Solver: Stratimikos: - + # Linear Solver Information Linear Solver Type: Belos - Linear Solver Types: - AztecOO: - Forward Solve: - AztecOO Settings: + Linear Solver Types: + AztecOO: + Forward Solve: + AztecOO Settings: Aztec Solver: GMRES Convergence Test: r0 Size of Krylov Subspace: 200 @@ -99,139 +99,139 @@ ANONYMOUS: VerboseObject: Output File: none Verbosity Level: low - + # Preconditioner Information Preconditioner Type: MueLu - Preconditioner Types: - - Ifpack: + Preconditioner Types: + + Ifpack: Overlap: 1 Prec Type: ILU - Ifpack Settings: + Ifpack Settings: 'fact: level-of-fill': 0 - - Ifpack2: + + Ifpack2: Overlap: 1 - Prec Type: ILUT - - MueLu: - Matrix: + Prec Type: ILUT + + MueLu: + Matrix: PDE equations: 2 - Factories: - myLineDetectionFact: + Factories: + myLineDetectionFact: factory: LineDetectionFactory 'linedetection: orientation': coordinates - mySemiCoarsenPFact1: + mySemiCoarsenPFact1: factory: SemiCoarsenPFactory 'semicoarsen: coarsen rate': 14 - UncoupledAggregationFact2: + UncoupledAggregationFact2: factory: UncoupledAggregationFactory 'aggregation: ordering': graph 'aggregation: max selected neighbors': 0 'aggregation: min agg size': 3 'aggregation: phase3 avoid singletons': true - MyCoarseMap2: + MyCoarseMap2: factory: CoarseMapFactory Aggregates: UncoupledAggregationFact2 - myTentativePFact2: + myTentativePFact2: 'tentative: calculate qr': true factory: TentativePFactory Aggregates: UncoupledAggregationFact2 CoarseMap: MyCoarseMap2 - mySaPFact2: + mySaPFact2: 'sa: eigenvalue estimate num iterations': 10 'sa: damping factor': 1.33333e+00 factory: SaPFactory P: myTentativePFact2 - myTransferCoordinatesFact: + myTransferCoordinatesFact: factory: CoordinatesTransferFactory CoarseMap: MyCoarseMap2 Aggregates: UncoupledAggregationFact2 - myTogglePFact: + myTogglePFact: factory: TogglePFactory 'semicoarsen: number of levels': 2 - TransferFactories: + TransferFactories: P1: mySemiCoarsenPFact1 P2: mySaPFact2 Ptent1: mySemiCoarsenPFact1 Ptent2: myTentativePFact2 Nullspace1: mySemiCoarsenPFact1 Nullspace2: myTentativePFact2 - myRestrictorFact: + myRestrictorFact: factory: TransPFactory P: myTogglePFact - myToggleTransferCoordinatesFact: + myToggleTransferCoordinatesFact: factory: ToggleCoordinatesTransferFactory Chosen P: myTogglePFact - TransferFactories: + TransferFactories: Coordinates1: mySemiCoarsenPFact1 Coordinates2: myTransferCoordinatesFact - myRAPFact: + myRAPFact: factory: RAPFactory P: myTogglePFact R: myRestrictorFact - TransferFactories: + TransferFactories: For Coordinates: myToggleTransferCoordinatesFact - myRepartitionHeuristicFact: + myRepartitionHeuristicFact: factory: RepartitionHeuristicFactory A: myRAPFact 'repartition: min rows per proc': 3000 'repartition: max imbalance': 1.327e+00 'repartition: start level': 1 - myZoltanInterface: + myZoltanInterface: factory: ZoltanInterface A: myRAPFact Coordinates: myToggleTransferCoordinatesFact number of partitions: myRepartitionHeuristicFact - myRepartitionFact: + myRepartitionFact: factory: RepartitionFactory A: myRAPFact Partition: myZoltanInterface 'repartition: remap parts': true number of partitions: myRepartitionHeuristicFact - myRebalanceProlongatorFact: + myRebalanceProlongatorFact: factory: RebalanceTransferFactory type: Interpolation P: myTogglePFact Coordinates: myToggleTransferCoordinatesFact Nullspace: myTogglePFact - myRebalanceRestrictionFact: + myRebalanceRestrictionFact: factory: RebalanceTransferFactory type: Restriction R: myRestrictorFact - myRebalanceAFact: + myRebalanceAFact: factory: RebalanceAcFactory A: myRAPFact TransferFactories: { } - mySmoother1: + mySmoother1: factory: TrilinosSmoother type: LINESMOOTHING_BANDEDRELAXATION 'smoother: pre or post': both - ParameterList: + ParameterList: 'relaxation: type': Gauss-Seidel 'relaxation: sweeps': 1 'relaxation: damping factor': 1.0 - mySmoother3: + mySmoother3: factory: TrilinosSmoother type: RELAXATION 'smoother: pre or post': both - ParameterList: + ParameterList: 'relaxation: type': Gauss-Seidel 'relaxation: sweeps': 1 'relaxation: damping factor': 1.0 - mySmoother4: + mySmoother4: factory: TrilinosSmoother type: RELAXATION 'smoother: pre or post': pre - ParameterList: + ParameterList: 'relaxation: type': Gauss-Seidel 'relaxation: sweeps': 4 'relaxation: damping factor': 1.0 - Hierarchy: + Hierarchy: max levels: 7 'coarse: max size': 2000 verbosity: None - Finest: + Finest: Smoother: mySmoother1 CoarseSolver: mySmoother4 P: myRebalanceProlongatorFact @@ -242,7 +242,7 @@ ANONYMOUS: A: myRebalanceAFact Coordinates: myRebalanceProlongatorFact Importer: myRepartitionFact - All: + All: startLevel: 1 Smoother: mySmoother4 CoarseSolver: mySmoother4 @@ -254,9 +254,9 @@ ANONYMOUS: A: myRebalanceAFact Coordinates: myRebalanceProlongatorFact Importer: myRepartitionFact - + ML: - Base Method Defaults: none + Base Method Defaults: none ML Settings: default values: SA ML output: 0 @@ -280,4 +280,3 @@ ANONYMOUS: 'coarse: max size': 2000 'coarse: pre or post': pre max levels: 7 - diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg new file mode 100644 index 0000000000..39ff988c9f --- /dev/null +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg @@ -0,0 +1,39 @@ +# config options for ismip6 antarctic ice sheet data set +[ismip6_run_ais_2300] + +# list of experiments to set up. +# Can be "tier1", "tier2", "all", or a comma-delimited list of runs +# "tier1" is expAE01-expAE06 plus hist and ctrlAE +# "tier2" is expAE07-expAE14 +exp_list = tier1 + +# Resolution that will be set up, in km. Should be one of 4, 8, as those are +# the two resolutions currently supported. +# The paths below must manually be set to be consistent. +mesh_res = 8 + +# Base path to the processed input ismip6 ocean and smb forcing files. +# User has to supply. +forcing_basepath = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res + +# Path to the initial condition file. User has to supply. +init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/relaxation_0TGmelt_10yr_muCap/AIS_8to30km_r01_20220906.smooth3.basinsFineTuned_carvedRonne_CIRWIP_relaxation_0TGmelt_10yr_muCap.nc + +# Path to the file for the basal melt parametrization coefficients. +melt_params_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/basin_and_coeff_gamma0_DeltaT_quadratic_non_local.nc + +# Path to the region mask file +region_mask_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/AIS_8to30km_r01_20220607.regionMask_ismip6.nc + +# Calving method to use. Should be one of: +# 'restore' for restore-calving front method (fixed calving front) +# 'von_mises' for von Mises threshold stress calving law +calving_method = restore + +# Path to the file containing the von Mises parameter fields +# groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. +# Only required if calving_method is set to 'von_mises' +von_mises_parameter_path = UNKNOWN + +# Path to the directory containing graph files +graph_files_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027 diff --git a/compass/landice/tests/ismip6_run_ais/namelist.landice b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice similarity index 100% rename from compass/landice/tests/ismip6_run_ais/namelist.landice rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice diff --git a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py similarity index 67% rename from compass/landice/tests/ismip6_run_ais/set_up_experiment.py rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py index 4447fe41af..98e2c65a9b 100644 --- a/compass/landice/tests/ismip6_run_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py @@ -1,10 +1,13 @@ +import glob import os -from compass.model import run_model, make_graph_file -from compass.step import Step -import shutil, glob, sys -from jinja2 import Template +import shutil +import sys from importlib import resources +from jinja2 import Template + +from compass.step import Step + class SetUpExperiment(Step): """ @@ -28,12 +31,12 @@ def __init__(self, test_case, name, subdir, exp): super().__init__(test_case=test_case, name=name, subdir=subdir) - def setup(self): + def setup(self): # noqa:C901 print(f" Setting up experiment {self.exp}") config = self.config - section = config['ismip6_run_ais'] + section = config['ismip6_run_ais_2300'] mesh_res = section.getint('mesh_res') forcing_basepath = section.get('forcing_basepath') init_cond_path = section.get('init_cond_path') @@ -42,6 +45,7 @@ def setup(self): melt_params_fname = os.path.split(melt_params_path)[-1] region_mask_path = section.get('region_mask_path') region_mask_fname = os.path.split(region_mask_path)[-1] + calving_method = section.get('calving_method') graph_files_path = section.get('graph_files_path') if self.exp == 'hist': @@ -49,20 +53,28 @@ def setup(self): else: exp_fcg = self.exp - # We chose to use vM calving at 4km but restore calving at 8km - if mesh_res == 4: + # Define where to get namelist, streams, yaml, etc. templates + # (in current package) + resource_location = \ + 'compass.landice.tests.ismip6_run.ismip6_ais_proj2300' + + # Define calving method + if calving_method == 'von_mises': use_vM_calving = True - else: + elif calving_method == 'restore': use_vM_calving = False # Figure out if the forcing is in tier1 or tier2 subdir if 'exp' in self.exp: if int(self.exp[-2:]) >= 7: - forcing_basepath = os.path.join(forcing_basepath, 'tier2_experiments') + forcing_basepath = os.path.join(forcing_basepath, + 'tier2_experiments') else: - forcing_basepath = os.path.join(forcing_basepath, 'tier1_experiments') + forcing_basepath = os.path.join(forcing_basepath, + 'tier1_experiments') else: - forcing_basepath = os.path.join(forcing_basepath, 'tier1_experiments') + forcing_basepath = os.path.join(forcing_basepath, + 'tier1_experiments') # Copy files we'll need from local paths specified in cfg file if self.exp == 'hist': @@ -71,30 +83,37 @@ def setup(self): shutil.copy(region_mask_path, self.work_dir) # Find and copy correct forcing files - smb_search_path = os.path.join(forcing_basepath, exp_fcg, 'processed_SMB_*_smbNeg_over_bareland.nc') + smb_search_path = os.path.join( + forcing_basepath, exp_fcg, + 'processed_SMB_*_smbNeg_over_bareland.nc') fcgFileList = glob.glob(smb_search_path) if len(fcgFileList) == 1: smb_path = fcgFileList[0] smb_fname = os.path.split(smb_path)[-1] shutil.copy(smb_path, self.work_dir) else: - sys.exit(f"ERROR: Did not find exactly one matching SMB file at {smb_search_path}: {fcgFileList}") + sys.exit("ERROR: Did not find exactly one matching SMB file at " + f"{smb_search_path}: {fcgFileList}") - tf_search_path = os.path.join(forcing_basepath, exp_fcg, 'processed_TF_*.nc') + tf_search_path = os.path.join(forcing_basepath, exp_fcg, + 'processed_TF_*.nc') fcgFileList = glob.glob(tf_search_path) if len(fcgFileList) == 1: tf_path = fcgFileList[0] tf_fname = os.path.split(tf_path)[-1] shutil.copy(tf_path, self.work_dir) else: - sys.exit(f"ERROR: Did not find exactly one matching TF file at {tf_search_path}: {fcgFileList}") + sys.exit("ERROR: Did not find exactly one matching TF file at " + f"{tf_search_path}: {fcgFileList}") # copy calving mask files for exp11-14 useCalvingMask = False if exp_fcg[-2:].isdigit(): exp_num = int(exp_fcg[-2:]) if exp_num >= 11: - mask_search_path = os.path.join(forcing_basepath, exp_fcg, 'Antarctica_8to30km_ice_shelf_collapse_mask_*.nc') + mask_search_path = os.path.join( + forcing_basepath, exp_fcg, + 'Antarctica_8to30km_ice_shelf_collapse_mask_*.nc') fcgFileList = glob.glob(mask_search_path) if len(fcgFileList) == 1: mask_path = fcgFileList[0] @@ -102,35 +121,40 @@ def setup(self): shutil.copy(mask_path, self.work_dir) useCalvingMask = True else: - sys.exit(f"ERROR: Did not find exactly one matching calving mask file at {mask_search_path}: {fcgFileList}") + sys.exit("ERROR: Did not find exactly one matching " + "calving mask file at " + f"{mask_search_path}: {fcgFileList}") # Make stream modifications based on files that were determined above - stream_replacements = { - 'input_file_SMB_forcing': smb_fname, - 'input_file_TF_forcing': tf_fname - } + stream_replacements = {'input_file_SMB_forcing': smb_fname, + 'input_file_TF_forcing': tf_fname} if self.exp == 'hist': stream_replacements['input_file_init_cond'] = init_cond_fname stream_replacements['input_file_region_mask'] = region_mask_fname stream_replacements['input_file_melt_params'] = melt_params_fname else: - stream_replacements['input_file_init_cond'] = 'USE_RESTART_FILE_INSTEAD' - stream_replacements['input_file_region_mask'] = 'USE_RESTART_FILE_INSTEAD' - stream_replacements['input_file_melt_params'] = 'USE_RESTART_FILE_INSTEAD' + stream_replacements['input_file_init_cond'] = \ + 'USE_RESTART_FILE_INSTEAD' + stream_replacements['input_file_region_mask'] = \ + 'USE_RESTART_FILE_INSTEAD' + stream_replacements['input_file_melt_params'] = \ + 'USE_RESTART_FILE_INSTEAD' if self.exp in ['hist', 'ctrlAE']: stream_replacements['forcing_interval'] = 'initial_only' else: stream_replacements['forcing_interval'] = '0001-00-00_00:00:00' self.add_streams_file( - 'compass.landice.tests.ismip6_run_ais', 'streams.landice.template', + resource_location, + 'streams.landice.template', out_name='streams.landice', template_replacements=stream_replacements) if useCalvingMask: - mask_stream_replacements = {'input_file_calving_mask_forcing_name': mask_fname} + mask_stream_replacements = {'input_file_calving_mask_forcing_name': + mask_fname} self.add_streams_file( - 'compass.landice.tests.ismip6_run_ais', 'streams.mask_calving', + resource_location, 'streams.mask_calving', out_name='streams.landice', template_replacements=mask_stream_replacements) @@ -138,13 +162,13 @@ def setup(self): vM_param_path = section.get('von_mises_parameter_path') vM_stream_replacements = {'input_file_VM_params': vM_param_path} self.add_streams_file( - 'compass.landice.tests.ismip6_run_ais', 'streams.vM_params', + resource_location, 'streams.vM_params', out_name='streams.landice', template_replacements=vM_stream_replacements) # Set up namelist and customize as needed self.add_namelist_file( - 'compass.landice.tests.ismip6_run_ais', 'namelist.landice', + resource_location, 'namelist.landice', out_name='namelist.landice') if mesh_res == 4: @@ -163,8 +187,10 @@ def setup(self): if use_vM_calving: options = {'config_calving': "'von_Mises_stress'", 'config_restore_calving_front': ".false.", - 'config_floating_von_Mises_threshold_stress_source': "'data'", - 'config_grounded_von_Mises_threshold_stress_source': "'data'"} + 'config_floating_von_Mises_threshold_stress_source': + "'data'", + 'config_grounded_von_Mises_threshold_stress_source': + "'data'"} self.add_namelist_options(options=options, out_name='namelist.landice') @@ -174,31 +200,35 @@ def setup(self): self.add_namelist_options(options=options, out_name='namelist.landice') - # For all projection runs, symlink the restart file for the historical run + # For all projection runs, symlink the restart file for the + # historical run # don't symlink restart_timestamp or you'll have a mighty mess if not self.exp == 'hist': - os.symlink(f"../hist/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) - with open(os.path.join(self.work_dir, "restart_timestamp"), "w") as text_file: + os.symlink("../hist/rst.2015-01-01.nc", + os.path.join(self.work_dir, 'rst.2015-01-01.nc')) + with open(os.path.join(self.work_dir, "restart_timestamp"), + "w") as text_file: text_file.write("2015-01-01_00:00:00") - # add the albany_input.yaml file - self.add_input_file(filename='albany_input.yaml', - package='compass.landice.tests.ismip6_run_ais', - copy=True) + self.add_input_file( + filename='albany_input.yaml', + package=resource_location, + copy=True) # copy graph files - # may be possible to use compass functionality, but wasn't working in this way - #make_graph_file(mesh_filename=init_cond_path, - # graph_filename='graph.info') - graphFileList = glob.glob(os.path.join(graph_files_path, 'graph.info*')) + # may be possible to use compass functionality, + # but wasn't working in this way + # make_graph_file(mesh_filename=init_cond_path, + # graph_filename='graph.info') + graphFileList = glob.glob(os.path.join(graph_files_path, + 'graph.info*')) for gf in graphFileList: shutil.copy(gf, self.work_dir) # provide an example submit script template = Template(resources.read_text( - 'compass.landice.tests.ismip6_run_ais', - f'slurm.{mesh_res:02d}.run')) + resource_location, f'slurm.{mesh_res:02d}.run')) slurm_replacements = {'EXP': f'{self.exp}_{mesh_res:02d}'} rendered_text = template.render(slurm_replacements) with open(os.path.join(self.work_dir, 'slurm.run'), "w") as fh: @@ -211,7 +241,7 @@ def run(self): """ Run this step of the test case """ - #make_graph_file(mesh_filename=self.mesh_file, - # graph_filename='graph.info') - #run_model(step=self, namelist='namelist.landice', - # streams='streams.landice') + # make_graph_file(mesh_filename=self.mesh_file, + # graph_filename='graph.info') + # run_model(step=self, namelist='namelist.landice', + # streams='streams.landice') diff --git a/compass/landice/tests/ismip6_run_ais/slurm.04.run b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.04.run similarity index 100% rename from compass/landice/tests/ismip6_run_ais/slurm.04.run rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.04.run diff --git a/compass/landice/tests/ismip6_run_ais/slurm.08.run b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.08.run similarity index 100% rename from compass/landice/tests/ismip6_run_ais/slurm.08.run rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.08.run diff --git a/compass/landice/tests/ismip6_run_ais/streams.landice.template b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.landice.template similarity index 100% rename from compass/landice/tests/ismip6_run_ais/streams.landice.template rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.landice.template diff --git a/compass/landice/tests/ismip6_run_ais/streams.mask_calving b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.mask_calving similarity index 100% rename from compass/landice/tests/ismip6_run_ais/streams.mask_calving rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.mask_calving diff --git a/compass/landice/tests/ismip6_run_ais/streams.vM_params b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.vM_params similarity index 100% rename from compass/landice/tests/ismip6_run_ais/streams.vM_params rename to compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.vM_params diff --git a/compass/landice/tests/ismip6_run_ais/__init__.py b/compass/landice/tests/ismip6_run_ais/__init__.py deleted file mode 100644 index d78054b6dd..0000000000 --- a/compass/landice/tests/ismip6_run_ais/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -from compass.testgroup import TestGroup -from compass.landice.tests.ismip6_run_ais.projection import Projection - - -class Ismip6RunAIS(TestGroup): - """ - A test group for Antarctica forward simulation testcases - - Attributes - ---------- - meshdirs : dict - """ - def __init__(self, mpas_core): - """ - mpas_core : compass.landice.Landice - the MPAS core that this test group belongs to - """ - super().__init__(mpas_core=mpas_core, name='ismip6_run_ais') - - self.add_test_case(Projection(test_group=self)) diff --git a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg b/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg deleted file mode 100644 index fc28866165..0000000000 --- a/compass/landice/tests/ismip6_run_ais/ismip6_run_ais.cfg +++ /dev/null @@ -1,31 +0,0 @@ -# config options for ismip6 antarctic ice sheet data set -[ismip6_run_ais] - -# list of experiments to set up. -# Can be "tier1", "tier2", "all", or a comma-delimited list of runs -# "tier1" is expAE01-expAE06 plus hist and ctrlAE -# "tier2" is expAE07-expAE14 -exp_list = tier1 - -# Resolution that will be set up, in km. Should be one of 4, 8, as those are -# the two resolutions currently supported. -# The paths below must manually be set to be consistent. -mesh_res = 8 - -# Base path to the processed input ismip6 ocean and smb forcing files. User has to supply. -forcing_basepath = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res - -# Path to the initial condition file. User has to supply. -init_cond_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/relaxation_0TGmelt_10yr_muCap/AIS_8to30km_r01_20220906.smooth3.basinsFineTuned_carvedRonne_CIRWIP_relaxation_0TGmelt_10yr_muCap.nc - -# Path to the file for the basal melt parametrization coefficients. -melt_params_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/basin_and_coeff_gamma0_DeltaT_quadratic_non_local.nc - -# Path to the region mask file -region_mask_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/AIS_8to30km_r01_20220607.regionMask_ismip6.nc - -# Path to the file containing the von Mises parameter fields groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. Only required for configurations that use von Mises calving (currently 4 km only) -von_mises_parameter_path = UNKNOWN - -# Path to the directory containing graph files -graph_files_path = /global/project/projectdirs/piscees/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027 From 11a305c376e20205562b2faefd7dcacc0057d6cc Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 13 Mar 2023 12:04:56 -0700 Subject: [PATCH 30/43] Update mpas calendar type in nl --- .../tests/ismip6_run/ismip6_ais_proj2300/namelist.landice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice index f1fe888330..f14b054e37 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice @@ -51,7 +51,7 @@ config_restart_timestamp_name = 'restart_timestamp' config_start_time ='file' config_stop_time = '2300-01-01_00:00:00' - config_calendar_type = 'gregorian_noleap' + config_calendar_type = 'noleap' config_stats_interval = 0 config_write_stats_on_startup = .false. From 8e9784c44c63f0706bcd400d2cb83f2ca05eea7a Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 13 Mar 2023 12:06:06 -0700 Subject: [PATCH 31/43] Add optional pre and post run commands to job script This commit adds optional arguments for additional commands that should be executed before and after 'compass run' in the job script. --- compass/job/__init__.py | 22 ++++++++++++++++------ compass/job/job_script.template | 3 ++- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/compass/job/__init__.py b/compass/job/__init__.py index a22acc02ce..54a0421235 100644 --- a/compass/job/__init__.py +++ b/compass/job/__init__.py @@ -1,11 +1,12 @@ -from jinja2 import Template -from importlib import resources import os +from importlib import resources + import numpy as np +from jinja2 import Template def write_job_script(config, machine, target_cores, min_cores, work_dir, - suite=''): + suite='', pre_run_commands='', post_run_commands=''): """ Parameters @@ -28,6 +29,14 @@ def write_job_script(config, machine, target_cores, min_cores, work_dir, suite : str, optional The name of the suite + + pre_run_commands : str, optional + Optional commands to be inserted into job script prior to calling + compass run + + post_run_commands : str, optional + Optional commands to be inserted into job script after calling of + compass run """ if config.has_option('parallel', 'account'): @@ -38,8 +47,8 @@ def write_job_script(config, machine, target_cores, min_cores, work_dir, cores_per_node = config.getint('parallel', 'cores_per_node') # as a rule of thumb, let's do the geometric mean between min and target - cores = np.sqrt(target_cores*min_cores) - nodes = int(np.ceil(cores/cores_per_node)) + cores = np.sqrt(target_cores * min_cores) + nodes = int(np.ceil(cores / cores_per_node)) partition = config.get('job', 'partition') if partition == '<<>>': @@ -87,7 +96,8 @@ def write_job_script(config, machine, target_cores, min_cores, work_dir, text = template.render(job_name=job_name, account=account, nodes=f'{nodes}', wall_time=wall_time, qos=qos, partition=partition, constraint=constraint, - suite=suite) + suite=suite, pre_run_commands=pre_run_commands, + post_run_commands=post_run_commands) text = _clean_up_whitespace(text) if suite == '': script_filename = 'job_script.sh' diff --git a/compass/job/job_script.template b/compass/job/job_script.template index 39ff3beb3a..09030e2a6a 100644 --- a/compass/job/job_script.template +++ b/compass/job/job_script.template @@ -18,5 +18,6 @@ {%- endif %} source load_compass_env.sh +{{ pre_run_commands }} compass run {{suite}} - +{{ post_run_commands }} From 23fd2b01121cce70c47d6a9e864860b39da1da31 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 13 Mar 2023 12:38:43 -0700 Subject: [PATCH 32/43] Use compass for job script and running model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adjusts the previous design philosophy to make use of compass functionality for: 1. creating graph files 2. creating job scripts 3. running the model A separate job script is created for each step (ismip6 experiment). The number of procs to be used is defined by ntasks in the config. The experiment is run by submitting the job script in each experiment directory. There is no ‘compass run’ functionality at the test case level. --- .../ismip6_ais_proj2300/__init__.py | 12 ++++- .../ismip6_ais_proj2300.cfg | 6 +-- .../ismip6_ais_proj2300/set_up_experiment.py | 46 +++++++++++++------ 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py index c4ea323adb..103a3e8738 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py @@ -64,7 +64,17 @@ def configure(self): self.add_step( SetUpExperiment(test_case=self, name=exp, subdir=exp, exp=exp)) + # Do not add experiments to step to steps_to_run; + # each experiment (step) should be run manually + self.steps_to_run = [] - # no run() method is needed + def run(self): + """ + A dummy run method + """ + raise ValueError("ERROR: 'compass run' has no functionality at the " + "test case level for this test. " + "Please submit the job script in " + "each experiment's subdirectory manually instead.") # no validate() method is needed diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg index 39ff988c9f..d7a696a68c 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg @@ -12,6 +12,9 @@ exp_list = tier1 # The paths below must manually be set to be consistent. mesh_res = 8 +# number of tasks to use for each run +ntasks = 256 + # Base path to the processed input ismip6 ocean and smb forcing files. # User has to supply. forcing_basepath = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res @@ -34,6 +37,3 @@ calving_method = restore # groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. # Only required if calving_method is set to 'von_mises' von_mises_parameter_path = UNKNOWN - -# Path to the directory containing graph files -graph_files_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027 diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py index 98e2c65a9b..ea1c7320e9 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py @@ -6,6 +6,9 @@ from jinja2 import Template +from compass.io import symlink +from compass.job import write_job_script +from compass.model import make_graph_file, run_model from compass.step import Step @@ -38,6 +41,8 @@ def setup(self): # noqa:C901 config = self.config section = config['ismip6_run_ais_2300'] mesh_res = section.getint('mesh_res') + self.ntasks = section.getint('ntasks') + self.min_tasks = self.ntasks forcing_basepath = section.get('forcing_basepath') init_cond_path = section.get('init_cond_path') init_cond_fname = os.path.split(init_cond_path)[-1] @@ -46,7 +51,6 @@ def setup(self): # noqa:C901 region_mask_path = section.get('region_mask_path') region_mask_fname = os.path.split(region_mask_path)[-1] calving_method = section.get('calving_method') - graph_files_path = section.get('graph_files_path') if self.exp == 'hist': exp_fcg = 'ctrlAE' @@ -216,15 +220,31 @@ def setup(self): # noqa:C901 package=resource_location, copy=True) - # copy graph files - # may be possible to use compass functionality, - # but wasn't working in this way - # make_graph_file(mesh_filename=init_cond_path, - # graph_filename='graph.info') - graphFileList = glob.glob(os.path.join(graph_files_path, - 'graph.info*')) - for gf in graphFileList: - shutil.copy(gf, self.work_dir) + # create graph file + make_graph_file(mesh_filename=init_cond_path, + graph_filename=os.path.join(self.work_dir, + 'graph.info')) + + # COMPASS does not create symlinks for the load script in step dirs, + # so use the standard approach for creating that symlink in each + # step dir. + if 'LOAD_COMPASS_ENV' in os.environ: + script_filename = os.environ['LOAD_COMPASS_ENV'] + # make a symlink to the script for loading the compass conda env. + symlink(script_filename, os.path.join(self.work_dir, + 'load_compass_env.sh')) + + # customize job script + self.config.set('job', 'job_name', self.exp) + machine = self.config.get('deploy', 'machine') + pre_run_cmd = ('LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"`;' + 'mkdir $LOGDIR; cp log* $LOGDIR; date') + post_run_cmd = "date" + write_job_script(self.config, machine, + target_cores=self.ntasks, min_cores=self.min_tasks, + work_dir=self.work_dir, + pre_run_commands=pre_run_cmd, + post_run_commands=post_run_cmd) # provide an example submit script template = Template(resources.read_text( @@ -241,7 +261,5 @@ def run(self): """ Run this step of the test case """ - # make_graph_file(mesh_filename=self.mesh_file, - # graph_filename='graph.info') - # run_model(step=self, namelist='namelist.landice', - # streams='streams.landice') + run_model(step=self, namelist='namelist.landice', + streams='streams.landice') From 5cc7525eb1b5c9d545660fb2b864cc413ed29e8e Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 13 Mar 2023 12:46:57 -0700 Subject: [PATCH 33/43] Remove hardcoded slurm files now that compass job files are generated --- .../ismip6_ais_proj2300/set_up_experiment.py | 11 ----------- .../ismip6_ais_proj2300/slurm.04.run | 18 ------------------ .../ismip6_ais_proj2300/slurm.08.run | 18 ------------------ 3 files changed, 47 deletions(-) delete mode 100644 compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.04.run delete mode 100644 compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.08.run diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py index ea1c7320e9..87b1d57518 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py @@ -2,9 +2,6 @@ import os import shutil import sys -from importlib import resources - -from jinja2 import Template from compass.io import symlink from compass.job import write_job_script @@ -246,14 +243,6 @@ def setup(self): # noqa:C901 pre_run_commands=pre_run_cmd, post_run_commands=post_run_cmd) - # provide an example submit script - template = Template(resources.read_text( - resource_location, f'slurm.{mesh_res:02d}.run')) - slurm_replacements = {'EXP': f'{self.exp}_{mesh_res:02d}'} - rendered_text = template.render(slurm_replacements) - with open(os.path.join(self.work_dir, 'slurm.run'), "w") as fh: - fh.write(rendered_text) - # link in exe self.add_model_as_input() diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.04.run b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.04.run deleted file mode 100644 index 3412ea0798..0000000000 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.04.run +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -#SBATCH --job-name={{ EXP }} -#SBATCH --account=m1795 -#SBATCH --nodes=60 -#SBATCH --tasks-per-node=64 -#SBATCH --exclusive -#SBATCH --time=12:00:00 -#SBATCH --qos=regular -#SBATCH --constraint=haswell - -LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"` -mkdir $LOGDIR -cp log* $LOGDIR - -source ../load_compass_env.sh -date -srun -n 3840 --cpu-bind=cores --hint=multithread ./landice_model -date diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.08.run b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.08.run deleted file mode 100644 index 2a1bc1659d..0000000000 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/slurm.08.run +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -#SBATCH --job-name={{ EXP }} -#SBATCH --account=m1795 -#SBATCH --nodes=5 -#SBATCH --tasks-per-node=64 -#SBATCH --exclusive -#SBATCH --time=15:00:00 -#SBATCH --qos=regular -#SBATCH --constraint=haswell - -LOGDIR=previous_logs_`date +"%Y-%m-%d_%H-%M-%S"` -mkdir $LOGDIR -cp log* $LOGDIR - -source ../load_compass_env.sh -date -srun -n 320 --cpu-bind=cores --hint=multithread ./landice_model -date From 497c62a719ed6123f45245be591cdb03d378c066 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Mon, 13 Mar 2023 13:38:58 -0700 Subject: [PATCH 34/43] add docs --- .../ismip6_ais_proj2300.cfg | 4 +- docs/developers_guide/landice/api.rst | 17 +++ .../landice/test_groups/index.rst | 1 + .../landice/test_groups/ismip6_run.rst | 58 +++++++++ .../users_guide/landice/test_groups/index.rst | 1 + .../landice/test_groups/ismip6_run.rst | 118 ++++++++++++++++++ 6 files changed, 197 insertions(+), 2 deletions(-) create mode 100644 docs/developers_guide/landice/test_groups/ismip6_run.rst create mode 100644 docs/users_guide/landice/test_groups/ismip6_run.rst diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg index d7a696a68c..3adc777d88 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg @@ -1,4 +1,3 @@ -# config options for ismip6 antarctic ice sheet data set [ismip6_run_ais_2300] # list of experiments to set up. @@ -9,7 +8,8 @@ exp_list = tier1 # Resolution that will be set up, in km. Should be one of 4, 8, as those are # the two resolutions currently supported. -# The paths below must manually be set to be consistent. +# mesh_res is informational only and is used for directory naming conventions +# The filepaths below must manually be set to be consistent. mesh_res = 8 # number of tasks to use for each run diff --git a/docs/developers_guide/landice/api.rst b/docs/developers_guide/landice/api.rst index c3384d58ce..bddb48c64a 100644 --- a/docs/developers_guide/landice/api.rst +++ b/docs/developers_guide/landice/api.rst @@ -313,6 +313,23 @@ ismip6_forcing ocean_thermal.process_thermal_forcing.ProcessThermalForcing.remap_ismip6_thermal_forcing_to_mali_vars ocean_thermal.process_thermal_forcing.ProcessThermalForcing.rename_ismip6_thermal_forcing_to_mali_vars +ismip6_run +~~~~~~~~~~ + +.. currentmodule:: compass.landice.tests.ismip6_run + +.. autosummary:: + :toctree: generated/ + + Ismip6Run + + ismip6_ais_proj2300.Ismip6AisProj2300 + ismip6_ais_proj2300.Ismip6AisProj2300.configure + ismip6_ais_proj2300.Ismip6AisProj2300.run + + ismip6_ais_proj2300.set_up_experiment.SetUpExperiment + ismip6_ais_proj2300.set_up_experiment.SetUpExperiment.setup + ismip6_ais_proj2300.set_up_experiment.SetUpExperiment.run kangerlussuaq ~~~~~~~~~~~~~ diff --git a/docs/developers_guide/landice/test_groups/index.rst b/docs/developers_guide/landice/test_groups/index.rst index 257ae1563d..c825371816 100644 --- a/docs/developers_guide/landice/test_groups/index.rst +++ b/docs/developers_guide/landice/test_groups/index.rst @@ -18,6 +18,7 @@ Test groups humboldt hydro_radial ismip6_forcing + ismip6_run kangerlussuaq koge_bugt_s mismipplus diff --git a/docs/developers_guide/landice/test_groups/ismip6_run.rst b/docs/developers_guide/landice/test_groups/ismip6_run.rst new file mode 100644 index 0000000000..f8a307abc1 --- /dev/null +++ b/docs/developers_guide/landice/test_groups/ismip6_run.rst @@ -0,0 +1,58 @@ +.. _dev_landice_ismip6_run: + +ismip6_run +========== + +The ``ismip6_run`` test group (:py:class:`compass.landice.tests.ismip6_run`) +sets up experiments from the ISMIP6 experimental protocol. +(see :ref:`landice_ismip6_run`). + +framework +--------- + +There is no shared functionality for the ``ismip6_run`` test group. +Shared functions may be added if additional test cases are added and the +needed functionality can be generalized. + +ismip6_ais_proj2300 +------------------- + +The :py:class:`compass.landice.tests.ismip6_run.ismip6_ais_proj2300.Ismip6AisProj2300` +sets up an ensemble of ISMIP6 Antarctica 2300 +simulations. The constructor does nothing other than +allow the ``ismip6_ais_proj2300`` test case to be listed by ``compass list`` +without having all individual experiments listed in a verbose listing. +Each individual experiment is a step rather than a test case to avoid having +excessive subdirectories. + +The ``configure`` method is where the experiments to be set up are determined. +The config option ``exp_list`` is parsed and each experiment to be included +is set up as a step of the test case by calling the +``SetUpExperiment`` constructor. +All of the experiments are removed from ``steps_to_run``, because the +experiments (steps) are not meant to be run together through the test +case, which is a contrary design to most compass test cases. + +The ``run`` method of the test case generates an error instructing the user +to submit batch jobs for each experiment individually. + +set_up_experiment +~~~~~~~~~~~~~~~~~ + +The class :py:class:`compass.landice.tests.ismip6_run.ismip6_ais_proj2300.set_up_experiment.SetUpExperiment` +defines a step for a single ISMIP6 experiment (model run). The constructor +stores the experiment name. + +The ``setup`` method actually sets up an experiment by taking a baseline +configuration and then namelist and streams as necessary to define the ISMIP6 +experiment requested. See the ISMIP6 website for the `list of experiment +definitions `_. + +A ``graph.info`` file is created for each run. +Additionally, a job script is written for the run so that the run can be +submitted as an independent slurm job. +Finally, a symlink to the compass load script is added to the run work +directory, which compass does not do by default. + +The ``run`` method runs MALI for the given experiment. + diff --git a/docs/users_guide/landice/test_groups/index.rst b/docs/users_guide/landice/test_groups/index.rst index 1a49b76865..5abcff0e47 100644 --- a/docs/users_guide/landice/test_groups/index.rst +++ b/docs/users_guide/landice/test_groups/index.rst @@ -23,6 +23,7 @@ physics but that are not run routinely. humboldt hydro_radial ismip6_forcing + ismip6_run kangerlussuaq koge_bugt_s mismipplus diff --git a/docs/users_guide/landice/test_groups/ismip6_run.rst b/docs/users_guide/landice/test_groups/ismip6_run.rst new file mode 100644 index 0000000000..d40b7184dd --- /dev/null +++ b/docs/users_guide/landice/test_groups/ismip6_run.rst @@ -0,0 +1,118 @@ +.. _landice_ismip6_run: + +ismip6_run +========== + +The ``landice/ismip6_run`` test group includes a test case for setting up +one or more experiments from the `ISMIP6 set of experiments `_. +This functionality assumes the initial condition, parameter, and forcing files +have already been generated. It creates a consistent set of run directories +for the experiments requested. It is not meant for automated running of the +experiments, and expert knowledge is recommended for conducting the actual +experiments. + +At present, there is a single test case for the +ISMIP6-Projections2300-Antarctica ensemble. + +ismip6_ais_proj2300 +------------------- + +``landice/ismip6_run/ismip6_ais_proj2300`` sets up one or more experiments +from the protocol for +`ISMIP6-Projections2300-Antarctica `_. + +The user should review and modify all values in the default config for +specifying input files and model information. See config comments for +detailed information about each option. +Note that default filepaths refer to files at NERSC and may need to be updated +depending on what machine is being used and user permissions. +It may also be necessary to +alter namelist, streams, or test case code if non-standard configurations +are to be used. + +config options +-------------- + +All config options should be reviewed and altered as needed. + +.. code-block:: cfg + + [ismip6_run_ais_2300] + + # list of experiments to set up. + # Can be "tier1", "tier2", "all", or a comma-delimited list of runs + # "tier1" is expAE01-expAE06 plus hist and ctrlAE + # "tier2" is expAE07-expAE14 + exp_list = tier1 + + # Resolution that will be set up, in km. Should be one of 4, 8, as those are + # the two resolutions currently supported. + # mesh_res is informational only and is used for directory naming conventions + # The filepaths below must manually be set to be consistent. + mesh_res = 8 + + # number of tasks to use for each run + ntasks = 256 + + # Base path to the processed input ismip6 ocean and smb forcing files. + # User has to supply. + forcing_basepath = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res + + # Path to the initial condition file. User has to supply. + init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/relaxation_0TGmelt_10yr_muCap/AIS_8to30km_r01_20220906.smooth3.basinsFineTuned_carvedRonne_CIRWIP_relaxation_0TGmelt_10yr_muCap.nc + + # Path to the file for the basal melt parametrization coefficients. + melt_params_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/basin_and_coeff_gamma0_DeltaT_quadratic_non_local.nc + + # Path to the region mask file + region_mask_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/AIS_8to30km_r01_20220607.regionMask_ismip6.nc + + # Calving method to use. Should be one of: + # 'restore' for restore-calving front method (fixed calving front) + # 'von_mises' for von Mises threshold stress calving law + calving_method = restore + + # Path to the file containing the von Mises parameter fields + # groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. + # Only required if calving_method is set to 'von_mises' + von_mises_parameter_path = UNKNOWN + +Additionally, a user should also include the following options (and possibly +others) that will be used for submitting the jobs for each ensemble member +(set to appropriate values for their usage situation): + +.. code-block:: cfg + + [parallel] + account = ALLOCATION_NAME_HERE + qos = regular + + [job] + wall_time = 10:00:00 + +Steps for setting up and running experiments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. With a compass conda environment set up, run, e.g., + ``compass setup -t landice/ismip6_run/ismip6_ais_proj2300 -w WORK_DIR_PATH -f USER.cfg`` + where ``WORK_DIR_PATH`` is a location that can store the whole + ensemble (typically a scratch drive) and ``USER.cfg`` is the + user-defined config described in the previous section that includes + options for ``[parallel]`` and ``[job]``, as well as any required + modifications to the ``[ismip6_run_ais_2300]`` section. Likely, most or all + attributes in the ``[ismip6_run_ais_2300]`` section need to be customized for a + given application. + +2. After ``compass setup`` completes and all runs are set up, go to the + ``WORK_DIR_PATH`` and change to the + ``landice/ismip6_run/ismip6_ais_proj2300`` subdirectory. + From there you will see subdirectories for each experiment. + +3. Each experiment is to be run individually. Change to the subdirectory + of the experiment you would like to run. It is suggested you review the + job script, namelist, and streams files to be sure everything is set as + expected. Then use ``sbatch`` to submit the job script. + +Note that the ``hist`` run must be completed before any of the other +experiments can be run. A symlink to the ``hist`` restart file from year +2015 exists in each of the other experiment subdirectories. From 4af890640790874e979d16dc1cb0c3cb99a7d169 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 5 Apr 2023 12:44:00 -0700 Subject: [PATCH 35/43] Doc/comment cleanup from code review --- .../tests/ismip6_run/ismip6_ais_proj2300/__init__.py | 2 +- .../landice/test_groups/ismip6_run.rst | 6 +++--- docs/users_guide/landice/test_groups/ismip6_run.rst | 10 ++++++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py index 103a3e8738..30e5dadc77 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py @@ -32,7 +32,7 @@ def configure(self): """ Set up the desired ISMIP6 AIS 2300 experiments. - Read the list from the config of which experiemnts the + Read the list from the config of which experiments the user wants to set up. Call thee add_step method and add the experiment to steps_to_run. Those operations are typically done in the constructor, but they are done here so that the list to set up diff --git a/docs/developers_guide/landice/test_groups/ismip6_run.rst b/docs/developers_guide/landice/test_groups/ismip6_run.rst index f8a307abc1..f26b936dc7 100644 --- a/docs/developers_guide/landice/test_groups/ismip6_run.rst +++ b/docs/developers_guide/landice/test_groups/ismip6_run.rst @@ -19,7 +19,7 @@ ismip6_ais_proj2300 The :py:class:`compass.landice.tests.ismip6_run.ismip6_ais_proj2300.Ismip6AisProj2300` sets up an ensemble of ISMIP6 Antarctica 2300 -simulations. The constructor does nothing other than +simulations. The constructor (``__init__``) does nothing other than allow the ``ismip6_ais_proj2300`` test case to be listed by ``compass list`` without having all individual experiments listed in a verbose listing. Each individual experiment is a step rather than a test case to avoid having @@ -28,7 +28,7 @@ excessive subdirectories. The ``configure`` method is where the experiments to be set up are determined. The config option ``exp_list`` is parsed and each experiment to be included is set up as a step of the test case by calling the -``SetUpExperiment`` constructor. +``SetUpExperiment`` constructor (``__init__``). All of the experiments are removed from ``steps_to_run``, because the experiments (steps) are not meant to be run together through the test case, which is a contrary design to most compass test cases. @@ -41,7 +41,7 @@ set_up_experiment The class :py:class:`compass.landice.tests.ismip6_run.ismip6_ais_proj2300.set_up_experiment.SetUpExperiment` defines a step for a single ISMIP6 experiment (model run). The constructor -stores the experiment name. +(``__init__``) stores the experiment name. The ``setup`` method actually sets up an experiment by taking a baseline configuration and then namelist and streams as necessary to define the ISMIP6 diff --git a/docs/users_guide/landice/test_groups/ismip6_run.rst b/docs/users_guide/landice/test_groups/ismip6_run.rst index d40b7184dd..bf5698e476 100644 --- a/docs/users_guide/landice/test_groups/ismip6_run.rst +++ b/docs/users_guide/landice/test_groups/ismip6_run.rst @@ -6,7 +6,8 @@ ismip6_run The ``landice/ismip6_run`` test group includes a test case for setting up one or more experiments from the `ISMIP6 set of experiments `_. This functionality assumes the initial condition, parameter, and forcing files -have already been generated. It creates a consistent set of run directories +have already been generated using the :ref:`landice_ismip6_forcing` test case. +It creates a consistent set of run directories for the experiments requested. It is not meant for automated running of the experiments, and expert knowledge is recommended for conducting the actual experiments. @@ -101,7 +102,12 @@ Steps for setting up and running experiments options for ``[parallel]`` and ``[job]``, as well as any required modifications to the ``[ismip6_run_ais_2300]`` section. Likely, most or all attributes in the ``[ismip6_run_ais_2300]`` section need to be customized for a - given application. + given application. It is possible to set up the test case without the + ``-f`` option, but generally users will need to make their own + adjustments to the example syntax above include it. Also, if you + do not compile MALI in the ``MALI-Dev`` submodule within compass, you will + need to include the ``-p`` option specifying the path to where you compiled + MALI. 2. After ``compass setup`` completes and all runs are set up, go to the ``WORK_DIR_PATH`` and change to the From 9d66f26977806a4511b9c0ab0838594e270c8cd3 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 5 Apr 2023 14:58:49 -0700 Subject: [PATCH 36/43] Move pio stride to cfg file This is to avoid having it hard-coded. This commit also moves the mesh resolution to the test case config routine, because it was no longer used for anything in the set_up_experiment module. I added the mesh resolution to the subdir where the test is set up to follow ISMIP6 naming convention. --- .../ismip6_ais_proj2300/__init__.py | 6 ++++-- .../ismip6_ais_proj2300.cfg | 4 ++++ .../ismip6_ais_proj2300/namelist.landice | 2 -- .../ismip6_ais_proj2300/set_up_experiment.py | 19 +++++++++++-------- .../landice/test_groups/ismip6_run.rst | 4 ++++ 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py index 30e5dadc77..4e5c573445 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/__init__.py @@ -53,6 +53,7 @@ def configure(self): [f'expAE{i:02}' for i in range(1, 15)] else: exp_list = exp_list.split(",") + mesh_res = self.config.getint('ismip6_run_ais_2300', 'mesh_res') for exp in exp_list: if os.path.exists(os.path.join(self.work_dir, exp)): @@ -61,9 +62,10 @@ def configure(self): f"{os.path.join(self.work_dir, exp)} and execute " "'compass setup' again to set this experiment up.") else: + exp_name = f'{exp}_{mesh_res:02}' self.add_step( - SetUpExperiment(test_case=self, name=exp, - subdir=exp, exp=exp)) + SetUpExperiment(test_case=self, name=exp_name, + subdir=exp_name, exp=exp)) # Do not add experiments to step to steps_to_run; # each experiment (step) should be run manually self.steps_to_run = [] diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg index 3adc777d88..54a72605cf 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg @@ -15,6 +15,10 @@ mesh_res = 8 # number of tasks to use for each run ntasks = 256 +# value to use for config_pio_stride. +# Should be divisible into ntasks +pio_stride = 128 + # Base path to the processed input ismip6 ocean and smb forcing files. # User has to supply. forcing_basepath = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice index f14b054e37..b1d3f4b47c 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/namelist.landice @@ -57,8 +57,6 @@ config_write_stats_on_startup = .false. config_stats_cell_ID = 1 config_write_output_on_startup = .true. - config_pio_num_iotasks = 10 - config_pio_stride = 32 config_always_compute_fem_grid = .true. diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py index 87b1d57518..dfd9701342 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py @@ -37,7 +37,6 @@ def setup(self): # noqa:C901 config = self.config section = config['ismip6_run_ais_2300'] - mesh_res = section.getint('mesh_res') self.ntasks = section.getint('ntasks') self.min_tasks = self.ntasks forcing_basepath = section.get('forcing_basepath') @@ -86,7 +85,7 @@ def setup(self): # noqa:C901 # Find and copy correct forcing files smb_search_path = os.path.join( forcing_basepath, exp_fcg, - 'processed_SMB_*_smbNeg_over_bareland.nc') + '*smb*_minus1_bare_land.nc') fcgFileList = glob.glob(smb_search_path) if len(fcgFileList) == 1: smb_path = fcgFileList[0] @@ -97,7 +96,7 @@ def setup(self): # noqa:C901 f"{smb_search_path}: {fcgFileList}") tf_search_path = os.path.join(forcing_basepath, exp_fcg, - 'processed_TF_*.nc') + '*TF_*.nc') fcgFileList = glob.glob(tf_search_path) if len(fcgFileList) == 1: tf_path = fcgFileList[0] @@ -172,11 +171,15 @@ def setup(self): # noqa:C901 resource_location, 'namelist.landice', out_name='namelist.landice') - if mesh_res == 4: - options = {'config_pio_num_iotasks': '60', - 'config_pio_stride': '64'} - self.add_namelist_options(options=options, - out_name='namelist.landice') + # set up pio options because we are not using compass run + pio_stride = section.getint('pio_stride') + assert self.ntasks % pio_stride == 0, \ + 'pio_stride is not evenly divisble into ntasks' + io_tasks = self.ntasks // pio_stride + options = {'config_pio_stride': f'{pio_stride}', + 'config_pio_num_iotasks': f'{io_tasks}'} + self.add_namelist_options(options=options, + out_name='namelist.landice') if self.exp == 'hist': options = {'config_do_restart': ".false.", diff --git a/docs/users_guide/landice/test_groups/ismip6_run.rst b/docs/users_guide/landice/test_groups/ismip6_run.rst index bf5698e476..417f292f81 100644 --- a/docs/users_guide/landice/test_groups/ismip6_run.rst +++ b/docs/users_guide/landice/test_groups/ismip6_run.rst @@ -55,6 +55,10 @@ All config options should be reviewed and altered as needed. # number of tasks to use for each run ntasks = 256 + # value to use for config_pio_stride. + # Should be divisible into ntasks + pio_stride = 128 + # Base path to the processed input ismip6 ocean and smb forcing files. # User has to supply. forcing_basepath = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res From 1f7390021bb8407e9d228e88b3f8ba7132f509bf Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 5 Apr 2023 20:13:35 -0600 Subject: [PATCH 37/43] Update symlink to restart files with new dir names --- .../tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py index dfd9701342..6f9b769b06 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py @@ -39,6 +39,7 @@ def setup(self): # noqa:C901 section = config['ismip6_run_ais_2300'] self.ntasks = section.getint('ntasks') self.min_tasks = self.ntasks + mesh_res = section.getint('mesh_res') forcing_basepath = section.get('forcing_basepath') init_cond_path = section.get('init_cond_path') init_cond_fname = os.path.split(init_cond_path)[-1] @@ -208,7 +209,7 @@ def setup(self): # noqa:C901 # historical run # don't symlink restart_timestamp or you'll have a mighty mess if not self.exp == 'hist': - os.symlink("../hist/rst.2015-01-01.nc", + os.symlink(f"../hist_{mesh_res:02}/rst.2015-01-01.nc", os.path.join(self.work_dir, 'rst.2015-01-01.nc')) with open(os.path.join(self.work_dir, "restart_timestamp"), "w") as text_file: From 4791e97d3f50744dc732238e9848ce264893e660 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 5 Apr 2023 20:16:29 -0600 Subject: [PATCH 38/43] Adjust search for forcing file names This may need adjusting depending on the situation --- .../tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py index 6f9b769b06..b7802f0e6e 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py @@ -86,7 +86,7 @@ def setup(self): # noqa:C901 # Find and copy correct forcing files smb_search_path = os.path.join( forcing_basepath, exp_fcg, - '*smb*_minus1_bare_land.nc') + '*smb*.nc') fcgFileList = glob.glob(smb_search_path) if len(fcgFileList) == 1: smb_path = fcgFileList[0] From 1a6df39a972a8b52f91a3ee165ffc779b313d237 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 5 Apr 2023 20:24:49 -0600 Subject: [PATCH 39/43] Make facemelting a cfg option --- .../ismip6_ais_proj2300.cfg | 3 ++ .../ismip6_ais_proj2300/set_up_experiment.py | 16 +++++++++- .../ismip6_ais_proj2300/streams.faceMelting | 32 +++++++++++++++++++ .../landice/test_groups/ismip6_run.rst | 3 ++ 4 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.faceMelting diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg index 54a72605cf..d16770559c 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg @@ -41,3 +41,6 @@ calving_method = restore # groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. # Only required if calving_method is set to 'von_mises' von_mises_parameter_path = UNKNOWN + +# Whether facemelting should be included in the runs +use_face_melting = True diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py index b7802f0e6e..fcf3e1d482 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/set_up_experiment.py @@ -48,6 +48,7 @@ def setup(self): # noqa:C901 region_mask_path = section.get('region_mask_path') region_mask_fname = os.path.split(region_mask_path)[-1] calving_method = section.get('calving_method') + use_face_melting = section.getboolean('use_face_melting') if self.exp == 'hist': exp_fcg = 'ctrlAE' @@ -86,7 +87,7 @@ def setup(self): # noqa:C901 # Find and copy correct forcing files smb_search_path = os.path.join( forcing_basepath, exp_fcg, - '*smb*.nc') + '*smb*bare*.nc') fcgFileList = glob.glob(smb_search_path) if len(fcgFileList) == 1: smb_path = fcgFileList[0] @@ -167,6 +168,11 @@ def setup(self): # noqa:C901 out_name='streams.landice', template_replacements=vM_stream_replacements) + if use_face_melting: + self.add_streams_file( + resource_location, 'streams.faceMelting', + out_name='streams.landice') + # Set up namelist and customize as needed self.add_namelist_file( resource_location, 'namelist.landice', @@ -199,6 +205,14 @@ def setup(self): # noqa:C901 self.add_namelist_options(options=options, out_name='namelist.landice') + # Include facemelting if needed + if use_face_melting: + options = { + 'config_front_mass_bal_grounded': "'ismip6'", + 'config_use_3d_thermal_forcing_for_face_melt': '.true.'} + self.add_namelist_options(options=options, + out_name='namelist.landice') + if useCalvingMask: options = {'config_calving': "'none'", 'config_apply_calving_mask': ".true."} diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.faceMelting b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.faceMelting new file mode 100644 index 0000000000..6c7829d224 --- /dev/null +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/streams.faceMelting @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/users_guide/landice/test_groups/ismip6_run.rst b/docs/users_guide/landice/test_groups/ismip6_run.rst index 417f292f81..8457efc92b 100644 --- a/docs/users_guide/landice/test_groups/ismip6_run.rst +++ b/docs/users_guide/landice/test_groups/ismip6_run.rst @@ -82,6 +82,9 @@ All config options should be reviewed and altered as needed. # Only required if calving_method is set to 'von_mises' von_mises_parameter_path = UNKNOWN + # Whether facemelting should be included in the runs + include_face_melting = True + Additionally, a user should also include the following options (and possibly others) that will be used for submitting the jobs for each ensemble member (set to appropriate values for their usage situation): From ee7887f1dbe93d8e9ee60efe7111f62b4e99706b Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 5 Apr 2023 20:46:44 -0600 Subject: [PATCH 40/43] Adjust default cfg options for 8km setup --- .../ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg | 4 ++-- docs/users_guide/landice/test_groups/ismip6_run.rst | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg index d16770559c..f080091dff 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300.cfg @@ -13,7 +13,7 @@ exp_list = tier1 mesh_res = 8 # number of tasks to use for each run -ntasks = 256 +ntasks = 128 # value to use for config_pio_stride. # Should be divisible into ntasks @@ -43,4 +43,4 @@ calving_method = restore von_mises_parameter_path = UNKNOWN # Whether facemelting should be included in the runs -use_face_melting = True +use_face_melting = False diff --git a/docs/users_guide/landice/test_groups/ismip6_run.rst b/docs/users_guide/landice/test_groups/ismip6_run.rst index 8457efc92b..88465ec594 100644 --- a/docs/users_guide/landice/test_groups/ismip6_run.rst +++ b/docs/users_guide/landice/test_groups/ismip6_run.rst @@ -53,7 +53,7 @@ All config options should be reviewed and altered as needed. mesh_res = 8 # number of tasks to use for each run - ntasks = 256 + ntasks = 128 # value to use for config_pio_stride. # Should be divisible into ntasks @@ -83,7 +83,7 @@ All config options should be reviewed and altered as needed. von_mises_parameter_path = UNKNOWN # Whether facemelting should be included in the runs - include_face_melting = True + include_face_melting = False Additionally, a user should also include the following options (and possibly others) that will be used for submitting the jobs for each ensemble member From 5855cbd0d97e99eae6a7d92e13c494fbc2908f39 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 7 Apr 2023 12:58:44 -0600 Subject: [PATCH 41/43] Add chicoma 4km cfg example --- .../ismip6_ais_proj2300_4km_chicoma.cfg | 45 +++++++++++++++++++ .../landice/test_groups/ismip6_run.rst | 4 ++ 2 files changed, 49 insertions(+) create mode 100644 compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg new file mode 100644 index 0000000000..085d212ac6 --- /dev/null +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg @@ -0,0 +1,45 @@ +[ismip6_run_ais_2300] +# list of experiments to set up. +# Can be "tier1", "tier2", "all", or a comma-delimited list of runs +# "tier1" is expAE01-expAE06 plus hist and ctrlAE +# "tier2" is expAE07-expAE14 +exp_list = hist,ctrlAE,expAE05 + +# Resolution that will be set up, in km. Should be one of 4, 8, as those are +# the two resolutions currently supported. +# mesh_res is informational only and is used for directory naming conventions +# The filepaths below must manually be set to be consistent. +mesh_res = 4 + +# number of tasks to use for each run +ntasks = 512 + +# value to use for config_pio_stride. +# Should be divisible into ntasks +pio_stride = 128 + +# Base path to the processed input ismip6 ocean and smb forcing files. +# User has to supply. +forcing_basepath = /usr/projects/climate/hollyhan/ismip6_files/forcing/4to20km_res + +# Path to the initial condition file. User has to supply. +init_cond_path = /usr/projects/climate/hollyhan/ismip6_files/initial_conditions/AIS_4to20km_20230105/AIS_4to20km_r01_20220907_m5_drop_bed_20m_bulldoze_troughs_75_to_400m_Enderby_maxstiffness_0.8_TG_pinning_40maf_bedmap2_surface_ASE_05perc_seafloor_mu.nc + +# Path to the file for the basal melt parametrization coefficients. +melt_params_path = /usr/projects/climate/hollyhan/ismip6_files/initial_conditions/AIS_4to20km_20230105/basin_and_coeff_gamma0_DeltaT_quadratic_non_local_after_relaxation.nc + +# Path to the region mask file +region_mask_path = /usr/projects/climate/hollyhan/ismip6_files/initial_conditions/AIS_4to20km_20230105/AIS_4to20km_r01_20220907.regionMask_ismip6.nc + +# Calving method to use. Should be one of: +# 'restore' for restore-calving front method (fixed calving front) +# 'von_mises' for von Mises threshold stress calving law +calving_method = restore + +# Path to the file containing the von Mises parameter fields +# groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. +# Only required if calving_method is set to 'von_mises' +von_mises_parameter_path = UNKNOWN + +# Whether facemelting should be included in the runs +use_face_melting = True diff --git a/docs/users_guide/landice/test_groups/ismip6_run.rst b/docs/users_guide/landice/test_groups/ismip6_run.rst index 88465ec594..fd2ebf4e04 100644 --- a/docs/users_guide/landice/test_groups/ismip6_run.rst +++ b/docs/users_guide/landice/test_groups/ismip6_run.rst @@ -35,6 +35,10 @@ config options -------------- All config options should be reviewed and altered as needed. +Example cfg files are included in the test case directory within the +``compass`` repo for previously used configurations on specific +machines to facilitate reproducibility and form a useful starting place +for new runs .. code-block:: cfg From af704d032ad76ef1c1e4bea4e56b8bdde024fb9c Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 7 Apr 2023 12:15:18 -0700 Subject: [PATCH 42/43] add nersc 4km, 8km cfg files --- .../ismip6_ais_proj2300_4km_nersc.cfg | 46 +++++++++++++++++++ .../ismip6_ais_proj2300_8km_nersc.cfg | 46 +++++++++++++++++++ 2 files changed, 92 insertions(+) create mode 100644 compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg create mode 100644 compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_8km_nersc.cfg diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg new file mode 100644 index 0000000000..7fc80df9fb --- /dev/null +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg @@ -0,0 +1,46 @@ +[ismip6_run_ais_2300] + +# list of experiments to set up. +# Can be "tier1", "tier2", "all", or a comma-delimited list of runs +# "tier1" is expAE01-expAE06 plus hist and ctrlAE +# "tier2" is expAE07-expAE14 +exp_list = tier1 + +# Resolution that will be set up, in km. Should be one of 4, 8, as those are +# the two resolutions currently supported. +# mesh_res is informational only and is used for directory naming conventions +# The filepaths below must manually be set to be consistent. +mesh_res = 8 + +# number of tasks to use for each run +ntasks = 128 + +# value to use for config_pio_stride. +# Should be divisible into ntasks +pio_stride = 128 + +# Base path to the processed input ismip6 ocean and smb forcing files. +# User has to supply. +forcing_basepath = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_4to20km_res + +# Path to the initial condition file. User has to supply. +init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_4to20km_20230105/relaxation_0TGmelt_10yr/relaxed_10yrs_4km.nc + +# Path to the file for the basal melt parametrization coefficients. +melt_params_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_4to20km_20230105/basin_and_coeff_gamma0_DeltaT_quadratic_non_local_after_relaxation.nc + +# Path to the region mask file +region_mask_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_4to20km_20230105/AIS_4to20km_r01_20220907.regionMask_ismip6.nc + +# Calving method to use. Should be one of: +# 'restore' for restore-calving front method (fixed calving front) +# 'von_mises' for von Mises threshold stress calving law +calving_method = restore + +# Path to the file containing the von Mises parameter fields +# groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. +# Only required if calving_method is set to 'von_mises' +von_mises_parameter_path = UNKNOWN + +# Whether facemelting should be included in the runs +use_face_melting = False diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_8km_nersc.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_8km_nersc.cfg new file mode 100644 index 0000000000..f080091dff --- /dev/null +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_8km_nersc.cfg @@ -0,0 +1,46 @@ +[ismip6_run_ais_2300] + +# list of experiments to set up. +# Can be "tier1", "tier2", "all", or a comma-delimited list of runs +# "tier1" is expAE01-expAE06 plus hist and ctrlAE +# "tier2" is expAE07-expAE14 +exp_list = tier1 + +# Resolution that will be set up, in km. Should be one of 4, 8, as those are +# the two resolutions currently supported. +# mesh_res is informational only and is used for directory naming conventions +# The filepaths below must manually be set to be consistent. +mesh_res = 8 + +# number of tasks to use for each run +ntasks = 128 + +# value to use for config_pio_stride. +# Should be divisible into ntasks +pio_stride = 128 + +# Base path to the processed input ismip6 ocean and smb forcing files. +# User has to supply. +forcing_basepath = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/forcing/ais_mesh_8to30km_res + +# Path to the initial condition file. User has to supply. +init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/relaxation_0TGmelt_10yr_muCap/AIS_8to30km_r01_20220906.smooth3.basinsFineTuned_carvedRonne_CIRWIP_relaxation_0TGmelt_10yr_muCap.nc + +# Path to the file for the basal melt parametrization coefficients. +melt_params_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/basin_and_coeff_gamma0_DeltaT_quadratic_non_local.nc + +# Path to the region mask file +region_mask_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP6-2300/initial_conditions/AIS_8to30km_20221027/AIS_8to30km_r01_20220607.regionMask_ismip6.nc + +# Calving method to use. Should be one of: +# 'restore' for restore-calving front method (fixed calving front) +# 'von_mises' for von Mises threshold stress calving law +calving_method = restore + +# Path to the file containing the von Mises parameter fields +# groundedVonMisesThresholdStress and floatingVonMisesThresholdStress. +# Only required if calving_method is set to 'von_mises' +von_mises_parameter_path = UNKNOWN + +# Whether facemelting should be included in the runs +use_face_melting = False From 0873f3167526013d0edb09cd37e495827f314e9d Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 7 Apr 2023 13:24:36 -0600 Subject: [PATCH 43/43] cfg corrections --- .../ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg | 2 +- .../ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg index 085d212ac6..05336e4fb6 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_chicoma.cfg @@ -23,7 +23,7 @@ pio_stride = 128 forcing_basepath = /usr/projects/climate/hollyhan/ismip6_files/forcing/4to20km_res # Path to the initial condition file. User has to supply. -init_cond_path = /usr/projects/climate/hollyhan/ismip6_files/initial_conditions/AIS_4to20km_20230105/AIS_4to20km_r01_20220907_m5_drop_bed_20m_bulldoze_troughs_75_to_400m_Enderby_maxstiffness_0.8_TG_pinning_40maf_bedmap2_surface_ASE_05perc_seafloor_mu.nc +init_cond_path = /usr/projects/climate/hollyhan/ismip6_files/initial_conditions/AIS_4to20km_20230105/relaxation_0TGmelt_10yr/relaxed_10yrs_4km.nc # Path to the file for the basal melt parametrization coefficients. melt_params_path = /usr/projects/climate/hollyhan/ismip6_files/initial_conditions/AIS_4to20km_20230105/basin_and_coeff_gamma0_DeltaT_quadratic_non_local_after_relaxation.nc diff --git a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg index 7fc80df9fb..3cdc634ccb 100644 --- a/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg +++ b/compass/landice/tests/ismip6_run/ismip6_ais_proj2300/ismip6_ais_proj2300_4km_nersc.cfg @@ -10,7 +10,7 @@ exp_list = tier1 # the two resolutions currently supported. # mesh_res is informational only and is used for directory naming conventions # The filepaths below must manually be set to be consistent. -mesh_res = 8 +mesh_res = 4 # number of tasks to use for each run ntasks = 128