Changeset 26661
- Timestamp:
- 11/24/21 10:35:23 (3 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 1 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/calvingdev2.m
r24305 r26661 42 42 if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end 43 43 44 md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,' nan',1,'Inf',1);45 md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,' nan',1,'Inf',1);44 md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1); 45 md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1); 46 46 md = checkfield(md,'fieldname','calving.height_above_floatation','<=',0); 47 47 end % }}} -
issm/trunk-jpl/src/m/classes/calvingvonmises.m
r24305 r26661 44 44 if (~strcmp(solution,'TransientSolution') | md.transient.ismovingfront==0), return; end 45 45 46 md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,' nan',1,'Inf',1);47 md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,' nan',1,'Inf',1);46 md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'NaN',1,'Inf',1); 47 md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'NaN',1,'Inf',1); 48 48 md = checkfield(md,'fieldname','calving.min_thickness','>=',0,'NaN',1,'Inf',1,'numel',1); 49 49 end % }}} -
issm/trunk-jpl/src/m/coordsystems/laea.py
r25065 r26661 1 1 def laea(lat, long): #{{{ 2 ''' 3 LAEA - Lambert Azimuthal Equal Area projection at lat, long projection 2 """LAEA - Lambert Azimuthal Equal Area projection at lat, long projection 4 3 center. 5 4 … … 10 9 string = laea(45, -90) 11 10 return string = '+proj=laea +lat_0=45 +lon_0=-90 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs' 12 '''11 """ 13 12 14 13 return '+proj=laea +lat_0={} +lon_0={} +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs'.format(lat, long) -
issm/trunk-jpl/src/m/exp/expwrite.py
r24213 r26661 3 3 4 4 def expwrite(contours, filename): 5 """ 6 EXPWRITE - write an Argus file from a dictionary given in input 5 """EXPWRITE - write an Argus file from a dictionary given in input 7 6 8 9 10 The first argument is the list containing the points coordinates11 and thesecond one the file to be written.7 This routine writes an Argus file from a dict containing the fields: 8 x and y of the coordinates of the points. 9 The first argument is the list containing the points coordinates and the 10 second one the file to be written. 12 11 13 14 12 Usage: 13 expwrite(contours, filename) 15 14 16 17 15 Example: 16 expwrite(coordstruct, 'domainoutline.exp') 18 17 19 18 See also EXPDOC, EXPREAD, EXPWRITEASVERTICES 20 19 """ 21 20 22 21 fid = open(filename, 'w') 23 22 for x, y in zip(contours['x'], contours['y']): 24 #if np.size(contour['x']) != np.size(contour['y']):25 23 if len(x) != len(y): 26 raise RuntimeError("contours x and y coordinates must be of identical size") 24 raise RuntimeError('contours x and y coordinates must be of identical size') 25 27 26 if 'name' in contours: 28 fid.write( "%s%s\n" % ('# Name:', contours['name']))27 fid.write('{}{}\n'.format('# Name:', contours['name'])) 29 28 else: 30 fid.write( "%s%s\n" % ('# Name:', filename))29 fid.write('{}{}\n'.format('# Name:', filename)) 31 30 32 31 #Add density if it's not there FIXME what is this ever used for? … … 35 34 density = 1 36 35 37 fid.write("%s\n" % ' # Icon:0') 38 fid.write("%s\n" % ' # Points Count Value') 39 #fid.write("%i %f\n" % (np.size(contour['x']), contour['density'])) 40 fid.write("%i %f\n" % (np.size(x), density)) 41 fid.write("%s\n" % ' # X pos Y pos') 42 #for x, y in zip(contour['x'], contour['y']): 36 fid.write('{}\n'.format('## Icon:0')) 37 fid.write('{}\n'.format('# Points Count Value') 38 if 'density' in contours: 39 if isinstance(contours['density'], int): 40 fid.write('{} {}\n'.format(np.size(x), density)) 41 else: 42 fid.write('{} {}\n'.format(np.size(x), 1.)) 43 else: 44 fid.write('{} {}\n'.format(np.size(x), 1.)) 45 fid.write('{}\n'.format('# X pos Y pos')) 43 46 for xi, yi in zip(x, y): 44 fid.write( "%10.10f %10.10f\n"% (xi, yi))45 fid.write( "\n")47 fid.write('%10.10f %10.10f\n' % (xi, yi)) 48 fid.write('\n') 46 49 47 50 fid.close() -
issm/trunk-jpl/src/m/modules/ExpToLevelSet.py
r26375 r26661 30 30 contourname = shpread(contourname) 31 31 32 # NOTE: This librarydoes not currently exist! See TODO list in function32 # NOTE: This module does not currently exist! See TODO list in function 33 33 # header. 34 34 distance = ExpToLevelSet_python(x, y, contourname) -
issm/trunk-jpl/src/m/shp/shp2exp.m
r26631 r26661 1 1 function shp2exp(shpfilename,expfilename) 2 %SHP2EXP - transform shape file to Argus .exp file2 %SHP2EXP - transform shape file to Argus .exp file 3 3 % 4 4 % Usage: -
issm/trunk-jpl/src/m/shp/shp2exp.py
r24213 r26661 1 import os 1 2 import shapefile 2 import os3 3 from expwrite import expwrite 4 4 5 5 6 def shp2exp(shapefilename, * 7 '''8 Convert a shapefile to an .exp file. Optionally, expfilename can be9 specified to give a name for the .exp file to be created, otherwise the10 .exp file will have the same prefix as the .shpfile.6 def shp2exp(shapefilename, *expfilename): 7 """SHP2EXP - Convert a shapefile to an Argus .exp file. Optionally, 8 expfilename can be specified to give a name for the .exp file to be 9 created, otherwise the .exp file will have the same prefix as the .shp 10 file. 11 11 12 12 Usage: … … 15 15 16 16 Examples: 17 shp2exp('Domain.shp') % creates Domain.exp 18 shp2exp('Domain.shp', 'DomainForISSM.exp') 19 ''' 17 shp2exp('Domain.shp') # Creates Domain.exp 18 shp2exp('Domain.shp', 'Domain.exp') 19 20 See also EXPMASTER, EXPDOC 21 """ 20 22 21 23 if not os.path.exists(shapefilename): 22 raise IOError( "shp2exp error message: file '%s' not found!" % shapefilename)24 raise IOError('shp2exp error message: file {} not found!'.format(shapefilename)) 23 25 if not len(expfilename): 24 26 expfile = os.path.splitext(shapefilename)[0] + '.exp' … … 33 35 for i in range(len(shp.shapes())): 34 36 geom = shp.shapes()[i].shapeType 35 if geom == 5: 37 if geom == 5: # polygon 36 38 expdict['closed'] = 1 37 39 tmpx = [p[0] for p in shp.shapes()[i].points] … … 39 41 x.append(tmpx) 40 42 y.append(tmpy) 41 elif geom == 3: 43 elif geom == 3: # line 42 44 expdict['closed'] = 0 43 45 tmpx = [p[0] for p in shp.shapes()[i].points] … … 45 47 x.append(tmpx) 46 48 y.append(tmpy) 47 elif geom == 1: 49 elif geom == 1: # point 48 50 expdict['closed'] = 0 49 51 x.append(shp.shapes()[i].points[0][0]) -
issm/trunk-jpl/src/m/solve/loadresultsfromcluster.py
r26358 r26661 22 22 md = loadresultsfromcluster(md) 23 23 md = loadresultsfromcluster(md, 'runtimename', runtimename) 24 25 Options include: 'runtimename', 'nolog' 26 27 Example: 28 md = loadresultsfromcluster(md, 'runtimename', 'test101-06-15-2021-13-24-18-4883') 24 29 """ 25 30 -
issm/trunk-jpl/src/m/solvers/asmoptions.m
r26607 r26661 1 1 function asm=asmoptions(varargin) 2 %ASMOPTIONS - return Additive Schwartz Method petsc options2 %ASMOPTIONS - return Additive Schwartz Method PETSc options 3 3 % 4 4 % Usage: -
issm/trunk-jpl/src/m/solvers/asmoptions.py
r26383 r26661 3 3 4 4 def asmoptions(*args): 5 #ASMOPTIONS - return ASM petsc options 6 # 7 # Usage: 8 # options = asmoptions 5 """ASMOPTIONS - Return Additive Schwartz Method PETSc options 9 6 10 #retrieve options provided in *args 7 Usage: 8 options = asmoptions 9 """ 10 11 # Retrieve options provided in *args 11 12 arguments = pairoptions(*args) 12 13 13 options = [['toolkit', 'petsc'], 14 ['mat_type', 'mpiaij'], 15 ['ksp_type', 'gmres'], 16 ['pc_type', 'asm'], 17 ['sub_pc_type', 'lu'], 18 ['pc_asm_overlap', 3], 19 ['ksp_max_it', 100], 20 ['ksp_rtol', 1e-30]] 14 options = [ 15 ['toolkit', 'petsc'], 16 ['mat_type', 'mpiaij'], 17 ['ksp_type', 'gmres'], 18 ['pc_type', 'asm'], 19 ['sub_pc_type', 'lu'], 20 ['pc_asm_overlap', 3], 21 ['ksp_max_it', 100], 22 ['ksp_rtol', 1e-30] 23 ] 21 24 22 # now, go through our arguments, and write over default options.25 # Now, go through our arguments, and write over default options 23 26 for i in range(len(arguments.list)): 24 27 arg1 = arguments.list[i][0] … … 33 36 break 34 37 if not found: 35 # this option did not exist, add it:38 # This option did not exist; add it 36 39 options.append([arg1, arg2]) 37 40 -
issm/trunk-jpl/src/m/solvers/asmstokesoptions.m
r26607 r26661 1 function asm=asm options(varargin)2 %ASM OPTIONS - return Additive Schwartz Method petsc options1 function asm=asmstokesoptions(varargin) 2 %ASMSTOKESOPTIONS - return Additive Schwartz Method Stokes PETSc options 3 3 % 4 4 % Usage: 5 % options=asm options;5 % options=asmstokesoptions; 6 6 7 7 %retrieve options provided in varargin
Note:
See TracChangeset
for help on using the changeset viewer.