From d5762ab689e714ef525d589a5547d31ce8f4e3d0 Mon Sep 17 00:00:00 2001 From: Trevor Hillebrand Date: Mon, 28 Sep 2026 19:24:36 -0700 Subject: [PATCH 01/20] Fix AIS ismip7 melt streams Add necessary melt parameters for ISMIP7 sub-shelf melt parameterization. Remove vestigial ismip6_melt_params stream. --- .../ismip7_run/ismip7_ais/streams.landice.template | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/streams.landice.template b/compass/landice/tests/ismip7_run/ismip7_ais/streams.landice.template index 3b241f685a..7dd3aec223 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/streams.landice.template +++ b/compass/landice/tests/ismip7_run/ismip7_ais/streams.landice.template @@ -82,23 +82,14 @@ - - - - - - - + + Date: Wed, 28 Oct 2026 08:13:54 -0700 Subject: [PATCH 02/20] Remove deprecated config_enable_timeAvgRestarts Remove deprecated config_enable_timeAvgRestarts option from namelist files. --- compass/landice/tests/ismip7_run/ismip7_ais/namelist.landice | 1 - compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice | 1 - 2 files changed, 2 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/namelist.landice b/compass/landice/tests/ismip7_run/ismip7_ais/namelist.landice index 498f0b8ebe..b2c127bc8e 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/namelist.landice +++ b/compass/landice/tests/ismip7_run/ismip7_ais/namelist.landice @@ -65,7 +65,6 @@ config_adaptive_timestep_include_DCFL = .false. config_adaptive_timestep_force_interval = '0000-01-00_00:00:00' config_timeaveraging_interval = '0001-00-00_00:00:00' - config_enable_timeAvgRestarts = .false. config_do_restart = .true. config_restart_timestamp_name = 'restart_timestamp' diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice index 1cbd94826d..08e6d958c6 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice +++ b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice @@ -62,7 +62,6 @@ config_adaptive_timestep_include_DCFL = .false. config_adaptive_timestep_force_interval = '0000-01-00_00:00:00' config_timeaveraging_interval = '0001-00-00_00:00:00' - config_enable_timeAvgRestarts = .false. config_do_restart = .true. config_restart_timestamp_name = 'restart_timestamp' From 3e3d3327d52ffa23f49044c3ba9ca297cd1b15e2 Mon Sep 17 00:00:00 2001 From: Trevor Hillebrand Date: Wed, 28 Oct 2026 08:17:21 -0700 Subject: [PATCH 03/20] Reduce restart intervals from 1 year to 3 months Use shorter restart intervals to reduce wasted compute time. --- .../tests/ismip7_run/ismip7_ais/streams.landice.template | 2 +- .../tests/ismip7_run/ismip7_gris/streams.landice.template | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/streams.landice.template b/compass/landice/tests/ismip7_run/ismip7_ais/streams.landice.template index 7dd3aec223..e3f9fe09ae 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/streams.landice.template +++ b/compass/landice/tests/ismip7_run/ismip7_ais/streams.landice.template @@ -13,7 +13,7 @@ filename_interval="output_interval" clobber_mode="overwrite" precision="double" - output_interval="0001-00-00_00:00:00" + output_interval="0000-03-00_00:00:00" reference_time="2000-01-01_00:00:00" filename_template="rst.$Y-$M-$D.nc" input_interval="initial_only" diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template b/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template index 348ae99e7f..e0516e2282 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template +++ b/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template @@ -13,7 +13,7 @@ filename_interval="output_interval" clobber_mode="overwrite" precision="double" - output_interval="0001-00-00_00:00:00" + output_interval="0000-03-00_00:00:00" reference_time="2000-01-01_00:00:00" filename_template="rst.$Y-$M-$D.nc" input_interval="initial_only" From ac4968772f6b6ac7e96ebbdf3888f9b9dfce8910 Mon Sep 17 00:00:00 2001 From: Trevor Hillebrand Date: Wed, 28 Oct 2026 08:19:54 -0700 Subject: [PATCH 04/20] Fix typo in albany_input.yaml Fix type ("Cubrature" instead of "Cubature") in yaml file. --- compass/landice/tests/ismip7_run/ismip7_ais/albany_input.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/albany_input.yaml b/compass/landice/tests/ismip7_run/ismip7_ais/albany_input.yaml index e301472436..534ac25fa7 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/albany_input.yaml +++ b/compass/landice/tests/ismip7_run/ismip7_ais/albany_input.yaml @@ -9,7 +9,7 @@ ANONYMOUS: Regularization Value: 1.0e-4 LandIce BCs: BC 0: - Cubrature Degree: 8 + Cubature Degree: 8 Basal Friction Coefficient: Type: Power Law Power Exponent: 0.33333333333 From be202e6ccaec18bed3510c7044b19f247ff0d798 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 29 Oct 2026 21:18:10 -0700 Subject: [PATCH 05/20] Add extrusion velo limiter option for GIS --- compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice | 1 + 1 file changed, 1 insertion(+) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice index 08e6d958c6..99d58113ed 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice +++ b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice @@ -4,6 +4,7 @@ config_unrealistic_velocity = 00.00159 config_nonconvergence_error = .false. config_flowParamA_calculation = 'PB1982' + config_cap_extrusion_velocity = .true. config_thickness_advection = 'fct' config_tracer_advection = 'fct' From b0aa529ac94eae7cd00b2e50cda75210f9d72651 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 29 Oct 2026 21:19:39 -0700 Subject: [PATCH 06/20] Update strainrate multiplier for GIS after calibration --- compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice index 99d58113ed..74b004dd7d 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice +++ b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice @@ -28,7 +28,7 @@ config_distribute_unablatedVolumeDynCell = .true. config_calving_error_threshold = 100000.0 config_apply_facemelt_strainrate_enhancement = .true. - config_calving_strainrate_scaling = 1.0 + config_calving_strainrate_scaling = 5.0 config_calving_strainrate_scaling_source = 'scalar' From 2d7331a89ef11b13f2893b94dbd00a3293a537db Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 29 Oct 2026 21:24:46 -0700 Subject: [PATCH 07/20] Update paths for input and surfaceRef files for GIS --- .../landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg index e54a657d03..5f28743169 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg @@ -19,7 +19,7 @@ pio_stride = 128 forcing_basepath = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/test_processing/GIS # Path to the initial condition file. User has to supply. -init_cond_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r02/GIS_1to10km_r02_20230202_remove_icebergs.nc +init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5.nc # Path to the file for the basal melt parametrization coefficients. # Required if use_3d_thermal_forcing is true. @@ -31,7 +31,7 @@ melt_params_path = NotAvailable use_3d_thermal_forcing = false # Path to the reference surface elevation file -reference_surface_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/forcing/GIS/upper_surface.nc +reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5_surfaceElevationRef.nc # Path to the region mask file region_mask_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r02/GIS_1to10km_r02_20230202_ismip6_regionMasks.nc From 47d4607527c237e1bbd79d86858cdae1c91a4362 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Fri, 30 Oct 2026 09:53:45 -0700 Subject: [PATCH 08/20] Update GIS cfg paths * OCX forcing path * enable 3d TF * ctrl forcing paths Note that it looks like the setup function is not equipped to handle ctrl 3d TF forcing that is broken into separate files, which is the case because of large file sizes. This may be why the 3d tf had been disabled. Also note that each of the two controls must be set up separately because the cfg uses direct paths to the forcing files themselves. --- .../ismip7_run/ismip7_gris/ismip7_gris_test.cfg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg index 5f28743169..d7ef70eac1 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg @@ -16,19 +16,19 @@ pio_stride = 128 # {forcing_basepath}/{model}_{scenario}/atmosphere/ # {forcing_basepath}/{model}_{scenario}/ocean_thermal_forcing/ # User has to supply. -forcing_basepath = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/test_processing/GIS +forcing_basepath = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS # Path to the initial condition file. User has to supply. init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5.nc # Path to the file for the basal melt parametrization coefficients. # Required if use_3d_thermal_forcing is true. -melt_params_path = NotAvailable +melt_params_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/OCX/ocean_thermal_forcing/GIS_1to10km_r03_20260925_meltParams_OCX.nc # Whether to force with 3D ocean thermal forcing (built by the # build_3d_thermal_forcing step of landice/ismip7_forcing/ocean_thermal) # instead of the default 2D forcing. Requires melt_params_path. -use_3d_thermal_forcing = false +use_3d_thermal_forcing = true # Path to the reference surface elevation file reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5_surfaceElevationRef.nc @@ -37,17 +37,17 @@ reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/init region_mask_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r02/GIS_1to10km_r02_20230202_ismip6_regionMasks.nc # Path to the 2D ocean thermal forcing climatology file for CTRL2015 runs. -ctrl_tf_climatology_path = NotAvailable +ctrl_tf_climatology_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/CESM2-WACCM_ctrl/ocean_thermal_forcing/GIS_1to10km_r03_20260925_2dThermalForcing_CESM2-WACCM_ctrl_2000-2301.nc # Path to the 3D ocean thermal forcing climatology file for CTRL2015 runs # (only needed if use_3d_thermal_forcing = true). -ctrl_tf_3d_climatology_path = NotAvailable +ctrl_tf_3d_climatology_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/CESM2-WACCM_ctrl/ocean_thermal_forcing/GIS_1to10km_r03_20260925_3dThermalForcing_CESM2-WACCM_ctrl*.nc # Path to the atmosphere climatology files for CTRL2015 runs. -ctrl_atm_climatology_path = NotAvailable +ctrl_atm_climatology_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/CESM2-WACCM_ctrl/atmosphere # Path to OCX forcing. -ocx_forcing_path = NotAvailable +ocx_forcing_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/OCX # Calving method to use. Options: restore, von_mises calving_method = restore From 154f1a5de5c7513be7cbbaac11dad16becb88653 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Sun, 1 Nov 2026 18:41:30 -0800 Subject: [PATCH 09/20] GIS: crev water=24; strainmult=4; CFLfrac=0.75 After fixing the MOLHO and FCT bugs, it became necessary to increase CD strainrate mult to 8 to match restore-calving VAF. However, at that level, Jakobhavn was exhibiting much too high and possibly borderline unstable retreat. I explored adding crevasse water depth to also increase calving. Amaral et al. (2020) recommend crevasse water depth=24 m for a GIS-wide parameter value, based on observed velocity and terminus position maps. Water depth=24m alone still greatly underestimates the VAF from restore-calving. So I then include strainrate multiplier on top of a prescribed 24 m water depth, and find strain rate multiplier of 4 works best. This commit also changes the allowable CFL fraction to 0.75 after testing shows similar accuracy to using 0.5. --- .../landice/tests/ismip7_run/ismip7_gris/namelist.landice | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice index 74b004dd7d..4ae1ee1dfd 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice +++ b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice @@ -28,9 +28,10 @@ config_distribute_unablatedVolumeDynCell = .true. config_calving_error_threshold = 100000.0 config_apply_facemelt_strainrate_enhancement = .true. - config_calving_strainrate_scaling = 5.0 + config_calving_strainrate_scaling = 4.0 config_calving_strainrate_scaling_source = 'scalar' - + config_crevasse_water_depth_source = 'scalar' + config_crevasse_water_depth = 24.0 config_thermal_solver = 'temperature' config_thermal_calculate_bmb = .true. @@ -59,7 +60,7 @@ config_adaptive_timestep_include_calving = .true. config_min_adaptive_timestep = 60 config_max_adaptive_timestep = 3.154e7 - config_adaptive_timestep_CFL_fraction = 0.5 + config_adaptive_timestep_CFL_fraction = 0.75 config_adaptive_timestep_include_DCFL = .false. config_adaptive_timestep_force_interval = '0000-01-00_00:00:00' config_timeaveraging_interval = '0001-00-00_00:00:00' From 62236277a5afd5ced2baee5aac016267412926ae Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 4 Nov 2026 09:37:34 -0800 Subject: [PATCH 10/20] Update final params: strainratemult=5, CFLfrac=0.5, remove extrusion opt --- .../landice/tests/ismip7_run/ismip7_gris/namelist.landice | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice index 4ae1ee1dfd..f8f9b5b9fd 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice +++ b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice @@ -4,7 +4,6 @@ config_unrealistic_velocity = 00.00159 config_nonconvergence_error = .false. config_flowParamA_calculation = 'PB1982' - config_cap_extrusion_velocity = .true. config_thickness_advection = 'fct' config_tracer_advection = 'fct' @@ -28,7 +27,7 @@ config_distribute_unablatedVolumeDynCell = .true. config_calving_error_threshold = 100000.0 config_apply_facemelt_strainrate_enhancement = .true. - config_calving_strainrate_scaling = 4.0 + config_calving_strainrate_scaling = 5.0 config_calving_strainrate_scaling_source = 'scalar' config_crevasse_water_depth_source = 'scalar' config_crevasse_water_depth = 24.0 @@ -60,7 +59,7 @@ config_adaptive_timestep_include_calving = .true. config_min_adaptive_timestep = 60 config_max_adaptive_timestep = 3.154e7 - config_adaptive_timestep_CFL_fraction = 0.75 + config_adaptive_timestep_CFL_fraction = 0.5 config_adaptive_timestep_include_DCFL = .false. config_adaptive_timestep_force_interval = '0000-01-00_00:00:00' config_timeaveraging_interval = '0001-00-00_00:00:00' From e2b1d124bc0b9b3554d05b27952e3406845911c3 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 4 Nov 2026 12:24:02 -0800 Subject: [PATCH 11/20] Update i.c. file to be consistent with new calving settings; rename production cfg --- ...p7_gris_test.cfg => ismip7_gris_pm_production.cfg} | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) rename compass/landice/tests/ismip7_run/ismip7_gris/{ismip7_gris_test.cfg => ismip7_gris_pm_production.cfg} (88%) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg similarity index 88% rename from compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg rename to compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg index d7ef70eac1..a3551d13d3 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_test.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg @@ -3,7 +3,12 @@ # List of experiments to set up. # Can be "all", "historical", "projections", "ctrl", or a # comma-delimited list of experiment names. -exp_list = historical_CESM2-WACCM,ssp585_CESM2-WACCM +#exp_list = historical_CESM2-WACCM,ssp585_CESM2-WACCM + +# first batch: 2026-11-04 +exp_list = historical_CESM2-WACCM,ssp585_CESM2-WACCM,ctrl_CESM2-WACCM,ocx + + # Number of tasks to use for each run ntasks = 512 @@ -19,7 +24,7 @@ pio_stride = 128 forcing_basepath = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS # Path to the initial condition file. User has to supply. -init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5.nc +init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261104/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5water24m.nc # Path to the file for the basal melt parametrization coefficients. # Required if use_3d_thermal_forcing is true. @@ -31,7 +36,7 @@ melt_params_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_ use_3d_thermal_forcing = true # Path to the reference surface elevation file -reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5_surfaceElevationRef.nc +reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261104/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5water24m_surfaceElevationRef.nc # Path to the region mask file region_mask_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r02/GIS_1to10km_r02_20230202_ismip6_regionMasks.nc From 9005baf2fbb86ad47ad44989665722ef18763c5f Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 4 Nov 2026 12:38:57 -0800 Subject: [PATCH 12/20] update region file to current mesh generation --- .../tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg index a3551d13d3..88a543e075 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg @@ -39,7 +39,7 @@ use_3d_thermal_forcing = true reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261104/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5water24m_surfaceElevationRef.nc # Path to the region mask file -region_mask_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r02/GIS_1to10km_r02_20230202_ismip6_regionMasks.nc +region_mask_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r03/GIS_1to10km_r03_20260903_ismip6_regionMasks.nc # Path to the 2D ocean thermal forcing climatology file for CTRL2015 runs. ctrl_tf_climatology_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/CESM2-WACCM_ctrl/ocean_thermal_forcing/GIS_1to10km_r03_20260925_2dThermalForcing_CESM2-WACCM_ctrl_2000-2301.nc From ea9ffe811449a587f0c63c5ff244b34c518cf8ae Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 4 Nov 2026 18:46:53 -0800 Subject: [PATCH 13/20] Update yaml friction settings to match GIS optimization --- compass/landice/tests/ismip7_run/ismip7_gris/albany_input.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/albany_input.yaml b/compass/landice/tests/ismip7_run/ismip7_gris/albany_input.yaml index ae2e22b2db..1db7993436 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/albany_input.yaml +++ b/compass/landice/tests/ismip7_run/ismip7_gris/albany_input.yaml @@ -15,8 +15,7 @@ ANONYMOUS: Power Exponent: 0.33333333333333 Mu Type: Field Effective Pressure Type: Hydrostatic Computed At Nodes - Zero Effective Pressure On Floating Ice At Nodes: true - Zero Beta On Floating Ice: true + Zero Beta On Floating Ice: false Use Pressurized Bed Above Sea Level: false # Discretization Description From 03f4aab67b28c64be50960e288aff2ff77fcf6a9 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Wed, 4 Nov 2026 22:11:51 -0800 Subject: [PATCH 14/20] Add monthly output stream with just thickness and surfaceSpeed --- .../ismip7_gris/streams.landice.template | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template b/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template index e0516e2282..52aaa8600f 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template +++ b/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template @@ -144,6 +144,21 @@ + + + + + + + + + Date: Thu, 5 Nov 2026 20:07:51 -0800 Subject: [PATCH 15/20] Remove initial_only forcing frequency for GIS ctrl run That was the case in ISMIP6, but for ISMIP7, the ctrl runs are a monthly climatology, so the same stream settings apply. --- .../ismip7_run/ismip7_gris/set_up_experiment.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py index 21e466663e..f23dfc2c7c 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py +++ b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py @@ -287,17 +287,12 @@ def setup(self): # noqa: C901 tf_3d_fname = '' # --- Set up streams --- - if scenario == 'ctrl': - forcing_interval_monthly = 'initial_only' - forcing_interval_annual = 'initial_only' - forcing_interval_TF = 'initial_only' - else: - forcing_interval_monthly = '0000-01-00_00:00:00' - forcing_interval_annual = '0001-00-00_00:00:00' - # GrIS thermal forcing (2D and 3D) is monthly. The annual - # cadence only applies to Antarctica, whose ISMIP7 3D forcing is - # provided annually. - forcing_interval_TF = forcing_interval_monthly + forcing_interval_monthly = '0000-01-00_00:00:00' + forcing_interval_annual = '0001-00-00_00:00:00' + # GrIS thermal forcing (2D and 3D) is monthly. The annual + # cadence only applies to Antarctica, whose ISMIP7 3D forcing is + # provided annually. + forcing_interval_TF = forcing_interval_monthly stream_replacements = { 'input_file_init_cond': init_cond_fname if is_historical From 058c577ff0ce2990260fdf44fc6ca4a991ab234b Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 5 Nov 2026 20:39:13 -0800 Subject: [PATCH 16/20] Treat ctrl like other ismip7_run experiments The ctrl experiments were special-cased in ismip7_gris and ismip7_ais, a holdover from the old constant-climate protocol. They used separate ctrl_*_climatology_path options and assumed a single 3D thermal forcing file, so the multi-year GrIS 3D TF chunks were never symlinked. Both ctrl runs now use {forcing_basepath}/{model}_ctrl and the same forcing-file discovery and intervals as the other experiments. In AIS, mesh-name filtering and annual TF are kept, and ctrl still skips the hydrofracture shelf-collapse mask. The ctrl_*_climatology_path options are removed from the configs and the docs are updated. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../ismip7_run/ismip7_ais/ismip7_ais.cfg | 10 - .../ismip7_run/ismip7_ais/ismip7_ais_test.cfg | 10 - .../ismip7_ais/set_up_experiment.py | 252 ++++++---------- .../ismip7_run/ismip7_gris/ismip7_gris.cfg | 10 - .../ismip7_gris/ismip7_gris_pm_production.cfg | 10 - .../ismip7_gris/set_up_experiment.py | 284 +++++++----------- .../landice/test_groups/ismip7_run.rst | 4 +- .../landice/test_groups/ismip7_run.rst | 9 +- 8 files changed, 196 insertions(+), 393 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais.cfg b/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais.cfg index 04defefb4c..a78d12322b 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais.cfg @@ -38,16 +38,6 @@ reference_surface_path = NotAvailable # Path to the region mask file region_mask_path = NotAvailable -# Path to the ocean thermal forcing climatology file for CTRL2015 runs. -# This is the constant-climate 30-year mean (2000-2029) thermal forcing. -# User has to supply if running ctrl experiments. -ctrl_tf_climatology_path = NotAvailable - -# Path to the atmosphere climatology files for CTRL2015 runs. -# Directory containing constant-climate SMB, temperature, etc. -# User has to supply if running ctrl experiments. -ctrl_atm_climatology_path = NotAvailable - # Path to OCX (observationally constrained experiment) forcing. # User has to supply if running the ocx experiment. ocx_forcing_path = NotAvailable diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais_test.cfg b/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais_test.cfg index be38585e1d..da4e2d9be5 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais_test.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais_test.cfg @@ -38,16 +38,6 @@ reference_surface_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/forcing/AI # 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 -# Path to the ocean thermal forcing climatology file for CTRL2015 runs. -# This is the constant-climate 30-year mean (2000-2029) thermal forcing. -# User has to supply if running ctrl experiments. -ctrl_tf_climatology_path = NotAvailable - -# Path to the atmosphere climatology files for CTRL2015 runs. -# Directory containing constant-climate SMB, temperature, etc. -# User has to supply if running ctrl experiments. -ctrl_atm_climatology_path = NotAvailable - # Path to OCX (observationally constrained experiment) forcing. # User has to supply if running the ocx experiment. ocx_forcing_path = NotAvailable diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py b/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py index 362f836367..32fe278313 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py @@ -93,9 +93,6 @@ def setup(self): # noqa: C901 if scenario == 'ocx': ocx_forcing_path = section.get('ocx_forcing_path') forcing_dir = ocx_forcing_path - elif scenario == 'ctrl': - # Control run uses climatology forcing - forcing_dir = None # handled separately below else: # Standard ESM-driven experiment forcing_dir = os.path.join(forcing_basepath, @@ -117,160 +114,91 @@ def setup(self): # noqa: C901 os.path.basename(reference_surface_path))) # --- Find and symlink forcing files --- - if scenario == 'ctrl': - # Control run: use climatology files - ctrl_tf_path = section.get('ctrl_tf_climatology_path') - ctrl_atm_path = section.get('ctrl_atm_climatology_path') - tf_fname = os.path.split(ctrl_tf_path)[-1] - os.symlink(ctrl_tf_path, + atm_dir = os.path.join(forcing_dir, 'atmosphere') + ocean_dir = os.path.join(forcing_dir, 'ocean_thermal_forcing') + + # SMB forcing + smb_search = os.path.join(atm_dir, '*SMB_*.nc') + smb_list = glob.glob(smb_search) + print(f" Found {len(smb_list)} SMB files before filtering") + smb_list = [f for f in smb_list if 'gradient' not in f] + print(f" Found {len(smb_list)} SMB files after removing " + f"gradients") + # Filter by mesh name to handle directories with multiple meshes + smb_list = [f for f in smb_list if mesh_name in f] + print(f" Found {len(smb_list)} SMB files after mesh filter: " + f"{smb_list}") + if len(smb_list) == 1: + smb_fname = os.path.split(smb_list[0])[-1] + os.symlink(smb_list[0], + os.path.join(self.work_dir, smb_fname)) + else: + sys.exit(f"ERROR: Expected 1 SMB file matching mesh " + f"{mesh_name} at {smb_search}, found " + f"{len(smb_list)}: {smb_list}") + + # Temperature forcing + temp_search = os.path.join(atm_dir, '*temperature_*.nc') + temp_list = glob.glob(temp_search) + temp_list = [f for f in temp_list if 'gradient' not in f] + # Filter by mesh name to handle directories with multiple meshes + temp_list = [f for f in temp_list if mesh_name in f] + if len(temp_list) == 1: + temp_fname = os.path.split(temp_list[0])[-1] + os.symlink(temp_list[0], + os.path.join(self.work_dir, temp_fname)) + else: + sys.exit(f"ERROR: Expected 1 temperature file matching mesh " + f"{mesh_name} at {temp_search}, found " + f"{len(temp_list)}") + + # Runoff forcing (optional — may not exist for all experiments) + runoff_search = os.path.join(atm_dir, '*runoff_*.nc') + runoff_list = glob.glob(runoff_search) + # Filter by mesh name to handle directories with multiple meshes + runoff_list = [f for f in runoff_list if mesh_name in f] + runoff_fname = '' + if len(runoff_list) == 1: + runoff_fname = os.path.split(runoff_list[0])[-1] + os.symlink(runoff_list[0], + os.path.join(self.work_dir, runoff_fname)) + + # SMB gradient (lapse rate) + smb_grad_search = os.path.join(atm_dir, '*SMB_gradient_*.nc') + smb_grad_list = glob.glob(smb_grad_search) + # Filter by mesh name to handle directories with multiple meshes + smb_grad_list = [f for f in smb_grad_list if mesh_name in f] + smb_grad_fname = '' + if len(smb_grad_list) == 1: + smb_grad_fname = os.path.split(smb_grad_list[0])[-1] + os.symlink(smb_grad_list[0], + os.path.join(self.work_dir, smb_grad_fname)) + + # Temperature gradient (lapse rate) + temp_grad_search = os.path.join(atm_dir, + '*temperature_gradient_*.nc') + temp_grad_list = glob.glob(temp_grad_search) + # Filter by mesh name to handle directories with multiple meshes + temp_grad_list = [f for f in temp_grad_list if mesh_name in f] + temp_grad_fname = '' + if len(temp_grad_list) == 1: + temp_grad_fname = os.path.split(temp_grad_list[0])[-1] + os.symlink(temp_grad_list[0], + os.path.join(self.work_dir, temp_grad_fname)) + + # Thermal forcing + tf_search = os.path.join(ocean_dir, '*3dThermalForcing_*.nc') + tf_list = glob.glob(tf_search) + # Filter by mesh name to handle directories with multiple meshes + tf_list = [f for f in tf_list if mesh_name in f] + if len(tf_list) == 1: + tf_fname = os.path.split(tf_list[0])[-1] + os.symlink(tf_list[0], os.path.join(self.work_dir, tf_fname)) - - # Find atmosphere climatology files - smb_files = glob.glob(os.path.join(ctrl_atm_path, '*SMB*.nc')) - smb_files = [f for f in smb_files if 'gradient' not in f] - # Filter by mesh name to handle directories with multiple meshes - smb_files = [f for f in smb_files if mesh_name in f] - if len(smb_files) == 1: - smb_fname = os.path.split(smb_files[0])[-1] - os.symlink(smb_files[0], - os.path.join(self.work_dir, smb_fname)) - else: - sys.exit(f"ERROR: Expected 1 SMB climatology file matching " - f"mesh {mesh_name} in {ctrl_atm_path}, found " - f"{len(smb_files)}") - - temp_files = glob.glob( - os.path.join(ctrl_atm_path, '*temperature*.nc')) - temp_files = [f for f in temp_files if 'gradient' not in f] - # Filter by mesh name to handle directories with multiple meshes - temp_files = [f for f in temp_files if mesh_name in f] - if len(temp_files) == 1: - temp_fname = os.path.split(temp_files[0])[-1] - os.symlink(temp_files[0], - os.path.join(self.work_dir, temp_fname)) - else: - sys.exit(f"ERROR: Expected 1 temperature climatology file " - f"matching mesh {mesh_name} in {ctrl_atm_path}, " - f"found {len(temp_files)}") - - runoff_files = glob.glob( - os.path.join(ctrl_atm_path, '*runoff*.nc')) - # Filter by mesh name to handle directories with multiple meshes - runoff_files = [f for f in runoff_files if mesh_name in f] - if len(runoff_files) == 1: - runoff_fname = os.path.split(runoff_files[0])[-1] - os.symlink(runoff_files[0], - os.path.join(self.work_dir, runoff_fname)) - else: - runoff_fname = '' # runoff may not exist for ctrl - - smb_grad_files = glob.glob( - os.path.join(ctrl_atm_path, '*SMB_gradient*.nc')) - # Filter by mesh name to handle directories with multiple meshes - smb_grad_files = [f for f in smb_grad_files if mesh_name in f] - smb_grad_fname = '' - if len(smb_grad_files) == 1: - smb_grad_fname = os.path.split(smb_grad_files[0])[-1] - os.symlink(smb_grad_files[0], - os.path.join(self.work_dir, smb_grad_fname)) - - temp_grad_files = glob.glob( - os.path.join(ctrl_atm_path, '*temperature_gradient*.nc')) - # Filter by mesh name to handle directories with multiple meshes - temp_grad_files = [f for f in temp_grad_files if mesh_name in f] - temp_grad_fname = '' - if len(temp_grad_files) == 1: - temp_grad_fname = os.path.split(temp_grad_files[0])[-1] - os.symlink(temp_grad_files[0], - os.path.join(self.work_dir, temp_grad_fname)) - else: - # Standard or OCX experiment: find forcing in forcing_dir - atm_dir = os.path.join(forcing_dir, 'atmosphere') - ocean_dir = os.path.join(forcing_dir, 'ocean_thermal_forcing') - - # SMB forcing - smb_search = os.path.join(atm_dir, '*SMB_*.nc') - smb_list = glob.glob(smb_search) - print(f" Found {len(smb_list)} SMB files before filtering") - smb_list = [f for f in smb_list if 'gradient' not in f] - print(f" Found {len(smb_list)} SMB files after removing " - f"gradients") - # Filter by mesh name to handle directories with multiple meshes - smb_list = [f for f in smb_list if mesh_name in f] - print(f" Found {len(smb_list)} SMB files after mesh filter: " - f"{smb_list}") - if len(smb_list) == 1: - smb_fname = os.path.split(smb_list[0])[-1] - os.symlink(smb_list[0], - os.path.join(self.work_dir, smb_fname)) - else: - sys.exit(f"ERROR: Expected 1 SMB file matching mesh " - f"{mesh_name} at {smb_search}, found " - f"{len(smb_list)}: {smb_list}") - - # Temperature forcing - temp_search = os.path.join(atm_dir, '*temperature_*.nc') - temp_list = glob.glob(temp_search) - temp_list = [f for f in temp_list if 'gradient' not in f] - # Filter by mesh name to handle directories with multiple meshes - temp_list = [f for f in temp_list if mesh_name in f] - if len(temp_list) == 1: - temp_fname = os.path.split(temp_list[0])[-1] - os.symlink(temp_list[0], - os.path.join(self.work_dir, temp_fname)) - else: - sys.exit(f"ERROR: Expected 1 temperature file matching mesh " - f"{mesh_name} at {temp_search}, found " - f"{len(temp_list)}") - - # Runoff forcing (optional — may not exist for all experiments) - runoff_search = os.path.join(atm_dir, '*runoff_*.nc') - runoff_list = glob.glob(runoff_search) - # Filter by mesh name to handle directories with multiple meshes - runoff_list = [f for f in runoff_list if mesh_name in f] - runoff_fname = '' - if len(runoff_list) == 1: - runoff_fname = os.path.split(runoff_list[0])[-1] - os.symlink(runoff_list[0], - os.path.join(self.work_dir, runoff_fname)) - - # SMB gradient (lapse rate) - smb_grad_search = os.path.join(atm_dir, '*SMB_gradient_*.nc') - smb_grad_list = glob.glob(smb_grad_search) - # Filter by mesh name to handle directories with multiple meshes - smb_grad_list = [f for f in smb_grad_list if mesh_name in f] - smb_grad_fname = '' - if len(smb_grad_list) == 1: - smb_grad_fname = os.path.split(smb_grad_list[0])[-1] - os.symlink(smb_grad_list[0], - os.path.join(self.work_dir, smb_grad_fname)) - - # Temperature gradient (lapse rate) - temp_grad_search = os.path.join(atm_dir, - '*temperature_gradient_*.nc') - temp_grad_list = glob.glob(temp_grad_search) - # Filter by mesh name to handle directories with multiple meshes - temp_grad_list = [f for f in temp_grad_list if mesh_name in f] - temp_grad_fname = '' - if len(temp_grad_list) == 1: - temp_grad_fname = os.path.split(temp_grad_list[0])[-1] - os.symlink(temp_grad_list[0], - os.path.join(self.work_dir, temp_grad_fname)) - - # Thermal forcing - tf_search = os.path.join(ocean_dir, '*3dThermalForcing_*.nc') - tf_list = glob.glob(tf_search) - # Filter by mesh name to handle directories with multiple meshes - tf_list = [f for f in tf_list if mesh_name in f] - if len(tf_list) == 1: - tf_fname = os.path.split(tf_list[0])[-1] - os.symlink(tf_list[0], - os.path.join(self.work_dir, tf_fname)) - else: - sys.exit(f"ERROR: Expected 1 TF file matching mesh " - f"{mesh_name} at {tf_search}, found " - f"{len(tf_list)}: {tf_list}") + sys.exit(f"ERROR: Expected 1 TF file matching mesh " + f"{mesh_name} at {tf_search}, found " + f"{len(tf_list)}: {tf_list}") # --- Find shelf collapse (calving) mask from ismip7_forcing # fracture Path C --- @@ -295,18 +223,8 @@ def setup(self): # noqa: C901 mask_fname = '' # --- Set up streams --- - # Determine forcing interval - if scenario == 'ctrl': - forcing_interval_monthly = 'initial_only' - forcing_interval_annual = 'initial_only' - elif is_historical: - # Historical: read forcing at each interval - forcing_interval_monthly = '0000-01-00_00:00:00' - forcing_interval_annual = '0001-00-00_00:00:00' - else: - # Projections - forcing_interval_monthly = '0000-01-00_00:00:00' - forcing_interval_annual = '0001-00-00_00:00:00' + forcing_interval_monthly = '0000-01-00_00:00:00' + forcing_interval_annual = '0001-00-00_00:00:00' stream_replacements = { 'input_file_init_cond': init_cond_fname if is_historical diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris.cfg index e6a8137ed0..5daa744bd6 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris.cfg @@ -36,16 +36,6 @@ reference_surface_path = NotAvailable # Path to the region mask file region_mask_path = NotAvailable -# Path to the 2D ocean thermal forcing climatology file for CTRL2015 runs. -ctrl_tf_climatology_path = NotAvailable - -# Path to the 3D ocean thermal forcing climatology file for CTRL2015 runs -# (only needed if use_3d_thermal_forcing = true). -ctrl_tf_3d_climatology_path = NotAvailable - -# Path to the atmosphere climatology files for CTRL2015 runs. -ctrl_atm_climatology_path = NotAvailable - # Path to OCX forcing. ocx_forcing_path = NotAvailable diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg index 88a543e075..c300d9f6fa 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg @@ -41,16 +41,6 @@ reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/init # Path to the region mask file region_mask_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r03/GIS_1to10km_r03_20260903_ismip6_regionMasks.nc -# Path to the 2D ocean thermal forcing climatology file for CTRL2015 runs. -ctrl_tf_climatology_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/CESM2-WACCM_ctrl/ocean_thermal_forcing/GIS_1to10km_r03_20260925_2dThermalForcing_CESM2-WACCM_ctrl_2000-2301.nc - -# Path to the 3D ocean thermal forcing climatology file for CTRL2015 runs -# (only needed if use_3d_thermal_forcing = true). -ctrl_tf_3d_climatology_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/CESM2-WACCM_ctrl/ocean_thermal_forcing/GIS_1to10km_r03_20260925_3dThermalForcing_CESM2-WACCM_ctrl*.nc - -# Path to the atmosphere climatology files for CTRL2015 runs. -ctrl_atm_climatology_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/CESM2-WACCM_ctrl/atmosphere - # Path to OCX forcing. ocx_forcing_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/OCX diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py index f23dfc2c7c..4b1f99248b 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py +++ b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py @@ -85,8 +85,6 @@ def setup(self): # noqa: C901 if scenario == 'ocx': ocx_forcing_path = section.get('ocx_forcing_path') forcing_dir = ocx_forcing_path - elif scenario == 'ctrl': - forcing_dir = None else: forcing_dir = os.path.join(forcing_basepath, f"{model}_{scenario}") @@ -107,184 +105,114 @@ def setup(self): # noqa: C901 os.path.basename(reference_surface_path))) # --- Find and symlink forcing files --- - if scenario == 'ctrl': - ctrl_tf_path = section.get('ctrl_tf_climatology_path') - ctrl_atm_path = section.get('ctrl_atm_climatology_path') - tf_fname = os.path.split(ctrl_tf_path)[-1] - os.symlink(ctrl_tf_path, - os.path.join(self.work_dir, tf_fname)) - - # 3D climatology TF (optional, only with use_3d_thermal_forcing) - if use_3d_thermal_forcing: - ctrl_tf_3d_path = section.get( - 'ctrl_tf_3d_climatology_path') - if ctrl_tf_3d_path == 'NotAvailable': - raise ValueError( - "ctrl_tf_3d_climatology_path must be supplied when " - "use_3d_thermal_forcing is true for a CTRL run") - tf_3d_fname = os.path.split(ctrl_tf_3d_path)[-1] - os.symlink(ctrl_tf_3d_path, - os.path.join(self.work_dir, tf_3d_fname)) - else: - tf_3d_fname = '' - - smb_files = glob.glob(os.path.join(ctrl_atm_path, '*SMB*.nc')) - smb_files = [f for f in smb_files if 'gradient' not in f] - if len(smb_files) == 1: - smb_fname = os.path.split(smb_files[0])[-1] - os.symlink(smb_files[0], - os.path.join(self.work_dir, smb_fname)) - else: - sys.exit(f"ERROR: Expected 1 SMB climatology file in " - f"{ctrl_atm_path}, found {len(smb_files)}") - - temp_files = glob.glob( - os.path.join(ctrl_atm_path, '*temperature*.nc')) - temp_files = [f for f in temp_files if 'gradient' not in f] - if len(temp_files) == 1: - temp_fname = os.path.split(temp_files[0])[-1] - os.symlink(temp_files[0], - os.path.join(self.work_dir, temp_fname)) - else: - sys.exit(f"ERROR: Expected 1 temperature climatology file in " - f"{ctrl_atm_path}, found {len(temp_files)}") - - runoff_files = glob.glob( - os.path.join(ctrl_atm_path, '*runoff*.nc')) - runoff_fname = '' - if len(runoff_files) == 1: - runoff_fname = os.path.split(runoff_files[0])[-1] - os.symlink(runoff_files[0], - os.path.join(self.work_dir, runoff_fname)) - - smb_grad_files = glob.glob( - os.path.join(ctrl_atm_path, '*SMB_gradient*.nc')) - smb_grad_fname = '' - if len(smb_grad_files) == 1: - smb_grad_fname = os.path.split(smb_grad_files[0])[-1] - os.symlink(smb_grad_files[0], - os.path.join(self.work_dir, smb_grad_fname)) - - temp_grad_files = glob.glob( - os.path.join(ctrl_atm_path, '*temperature_gradient*.nc')) - temp_grad_fname = '' - if len(temp_grad_files) == 1: - temp_grad_fname = os.path.split(temp_grad_files[0])[-1] - os.symlink(temp_grad_files[0], - os.path.join(self.work_dir, temp_grad_fname)) - + atm_dir = os.path.join(forcing_dir, 'atmosphere') + ocean_dir = os.path.join(forcing_dir, 'ocean_thermal_forcing') + + smb_search = os.path.join(atm_dir, '*SMB_*.nc') + smb_list = glob.glob(smb_search) + smb_list = [f for f in smb_list if 'gradient' not in f] + if len(smb_list) == 1: + smb_fname = os.path.split(smb_list[0])[-1] + os.symlink(smb_list[0], + os.path.join(self.work_dir, smb_fname)) + else: + sys.exit(f"ERROR: Expected 1 SMB file at {smb_search}, " + f"found {len(smb_list)}") + + temp_search = os.path.join(atm_dir, '*temperature_*.nc') + temp_list = glob.glob(temp_search) + temp_list = [f for f in temp_list if 'gradient' not in f] + if len(temp_list) == 1: + temp_fname = os.path.split(temp_list[0])[-1] + os.symlink(temp_list[0], + os.path.join(self.work_dir, temp_fname)) else: - atm_dir = os.path.join(forcing_dir, 'atmosphere') - ocean_dir = os.path.join(forcing_dir, 'ocean_thermal_forcing') - - smb_search = os.path.join(atm_dir, '*SMB_*.nc') - smb_list = glob.glob(smb_search) - smb_list = [f for f in smb_list if 'gradient' not in f] - if len(smb_list) == 1: - smb_fname = os.path.split(smb_list[0])[-1] - os.symlink(smb_list[0], - os.path.join(self.work_dir, smb_fname)) - else: - sys.exit(f"ERROR: Expected 1 SMB file at {smb_search}, " - f"found {len(smb_list)}") - - temp_search = os.path.join(atm_dir, '*temperature_*.nc') - temp_list = glob.glob(temp_search) - temp_list = [f for f in temp_list if 'gradient' not in f] - if len(temp_list) == 1: - temp_fname = os.path.split(temp_list[0])[-1] - os.symlink(temp_list[0], - os.path.join(self.work_dir, temp_fname)) - else: - sys.exit(f"ERROR: Expected 1 temperature file at " - f"{temp_search}, found {len(temp_list)}") - - runoff_search = os.path.join(atm_dir, '*runoff_*.nc') - runoff_list = glob.glob(runoff_search) - runoff_fname = '' - if len(runoff_list) == 1: - runoff_fname = os.path.split(runoff_list[0])[-1] - os.symlink(runoff_list[0], - os.path.join(self.work_dir, runoff_fname)) - - smb_grad_search = os.path.join(atm_dir, '*SMB_gradient_*.nc') - smb_grad_list = glob.glob(smb_grad_search) - smb_grad_fname = '' - if len(smb_grad_list) == 1: - smb_grad_fname = os.path.split(smb_grad_list[0])[-1] - os.symlink(smb_grad_list[0], - os.path.join(self.work_dir, smb_grad_fname)) - - temp_grad_search = os.path.join(atm_dir, - '*temperature_gradient_*.nc') - temp_grad_list = glob.glob(temp_grad_search) - temp_grad_fname = '' - if len(temp_grad_list) == 1: - temp_grad_fname = os.path.split(temp_grad_list[0])[-1] - os.symlink(temp_grad_list[0], - os.path.join(self.work_dir, temp_grad_fname)) - - # GrIS thermal forcing: always 2D, plus 3D when - # use_3d_thermal_forcing is true (see build_3d_thermal_forcing - # in landice/ismip7_forcing/ocean_thermal) - - # 2D thermal forcing (always) - tf_2d_search = os.path.join(ocean_dir, - '*2dThermalForcing_*.nc') - tf_2d_list = sorted(glob.glob(tf_2d_search)) - if len(tf_2d_list) != 1: - sys.exit(f"ERROR: Expected 1 2D TF file at {tf_2d_search}, " - f"found {len(tf_2d_list)}") - tf_fname = os.path.split(tf_2d_list[0])[-1] - os.symlink(tf_2d_list[0], - os.path.join(self.work_dir, tf_fname)) - - # 3D thermal forcing (optional, only with - # use_3d_thermal_forcing) - if use_3d_thermal_forcing: - tf_3d_search = os.path.join(ocean_dir, - '*3dThermalForcing_*.nc') - tf_3d_list = sorted(glob.glob(tf_3d_search)) - if len(tf_3d_list) == 0: - sys.exit(f"ERROR: Expected at least 1 3D TF file at " - f"{tf_3d_search}, found 0") - # 3D TF is written one file per N-year block, named by the - # block start year (..._.nc). Symlink the whole - # series and address it with a $Y filename_template plus a - # filename_interval so MALI advances across chunk files. - for tf_path in tf_3d_list: - tf_base = os.path.split(tf_path)[-1] - os.symlink(tf_path, - os.path.join(self.work_dir, tf_base)) - start_years = [] - for f in tf_3d_list: - match = re.search(r'_(\d{4})\.nc$', - os.path.split(f)[-1]) - if not match: + sys.exit(f"ERROR: Expected 1 temperature file at " + f"{temp_search}, found {len(temp_list)}") + + runoff_search = os.path.join(atm_dir, '*runoff_*.nc') + runoff_list = glob.glob(runoff_search) + runoff_fname = '' + if len(runoff_list) == 1: + runoff_fname = os.path.split(runoff_list[0])[-1] + os.symlink(runoff_list[0], + os.path.join(self.work_dir, runoff_fname)) + + smb_grad_search = os.path.join(atm_dir, '*SMB_gradient_*.nc') + smb_grad_list = glob.glob(smb_grad_search) + smb_grad_fname = '' + if len(smb_grad_list) == 1: + smb_grad_fname = os.path.split(smb_grad_list[0])[-1] + os.symlink(smb_grad_list[0], + os.path.join(self.work_dir, smb_grad_fname)) + + temp_grad_search = os.path.join(atm_dir, + '*temperature_gradient_*.nc') + temp_grad_list = glob.glob(temp_grad_search) + temp_grad_fname = '' + if len(temp_grad_list) == 1: + temp_grad_fname = os.path.split(temp_grad_list[0])[-1] + os.symlink(temp_grad_list[0], + os.path.join(self.work_dir, temp_grad_fname)) + + # GrIS thermal forcing: always 2D, plus 3D when + # use_3d_thermal_forcing is true (see build_3d_thermal_forcing + # in landice/ismip7_forcing/ocean_thermal) + + # 2D thermal forcing (always) + tf_2d_search = os.path.join(ocean_dir, '*2dThermalForcing_*.nc') + tf_2d_list = sorted(glob.glob(tf_2d_search)) + if len(tf_2d_list) != 1: + sys.exit(f"ERROR: Expected 1 2D TF file at {tf_2d_search}, " + f"found {len(tf_2d_list)}") + tf_fname = os.path.split(tf_2d_list[0])[-1] + os.symlink(tf_2d_list[0], + os.path.join(self.work_dir, tf_fname)) + + # 3D thermal forcing (optional, only with use_3d_thermal_forcing) + if use_3d_thermal_forcing: + tf_3d_search = os.path.join(ocean_dir, '*3dThermalForcing_*.nc') + tf_3d_list = sorted(glob.glob(tf_3d_search)) + if len(tf_3d_list) == 0: + sys.exit(f"ERROR: Expected at least 1 3D TF file at " + f"{tf_3d_search}, found 0") + # 3D TF is written one file per N-year block, named by the + # block start year (..._.nc). Symlink the whole + # series and address it with a $Y filename_template plus a + # filename_interval so MALI advances across chunk files. + for tf_path in tf_3d_list: + tf_base = os.path.split(tf_path)[-1] + os.symlink(tf_path, + os.path.join(self.work_dir, tf_base)) + start_years = [] + for f in tf_3d_list: + match = re.search(r'_(\d{4})\.nc$', + os.path.split(f)[-1]) + if not match: + sys.exit( + f"ERROR: 3D thermal forcing file does not " + f"match expected pattern *_YYYY.nc: {f}") + start_years.append(int(match.group(1))) + start_years = sorted(start_years) + sample = os.path.split(tf_3d_list[0])[-1] + tf_3d_fname = re.sub(r'_\d{4}\.nc$', '_$Y.nc', sample) + if len(start_years) > 1: + interval_years = start_years[1] - start_years[0] + # Validate uniform spacing across all chunks + for i in range(2, len(start_years)): + spacing = start_years[i] - start_years[i - 1] + if spacing != interval_years: sys.exit( - f"ERROR: 3D thermal forcing file does not " - f"match expected pattern *_YYYY.nc: {f}") - start_years.append(int(match.group(1))) - start_years = sorted(start_years) - sample = os.path.split(tf_3d_list[0])[-1] - tf_3d_fname = re.sub(r'_\d{4}\.nc$', '_$Y.nc', sample) - if len(start_years) > 1: - interval_years = start_years[1] - start_years[0] - # Validate uniform spacing across all chunks - for i in range(2, len(start_years)): - spacing = start_years[i] - start_years[i - 1] - if spacing != interval_years: - sys.exit( - f"ERROR: 3D thermal forcing chunk years " - f"are not uniformly spaced. Expected " - f"interval {interval_years} years, but " - f"chunks {start_years[i - 1]} and " - f"{start_years[i]} are {spacing} years " - f"apart.") - tf_3d_filename_interval = \ - f"{interval_years:04d}-00-00_00:00:00" - else: - tf_3d_fname = '' + f"ERROR: 3D thermal forcing chunk years " + f"are not uniformly spaced. Expected " + f"interval {interval_years} years, but " + f"chunks {start_years[i - 1]} and " + f"{start_years[i]} are {spacing} years " + f"apart.") + tf_3d_filename_interval = \ + f"{interval_years:04d}-00-00_00:00:00" + else: + tf_3d_fname = '' # --- Set up streams --- forcing_interval_monthly = '0000-01-00_00:00:00' diff --git a/docs/developers_guide/landice/test_groups/ismip7_run.rst b/docs/developers_guide/landice/test_groups/ismip7_run.rst index e5a093c5ce..b09bee2953 100644 --- a/docs/developers_guide/landice/test_groups/ismip7_run.rst +++ b/docs/developers_guide/landice/test_groups/ismip7_run.rst @@ -108,8 +108,8 @@ The ``setup`` method sets up the experiment directory by: 7. Creating a restart symlink for projection experiments pointing to the corresponding ESM's historical restart (``../historical_{model}/rst.2015-01-01.nc``). -8. Setting up CTRL2015 experiments with constant-climate forcing - (``initial_only`` intervals). +8. Setting up CTRL2015 experiments like any other ESM experiment, with + forcing from ``{forcing_basepath}/{model}_ctrl`` (no special-casing). 9. Setting up the OCX experiment with reanalysis-based forcing. 10. If SLM coupling is enabled, adding a ``CreateSlmMappingFiles`` step and writing the SLM namelist from the Jinja2 template. diff --git a/docs/users_guide/landice/test_groups/ismip7_run.rst b/docs/users_guide/landice/test_groups/ismip7_run.rst index a361c885a6..7bbd2b42ef 100644 --- a/docs/users_guide/landice/test_groups/ismip7_run.rst +++ b/docs/users_guide/landice/test_groups/ismip7_run.rst @@ -173,10 +173,6 @@ All config options should be reviewed and altered as needed. reference_surface_path = NotAvailable region_mask_path = NotAvailable - # Climatology files for CTRL2015 experiments - ctrl_tf_climatology_path = NotAvailable - ctrl_atm_climatology_path = NotAvailable - # OCX forcing path ocx_forcing_path = NotAvailable @@ -288,8 +284,9 @@ ISMIP7 uses more forcing fields than ISMIP6, at mixed temporal resolutions: * ``ismip6shelfMelt_deltaT``, ``ismip6shelfMelt_basin``, ``ismip6shelfMelt_gamma0`` — melt parameterization coefficients -For CTRL2015 experiments, all forcing intervals are set to -``initial_only`` (constant climate). +The CTRL2015 experiments use the same forcing layout and forcing +intervals as the other experiments, with forcing taken from +``{forcing_basepath}/{model}_ctrl``. .. _landice_ismip7_run_mask_calving: From 65e55a6f1ad767c44e2d070b6bd5fa07e255fb78 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Thu, 5 Nov 2026 21:03:59 -0800 Subject: [PATCH 17/20] Align GrIS 3D TF stream reference time with first chunk The 3D thermal forcing stream used a fixed reference_time of 2000-01-01, which puts filename boundaries at 2010, 2020, ... and does not match projection chunks that start in 2015. Set reference_time to the start of the first chunk, and fail setup if multiple files share a chunk start year (e.g. two versions of the series in one directory). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/ismip7_run/ismip7_gris/set_up_experiment.py | 9 +++++++++ .../ismip7_run/ismip7_gris/streams.landice.template | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py index 4b1f99248b..4cf4450757 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py +++ b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py @@ -80,6 +80,7 @@ def setup(self): # noqa: C901 # 3D thermal-forcing filename_interval default; the chunked case # overrides it below when deriving the interval from chunk spacing. tf_3d_filename_interval = 'none' + tf_3d_reference_time = '2000-01-01_00:00:00' # --- Determine forcing file paths --- if scenario == 'ocx': @@ -194,6 +195,13 @@ def setup(self): # noqa: C901 f"match expected pattern *_YYYY.nc: {f}") start_years.append(int(match.group(1))) start_years = sorted(start_years) + if len(set(start_years)) != len(start_years): + sys.exit( + f"ERROR: Multiple 3D thermal forcing files share a " + f"start year in {ocean_dir}. Keep only one version " + f"of the 3D TF series in this directory.") + # Align the stream's file boundaries with the first chunk + tf_3d_reference_time = f"{start_years[0]:04d}-01-01_00:00:00" sample = os.path.split(tf_3d_list[0])[-1] tf_3d_fname = re.sub(r'_\d{4}\.nc$', '_$Y.nc', sample) if len(start_years) > 1: @@ -240,6 +248,7 @@ def setup(self): # noqa: C901 'forcing_interval_annual': forcing_interval_annual, 'forcing_interval_TF': forcing_interval_TF, 'tf_3d_filename_interval': tf_3d_filename_interval, + 'tf_3d_reference_time': tf_3d_reference_time, 'use_3d_thermal_forcing': use_3d_thermal_forcing, } diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template b/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template index 52aaa8600f..4fd37cc186 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template +++ b/compass/landice/tests/ismip7_run/ismip7_gris/streams.landice.template @@ -78,7 +78,7 @@ filename_template="{{ input_file_TF_3d_forcing }}" filename_interval="{{ tf_3d_filename_interval }}" input_interval="{{ forcing_interval_TF }}" - reference_time="2000-01-01_00:00:00" + reference_time="{{ tf_3d_reference_time }}" runtime_format="single_file"> From 64f76d3447dda6bcea39268810202009dba6a802 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Sat, 7 Nov 2026 14:58:22 -0800 Subject: [PATCH 18/20] Partition graph.info in ismip7_run experiment setup Create graph.info.part. alongside graph.info for GrIS and AIS so job scripts that run MALI directly find the decomposition. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py | 5 ++++- .../tests/ismip7_run/ismip7_gris/set_up_experiment.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py b/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py index 32fe278313..eff000c4e3 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py @@ -8,7 +8,7 @@ from compass.job import write_job_script from compass.landice.tests.ismip7_run.gia_options import parse_gia_model from compass.load_script import symlink_load_script -from compass.model import make_graph_file, run_model +from compass.model import make_graph_file, partition, run_model from compass.step import Step @@ -399,6 +399,9 @@ def setup(self): # noqa: C901 make_graph_file(mesh_filename=init_cond_path, graph_filename=os.path.join(self.work_dir, 'graph.info')) + # the job script runs MALI directly, so partition now + partition(self.ntasks, self.config, self.logger, + graph_file=os.path.join(self.work_dir, 'graph.info')) symlink_load_script(self.work_dir) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py index 4cf4450757..70a1929c8a 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py +++ b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py @@ -5,7 +5,7 @@ from compass.job import write_job_script from compass.load_script import symlink_load_script -from compass.model import make_graph_file, run_model +from compass.model import make_graph_file, partition, run_model from compass.step import Step @@ -315,6 +315,9 @@ def setup(self): # noqa: C901 make_graph_file(mesh_filename=init_cond_path, graph_filename=os.path.join(self.work_dir, 'graph.info')) + # the job script runs MALI directly, so partition now + partition(self.ntasks, self.config, self.logger, + graph_file=os.path.join(self.work_dir, 'graph.info')) symlink_load_script(self.work_dir) From 22e2ab1435c596e54e9b0f2b61c95862503959ad Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Sat, 7 Nov 2026 15:15:58 -0800 Subject: [PATCH 19/20] Add optional custom job script to ismip7_run Add custom_job_script and custom_job_env_cmds options for GrIS and AIS. With custom_job_script = custom, each experiment also gets a job_script.custom.sh that runs the linked MALI executable directly. Enable it in ismip7_gris_pm_production.cfg. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../tests/ismip7_run/custom_job_script.py | 66 +++++++++++++++++++ .../ismip7_run/ismip7_ais/ismip7_ais.cfg | 11 ++++ .../ismip7_ais/set_up_experiment.py | 8 +++ .../ismip7_run/ismip7_gris/ismip7_gris.cfg | 11 ++++ .../ismip7_gris_20261104-firstBatch.cfg | 59 +++++++++++++++++ .../ismip7_gris/ismip7_gris_pm_production.cfg | 11 ++++ .../ismip7_gris/set_up_experiment.py | 8 +++ .../ismip7_run/job_script_custom.template | 26 ++++++++ docs/developers_guide/landice/api.rst | 1 + .../landice/test_groups/ismip7_run.rst | 14 ++++ .../landice/test_groups/ismip7_run.rst | 29 ++++++++ 11 files changed, 244 insertions(+) create mode 100644 compass/landice/tests/ismip7_run/custom_job_script.py create mode 100644 compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_20261104-firstBatch.cfg create mode 100644 compass/landice/tests/ismip7_run/job_script_custom.template diff --git a/compass/landice/tests/ismip7_run/custom_job_script.py b/compass/landice/tests/ismip7_run/custom_job_script.py new file mode 100644 index 0000000000..b834c49f61 --- /dev/null +++ b/compass/landice/tests/ismip7_run/custom_job_script.py @@ -0,0 +1,66 @@ +import os +from importlib import resources + +import numpy as np +from jinja2 import Template + + +def write_custom_job_script(config, section, work_dir, job_name, ntasks): + """ + Write ``job_script.custom.sh``, which runs MALI directly from the run + directory with a user-supplied environment, if requested in the config + + Parameters + ---------- + config : compass.config.CompassConfigParser + Configuration options for the test case + + section : str + The config section with the ``custom_job_script`` and + ``custom_job_env_cmds`` options + + work_dir : str + The work directory where the job script should be written + + job_name : str + The name of the batch job + + ntasks : int + The number of MPI tasks for the model run + """ + option = config.get(section, 'custom_job_script') + if option == 'None': + return + if option != 'custom': + raise ValueError(f"[{section}] custom_job_script must be 'None' or " + f"'custom', not '{option}'") + + env_cmds = config.get(section, 'custom_job_env_cmds') + if env_cmds == 'None': + raise ValueError(f"[{section}] custom_job_env_cmds must be set when " + f"custom_job_script = custom") + + if config.has_option('parallel', 'account'): + account = config.get('parallel', 'account') + else: + account = '' + + if config.has_option('parallel', 'constraints'): + constraint = config.getlist('parallel', 'constraints')[0] + else: + constraint = '' + + cores_per_node = config.getint('parallel', 'cores_per_node') + nodes = int(np.ceil(ntasks / cores_per_node)) + + model = os.path.basename(config.get('executables', 'model')) + + template = Template(resources.read_text( + 'compass.landice.tests.ismip7_run', 'job_script_custom.template')) + text = template.render( + job_name=job_name, account=account, nodes=f'{nodes}', + constraint=constraint, env_cmds=env_cmds, ntasks=ntasks, model=model, + parallel_executable=config.get('parallel', 'parallel_executable')) + + with open(os.path.join(work_dir, 'job_script.custom.sh'), 'w') as handle: + handle.write(text) diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais.cfg b/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais.cfg index a78d12322b..c84890a8e2 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_ais/ismip7_ais.cfg @@ -94,5 +94,16 @@ fastiso_mask_filename = None # Note: for now, resolution finer than 8 km yield numerically unstable results fastiso_res_km = 8 +# Optionally write job_script.custom.sh, which runs the MALI executable +# directly (in addition to the standard compass job_script.sh). +# Options: None (no custom script) or custom +custom_job_script = None + +# Environment commands for the custom job script, as a single line, e.g. +# "source /path/to/modules.sh; export LD_LIBRARY_PATH=/path/lib:$$LD_LIBRARY_PATH" +# Write each literal $ as $$ so the config parser does not interpolate it. +# Required if custom_job_script = custom +custom_job_env_cmds = None + [parallel] parallel_executable = srun --label --cpu-bind=cores diff --git a/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py b/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py index eff000c4e3..d89030b177 100644 --- a/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py +++ b/compass/landice/tests/ismip7_run/ismip7_ais/set_up_experiment.py @@ -6,6 +6,9 @@ from jinja2 import Template from compass.job import write_job_script +from compass.landice.tests.ismip7_run.custom_job_script import ( + write_custom_job_script, +) from compass.landice.tests.ismip7_run.gia_options import parse_gia_model from compass.load_script import symlink_load_script from compass.model import make_graph_file, partition, run_model @@ -416,6 +419,11 @@ def setup(self): # noqa: C901 pre_run_commands=pre_run_cmd, post_run_commands=post_run_cmd) + write_custom_job_script(self.config, 'ismip7_run_ais', + work_dir=self.work_dir, + job_name=f'{self.exp}_ais', + ntasks=self.ntasks) + self.add_model_as_input() def run(self): diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris.cfg index 5daa744bd6..aaa15f5cd9 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris.cfg @@ -45,5 +45,16 @@ calving_method = restore # Path to the von Mises parameter fields. von_mises_parameter_path = NotAvailable +# Optionally write job_script.custom.sh, which runs the MALI executable +# directly (in addition to the standard compass job_script.sh). +# Options: None (no custom script) or custom +custom_job_script = None + +# Environment commands for the custom job script, as a single line, e.g. +# "source /path/to/modules.sh; export LD_LIBRARY_PATH=/path/lib:$$LD_LIBRARY_PATH" +# Write each literal $ as $$ so the config parser does not interpolate it. +# Required if custom_job_script = custom +custom_job_env_cmds = None + [parallel] parallel_executable = srun --label --cpu-bind=cores diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_20261104-firstBatch.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_20261104-firstBatch.cfg new file mode 100644 index 0000000000..a65fef6743 --- /dev/null +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_20261104-firstBatch.cfg @@ -0,0 +1,59 @@ +[ismip7_run_gris] + +# List of experiments to set up. +# Can be "all", "historical", "projections", "ctrl", or a +# comma-delimited list of experiment names. +#exp_list = historical_CESM2-WACCM,ssp585_CESM2-WACCM + +# first batch: 2026-11-04 +exp_list = historical_CESM2-WACCM,ssp585_CESM2-WACCM,ctrl_CESM2-WACCM,ocx + + + +# Number of tasks to use for each run +ntasks = 512 + +# Value to use for config_pio_stride. +pio_stride = 128 + +# Base path to the pre-processed ISMIP7 forcing files. +# Expected layout: +# {forcing_basepath}/{model}_{scenario}/atmosphere/ +# {forcing_basepath}/{model}_{scenario}/ocean_thermal_forcing/ +# User has to supply. +forcing_basepath = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS + +# Path to the initial condition file. User has to supply. +init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5.nc + +# Path to the file for the basal melt parametrization coefficients. +# Required if use_3d_thermal_forcing is true. +melt_params_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/OCX/ocean_thermal_forcing/GIS_1to10km_r03_20260925_meltParams_OCX.nc + +# Whether to force with 3D ocean thermal forcing (built by the +# build_3d_thermal_forcing step of landice/ismip7_forcing/ocean_thermal) +# instead of the default 2D forcing. Requires melt_params_path. +use_3d_thermal_forcing = true + +# Path to the reference surface elevation file +reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5_surfaceElevationRef.nc + +# Path to the region mask file +region_mask_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r02/GIS_1to10km_r02_20230202_ismip6_regionMasks.nc + +# Path to OCX forcing. +ocx_forcing_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS/OCX + +# Calving method to use. Options: restore, von_mises +calving_method = restore + +# Path to the von Mises parameter fields. +von_mises_parameter_path = NotAvailable + +# Path to the file containing the calving strain rate scaling field. +# If provided, the calvingStrainRateScaling stream will be added. +# Actual use is controlled by namelist options in MALI. +calving_strain_rate_scaling_path = NotAvailable + +[parallel] +parallel_executable = srun --label --cpu-bind=cores diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg index c300d9f6fa..621923d08e 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg @@ -55,5 +55,16 @@ von_mises_parameter_path = NotAvailable # Actual use is controlled by namelist options in MALI. calving_strain_rate_scaling_path = NotAvailable +# Optionally write job_script.custom.sh, which runs the MALI executable +# directly (in addition to the standard compass job_script.sh). +# Options: None (no custom script) or custom +custom_job_script = custom + +# Environment commands for the custom job script, as a single line, e.g. +# "source /path/to/modules.sh; export LD_LIBRARY_PATH=/path/lib:$$LD_LIBRARY_PATH" +# Write each literal $ as $$ so the config parser does not interpolate it. +# Required if custom_job_script = custom +custom_job_env_cmds = source /global/common/software/fanssie/pm_cpu_gnu_modules_20261030.sh; export LD_LIBRARY_PATH=/global/common/software/fanssie/superlu/7.0.1/gcc/14.3/lib64:$$LD_LIBRARY_PATH + [parallel] parallel_executable = srun --label --cpu-bind=cores diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py index 70a1929c8a..a20b4d8512 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py +++ b/compass/landice/tests/ismip7_run/ismip7_gris/set_up_experiment.py @@ -4,6 +4,9 @@ import sys from compass.job import write_job_script +from compass.landice.tests.ismip7_run.custom_job_script import ( + write_custom_job_script, +) from compass.load_script import symlink_load_script from compass.model import make_graph_file, partition, run_model from compass.step import Step @@ -332,6 +335,11 @@ def setup(self): # noqa: C901 pre_run_commands=pre_run_cmd, post_run_commands=post_run_cmd) + write_custom_job_script(self.config, 'ismip7_run_gris', + work_dir=self.work_dir, + job_name=f'{self.exp}_gris', + ntasks=self.ntasks) + self.add_model_as_input() def run(self): diff --git a/compass/landice/tests/ismip7_run/job_script_custom.template b/compass/landice/tests/ismip7_run/job_script_custom.template new file mode 100644 index 0000000000..3ca0d790cd --- /dev/null +++ b/compass/landice/tests/ismip7_run/job_script_custom.template @@ -0,0 +1,26 @@ +#!/bin/bash +#SBATCH --job-name={{ job_name }} +{% if account != '' -%} +#SBATCH --account={{ account }} +{%- endif %} +#SBATCH --nodes={{ nodes }} +#SBATCH --output=slurm.o%j +#SBATCH --exclusive +#SBATCH --time=00:30:00 +#SBATCH --qos=debug +{% if constraint != '' -%} +#SBATCH --constraint={{ constraint }} +{%- endif %} + +date + +if [[ -f log.landice.0000.out ]]; then + LOGDIR="archived_logs_$(date -r log.landice.0000.out '+%Y-%m-%d_%H-%M-%S')" + mkdir -- "$LOGDIR" + cp log* "$LOGDIR/" +fi + +{{ env_cmds }} + +{{ parallel_executable }} -n {{ ntasks }} ./{{ model }} +date diff --git a/docs/developers_guide/landice/api.rst b/docs/developers_guide/landice/api.rst index 71329383e9..c28b86abed 100644 --- a/docs/developers_guide/landice/api.rst +++ b/docs/developers_guide/landice/api.rst @@ -551,6 +551,7 @@ ismip7_run Ismip7Run gia_options.parse_gia_model + custom_job_script.write_custom_job_script ismip7_ais.Ismip7Ais ismip7_ais.Ismip7Ais.configure diff --git a/docs/developers_guide/landice/test_groups/ismip7_run.rst b/docs/developers_guide/landice/test_groups/ismip7_run.rst index b09bee2953..b033bd1873 100644 --- a/docs/developers_guide/landice/test_groups/ismip7_run.rst +++ b/docs/developers_guide/landice/test_groups/ismip7_run.rst @@ -199,3 +199,17 @@ template and ``filename_interval``. Both 2D and 3D GrIS thermal forcing use monthly input intervals. When 3D forcing is enabled, the facemelting routine still uses the ismip6_2dThermalForcing field to avoid any artificats introduced by constructing the 3d fields. + +custom_job_script +~~~~~~~~~~~~~~~~~ + +The function +:py:func:`compass.landice.tests.ismip7_run.custom_job_script.write_custom_job_script` +is called at the end of ``setup()`` in both ``SetUpExperiment`` classes. If +``custom_job_script`` is ``custom``, it renders +``job_script_custom.template`` into ``job_script.custom.sh``. The standard +``job_script.sh`` cannot be suppressed from a step, because +``compass/setup.py`` writes it after every step's ``setup()``. The srun line +uses ``[parallel] parallel_executable`` and the ``./landice_model`` link that +``add_model_as_input()`` creates. ``qos`` and ``time`` are fixed in the +template. diff --git a/docs/users_guide/landice/test_groups/ismip7_run.rst b/docs/users_guide/landice/test_groups/ismip7_run.rst index 7bbd2b42ef..fba11830de 100644 --- a/docs/users_guide/landice/test_groups/ismip7_run.rst +++ b/docs/users_guide/landice/test_groups/ismip7_run.rst @@ -254,6 +254,35 @@ across multiple year-block files addressed via a ``$Y`` template), plus ``ismip6shelfMelt_gamma0`` from the file at ``melt_params_path`` (which must be supplied in that case). +.. _landice_ismip7_run_custom_job_script: + +Custom job script +----------------- + +Both the AIS and GrIS configs have two options for writing a job script that +calls the MALI executable directly, instead of ``compass run``: + +.. code-block:: cfg + + # None (default, no custom script) or custom + custom_job_script = None + + # Single line of environment commands, required if custom_job_script = + # custom + custom_job_env_cmds = None + +With ``custom_job_script = custom``, each experiment directory gets a +``job_script.custom.sh`` in addition to the standard ``job_script.sh``, which +is still written by compass. The job name is ``_``, with +``qos=debug`` and a 30-minute wall time (edit the script for production +runs). Nodes come from ``ntasks`` and ``cores_per_node``. The script archives +any existing logs, runs ``custom_job_env_cmds``, and calls +`` -n ./landice_model``, so the executable is +the one linked in the run directory (compass's own MALI or the one given with +``-p`` to ``compass setup``). Write each literal ``$`` in +``custom_job_env_cmds`` as ``$$``, since the config parser interpolates +``$``. ``ismip7_gris_pm_production.cfg`` enables this option. + .. _landice_ismip7_run_forcing_streams: Forcing Streams From 14d0f7e8b6de3fa2a851c66f7a297dc72e971867 Mon Sep 17 00:00:00 2001 From: Matthew Hoffman Date: Sun, 8 Nov 2026 21:04:18 -0800 Subject: [PATCH 20/20] Set water depth to 0; update i.c. & surf ref files Another round of testing indicates this is the optimal OCX. Also set ismip7_gris_pm_production.cfg to set up OCX plus all CESM runs initially. And set account to m4274. --- .../ismip7_gris/ismip7_gris_pm_production.cfg | 12 ++++-------- .../tests/ismip7_run/ismip7_gris/namelist.landice | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg index 621923d08e..4ebf74e15a 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg +++ b/compass/landice/tests/ismip7_run/ismip7_gris/ismip7_gris_pm_production.cfg @@ -3,12 +3,7 @@ # List of experiments to set up. # Can be "all", "historical", "projections", "ctrl", or a # comma-delimited list of experiment names. -#exp_list = historical_CESM2-WACCM,ssp585_CESM2-WACCM - -# first batch: 2026-11-04 -exp_list = historical_CESM2-WACCM,ssp585_CESM2-WACCM,ctrl_CESM2-WACCM,ocx - - +exp_list = ocx,historical_CESM2-WACCM,ssp370_CESM2-WACCM,ssp126_CESM2-WACCM,ssp585_CESM2-WACCM,ctrl_CESM2-WACCM # Number of tasks to use for each run ntasks = 512 @@ -24,7 +19,7 @@ pio_stride = 128 forcing_basepath = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_20260929/GIS # Path to the initial condition file. User has to supply. -init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261104/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5water24m.nc +init_cond_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_after_8yr-iter-relax_basicFields2.nc # Path to the file for the basal melt parametrization coefficients. # Required if use_3d_thermal_forcing is true. @@ -36,7 +31,7 @@ melt_params_path = /global/cfs/cdirs/m4288/users/trhille/ISMIP7/process_forcing_ use_3d_thermal_forcing = true # Path to the reference surface elevation file -reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261104/GIS_1to10km_r03_20260925_8yrIterRelax_1dayCD5water24m_surfaceElevationRef.nc +reference_surface_path = /global/cfs/cdirs/fanssie/MALI_projects/ISMIP7/GIS/initial_condition/20261029/GIS_1to10km_r03_20260925_after_8yr-iter-relax_surfaceElevationRef.nc # Path to the region mask file region_mask_path = /global/cfs/cdirs/fanssie/MALI_input_files/GIS_1to10km_r03/GIS_1to10km_r03_20260903_ismip6_regionMasks.nc @@ -68,3 +63,4 @@ custom_job_env_cmds = source /global/common/software/fanssie/pm_cpu_gnu_modules_ [parallel] parallel_executable = srun --label --cpu-bind=cores +account = m4274 diff --git a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice index f8f9b5b9fd..b42bcf915e 100644 --- a/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice +++ b/compass/landice/tests/ismip7_run/ismip7_gris/namelist.landice @@ -30,7 +30,7 @@ config_calving_strainrate_scaling = 5.0 config_calving_strainrate_scaling_source = 'scalar' config_crevasse_water_depth_source = 'scalar' - config_crevasse_water_depth = 24.0 + config_crevasse_water_depth = 0.0 config_thermal_solver = 'temperature' config_thermal_calculate_bmb = .true.