Skip to content

Commit

Permalink
working on test hindcasts
Browse files Browse the repository at this point in the history
  • Loading branch information
aaschwanden committed Nov 21, 2024
1 parent 98a72ef commit c081f41
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 52 deletions.
26 changes: 15 additions & 11 deletions calibration/calibrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
help="File to boot from",
default=None,
)
parser.add_argument(
"--force_to_thickness_file",
dest="ftt_file",
help="Force-to-thickness target file",
default=None,
)
parser.add_argument(
"--i_dir",
dest="input_dir",
Expand Down Expand Up @@ -255,6 +261,7 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
data_dir = abspath(options.data_dir)
output_dir = abspath(options.output_dir)
boot_file = options.boot_file
ftt_file = options.ftt_file
grid_file = options.grid_file
compression_level = options.compression_level
oformat = options.oformat
Expand All @@ -279,7 +286,7 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0

master_config_file = computing.get_path_to_config()

regridvars = "litho_temp,enthalpy,age,tillwat,bmelt,ice_area_specific_volume"
regridvars = "litho_temp,enthalpy,age,tillwat,bmelt,ice_area_specific_volume,thk"

dirs = {"output": "$output_dir"}
for d in ["performance", "state", "scalar", "spatial", "jobs", "basins"]:
Expand Down Expand Up @@ -449,16 +456,13 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
outfile = f"g{horizontal_resolution}m_{experiment}.nc"

general_params_dict["output.file"] = join(dirs["state"], outfile)
general_params_dict["bootstrap"] = ""
general_params_dict["i"] = boot_file
if hasattr(combination, "input.regrid.file"):
regrid_file = (
f"""$data_dir/initial_states/{combination["input.regrid.file"]}"""
)
general_params_dict["input.regrid.file"] = regrid_file
else:
if boot_file is not None:
general_params_dict["bootstrap"] = ""
general_params_dict["i"] = boot_file
general_params_dict["input.regrid.file"] = input_file
general_params_dict["input.regrid.vars"] = regridvars
general_params_dict["input.regrid.vars"] = regridvars
else:
general_params_dict["i"] = input_file
if test_climate_models:
general_params_dict["test_climate_models"] = ""

Expand Down Expand Up @@ -577,7 +581,7 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
climate_parameters["atmosphere.frac_P.file"] = climate_offset_file_p

if combination["climate"] in ("forcing_smb"):
climate_parameters["surface.force_to_thickness.file"] = boot_file
climate_parameters["surface.force_to_thickness.file"] = ftt_file

climate_params_dict = computing.generate_climate(
combination["climate"], **climate_parameters
Expand Down
26 changes: 7 additions & 19 deletions hindcasts/hindcast.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,6 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
help="output size type",
default="custom",
)
parser.add_argument(
"--test_climate_models",
dest="test_climate_models",
action="store_true",
help="Turn off ice dynamics and mass transport to test climate models",
default=False,
)
parser.add_argument(
"-s",
"--system",
Expand Down Expand Up @@ -261,6 +254,7 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
data_dir = abspath(options.data_dir)
output_dir = abspath(options.output_dir)
boot_file = options.boot_file
ftt_file = options.ftt_file
grid_file = options.grid_file
compression_level = options.compression_level
oformat = options.oformat
Expand Down Expand Up @@ -455,19 +449,13 @@ def create_offset_file(file_name: str, delta_T: float = 0.0, frac_P: float = 1.0
outfile = f"g{horizontal_resolution}m_{experiment}.nc"

general_params_dict["output.file"] = join(dirs["state"], outfile)
general_params_dict["bootstrap"] = ""
# general_params_dict["input.file"] = pism_dataname
general_params_dict["i"] = boot_file
if hasattr(combination, "input.regrid.file"):
regrid_file = (
f"""$data_dir/initial_states/{combination["input.regrid.file"]}"""
)
general_params_dict["input.regrid.file"] = regrid_file
else:
if boot_file is not None:
general_params_dict["bootstrap"] = ""
general_params_dict["i"] = boot_file
general_params_dict["input.regrid.file"] = input_file
general_params_dict["input.regrid.vars"] = regridvars
if test_climate_models:
general_params_dict["test_climate_models"] = ""
general_params_dict["input.regrid.vars"] = regridvars
else:
general_params_dict["i"] = input_file

if osize != "custom":
general_params_dict["output.size"] = osize
Expand Down
28 changes: 17 additions & 11 deletions uq/ensemble_gris_ragis_w_posterior_lhs_10.csv
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
id,calving.vonmises_calving.sigma_max,calving.rate_scaling.file,ocean.th.gamma_T,ocean_file,climate_file,frontal_melt.routing.parameter_a,frontal_melt.routing.parameter_b,frontal_melt.routing.power_alpha,frontal_melt.routing.power_beta,stress_balance.sia.enhancement_factor,stress_balance.ssa.Glen_exponent,basal_resistance.pseudo_plastic.q,basal_yield_stress.mohr_coulomb.till_effective_fraction_overburden,basal_yield_stress.mohr_coulomb.topg_to_phi.phi_min,basal_yield_stress.mohr_coulomb.topg_to_phi.phi_max,basal_yield_stress.mohr_coulomb.topg_to_phi.topg_min,basal_yield_stress.mohr_coulomb.topg_to_phi.topg_max,calving.thickness_calving.threshold,climate,fractures,frontal_melt,hydrology,ocean.models,prescribed_retreat_file,sliding_law
0,639833.9781014946,seasonal_calving_id_1_1975_2025.nc,0.00012797924651265064,MAR3.9_ACCESS1-3_rcp85_ocean_1960-2100_v4.nc,RACMO2.3p2_ERA5_FGRN055_1975_2023.nc,0.00028952379375158836,1.4599533172820696,0.5587653867692417,1.2686356750793333,1.8060967,3.2709284,0.7799437,0.01837933,6.452461,41.821312,-422.5772,609.4973,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
1,584076.7201496906,seasonal_calving_id_4_1975_2025.nc,0.0001264175939687888,MAR3.9_NorESM1-M_rcp85_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5-1975_2023.nc,0.00026702579404951966,1.5060983709550948,0.4729227470478462,1.3449078493530786,2.692938,3.303913,0.6418389,0.015048247,6.4747543,42.12996,-472.44016,203.97838,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
2,393773.8388999552,seasonal_calving_id_0_1975_2025.nc,0.00010764881888145766,MAR3.9_NorESM1-M_rcp85_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.0003510237908136755,1.0551405123892463,0.3508405479321246,1.447402545281397,2.3807592,3.350078,0.75732327,0.017875353,6.094557,40.57491,-361.68607,164.38693,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
3,354620.80152645346,seasonal_calving_id_3_1975_2025.nc,0.00013895597732504995,MAR3.9_MIROC-ESM-CHEM_rcp26_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5-1975_2023.nc,0.0003027910958626526,1.1849373976500233,0.7172688876597926,1.6585755812931686,2.419273,3.21749,0.73082274,0.02110696,9.58462,42.327618,-227.21051,200.45576,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
4,533749.9653132386,seasonal_calving_id_0_1975_2025.nc,8.333999080118926e-05,MAR3.9_CNRM-ESM2_ssp585_ocean_1960-2100_v4.nc,RACMO2.3p2_ERA5_FGRN055_1975_2023.nc,0.00033559693532312447,1.2760639239164655,0.7776080115727233,1.7786064832583663,2.235555,3.3389168,0.7067705,0.0148410695,7.1412497,43.360264,-468.35165,275.96463,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
5,518517.4079637064,seasonal_calving_id_5_1975_2025.nc,0.00014345436051283876,MAR3.9_CNRM-ESM2_ssp585_ocean_1960-2100_v4.nc,RACMO2.3p2_ERA5_FGRN055_1975_2023.nc,0.0003426384765682258,1.103571925020619,0.6759100287760093,1.1991379769041592,2.92525,3.3223712,0.9053744,0.021403477,6.1316037,43.989822,-321.58493,314.52618,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
6,481474.12773260474,seasonal_calving_id_4_1975_2025.nc,0.00010061698527650212,MAR3.9_MIROC-ESM-CHEM_rcp26_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5-1975_2023.nc,0.00025054276452383294,1.3062756607938422,0.8127448452540618,1.5050540239957018,2.657467,3.3359725,0.7436864,0.018171877,8.720423,42.392143,-384.8716,112.446884,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
7,614443.5225320222,seasonal_calving_id_3_1975_2025.nc,0.00011400496616611948,MAR3.9_CNRM-CM6_ssp126_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.0002523166722702691,1.6883487136505306,0.6029859331810414,1.6624622632170505,2.9612827,3.2270076,0.6469191,0.023095798,7.904698,43.5431,-294.77872,299.6066,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
8,461787.67849641794,seasonal_calving_id_6_1975_2025.nc,9.580448668924874e-05,MAR3.9_HadGEM2-ES_rcp85_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.0002867793162606546,1.5671065927469,0.4582404690283366,1.5272548168985494,3.2221274,3.3186867,0.7876074,0.02092213,5.6647468,44.035088,-418.88864,436.89792,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
9,435501.97128416493,seasonal_calving_id_2_1975_2025.nc,7.890055583665389e-05,MAR3.9_HadGEM2-ES_rcp85_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5-1975_2023.nc,0.00032297855672209596,1.398476548681747,0.3971883670994767,1.1161077080185227,3.0252879,3.31883,0.610163,0.021592047,5.841159,43.05585,-517.7227,390.3506,50,given_smb,false,routing,routing,th,pism_g450m_frontretreat_calfin_1972_2019.nc,pseudo_plastic
id,calving.vonmises_calving.sigma_max,calving.rate_scaling.file,ocean.th.gamma_T,ocean_file,climate_file,frontal_melt.routing.parameter_a,frontal_melt.routing.parameter_b,frontal_melt.routing.power_alpha,frontal_melt.routing.power_beta,prescribed_retreat_file,stress_balance.sia.enhancement_factor,stress_balance.ssa.Glen_exponent,basal_resistance.pseudo_plastic.q,basal_yield_stress.mohr_coulomb.till_effective_fraction_overburden,basal_yield_stress.mohr_coulomb.topg_to_phi.phi_min,basal_yield_stress.mohr_coulomb.topg_to_phi.phi_max,basal_yield_stress.mohr_coulomb.topg_to_phi.topg_min,basal_yield_stress.mohr_coulomb.topg_to_phi.topg_max,calving.thickness_calving.threshold,climate,fractures,frontal_melt,hydrology,ocean.models,sliding_law
0,379345.9282000555,seasonal_calving_id_5_1900_2025.nc,0.00011235038749034463,MAR3.9_IPSL-CM5-MR_rcp85_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5_1940_2023.nc,0.0002838851971794361,1.2303525147224585,0.7025237003587892,1.5210655185648143,pism_g450m_frontretreat_calfin_1972_2019.nc,2.123134,3.2766855,0.8413679,0.016975757,5.4814487,42.054695,-344.75388,275.85342,50,given_smb,false,routing,routing,th,pseudo_plastic
1,622928.3931863204,seasonal_calving_id_1_1900_2025.nc,0.00013572631258320216,MAR3.9_MIROC-ESM-CHEM_rcp85_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.0002502182742820084,1.1435529978702128,0.44707157511655027,1.6160850052128295,,2.160123,3.3535109,0.7966587,0.015945252,8.167392,41.86481,-436.743,287.36707,50,given_smb,false,routing,routing,th,pseudo_plastic
2,401886.84950534534,seasonal_calving_id_2_1900_2025.nc,0.0001275704655448247,MAR3.9_NorESM1-M_rcp85_ocean_1960-2100_v4.nc,RACMO2.3p2_ERA5_FGRN055_1940_2023.nc,0.0002694931454098146,1.3930091135134735,0.7722922935915284,1.232097228810924,,2.2584274,3.2885947,0.63916934,0.024142278,6.0374675,40.71046,-458.89868,414.78302,50,given_smb,false,routing,routing,th,pseudo_plastic
3,359309.6541086359,seasonal_calving_id_2_1900_2025.nc,9.784360269088032e-05,MAR3.9_CSIRO-Mk3.6_rcp85_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5_1940_2023.nc,0.00031194125839985743,1.6792991205003414,0.6765443836043562,1.631415842079393,,2.4301603,3.3316615,0.8422035,0.016467124,5.233941,41.80455,-420.0276,328.18338,50,given_smb,false,routing,routing,th,pseudo_plastic
4,449193.9986873009,seasonal_calving_id_2_1900_2025.nc,7.70803802541351e-05,MAR3.9_CNRM-CM6_ssp126_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5_1940_2023.nc,0.0003029401321498064,1.0204198952778518,0.7819411964833904,1.4338968006235975,,2.942065,3.26128,0.5912892,0.020874674,6.6312346,44.801792,-550.1455,516.5576,50,given_smb,false,routing,routing,th,pseudo_plastic
5,429731.19518330705,seasonal_calving_id_1_1900_2025.nc,9.890604569022594e-05,MAR3.9_CNRM-CM6_ssp585_ocean_1960-2100_v4.nc,RACMO2.3p2_ERA5_FGRN055_1940_2023.nc,0.00034639922666672505,1.3429299811529867,0.83261821199621,1.1699339298832414,pism_g450m_frontretreat_calfin_1972_2019.nc,2.8697572,3.2918458,0.71376574,0.027753014,6.940427,44.199738,-365.8419,650.9196,50,given_smb,false,routing,routing,th,pseudo_plastic
6,505648.76696034335,seasonal_calving_id_4_1900_2025.nc,0.00010403766481254232,MAR3.9_IPSL-CM5-MR_rcp85_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.00034472548711774007,1.0476738645082138,0.34169850498862886,1.1168955071508344,pism_g450m_frontretreat_calfin_1972_2019.nc,2.597211,3.2535717,0.8391691,0.019702183,6.415715,42.726112,-225.40007,167.93361,50,given_smb,false,routing,routing,th,pseudo_plastic
7,477551.011272695,seasonal_calving_id_0_1900_2025.nc,0.00012144127744082681,MAR3.9_UKESM1-CM6_ssp585_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.00025688451650653224,1.4310012387772535,0.5614888668987055,1.7409756925468702,pism_g450m_frontretreat_calfin_1972_2019.nc,2.7335684,3.3172615,0.67435247,0.02203199,5.3762136,43.936695,-428.17383,396.67142,50,given_smb,false,routing,routing,th,pseudo_plastic
8,495913.6336149336,seasonal_calving_id_6_1900_2025.nc,8.232115213482595e-05,MAR3.9_NorESM1-M_rcp85_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.00033671201825808187,1.5712873426123215,0.6223918525223384,1.473112340950148,pism_g450m_frontretreat_calfin_1972_2019.nc,2.546658,3.2558146,0.7430103,0.016484534,10.223384,40.86032,-157.69101,94.73569,50,given_smb,false,routing,routing,th,pseudo_plastic
9,562472.4422320724,seasonal_calving_id_5_1900_2025.nc,9.023413480549976e-05,MAR3.9_CNRM-ESM2_ssp585_ocean_1960-2100_v4.nc,RACMO2.3p2_ERA5_FGRN055_1940_2023.nc,0.0002937605111028171,1.458949556203368,0.7193799847377675,1.227363494165471,,2.5531497,3.2625332,0.7931533,0.016488966,6.5860906,43.422768,-450.9847,315.5284,50,given_smb,false,routing,routing,th,pseudo_plastic
10,521444.64131985547,seasonal_calving_id_6_1900_2025.nc,0.00012575047791759964,MAR3.9_CSIRO-Mk3.6_rcp85_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.0003271669455288973,1.6193587810218042,0.31832153997065676,1.7016640687749094,pism_g450m_frontretreat_calfin_1972_2019.nc,2.940844,3.264102,0.77856225,0.02632627,7.546342,40.77475,-311.81006,355.59103,50,given_smb,false,routing,routing,th,pseudo_plastic
11,589730.5886689293,seasonal_calving_id_3_1900_2025.nc,0.00013716712856782012,MAR3.9_MIROC-ESM-CHEM_rcp85_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5_1940_2023.nc,0.000317048987675706,1.1773680040003143,0.4275657647732505,1.2828219515539998,,3.281785,3.2958112,0.72785324,0.017786508,7.6660924,44.66604,-382.22922,272.02954,50,given_smb,false,routing,routing,th,pseudo_plastic
12,544596.9572617215,seasonal_calving_id_3_1900_2025.nc,0.0001439944442608789,MAR3.9_HadGEM2-ES_rcp85_ocean_1960-2100_v4.nc,RACMO2.3p2_ERA5_FGRN055_1940_2023.nc,0.0003552755032649733,1.093947643977443,0.4952971214426679,1.5708800325522114,pism_g450m_frontretreat_calfin_1972_2019.nc,2.910006,3.2547426,0.734182,0.021232689,5.8270326,41.424423,-431.2235,352.64825,50,given_smb,false,routing,routing,th,pseudo_plastic
13,647016.243366211,seasonal_calving_id_5_1900_2025.nc,0.00011641916652670815,MAR3.9_CNRM-CM6_ssp126_ocean_1960-2100_v4.nc,MARv3.14-monthly-ERA5_1940_2023.nc,0.00024352317815953922,1.4890146407676592,0.5247129696443806,1.322431164143008,pism_g450m_frontretreat_calfin_1972_2019.nc,2.5339985,3.254448,0.80985093,0.019717313,7.6999607,41.274353,-482.1531,433.00592,50,given_smb,false,routing,routing,th,pseudo_plastic
14,609655.2908592265,seasonal_calving_id_4_1900_2025.nc,0.00014832408121659055,MAR3.9_CNRM-CM6_ssp585_ocean_1960-2100_v4.nc,HIRHAM5-monthly-ERA5_1975_2021.nc,0.00027546891027903787,1.5364433778768694,0.591895243654998,1.7576014913300577,,2.691325,3.3251398,0.70012057,0.015261737,5.386983,41.70452,-545.28723,146.16347,50,given_smb,false,routing,routing,th,pseudo_plastic
15,420037.38728611765,seasonal_calving_id_0_1900_2025.nc,8.790686592597148e-05,MAR3.9_ACCESS1-3_rcp85_ocean_1960-2100_v4.nc,RACMO2.3p2_ERA5_FGRN055_1940_2023.nc,0.00028584735249421593,1.2780100583901532,0.36906672459097106,1.381051058578285,,2.5995126,3.3337882,0.67210436,0.021418488,8.680145,44.221317,-436.6515,232.57278,50,given_smb,false,routing,routing,th,pseudo_plastic
Loading

0 comments on commit c081f41

Please sign in to comment.