tpreprocess.py - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch) (HTM) git clone git://src.adamsgaard.dk/pism (DIR) Log (DIR) Files (DIR) Refs (DIR) LICENSE --- tpreprocess.py (1112B) --- 1 #!/usr/bin/env python3 2 3 # Copyright (C) 2012, 2014, 2016, 2018 Moritz Huetten and Torsten Albrecht 4 5 # create MISMIP config override file 6 7 try: 8 from netCDF4 import Dataset as NC 9 except: 10 print("netCDF4 is not installed!") 11 sys.exit(1) 12 13 filename = "MISMIP3D_conf.nc" 14 15 print(' creating MISMIP3D_conf.nc for configuration parameters (overrides) ...') 16 17 nc = NC(filename, 'w', format="NETCDF3_CLASSIC") 18 19 var = nc.createVariable("pism_overrides", 'i') 20 21 attrs = {"ocean.always_grounded": "no", 22 "geometry.update.use_basal_melt_rate": "no", 23 "stress_balance.ssa.compute_surface_gradient_inward": "no", 24 "flow_law.isothermal_Glen.ice_softness": 1.0e-25, 25 "constants.ice.density": 900., 26 "constants.sea_water.density": 1000., 27 "bootstrapping.defaults.geothermal_flux": 0.0, 28 "stress_balance.ssa.Glen_exponent": 3., 29 "constants.standard_gravity": 9.81, 30 "ocean.sub_shelf_heat_flux_into_ice": 0.0, 31 "stress_balance.sia.bed_smoother.range": 0.0, 32 } 33 34 for name, value in attrs.items(): 35 var.setncattr(name, value) 36 37 nc.close()