clm.Solver.CLM.WriteLogs = False clm.Solver.CLM.WriteLastRST = True clm.Solver.CLM.DailyRST = False clm.Solver.CLM.SingleFile = True clm.Solver.CLM.EvapBeta = 'Linear' clm.Solver.CLM.VegWaterStress = 'Saturation' clm.Solver.CLM.ResSat = 0.2 clm.Solver.CLM.WiltingPoint = 0.2 clm.Solver.CLM.FieldCapacity = 1.00 clm.Solver.CLM.IrrigationType = 'none' #--------------------------------------------------------- # Initial conditions: water pressure #--------------------------------------------------------- clm.ICPressure.Type = 'HydroStaticPatch' clm.ICPressure.GeomNames = 'domain' clm.Geom.domain.ICPressure.Value = -1.0 clm.Geom.domain.ICPressure.RefGeom = 'domain' clm.Geom.domain.ICPressure.RefPatch = 'z_upper' for reuseCount in reuseValues: new_name = f'clm_ts_{reuseCount}' new_name = clm.clone(f'{new_name}') new_name.Solver.CLM.ReuseCount = reuseCount new_name.TimeStep.Value = (1.0 / reuseCount) new_name.run(working_directory=dir_name)
'silty_clay_loam': 's9', 'clay_loam': 's10', 'silty_clay': 's11', 'clay': 's12', 'organic': 's13', 'sil_sedimentary': 'g1', 'bedrock_2': 'g3', 'crystalline': 'g4', 'fg_unconsolidated': 'g5', 'unconsolidated': 'g6', 'cg_sil_sedimentary': 'g7', 'carbonate': 'g8' } # cloning run object to test optional run assignment db_test_2 = db_test.clone('db_test_2') # standard inline procedure calls in Python SubsurfacePropertiesBuilder(db_test)\ .load_default_properties() \ .assign(mapping=subsurf_mapping) \ .apply() \ .print_as_table() # testing optional run assignment in apply SubsurfacePropertiesBuilder()\ .load_default_properties() \ .assign(mapping=subsurf_mapping) \ .assign('bedrock_2', 'g4') \ .apply(db_test_2) \ .print_as_table()
# set water table to be at the bottom of the domain, the top layer is initially dry dover_1.ICPressure.Type = 'HydroStaticPatch' dover_1.ICPressure.GeomNames = 'domain' dover_1.Geom.domain.ICPressure.Value = -3.0 dover_1.Geom.domain.ICPressure.RefGeom = 'domain' dover_1.Geom.domain.ICPressure.RefPatch = 'z_upper' #----------------------------------------------------------------------------- # Run and Unload the ParFlow output files #----------------------------------------------------------------------------- dover_1.run() #----------------------------------------------------------------------------- # Testing serial run #----------------------------------------------------------------------------- dover_2 = dover_1.clone('dover_2') dover_2.TopoSlopesX.Type = 'Constant' dover_2.TopoSlopesX.GeomNames = 'left right channel' dover_2.TopoSlopesX.Geom.left.Value = -0.002 dover_2.TopoSlopesX.Geom.right.Value = 0.002 dover_2.TopoSlopesX.Geom.channel.Value = 0.00 dover_2.run()
sandtank.Geom.domain.ICPressure.RefGeom = 'domain' sandtank.Geom.domain.ICPressure.RefPatch = 'z_lower' else: fname_ic = f'./sandtank.out.press.{"{:0>5}".format(StartNumber)}.pfb' print(f'Initial Conditions: {fname_ic}') sandtank.ICPressure.Type = 'PFBFile' sandtank.ICPressure.GeomNames = 'domain' sandtank.Geom.domain.ICPressure.FileName = fname_ic sandtank.dist(fname_ic) # ----------------------------------------------------------------------------- # Generating random boundary conditions to run ensemble # ----------------------------------------------------------------------------- sandtank.dist('SandTank_Indicator.pfb') hleft_list = random.sample(range(0, 50), 10) hright_list = random.sample(range(0, 50), 10) for i in range(len(hleft_list)): new_name = f's_l{"{:0>2}".format(hleft_list[i])}_r' \ f'{"{:0>2}".format(hright_list[i])}' new_run = sandtank.clone(new_name) new_run.Patch.x_lower.BCPressure.alltime.Value = hleft_list[i] new_run.Patch.x_upper.BCPressure.alltime.Value = hright_list[i] new_run.run(skip_validation=True) for i in range(len(hleft_list)): print(f'Run #{i+1}:') print(f' Left head boundary = {hleft_list[i]} m') print(f' Right head boundary = {hright_list[i]} m')