Changeset 25125
- Timestamp:
- 06/23/20 15:42:10 (5 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 6 added
- 44 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/etc/environment.sh
r24877 r25125 372 372 fi 373 373 374 NETCDF_PYTHON_DIR="${ISSM_DIR}/externalpackages/netcdf-python/install" 375 if [ -d "${NETCDF_PYTHON_DIR}" ]; then 376 if [ -d "${NETCDF_PYTHON_DIR}/lib/python2.7/site-packages" ]; then 377 ld_library_path_append "${NETCDF_PYTHON_DIR}/lib/python2.7/site-packages" 378 fi 379 fi 380 374 381 HDF5_DIR="${ISSM_DIR}/externalpackages/hdf5/install" 375 382 if [ -d "${HDF5_DIR}" ]; then -
issm/trunk-jpl/externalpackages/netcdf-python/install.sh
r23435 r25125 2 2 set -eu 3 3 4 #Some cleanup5 rm -rf install netCDF4-1.06 mkdir install7 4 8 #Download from ISSM server 9 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netCDF4-1.0.tar.gz" "netCDF4-1.0.tar.gz" 5 # Constants 6 # 7 VER="1.5.3" 10 8 11 #Untar 12 tar -zxvf netCDF4-1.0.tar.gz 9 # Environment 10 # 11 export HDF5_DIR="${ISSM_DIR}/externalpackages/petsc/install" 12 export MPIINC_DIR="${ISSM_DIR}/externalpackages/petsc/install/include" 13 export NETCDF_DIR="${ISSM_DIR}/externalpackages/netcdf/install" 14 export PYTHONUSERBASE="${ISSM_DIR}/externalpackages/netcdf-python/install" # This variable and '--user' option supplied to 'setup.py install' are required to install to custom location (source: https://setuptools.readthedocs.io/en/latest/easy_install.html#custom-installation-locations) 13 15 14 #for later: 15 rm -rf ISSMDIR 16 echo $ISSM_DIR | sed 's/\//\\\//g' > ISSMDIR 17 ISSMDIR=`cat ISSMDIR` && rm -rf ISSMDIR 16 # Download source 17 $ISSM_DIR/scripts/DownloadExternalPackage.sh "https://issm.ess.uci.edu/files/externalpackages/netcdf4-python-${VER}rel.tar.gz" "netcdf4-python-${VER}rel.tar.gz" 18 18 19 #Move netCDF4 to install directory 20 rm -rf install/* 21 mv netCDF4-1.0/* install/ 22 rm -rf netCDF4-1.0 19 # Unpack source 20 tar -zxvf netcdf4-python-${VER}rel.tar.gz 23 21 24 #Configur and compile 25 cd install 26 #edit setup.cfg to point to hdf5 and netcdf 27 cat setup.cfg.template | sed "s/\#netCDF4_dir = \/usr\/local/netCDF4_dir = $ISSMDIR\/externalpackages\/netcdf\/install/g" | sed "s/\#HDF5_dir = \/usr\/local/HDF5_DIR = $ISSMDIR\/externalpackages\/hdf5\/install/g" > setup.cfg 22 # Cleanup 23 rm -rf install src 24 mkdir install src 28 25 26 # Move source to 'src' directory 27 mv netcdf4-python-${VER}rel/* src/ 28 rm -rf netcdf4-python-${VER}rel 29 30 # Compile and install 31 cd src 29 32 python setup.py build 30 python setup.py install 33 python setup.py install --user 34 35 # Unzip eggs 36 for egg in $(find "${PYTHONUSERBASE}/lib" -name *.egg); do 37 parent_dir=$(dirname ${egg}) 38 filename=$(basename -- ${egg}) 39 extension="${filename##*.}" 40 filename="${filename%.*}" 41 src_dir="${parent_dir}/${filename}" 42 unzip ${egg} ${src_dir} 43 done -
issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static-with_tests.sh
r25073 r25125 53 53 --enable-fast-install \ 54 54 --disable-doxygen \ 55 --enable-netcdf4 \ 55 56 --disable-filter-testing \ 56 57 --disable-dap-remote-tests \ -
issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-static.sh
r25073 r25125 53 53 --enable-fast-install \ 54 54 --disable-doxygen \ 55 --enable-netcdf4 \ 55 56 --disable-testsets \ 56 57 --disable-examples -
issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel-with_tests.sh
r25073 r25125 50 50 --enable-fast-install \ 51 51 --disable-doxygen \ 52 --enable-netcdf4 \ 52 53 --disable-filter-testing \ 53 54 --disable-dap-remote-tests \ -
issm/trunk-jpl/externalpackages/netcdf/install-4.7-parallel.sh
r25073 r25125 51 51 --disable-doxygen \ 52 52 --disable-testsets \ 53 --disable-examples 53 --disable-examples \ 54 --enable-netcdf4 54 55 55 56 # Compile and install -
issm/trunk-jpl/externalpackages/netcdf/install-4.7.sh
r25073 r25125 50 50 --disable-doxygen \ 51 51 --disable-testsets \ 52 --disable-examples 52 --disable-examples \ 53 --enable-netcdf4 53 54 54 55 # Compile and install -
issm/trunk-jpl/jenkins/ross-debian_linux-solid_earth
r25095 r25125 31 31 32 32 EXTERNALPACKAGES=" 33 autotools install-debian-linux.sh 34 cmake install.sh 35 petsc install-3.12-linux-solid_earth.sh 36 triangle install-linux.sh 37 chaco install.sh 38 m1qn3 install.sh 39 semic install.sh 40 boost install-1.7-linux.sh 41 curl install-7.67.sh 42 netcdf install-4.7.sh 43 proj install-6.2.sh 44 gdal install-3.0-python-netcdf.sh 45 gshhg install.sh 46 gmt install-6.0-linux.sh 47 gmsh install-4.sh 48 shell2junit install.sh 33 autotools install-debian-linux.sh 34 cmake install.sh 35 petsc install-3.12-linux-solid_earth.sh 36 triangle install-linux.sh 37 chaco install.sh 38 m1qn3 install.sh 39 semic install.sh 40 boost install-1.7-linux.sh 41 curl install-7.67.sh 42 netcdf install-4.7-parallel.sh 43 netcdf-python install.sh 44 proj install-6.2.sh 45 gdal install-3.0-python-netcdf.sh 46 gshhg install.sh 47 gmt install-6.0-linux.sh 48 gmsh install-4.sh 49 shell2junit install.sh 49 50 " 50 51 … … 54 55 55 56 # Test suites 56 MATLAB_TEST= 157 MATLAB_TEST=0 57 58 PYTHON_TEST=1 58 59 JAVASCRIPT_TEST=0 -
issm/trunk-jpl/scripts/devpath.py
r24593 r25125 2 2 3 3 # NOTE: This script is a stripped-down version of 4 # $ISSM_DIR/src/m/dev/devpath.py and is intended only for loading ISSM in 5 # order to test our distributable packages. It assumes the following is 6 # set before $ISSM_DIR/test/NightlyRun/runme.py is called, 4 # $ISSM_DIR/src/m/dev/devpath.py and is intended only for loading ISSM in 5 # order to test our distributable packages. It assumes the following is 6 # set before $ISSM_DIR/test/NightlyRun/runme.py is called, 7 7 # 8 8 # export ISSM_DIR=</path/to/ISSM> 9 # 9 # export PATH="${PATH}:${ISSM_DIR}/bin" 10 10 # export PYTHONPATH="${ISSM_DIR}/scripts" 11 11 # export PYTHONSTARTUP="${PYTHONPATH}/devpath.py" -
issm/trunk-jpl/src/m/classes/basin.py
r25065 r25125 1 1 import math 2 import numpy as np 2 3 3 4 from boundary import boundary 4 5 from epsg2proj import epsg2proj 6 from gdaltransform import gdaltransform 5 7 from helpers import fileparts 6 8 from laea import laea … … 72 74 73 75 def isnameany(self, *args): #{{{ 76 boolean = 0 74 77 for arg in args: 75 if arg == self.name: 76 return 1 77 return 0 78 if type(arg) in [np.ndarray, list]: 79 for name in arg: 80 if name == self.name: 81 boolean = 1 82 break 83 elif arg == self.name: 84 boolean = 1 85 break 86 return boolean 78 87 #}}} 79 88 80 89 def iscontinentany(self, *args): #{{{ 90 boolean = 0 81 91 for arg in args: 82 if arg == self.continent: 83 return 1 84 return 0 92 if type(arg) in [np.ndarray, list]: 93 for continent in arg: 94 if continent == self.continent: 95 boolean = 1 96 break 97 elif arg == self.continent: 98 boolean = 1 99 break 100 return boolean 85 101 #}}} 86 102 … … 130 146 y.append(y[0]) 131 147 132 setattr(out, 'x', x) 133 setattr(out, 'y', y) 134 setattr(out, 'nods', len(x)) 148 out = {} 149 out['x'] = x 150 out['y'] = y 151 out['nods'] = len(x) 135 152 136 153 return out … … 198 215 ba = self.contour() 199 216 flags = np.zeros(len(contours)) 200 for i in range(len(contours)) 217 for i in range(len(contours)): 201 218 h = contours[i] 202 219 isin = inpolygon(h.x, h.y, ba.x, ba.y) -
issm/trunk-jpl/src/m/classes/boundary.m
r25068 r25125 74 74 end 75 75 output=shpread([self.shppath '/' name '.' ext]); 76 76 77 77 %do we reverse? 78 78 if strcmpi(self.orientation,'reverse'), -
issm/trunk-jpl/src/m/classes/boundary.py
r25065 r25125 4 4 5 5 from epsg2proj import epsg2proj 6 from helpers import * 6 7 from pairoptions import pairoptions 7 8 from shpread import shpread … … 75 76 def edges(self): #{{{ 76 77 #read domain 77 path, name, ext = fileparts(s hp.shpfilename)78 path, name, ext = fileparts(self.shpfilename) 78 79 if ext != 'shp': 79 80 ext = 'shp' … … 82 83 #do we reverse? 83 84 if self.orientation == 'reverse': 84 output.x = np.flipud(output.x) 85 output.y = np.flipud(output.y) 85 for i in range(len(output)): 86 output[i].x = np.flipud(output[i].x) 87 output[i].y = np.flipud(output[i].y) 86 88 #}}} 87 89 … … 104 106 105 107 #read domain 106 path, name, ext = fileparts(s hp.shpfilename)108 path, name, ext = fileparts(self.shpfilename) 107 109 if ext != 'shp': 108 110 ext = 'shp' … … 167 169 168 170 #read domain 169 path, name, ext = fileparts(s hp.shpfilename)171 path, name, ext = fileparts(self.shpfilename) 170 172 if ext != 'shp': 171 173 ext = 'shp' -
issm/trunk-jpl/src/m/classes/fourierlove.py
r24261 r25125 34 34 string = "%s\n%s" % (string, fielddisplay(self, 'sh_nmin', 'minimum spherical harmonic degree (default 1)')) 35 35 string = "%s\n%s" % (string, fielddisplay(self, 'g0', 'adimensioning constant for gravity (default 10) [m / s^2]')) 36 string = "%s\n%s" % (string, fielddisplay(self, 'r0', 'adimensioning constant for radius (default 6378 * 1.0e3) [m]'))36 string = "%s\n%s" % (string, fielddisplay(self, 'r0', 'adimensioning constant for radius (default 6378e3) [m]')) 37 37 string = "%s\n%s" % (string, fielddisplay(self, 'mu0', 'adimensioning constant for stress (default 1.0e11) [Pa]')) 38 38 string = "%s\n%s" % (string, fielddisplay(self, 'allow_layer_deletion', 'allow for migration of the integration boundary with increasing spherical harmonics degree (default 1)')) … … 66 66 self.sh_nmin = 1 67 67 self.g0 = 10 # m / s^2 68 self.r0 = 6378 * 1e3 #m68 self.r0 = 6378e3 #m 69 69 self.mu0 = 1e11 # Pa 70 70 self.allow_layer_deletion = 1 -
issm/trunk-jpl/src/m/classes/linearbasalforcings.py
r24546 r25125 1 import numpy as np 2 3 from checkfield import checkfield 1 4 from fielddisplay import fielddisplay 2 from checkfield import checkfield3 5 from WriteData import WriteData 4 import numpy as np5 6 6 7 -
issm/trunk-jpl/src/m/classes/loadinglove.m
r25118 r25125 31 31 %tidal love numbers: 32 32 self.th=0.6149; %degree 2 33 self.tk=0.3055; % 33 self.tk=0.3055; %degree 2 34 34 35 35 %secular fluid love number: … … 75 75 end % }}} 76 76 function marshall(self,prefix,md,fid) % {{{ 77 77 78 78 WriteData(fid,prefix,'name','md.solidearth.love.model','data',1,'format','Integer'); 79 79 … … 85 85 WriteData(fid,prefix,'object',self,'fieldname','tk','name','md.solidearth.love.tk','format','Double'); 86 86 WriteData(fid,prefix,'object',self,'fieldname','tk2secular','name','md.solidearth.love.tk2secular','format','Double'); 87 88 87 89 88 end % }}} -
issm/trunk-jpl/src/m/classes/matdamageice.py
r24213 r25125 86 86 self.heatcapacity = 2093. 87 87 #ice latent heat of fusion L (J / kg) 88 self.latentheat = 3.34 * 1.0e588 self.latentheat = 3.34e5 89 89 #ice thermal conductivity (W / m / K) 90 90 self.thermalconductivity = 2.4 … … 96 96 self.meltingpoint = 273.15 97 97 #rate of change of melting point with pressure (K / Pa) 98 self.beta = 9.8 * 1.0e-898 self.beta = 9.8e-8 99 99 #mixed layer (ice-water interface) heat capacity (J / kg / K) 100 100 self.mixed_layer_capacity = 3974. 101 101 #thermal exchange velocity (ice-water interface) (m / s) 102 self.thermal_exchange_velocity = 1.00 * 1.0e-4102 self.thermal_exchange_velocity = 1.00e-4 103 103 #Rheology law: what is the temperature dependence of B with T 104 104 #available: none, paterson and arrhenius … … 106 106 107 107 # GIA: 108 self.lithosphere_shear_modulus = 6.7 * 1.0e10 # (Pa)108 self.lithosphere_shear_modulus = 6.7e10 # (Pa) 109 109 self.lithosphere_density = 3.32 # (g / cm^ - 3) 110 self.mantle_shear_modulus = 1.45 * 1.0e11 # (Pa)110 self.mantle_shear_modulus = 1.45e11 # (Pa) 111 111 self.mantle_density = 3.34 # (g / cm^ - 3) 112 112 -
issm/trunk-jpl/src/m/classes/materials.py
r24756 r25125 80 80 self.heatcapacity = 2093. 81 81 #ice latent heat of fusion L (J / kg) 82 self.latentheat = 3.34 * 1.0e582 self.latentheat = 3.34e5 83 83 #ice thermal conductivity (W / m / K) 84 84 self.thermalconductivity = 2.4 … … 88 88 self.meltingpoint = 273.15 89 89 #rate of change of melting point with pressure (K / Pa) 90 self.beta = 9.8 * 1.0e-890 self.beta = 9.8e-8 91 91 #mixed layer (ice-water interface) heat capacity (J / kg / K) 92 92 self.mixed_layer_capacity = 3974. 93 93 #thermal exchange velocity (ice-water interface) (m / s) 94 self.thermal_exchange_velocity = 1.00 * 1.0e-494 self.thermal_exchange_velocity = 1.00e-4 95 95 #Rheology law: what is the temperature dependence of B with T 96 96 #available: none, paterson and arrhenius … … 101 101 #center of the earth (approximation, must not be 0), then the lab (lithosphere / asthenosphere boundary) then the surface 102 102 #(with 1d3 to avoid numerical singularities) 103 self.radius = [1e3, 6278 * 1e3, 6378 * 1e3]103 self.radius = [1e3, 6278e3, 6378e3] 104 104 self.viscosity = [1e21, 1e40] #mantle and lithosphere viscosity (respectively) [Pa.s] 105 self.lame_mu = [1.45 * 1e11, 6.7 * 1e10] # (Pa) #lithosphere and mantle shear modulus (respectively) [Pa]105 self.lame_mu = [1.45e11, 6.7e10] # (Pa) #lithosphere and mantle shear modulus (respectively) [Pa] 106 106 self.lame_lambda = self.lame_mu # (Pa) #mantle and lithosphere lamba parameter (respectively) [Pa] 107 107 self.burgers_viscosity = [np.nan, np.nan] 108 108 self.burgers_mu = [np.nan, np.nan] 109 109 self.isburgers = [0, 0] 110 self.density = [5.51 * 1e3, 5.50 * 1e3] # (Pa) #mantle and lithosphere density [kg / m^3]110 self.density = [5.51e3, 5.50e3] # (Pa) #mantle and lithosphere density [kg / m^3] 111 111 self.issolid = [1, 1] # is layer solid or liquid. 112 112 elif nat == 'hydro': -
issm/trunk-jpl/src/m/classes/matestar.py
r24213 r25125 91 91 self.heatcapacity = 2093. 92 92 #ice latent heat of fusion L (J / kg) 93 self.latentheat = 3.34 * 1.0e593 self.latentheat = 3.34e5 94 94 #ice thermal conductivity (W / m / K) 95 95 self.thermalconductivity = 2.4 … … 101 101 self.meltingpoint = 273.15 102 102 #rate of change of melting point with pressure (K / Pa) 103 self.beta = 9.8 * 1.0e-8103 self.beta = 9.8e-8 104 104 #mixed layer (ice-water interface) heat capacity (J / kg / K) 105 105 self.mixed_layer_capacity = 3974. 106 106 #thermal exchange velocity (ice-water interface) (m / s) 107 self.thermal_exchange_velocity = 1.00 * 1.0e-4107 self.thermal_exchange_velocity = 1.00e-4 108 108 #Rheology law: what is the temperature dependence of B with T 109 109 #available: none, paterson and arrhenius 110 110 self.rheology_law = 'Paterson' 111 111 # GIA: 112 self.lithosphere_shear_modulus = 6.7 * 1.0e10 # (Pa)112 self.lithosphere_shear_modulus = 6.7e10 # (Pa) 113 113 self.lithosphere_density = 3.32 # (g / cm^ - 3) 114 self.mantle_shear_modulus = 1.45 * 1.0e11 # (Pa)114 self.mantle_shear_modulus = 1.45e11 # (Pa) 115 115 self.mantle_density = 3.34 # (g / cm^ - 3) 116 116 #SLR -
issm/trunk-jpl/src/m/classes/matice.py
r24213 r25125 87 87 self.heatcapacity = 2093. 88 88 #ice latent heat of fusion L (J / kg) 89 self.latentheat = 3.34 * 1.0e589 self.latentheat = 3.34e5 90 90 #ice thermal conductivity (W / m / K) 91 91 self.thermalconductivity = 2.4 … … 97 97 self.meltingpoint = 273.15 98 98 #rate of change of melting point with pressure (K / Pa) 99 self.beta = 9.8 * 1.0e-899 self.beta = 9.8e-8 100 100 #mixed layer (ice-water interface) heat capacity (J / kg / K) 101 101 self.mixed_layer_capacity = 3974. 102 102 #thermal exchange velocity (ice-water interface) (m / s) 103 self.thermal_exchange_velocity = 1.00 * 1.0e-4103 self.thermal_exchange_velocity = 1.00e-4 104 104 #Rheology law: what is the temperature dependence of B with T 105 105 #available: none, paterson and arrhenius … … 107 107 108 108 # GIA: 109 self.lithosphere_shear_modulus = 6.7 * 1.0e10 # (Pa)109 self.lithosphere_shear_modulus = 6.7e10 # (Pa) 110 110 self.lithosphere_density = 3.32 # (g / cm^ - 3) 111 self.mantle_shear_modulus = 1.45 * 1.0e11 # (Pa)111 self.mantle_shear_modulus = 1.45e11 # (Pa) 112 112 self.mantle_density = 3.34 # (g / cm^ - 3) 113 113 -
issm/trunk-jpl/src/m/classes/model.py
r25094 r25125 29 29 from initialization import initialization 30 30 from rifts import rifts 31 from s lr import slr31 from solidearth import solidearth 32 32 from dsl import dsl 33 33 from debug import debug … … 98 98 self.rifts = rifts() 99 99 self.dsl = dsl() 100 self.s lr = slr()100 self.solidearth = solidearth() 101 101 102 102 self.debug = debug() … … 147 147 'initialization', 148 148 'rifts', 149 's lr',149 'solidearth', 150 150 'dsl', 151 151 'debug', … … 194 194 string = "%s\n%s" % (string, "%19s: % - 22s - - %s" % ("initialization", "[%s, %s]" % ("1x1", obj.initialization.__class__.__name__), "initial guess / state")) 195 195 string = "%s\n%s" % (string, "%19s: % - 22s - - %s" % ("rifts", "[%s, %s]" % ("1x1", obj.rifts.__class__.__name__), "rifts properties")) 196 string = "%s\n%s" % (string, "%19s: % - 22s - - %s" % ("s lr", "[%s, %s]" % ("1x1", obj.slr.__class__.__name__), "slr forcings"))196 string = "%s\n%s" % (string, "%19s: % - 22s - - %s" % ("solidearth", "[%s, %s]" % ("1x1", obj.solidearth.__class__.__name__), "solid earth inputs and settings")) 197 197 string = "%s\n%s" % (string, "%19s: % - 22s - - %s" % ("dsl", "[%s, %s]" % ("1x1", obj.dsl.__class__.__name__), "dynamic sea level")) 198 198 string = "%s\n%s" % (string, "%19s: % - 22s - - %s" % ("debug", "[%s, %s]" % ("1x1", obj.debug.__class__.__name__), "debugging tools (valgrind, gprof)")) -
issm/trunk-jpl/src/m/classes/pairoptions.py
r25012 r25125 43 43 #check length of input 44 44 if len(arg) % 2: 45 raise TypeError('Invalid parameter /value pair arguments')45 raise TypeError('Invalid parameter/value pair arguments') 46 46 numoptions = int(len(arg) / 2) 47 47 -
issm/trunk-jpl/src/m/classes/rotational.m
r25118 r25125 22 22 23 23 %moment of inertia: 24 self.equatorialmoi =8.0077*10^37; % [kg m^2]25 self.polarmoi 24 self.equatorialmoi =8.0077*10^37; % [kg m^2] 25 self.polarmoi =8.0345*10^37; % [kg m^2] 26 26 27 27 % mean rotational velocity of earth -
issm/trunk-jpl/src/m/classes/sealevelmodel.m
r25065 r25125 220 220 if iscell(continent), 221 221 if length(continent)==1, 222 223 224 225 226 227 228 229 222 if strcmpi(continent{1},'all'), 223 %need to transform this into a list of continents: 224 continent={}; 225 for i=1:length(self.basins), 226 continent{end+1}=self.basins{i}.continent; 227 end 228 continent=unique(continent); 229 end 230 230 else 231 231 %nothing to do, we have a list of continents … … 236 236 continent={}; 237 237 for i=1:length(self.basins), 238 238 continent{end+1}=self.basins{i}.continent; 239 239 end 240 240 continent=unique(continent); … … 247 247 if iscell(bas), 248 248 if length(bas)==1, 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 249 if strcmpi(bas{1},'all'), 250 %need to transform this into a list of basins: 251 baslist=[]; 252 for i=1:length(self.basins), 253 if self.basins{i}.iscontinentany(continent{:}), 254 baslist(end+1)=i; 255 end 256 end 257 baslist=unique(baslist); 258 else 259 bas=bas{1}; 260 baslist=[]; 261 for i=1:length(self.basins), 262 if self.basins{i}.iscontinentany(continent{:}), 263 if self.basins{i}.isnameany(bas), 264 baslist(end+1)=i; 265 end 266 end 267 end 268 269 end 270 270 else 271 271 %we have a list of basin names: -
issm/trunk-jpl/src/m/classes/sealevelmodel.py
r25065 r25125 43 43 44 44 # Create a default object 45 self .setdefaultparameters()45 self = self.setdefaultparameters() 46 46 47 47 if len(args): … … 77 77 self.eltransitions = [] 78 78 self.planet = 'earth' 79 80 return self81 79 #}}} 82 80 … … 191 189 self.eltransitions.append(meshintersect3d(xe, ye, ze, xei, yei, zei, 'force', force)) 192 190 #}}} 191 192 def checkintersections(self): #{{{ 193 flags = np.zeros(self.earth.mesh.numberofvertices, 1) 194 for i in range(len(self.basins)): 195 flags[self.transitions[i]] = i 196 plotmodel(self.earth, 'data', flags, 'coastline', 'on') 197 #}}} 198 199 def checkbasinconsistency(self): #{{{ 200 for i in range(len(self.basins)): 201 self.basins[i].checkconsistency() 202 #}}} 203 204 def basinindx(self, *args): #{{{ 205 options = pairoptions(*args) 206 continent = options.getfieldvalue('continent', 'all') 207 bas = options.getfieldvalue('basin', 'all') 208 209 #expand continent list #{{{ 210 if type(continent) == np.ndarray: 211 if continent.shape[1] == 1: 212 if continent[0] == 'all': 213 #need to transform this into a list of continents 214 continent = [] 215 for i in range(len(self.basins)): 216 continent.append(self.basins[i].continent) 217 continent = np.unique(continent) 218 else: 219 pass #nothing to do, we have a list of continents 220 else: 221 if continent == 'all': 222 #need to transform this into a list of continents 223 continent = [] 224 for i in range(len(self.basins)): 225 continent.append(self.basins[i].continent) 226 continent = np.unique(continent) 227 else: 228 continent = [continent] 229 #}}} 230 #expand basins list using the continent list above and the extra bas discriminator #{{{ 231 if type(bas) == np.ndarray: 232 if bas.shape[1] == 1: 233 if bas[0] == 'all': 234 #need to transform this into a list of basins 235 baslist = [] 236 for i in range(len(self.basins)): 237 if self.basins[i].iscontinentany(continent): 238 baslist.append(i) 239 baslist = np.unique(baslist) 240 else: 241 bas = bas[0] 242 baslist = [] 243 for i in range(len(self.basins)): 244 if self.basins[i].iscontinentany(continent): 245 if self.basins[i].isnameany(bas): 246 baslist.append(i) 247 else: 248 #we have a list of basin names 249 baslist = [] 250 for i in range(len(bas)): 251 basname = bas[i] 252 for j in range(len(self.basins)): 253 if self.basins[j].iscontinentany(continent): 254 if self.basins[j].isnameany(basname): 255 baslist.append(j) 256 baslist = np.unique(baslist) 257 else: 258 if bas == 'all': 259 baslist = [] 260 for i in range(len(self.basins)): 261 if self.basins[i].iscontinentany(continent): 262 baslist.append(i) 263 baslist = np.unique(baslist) 264 else: 265 baslist = [] 266 for i in range(len(self.basins)): 267 if self.basins[i].iscontinentany(continent): 268 if self.basins[i].isnameany(bas): 269 baslist.append(i) 270 baslist = np.unique(baslist) 271 272 return baslist 273 #}}} 274 #}}} -
issm/trunk-jpl/src/m/classes/slr.py
r25014 r25125 104 104 self.fluid_love = 0.942 105 105 #moment of inertia: 106 self.equatorial_moi = 8.0077 * 1.0e37 # [kg m^2]107 self.polar_moi = 8.0345 * 1.0e37 # [kg m^2]106 self.equatorial_moi = 8.0077e37 # [kg m^2] 107 self.polar_moi = 8.0345e37 # [kg m^2] 108 108 #mean rotational velocity of earth 109 self.angular_velocity = 7.2921 * 1.0e-5 # [s^ - 1]109 self.angular_velocity = 7.2921e-5 # [s^ - 1] 110 110 #numerical discretization accuracy 111 111 self.degacc = 0.01 -
issm/trunk-jpl/src/m/classes/solidearthsettings.m
r25118 r25125 46 46 self.degacc=.01; 47 47 48 %how many time steps we skip before we run SOLIDEARTHSETTINGSsolver during transient48 %how many time steps we skip before we run solidearthsettings solver during transient 49 49 self.runfrequency=1; 50 50 … … 86 86 fielddisplay(self,'ocean_area_scaling','correction for model representation of ocean area [default: No correction]'); 87 87 fielddisplay(self,'computesealevelchange','compute sealevel change from GRD in addition to steric?) default 0'); 88 fielddisplay(self,'runfrequency','how many time steps we skip before we run SOLIDEARTHSETTINGSsolver during transient (default: 1)');88 fielddisplay(self,'runfrequency','how many time steps we skip before we run solidearthsettings solver during transient (default: 1)'); 89 89 fielddisplay(self,'rigid','rigid earth graviational potential perturbation'); 90 90 fielddisplay(self,'elastic','elastic earth graviational potential perturbation'); -
issm/trunk-jpl/src/m/classes/surfaceload.m
r25118 r25125 60 60 function marshall(self,prefix,md,fid) % {{{ 61 61 62 if isempty(self.icethicknesschange), self.icethicknesschange=zeros(md.mesh.numberofelements+1,1); end 63 if isempty(self.waterheightchange), self.waterheightchange=zeros(md.mesh.numberofelements+1,1); end 64 if isempty(self.other), self.other=zeros(md.mesh.numberofelements+1,1); end 62 if isempty(self.icethicknesschange), 63 self.icethicknesschange=zeros(md.mesh.numberofelements+1,1); 64 end 65 if isempty(self.waterheightchange), 66 self.waterheightchange=zeros(md.mesh.numberofelements+1,1); 67 end 68 if isempty(self.other), 69 self.other=zeros(md.mesh.numberofelements+1,1); 70 end 65 71 WriteData(fid,prefix,'object',self,'fieldname','icethicknesschange','name','md.solidearth.surfaceload.icethicknesschange',... 66 72 'format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1,'yts',md.constants.yts); -
issm/trunk-jpl/src/m/coordsystems/gdaltransform.py
r25065 r25125 43 43 filename_out = file_out.name 44 44 45 file_in.write(b'%8g %8g\n' % (x.flatten(1) y.flatten(1)))45 file_in.write(b'%8g %8g\n' % (x.flatten(1), y.flatten(1))) 46 46 file_in.close() 47 47 -
issm/trunk-jpl/src/m/dev/devpath.py
r24254 r25125 11 11 raise NameError('"ISSM_DIR" environment variable is empty! You should define ISSM_DIR in your .cshrc or .bashrc!') 12 12 13 #Go through src/m and append any directory that contains a *.py file to PATH 13 #Get paths to locally installed Python libraries 14 tpls = [ 15 'cftime', # Needed for netCDF4 16 'netCDF4' 17 ] 18 for tpl in os.listdir(ISSM_DIR + '/externalpackages'): 19 tpl_path = ISSM_DIR + '/externalpackages/' + tpl 20 for dirpath, dirnames, filenames in os.walk(tpl_path): 21 install_lib_path = dirpath + '/install/lib' 22 for dirpath, dirnames, filenames in os.walk(install_lib_path): 23 for dirname in dirnames: 24 if dirname in tpls: 25 dir = dirpath + '/' + dirname 26 for file in os.listdir(dir): 27 if file.find(".py") != -1: 28 if file.find(".pyc") == -1: 29 if dirpath not in sys.path: 30 sys.path.append(dirpath) 31 32 #Go through src/m and append any directory that contains a *.py file to PATH 14 33 for root, dirs, files in os.walk(ISSM_DIR + '/src/m'): 15 34 if '.svn' in dirs: … … 21 40 sys.path.append(root) 22 41 23 42 #Also add the Nightly run directory 24 43 if ISSM_DIR + '/test/NightlyRun' not in sys.path: 25 44 sys.path.append(ISSM_DIR + '/test/NightlyRun') … … 28 47 if ISSM_DIR + '/src/wrappers/python/.libs' not in sys.path: 29 48 sys.path.append(ISSM_DIR + '/src/wrappers/python/.libs') 30 # If using clusters, we need to have the path to the cluster settings directory 49 50 # If using clusters, we need to have the path to the cluster settings directory 31 51 if JPL_SVN is not None: 32 52 jpl_path = JPL_SVN + '/usr/' + USERNAME -
issm/trunk-jpl/src/m/geometry/polyarea.py
r25065 r25125 4 4 5 5 6 def polyarea : #{{{6 def polyarea(x, y): #{{{ 7 7 ''' 8 8 POLYAREA - returns the area of the 2-D polygon defined by the vertices in -
issm/trunk-jpl/src/m/io/loadvars.py
r25092 r25125 1 from collections import OrderedDict 2 from netCDF4 import Dataset 3 import numpy as np 4 from re import findall 1 5 import shelve 2 import numpy as np 3 from netCDF4 import Dataset 4 from re import findall 5 from collections import OrderedDict 6 6 7 from model import * 7 8 #hack to keep python 2 compatibility … … 15 16 16 17 def loadvars(*args, OL): 17 """18 LOADVARS - function to load variables toa file.19 20 This function loads one or more variables from a file. The names of the variables21 must be supplied. If more than one variable is specified, it may be done with22 a list of names or a dictionary of name as keys. The output type will correspond23 t o the input type. All the variables in the file may be loaded by specifying only24 the file name.18 ''' 19 LOADVARS - function to load variables from a file. 20 21 This function loads one or more variables from a file. The names of the 22 variables must be supplied. If more than one variable is specified, it may 23 be done with a list of names or a dictionary of name as keys. The output 24 type will correspond to the input type. All the variables in the file may 25 be loaded by specifying only the file name. 25 26 26 27 Usage: … … 29 30 nvdict = loadvars('shelve.dat', {'a':None, 'b':None}) 30 31 nvdict = loadvars('shelve.dat') 31 32 """ 32 ''' 33 33 34 34 filename = '' … … 40 40 if not filename: 41 41 filename = '/tmp/shelve.dat' 42 43 42 else: 44 43 raise TypeError("Missing file name.") … … 47 46 for name in args[1:]: 48 47 nvdict[name] = None 49 50 48 elif len(args) == 2 and isinstance(args[1], list): # (filename, [names]) 51 49 for name in args[1]: 52 50 nvdict[name] = None 53 54 51 elif len(args) == 2 and isinstance(args[1], dict): # (filename, {names:values}) 55 52 nvdict = args[1] 56 57 53 elif len(args) == 1: # (filename) 58 54 pass 59 60 55 else: 61 56 raise TypeError("Unrecognized input arguments.") … … 78 73 print(("Variable '%s' loaded." % name)) 79 74 my_shelf.close() 80 81 75 else: #We used netcdf for the save 82 76 try: -
issm/trunk-jpl/src/m/materials/nye.py
r24794 r25125 40 40 n = 8. # Glen's exponent 41 41 elif ice_type == 2: # H2O ice 42 A_const = 9 * 1.0e4 # s^-1 MPa42 A_const = 9e4 # s^-1 MPa 43 43 Q = 60000. # J mol^-1 44 44 n = 3. # Glen's exponent -
issm/trunk-jpl/src/m/plot/applyoptions.py
r25065 r25125 5 5 from matplotlib.ticker import MaxNLocator 6 6 except ImportError: 7 print("could not import py lab, matplotlib has not been installed, no plotting capabilities enabled")7 print("could not import pyplot, matplotlib has not been installed, no plotting capabilities enabled") 8 8 import numpy as np 9 9 -
issm/trunk-jpl/src/m/plot/plot_unit.py
r25065 r25125 7 7 from mpl_toolkits.mplot3d.art3d import Poly3DCollection 8 8 except ImportError: 9 print("could not import py lab, matplotlib has not been installed, no plotting capabilities enabled")9 print("could not import pyplot, matplotlib has not been installed, no plotting capabilities enabled") 10 10 import numpy as np 11 11 -
issm/trunk-jpl/src/m/plot/plotmodel.py
r25065 r25125 5 5 from mpl_toolkits.axes_grid1 import ImageGrid 6 6 except ImportError: 7 print("could not import py lab, matplotlib has not been installed, no plotting capabilities enabled")7 print("could not import pyplot, matplotlib has not been installed, no plotting capabilities enabled") 8 8 import numpy as np 9 9 -
issm/trunk-jpl/src/m/shp/shpread.m
r25065 r25125 21 21 %recover options 22 22 options=pairoptions(varargin{:}); 23 invert=getfieldvalue(options,'invert',0); 23 24 24 25 %some checks … … 97 98 end 98 99 99 invert=getfieldvalue(options,'invert',0);100 100 if invert, 101 101 for i=1:length(Struct), -
issm/trunk-jpl/src/m/shp/shpread.py
r25065 r25125 5 5 print("could not import shapefile, PyShp has not been installed, no shapefile reading capabilities enabled") 6 6 7 from helpers import OrderedStruct 7 8 from pairoptions import pairoptions 8 9 … … 47 48 Sources: 48 49 - https://github.com/GeospatialPython/pyshp 50 51 TODO: 52 - Create class that can be used to store and pretty print shape structs 53 (ala OrderedStruct from src/m/qmu/helpers.py). 49 54 ''' 50 55 … … 59 64 sf = shapefile.Reader(filename) 60 65 61 Dicts = [] 62 63 #retrieve ID (if it exists) 64 fields = sf.fields 65 for i in range(1, len(fields)): # skip over first field, which is "DeletionFlag" 66 if fields[i][0] == 'id': 67 name = str(sf.record(i - 1)[0]) # record index is offset by one, again, because of "DeletionFlag" 68 break 69 66 Structs = [] 70 67 shapes = sf.shapes() 71 68 for i in range(len(shapes)): 72 Dict = {}69 Struct = OrderedStruct() 73 70 shape = shapes[i] 74 71 if shape.shapeType == shapefile.POINT: 75 Dict['x']= shape.points[0][0]76 Dict['y']= shape.points[0][1]77 Dict['density']= 178 Dict['Geometry']= 'Point'72 Struct.x = shape.points[0][0] 73 Struct.y = shape.points[0][1] 74 Struct.density = 1 75 Struct.Geometry = 'Point' 79 76 elif shape.shapeType == shapefile.POLYLINE: 80 77 num_points = len(shape.points) … … 85 82 x.append(point[0]) 86 83 y.append(point[1]) 87 Dict['x']= x88 Dict['y']= y89 Dict['nods']= num_points90 Dict['density']= 191 Dict['closed']= 192 Dict['BoundingBox']= shape.bbox93 Dict['Geometry']= 'Line'84 Struct.x = x 85 Struct.y = y 86 Struct.nods = num_points 87 Struct.density = 1 88 Struct.closed = 1 89 Struct.BoundingBox = shape.bbox 90 Struct.Geometry = 'Line' 94 91 elif shape.shapeType == shapefile.POLYGON: 95 92 num_points = len(shape.points) … … 100 97 x.append(point[0]) 101 98 y.append(point[1]) 102 Dict['x']= x103 Dict['y']= y104 Dict['nods']= num_points105 Dict['density']= 1106 Dict['closed']= 1107 Dict['BoundingBox']= shape.bbox108 Dict['Geometry'] ='Polygon'99 Struct.x = x 100 Struct.y = y 101 Struct.nods = num_points 102 Struct.density = 1 103 Struct.closed = 1 104 Struct.BoundingBox = shape.bbox 105 Struct.Geometry = 'Polygon' 109 106 else: 110 107 # NOTE: We could do this once before looping over shapes as all … … 115 112 # 116 113 raise Exception('shpread error: geometry {} is not currently supported'.format(shape.shapeTypeName)) 114 117 115 name = '' 118 116 fields = sf.fields … … 121 119 # 'id' field gets special treatment 122 120 if fieldname == 'id': 123 name = str(sf.record( j - 1)[0]) # record index is offset by one, again, because of "DeletionFlag"121 name = str(sf.record(i)[j - 1]) # record index is offset by one, again, because of "DeletionFlag" 124 122 else: 125 Dict[fieldname] = sf.record(j - 1)[0]126 Dict['name']= name127 Dicts.append(Dict)123 setattr(Struct, str(fieldname), sf.record(i)[j - 1]) # cast to string removes "u" from "u'fieldname'" 124 Struct.name = name 125 Structs.append(Struct) 128 126 129 127 invert = options.getfieldvalue('invert', 0) 130 128 if invert: 131 for i in range(len( Dicts)):132 Dicts[i].x = np.flipud(Dicts[i].x)133 Dicts[i].y = np.flipud(Dicts[i].y)129 for i in range(len(Structs)): 130 Structs[i].x = np.flipud(Structs[i].x) 131 Structs[i].y = np.flipud(Structs[i].y) 134 132 135 return Dicts133 return Structs 136 134 #}}} -
issm/trunk-jpl/test/NightlyRun/test2001.py
r24214 r25125 1 1 #Test Name: SquareSheetConstrainedGia2d 2 from socket import gethostname 3 2 4 import numpy as np 5 3 6 from model import * 4 from socket import gethostname5 from triangle import *6 from setmask import *7 7 from parameterize import * 8 8 from setflowequation import * 9 from setmask import * 9 10 from solve import * 11 from triangle import * 10 12 11 13 12 #Define a model 13 md = model() 14 md = triangle(md, '../Exp/Square.exp', 100000.) 14 md = triangle(model(), '../Exp/Square.exp', 100000.) 15 15 md = setmask(md, '', '') 16 16 md = parameterize(md, '../Par/SquareSheetConstrained.py') 17 17 18 #GIA 19 md.gia = giaivins() 20 md.gia.lithosphere_thickness = 100. * np.ones(md.mesh.numberofvertices) # in km 21 md.gia.mantle_viscosity = 1.0e21 * np.ones(md.mesh.numberofvertices) # in Pa.s 22 md.materials.lithosphere_shear_modulus = 6.7e10 # in Pa 23 md.materials.lithosphere_density = 3.32 # in g/cm^3 24 md.materials.mantle_shear_modulus = 1.45e11 # in Pa 25 md.materials.mantle_density = 3.34 # in g/cm^3 26 18 27 #Indicate what you want to compute 19 md.gia.cross_section_shape = 1 # for square-edged x -section28 md.gia.cross_section_shape = 1 # for square-edged x-section 20 29 21 30 #Define loading history (see test2001.m for the description) … … 35 44 field_names = ['GiaW', 'GiadWdt'] 36 45 field_tolerances = [1e-13, 1e-13] 37 field_values = [md.results.GiaSolution. GiaW,38 md.results.GiaSolution. GiadWdt]46 field_values = [md.results.GiaSolution.UGia, 47 md.results.GiaSolution.UGiaRate] -
issm/trunk-jpl/test/NightlyRun/test2002.py
r24914 r25125 1 #Test Name: EarthS lr1 #Test Name: EarthSolidearth 2 2 import numpy as np 3 3 … … 15 15 md.mesh = gmshplanet('radius', 6.371012 * 10**3, 'resolution', 700.) #500 km resolution mesh 16 16 17 #parameterize s lrsolution:18 #s lrloading:19 md.s lr.deltathickness = np.zeros((md.mesh.numberofelements))20 md.s lr.sealevel = np.zeros((md.mesh.numberofvertices))17 #parameterize solidearth solution: 18 #solidearth loading: 19 md.solidearth.deltathickness = np.zeros((md.mesh.numberofelements)) 20 md.solidearth.sealevel = np.zeros((md.mesh.numberofvertices)) 21 21 md.dsl.global_average_thermosteric_sea_level_change=np.zeros((2, )) 22 22 md.dsl.sea_surface_height_change_above_geoid=np.zeros((md.mesh.numberofvertices+1, )) … … 28 28 longe = np.sum(md.mesh.long[md.mesh.elements - 1], axis=1) / 3 29 29 pos = np.where(late < -80) 30 md.s lr.deltathickness[pos] = -10030 md.solidearth.deltathickness[pos] = -100 31 31 #greenland 32 32 pos = np.where(np.logical_and.reduce((late > 70, late < 80, longe > -60, longe < -30))) 33 md.s lr.deltathickness[pos] = -10033 md.solidearth.deltathickness[pos] = -100 34 34 35 35 #elastic loading from love numbers: 36 36 nlov = 101 37 md.s lr.love_h = love_numbers('h')[:nlov]38 md.s lr.love_k = love_numbers('k')[:nlov]39 md.s lr.love_l = love_numbers('l')[:nlov]37 md.solidearth.love_h = love_numbers('h')[:nlov] 38 md.solidearth.love_k = love_numbers('k')[:nlov] 39 md.solidearth.love_l = love_numbers('l')[:nlov] 40 40 41 41 #mask: … … 54 54 55 55 #make sure that the elements that have loads are fully grounded: 56 pos = np.nonzero(md.s lr.deltathickness)[0]56 pos = np.nonzero(md.solidearth.deltathickness)[0] 57 57 md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1 58 58 … … 61 61 md.mask.ice_levelset = icemask 62 62 63 md.s lr.ocean_area_scaling = 063 md.solidearth.ocean_area_scaling = 0 64 64 65 65 #geometry for the bed, arbitrary … … 73 73 74 74 #New stuff 75 md.s lr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))76 md.s lr.Ngia = np.zeros((md.mesh.numberofvertices, ))77 md.s lr.Ugia = np.zeros((md.mesh.numberofvertices, ))78 md.s lr.hydro_rate = np.zeros((md.mesh.numberofvertices, ))75 md.solidearth.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, )) 76 md.solidearth.Ngia = np.zeros((md.mesh.numberofvertices, )) 77 md.solidearth.Ugia = np.zeros((md.mesh.numberofvertices, )) 78 md.solidearth.hydro_rate = np.zeros((md.mesh.numberofvertices, )) 79 79 80 80 #Miscellaneous … … 82 82 83 83 #Solution parameters 84 md.s lr.reltol = np.nan85 md.s lr.abstol = 1e-386 md.s lr.geodetic = 184 md.solidearth.reltol = np.nan 85 md.solidearth.abstol = 1e-3 86 md.solidearth.geodetic = 1 87 87 88 88 #max number of iteration reverted back to 10 (i.e., the original default value) 89 md.s lr.maxiter = 1089 md.solidearth.maxiter = 10 90 90 91 91 #eustatic run: 92 md.s lr.rigid = 093 md.s lr.elastic = 094 md.s lr.rotation = 092 md.solidearth.rigid = 0 93 md.solidearth.elastic = 0 94 md.solidearth.rotation = 0 95 95 md = solve(md, 'Sealevelrise') 96 96 Seustatic = md.results.SealevelriseSolution.Sealevel 97 97 98 98 #eustatic + rigid run: 99 md.s lr.rigid = 1100 md.s lr.elastic = 0101 md.s lr.rotation = 099 md.solidearth.rigid = 1 100 md.solidearth.elastic = 0 101 md.solidearth.rotation = 0 102 102 md = solve(md, 'Sealevelrise') 103 103 Srigid = md.results.SealevelriseSolution.Sealevel 104 104 105 105 #eustatic + rigid + elastic run: 106 md.s lr.rigid = 1107 md.s lr.elastic = 1108 md.s lr.rotation = 0106 md.solidearth.rigid = 1 107 md.solidearth.elastic = 1 108 md.solidearth.rotation = 0 109 109 md = solve(md, 'Sealevelrise') 110 110 Selastic = md.results.SealevelriseSolution.Sealevel 111 111 112 112 #eustatic + rigid + elastic + rotation run: 113 md.s lr.rigid = 1114 md.s lr.elastic = 1115 md.s lr.rotation = 1113 md.solidearth.rigid = 1 114 md.solidearth.elastic = 1 115 md.solidearth.rotation = 1 116 116 md = solve(md, 'Sealevelrise') 117 117 Srotation = md.results.SealevelriseSolution.Sealevel -
issm/trunk-jpl/test/NightlyRun/test2003.py
r24919 r25125 1 #Test Name: EarthS lr_rotationalFeedback1 #Test Name: EarthSolidearth_rotationalFeedback 2 2 import numpy as np 3 3 from model import * … … 13 13 md.mesh = gmshplanet('radius', 6.371012 * 1e3, 'resolution', 1000.) #500 km resolution mesh 14 14 15 #parameterize s lrsolution:16 #s lrloading: {{{17 md.s lr.deltathickness = np.zeros((md.mesh.numberofelements, ))18 md.s lr.sealevel = np.zeros((md.mesh.numberofvertices, ))15 #parameterize solidearth solution: 16 #solidearth loading: {{{ 17 md.solidearth.deltathickness = np.zeros((md.mesh.numberofelements, )) 18 md.solidearth.sealevel = np.zeros((md.mesh.numberofvertices, )) 19 19 md.dsl.global_average_thermosteric_sea_level_change=np.zeros((2, )) 20 20 md.dsl.sea_surface_height_change_above_geoid=np.zeros((md.mesh.numberofvertices+1, )) … … 28 28 longe = sum(md.mesh.long[md.mesh.elements - 1], 1) / 3 29 29 pos = np.intersect1d(np.array(np.where(late < -75)), np.array(np.where(longe < 0))) 30 md.s lr.deltathickness[pos] = -130 md.solidearth.deltathickness[pos] = -1 31 31 32 32 #elastic loading from love numbers: 33 33 nlov = 1000 34 md.s lr.love_h = np.array(love_numbers('h'))35 md.s lr.love_h = np.resize(md.slr.love_h, nlov + 1)36 md.s lr.love_k = np.array(love_numbers('k'))37 md.s lr.love_k = np.resize(md.slr.love_k, nlov + 1)38 md.s lr.love_l = np.array(love_numbers('l'))39 md.s lr.love_l = np.resize(md.slr.love_l, nlov + 1)34 md.solidearth.love_h = np.array(love_numbers('h')) 35 md.solidearth.love_h = np.resize(md.solidearth.love_h, nlov + 1) 36 md.solidearth.love_k = np.array(love_numbers('k')) 37 md.solidearth.love_k = np.resize(md.solidearth.love_k, nlov + 1) 38 md.solidearth.love_l = np.array(love_numbers('l')) 39 md.solidearth.love_l = np.resize(md.solidearth.love_l, nlov + 1) 40 40 #}}} 41 41 … … 56 56 57 57 #make sure that the elements that have loads are fully grounded: 58 pos = np.nonzero(md.s lr.deltathickness)[0]58 pos = np.nonzero(md.solidearth.deltathickness)[0] 59 59 md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1 60 60 … … 65 65 66 66 # use model representation of ocea area (not the ture area) 67 md.s lr.ocean_area_scaling = 067 md.solidearth.ocean_area_scaling = 0 68 68 69 69 #geometry … … 83 83 84 84 #New stuff 85 md.s lr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))86 md.s lr.Ngia = np.zeros((md.mesh.numberofvertices, ))87 md.s lr.Ugia = np.zeros((md.mesh.numberofvertices, ))88 md.s lr.hydro_rate = np.zeros((md.mesh.numberofvertices, ))85 md.solidearth.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, )) 86 md.solidearth.Ngia = np.zeros((md.mesh.numberofvertices, )) 87 md.solidearth.Ugia = np.zeros((md.mesh.numberofvertices, )) 88 md.solidearth.hydro_rate = np.zeros((md.mesh.numberofvertices, )) 89 89 90 90 #Solution parameters 91 md.s lr.reltol = float('NaN')92 md.s lr.abstol = 1e-393 md.s lr.geodetic = 191 md.solidearth.reltol = float('NaN') 92 md.solidearth.abstol = 1e-3 93 md.solidearth.geodetic = 1 94 94 95 95 #eustatic + rigid + elastic run: 96 md.s lr.rigid = 197 md.s lr.elastic = 198 md.s lr.rotation = 096 md.solidearth.rigid = 1 97 md.solidearth.elastic = 1 98 md.solidearth.rotation = 0 99 99 md.cluster = generic('name', gethostname(), 'np', 3) 100 100 #md.verbose = verbose('111111111') … … 108 108 109 109 #eustatic + rigid + elastic + rotation run: 110 md.s lr.rigid = 1111 md.s lr.elastic = 1112 md.s lr.rotation = 1110 md.solidearth.rigid = 1 111 md.solidearth.elastic = 1 112 md.solidearth.rotation = 1 113 113 md.cluster = generic('name', gethostname(), 'np', 3) 114 114 #md.verbose = verbose('111111111') -
issm/trunk-jpl/test/NightlyRun/test2004.m
r25124 r25125 1 1 %Test Name: Sea-Level-Partitions 2 testagainst2002=0; 3 2 4 %Data paths: {{{ 3 modeldatapath='/Users/larour/ModelData';4 5 shppath='../Data/shp/'; 5 6 gshhsshapefile=[shppath 'GSHHS_c_L1-NightlyRun.shp']; 6 7 %}}} 7 8 testagainst2002=0;9 10 %Data paths: {{{11 modeldatapath='/Users/larour/ModelData';12 shppath='../Data/shp/';13 gshhsshapefile=[shppath 'GSHHS_c_L1-NightlyRun.shp'];14 %}}}15 8 16 9 %create sealevel model to hold our information: 17 10 sl=sealevelmodel(); 18 11 19 12 %Create basins using boundaries from shapefile: … … 33 26 boundary('shppath',shppath,'shpfilename','SouthAntarctica','proj',proj3031)... 34 27 })); 35 36 37 38 39 40 41 42 43 %}}} 44 45 46 47 48 49 50 51 52 28 %}}} 29 %Ross: {{{ 30 sl.addbasin(basin('continent','antarctica','name','ross','proj',proj3031,'boundaries',{... 31 boundary('shppath',shppath,'shpfilename','SouthAntarctica','proj',proj3031),... 32 boundary('shppath',shppath,'shpfilename','RossIceShelf','proj',proj3031),... 33 boundary('shppath',shppath,'shpfilename','RossWestFront','proj',proj3031),... 34 boundary('shppath',shppath,'shpfilename','RossFront','proj',proj3031,'orientation','reverse')... 35 })); 36 %}}} 37 %HemisphereEast: {{{ 38 sl.addbasin(basin('continent','hemisphereeast','name','hemisphereeast','proj',laea(0,+90),'boundaries',{... %Australian projection lat,long 39 boundary('shppath',shppath,'shpfilename','HemisphereSplit','proj',proj4326),... 40 boundary('shppath',shppath,'shpfilename','SouthAntarctica','proj',proj3031),... 41 boundary('shppath',shppath,'shpfilename','RossFront','proj',proj3031),... 42 boundary('shppath',shppath,'shpfilename','RossWestFront','proj',proj3031),... 43 boundary('shppath',shppath,'shpfilename','EastAntarctica2','proj',proj3031,'orientation','reverse'),... 44 boundary('shppath',shppath,'shpfilename','NorthAntarctica','proj',proj3031)... 45 })); 53 46 %}}} 54 47 %Antarctica excluding Ronne: {{{ … … 59 52 boundary('shppath',shppath,'shpfilename','RossIceShelf','proj',proj3031,'orientation','reverse'),... 60 53 boundary('shppath',shppath,'shpfilename','SouthAntarctica','proj',proj3031),... 61 boundary('shppath',shppath,'shpfilename','WestAntarctica2','proj',proj3031) ...62 boundary('shppath',shppath,'shpfilename','RonneWestSummit','proj',proj3031) ...63 boundary('shppath',shppath,'shpfilename','RonneIceShelf','proj',proj3031) ...64 boundary('shppath',shppath,'shpfilename','RonneEastSummit','proj',proj3031) ...54 boundary('shppath',shppath,'shpfilename','WestAntarctica2','proj',proj3031),... 55 boundary('shppath',shppath,'shpfilename','RonneWestSummit','proj',proj3031),... 56 boundary('shppath',shppath,'shpfilename','RonneIceShelf','proj',proj3031),... 57 boundary('shppath',shppath,'shpfilename','RonneEastSummit','proj',proj3031),... 65 58 boundary('shppath',shppath,'shpfilename','RonneBrunt','proj',proj3031)... 66 59 })); 67 68 69 70 71 72 73 74 60 %}}} 61 %Ronne: {{{ 62 sl.addbasin(basin('continent','antarctica','name','ronne','proj',proj3031,'boundaries',{... 63 boundary('shppath',shppath,'shpfilename','RonneWestSummit','proj',proj3031),... 64 boundary('shppath',shppath,'shpfilename','RonneIceShelf','proj',proj3031),... 65 boundary('shppath',shppath,'shpfilename','RonneEastSummit','proj',proj3031),... 66 boundary('shppath',shppath,'shpfilename','RonneFront','proj',proj3031,'orientation','reverse')... 67 })); 75 68 %}}} 76 69 … … 372 365 md.timestepping.time_step=1; 373 366 374 % max number of iteration reverted back to 10 (i.e.,the original default value)367 %max number of iterations reverted back to 10 (i.e. the original default value) 375 368 md.solidearth.settings.maxiter=10; 376 369 -
issm/trunk-jpl/test/NightlyRun/test2010.py
r24925 r25125 14 14 md.mesh = gmshplanet('radius', rad_e, 'resolution', 1000.0) # km resolution 15 15 16 #parameterize s lrsolution:17 #s lrloading: {{{16 #parameterize solidearth solution: 17 #solidearth loading: {{{ 18 18 late = sum(md.mesh.lat[md.mesh.elements - 1], 1) / 3 19 19 longe = sum(md.mesh.long[md.mesh.elements - 1], 1) / 3 20 20 21 md.s lr.deltathickness = np.zeros((md.mesh.numberofelements, ))21 md.solidearth.deltathickness = np.zeros((md.mesh.numberofelements, )) 22 22 pos = np.intersect1d(np.array(np.where(late < -75)), np.array(np.where(longe > 0))) 23 23 #python does not include last element in array slices, (6:7) -> [5:7] 24 md.s lr.deltathickness[pos[5:7]] = -124 md.solidearth.deltathickness[pos[5:7]] = -1 25 25 26 md.s lr.sealevel = np.zeros((md.mesh.numberofvertices, ))26 md.solidearth.sealevel = np.zeros((md.mesh.numberofvertices, )) 27 27 md.dsl.global_average_thermosteric_sea_level_change=np.zeros((2, )) 28 28 md.dsl.sea_surface_height_change_above_geoid=np.zeros((md.mesh.numberofvertices+1, )) 29 29 md.dsl.sea_water_pressure_change_at_sea_floor=np.zeros((md.mesh.numberofvertices+1, )) 30 30 31 md.s lr.ocean_area_scaling = 131 md.solidearth.ocean_area_scaling = 1 32 32 33 33 #elastic loading from love numbers: 34 34 nlov = 1000 35 md.s lr.love_h = np.array(love_numbers('h'))36 md.s lr.love_h = np.resize(md.slr.love_h, nlov + 1)37 md.s lr.love_k = np.array(love_numbers('k'))38 md.s lr.love_k = np.resize(md.slr.love_k, nlov + 1)39 md.s lr.love_l = np.array(love_numbers('l'))40 md.s lr.love_l = np.resize(md.slr.love_l, nlov + 1)35 md.solidearth.love_h = np.array(love_numbers('h')) 36 md.solidearth.love_h = np.resize(md.solidearth.love_h, nlov + 1) 37 md.solidearth.love_k = np.array(love_numbers('k')) 38 md.solidearth.love_k = np.resize(md.solidearth.love_k, nlov + 1) 39 md.solidearth.love_l = np.array(love_numbers('l')) 40 md.solidearth.love_l = np.resize(md.solidearth.love_l, nlov + 1) 41 41 42 42 #}}} … … 56 56 57 57 #make sure that the elements that have loads are fully grounded: 58 pos = np.nonzero(md.s lr.deltathickness)[0]58 pos = np.nonzero(md.solidearth.deltathickness)[0] 59 59 md.mask.ocean_levelset[md.mesh.elements[pos, :] - 1] = 1 60 60 … … 79 79 # }}} 80 80 #Solution parameters {{{ 81 md.s lr.reltol = float('NaN')82 md.s lr.abstol = 1e-383 md.s lr.geodetic = 181 md.solidearth.reltol = float('NaN') 82 md.solidearth.abstol = 1e-3 83 md.solidearth.geodetic = 1 84 84 # }}} 85 85 86 86 #New stuff 87 md.s lr.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, ))88 md.s lr.Ngia = np.zeros((md.mesh.numberofvertices, ))89 md.s lr.Ugia = np.zeros((md.mesh.numberofvertices, ))90 md.s lr.hydro_rate = np.zeros((md.mesh.numberofvertices, ))87 md.solidearth.spcthickness = np.nan * np.ones((md.mesh.numberofvertices, )) 88 md.solidearth.Ngia = np.zeros((md.mesh.numberofvertices, )) 89 md.solidearth.Ugia = np.zeros((md.mesh.numberofvertices, )) 90 md.solidearth.hydro_rate = np.zeros((md.mesh.numberofvertices, )) 91 91 92 92 #eustatic + rigid + elastic run: 93 md.s lr.rigid = 194 md.s lr.elastic = 195 md.s lr.rotation = 193 md.solidearth.rigid = 1 94 md.solidearth.elastic = 1 95 md.solidearth.rotation = 1 96 96 md.cluster = generic('name', gethostname(), 'np', 3) 97 97 … … 99 99 md = solve(md, 'Sealevelrise') 100 100 eus = md.results.SealevelriseSolution.SealevelRSLEustatic 101 s lr= md.results.SealevelriseSolution.Sealevel101 solidearth = md.results.SealevelriseSolution.Sealevel 102 102 moixz = md.results.SealevelriseSolution.SealevelInertiaTensorXZ 103 103 moiyz = md.results.SealevelriseSolution.SealevelInertiaTensorYZ … … 105 105 106 106 # analytical moi = > just checking FOR ICE only!!! {{{ 107 # ...have to mute**s lrinduced MOI in Tria.cpp**prior to the comparison107 # ...have to mute**solidearth induced MOI in Tria.cpp**prior to the comparison 108 108 #rad_e = rad_e * 1e3 # now in meters 109 109 #areas = GetAreasSphericalTria(md.mesh.elements, md.mesh.lat, md.mesh.long, rad_e) 110 110 #lat = late * pi / 180 lon = longe * pi / 180 111 #moi_xz = sum(-md.materials.rho_freshwater. * md.s lr.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * cos(lon))112 #moi_yz = sum(-md.materials.rho_freshwater. * md.s lr.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * sin(lon))111 #moi_xz = sum(-md.materials.rho_freshwater. * md.solidearth.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * cos(lon)) 112 #moi_yz = sum(-md.materials.rho_freshwater. * md.solidearth.deltathickness. * areas. * rad_e^2. * sin(lat). * cos(lat). * sin(lon)) 113 113 # }}} 114 114 115 115 #Fields and tolerances to track changes 116 field_names = ['eus', 's lr', 'moixz', 'moiyz', 'moizz']116 field_names = ['eus', 'solidearth', 'moixz', 'moiyz', 'moizz'] 117 117 field_tolerances = [1e-13, 1e-13, 1e-13, 1e-13, 1e-13] 118 field_values = [eus, s lr, moixz, moiyz, moizz]118 field_values = [eus, solidearth, moixz, moiyz, moizz] -
issm/trunk-jpl/test/NightlyRun/test2424.py
r24862 r25125 30 30 31 31 md.timestepping.time_step = .1 32 md.s lr.sealevel = newforcing(md.timestepping.start_time, md.timestepping.final_time,32 md.solidearth.sealevel = newforcing(md.timestepping.start_time, md.timestepping.final_time, 33 33 md.timestepping.time_step, -200., 200., md.mesh.numberofvertices) 34 34 -
issm/trunk-jpl/test/NightlyRun/test2425.py
r24261 r25125 39 39 md.geometry.bed = md.geometry.bed + 1000 40 40 md.geometry.surface = md.geometry.surface + 1000 41 md.s lr.sealevel = 1000 * np.ones((md.mesh.numberofvertices, ))41 md.solidearth.sealevel = 1000 * np.ones((md.mesh.numberofvertices, )) 42 42 43 43 md = solve(md, 'Transient', 'checkconsistency', 'no')
Note:
See TracChangeset
for help on using the changeset viewer.