Changeset 26352
- Timestamp:
- 07/16/21 17:19:58 (4 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.m
r24861 r26352 40 40 pos=find(md.mesh.vertexonboundary & ~vertexonicefront); 41 41 if isempty(pos), 42 disp(' SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet applied')42 disp('Warning: SetMarineIceSheetBC.m: ice front all around the glacier, no dirichlet applied') 43 43 end 44 44 md.stressbalance.spcvx=NaN*ones(md.mesh.numberofvertices,1); -
issm/trunk-jpl/src/m/boundaryconditions/SetMarineIceSheetBC.py
r24861 r26352 5 5 6 6 def SetMarineIceSheetBC(md, icefrontfile=''): 7 """ 8 SETICEMARINESHEETBC - Create the boundary conditions for stressbalanceand thermal models for a Marine Ice Sheet with Ice Front7 """SETICEMARINESHEETBC - Create the boundary conditions for stressbalance 8 and thermal models for a Marine Ice Sheet with Ice Front 9 9 10 11 12 10 Neumann BC are used on the ice front (an ARGUS contour around the ice front 11 can be given in input, or it will be deduced as onfloatingice & onboundary) 12 Dirichlet BC are used elsewhere for stressbalance 13 13 14 15 16 14 Usage: 15 md = SetMarineIceSheetBC(md, icefrontfile) 16 md = SetMarineIceSheetBC(md) 17 17 18 19 20 18 Example: 19 md = SetMarineIceSheetBC(md, 'Front.exp') 20 md = SetMarineIceSheetBC(md) 21 21 22 22 See also: SETICESHELFBC, SETMARINEICESHEETBC 23 23 """ 24 24 #node on Dirichlet (boundary and ~icefront) … … 39 39 pos = np.nonzero(np.logical_and(md.mesh.vertexonboundary, np.logical_not(vertexonicefront)))[0] 40 40 if not np.size(pos): 41 print(" SetMarineIceSheetBC warning: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.")41 print("Warning: SetMarineIceSheetBC.py: ice front all around the glacier, no dirichlet found. Dirichlet must be added manually.") 42 42 43 43 md.stressbalance.spcvx = float('nan') * np.ones(md.mesh.numberofvertices) -
issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.m
r26231 r26352 22 22 23 23 if ~ismember('SealevelchangeAnalysis',analyses) | (strcmp(solution,'TransientSolution') & md.solidearth.settings.isgrd==1), 24 error('offlinesolidearthsolution checkconsistency error message: trying to run GRD patterns while supplying an offline solution for those patterns!');24 error('offlinesolidearthsolution.m::checkconsistency: trying to run GRD patterns while supplying an offline solution for those patterns!'); 25 25 end 26 26 self.checkconsistency@solidearthsolution(md,solution,analyses); -
issm/trunk-jpl/src/m/classes/offlinesolidearthsolution.py
r26316 r26352 57 57 # Transform our time series into time series rates 58 58 if len(np.shape(self.displacementeast)) == 1: 59 print(' External solidearthsolution warning: only one time step provided, assuming the values are rates per year')59 print('Warning: offlinesolidearthsolution.py::marshall: only one time step provided, assuming the values are rates per year') 60 60 displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0) 61 61 displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0) -
issm/trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.m
r24537 r26352 598 598 else 599 599 warning('param_write:param_unrecog','Parameter ''%s'' is of unrecognized type ''%s''.',pname,class(params.(pname))); 600 return601 600 end 602 603 601 end% }}} -
issm/trunk-jpl/src/m/classes/qmu/dakota_method/dmeth_params_write.py
r24213 r26352 7 7 8 8 def dmeth_params_write(dm, fid, sbeg='\t '): 9 '''write the parameters from a dakota_method object.9 """write the parameters from a dakota_method object. 10 10 [] = dmeth_params_write(dm, fid, sbeg) 11 '''11 """ 12 12 13 13 if not isinstance(dm, dakota_method): … … 509 509 # check for errors 510 510 if not isfield(params, pname): 511 warning('param_write:param_not_found', 'Parameter ' + str(pname) + ' not found in ' + params + '.')511 print('Warning: dmeth_params_write.py::param_write: Parameter {} not found in {}.'.format(pname, params)) 512 512 return 513 513 elif type(vars(params)[pname]) == bool and not vars(params)[pname]: 514 514 return 515 515 elif isempty(vars(params)[pname]): 516 print('Warning: param_write:param_empty: Parameter {} requires input of type {}.'.format(pname, type(vars(params)[pname])))516 print('Warning: dmeth_params_write.py::param_write: Parameter {} requires input of type {}.'.format(pname, type(vars(params)[pname]))) 517 517 return 518 518 … … 535 535 536 536 else: 537 print('Warning: param_write:param_unrecog: Parameter {} is of unrecognized type {}.'.format(pname, type(vars(params)[pname])))538 537 print('Warning: dmeth_params_write.py::param_write: Parameter {} is of unrecognized type {}.'.format(pname, type(vars(params)[pname]))) 538 return -
issm/trunk-jpl/src/m/classes/sealevelmodel.m
r26307 r26352 50 50 for i=1:length(slm.icecaps), 51 51 if slm.icecaps{i}.transient.iscoupler==0, 52 warning(sprintf('sealevelmodel checkconsistency error: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name));52 warning(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the transient coupler option turned on!',slm.icecaps{i}.miscellaneous.name)); 53 53 end 54 54 end 55 55 56 56 if slm.earth.transient.iscoupler==0, 57 warning('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!');57 warning('sealevelmodel.m::checkconsistency: earth model should have the transient coupler option turned on!'); 58 58 end 59 59 … … 61 61 for i=1:length(slm.icecaps), 62 62 if slm.icecaps{i}.mesh.numberofvertices ~= length(slm.earth.solidearth.transitions{i}), 63 error(['sealevelmodel checkconsistencyissue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]);63 error(['sealevelmodel.m::checkconsistency: issue with size of transition vector for ice cap: ' num2str(i) ' name: ' slm.icecaps{i}.miscellaneous.name]); 64 64 end 65 65 end … … 68 68 for i=1:length(slm.icecaps), 69 69 if slm.icecaps{i}.solidearth.settings.runfrequency~=slm.earth.solidearth.settings.runfrequency, 70 error(sprintf('sealevelmodel checkconsistency error: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name));70 error(sprintf('sealevelmodel.m::checkconsistency: icecap model %s should have the same run frequency as earth!',slm.icecaps{i}.miscellaneous.name)); 71 71 end 72 72 end … … 76 76 md= slm.icecaps{i}; 77 77 if ~isempty(find(md.dsl.steric_rate - slm.earth.dsl.steric_rate(slm.earth.dsl.transitions{i}))), 78 error(sprintf('s teric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));78 error(sprintf('sealevelmodel.m::checkconsistency: steric rate on ice cap %s is not the same as for the earth\n',md.miscellaneous.name)); 79 79 end 80 80 end … … 84 84 md= slm.icecaps{i}; 85 85 if md.solidearthsettings.isgrd~=slm.earth.solidearthsettings.isgrd 86 error(sprintf(' isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name));86 error(sprintf('sealevelmodel.m::checkconsistency: isgrd on ice cap %s is not the same as for the earth\n',md.miscellaneous.name)); 87 87 end 88 88 end … … 92 92 md= slm.icecaps{i}; 93 93 if ~isempty(md.solidearth.external), 94 error(' cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model');94 error('sealevelmodel.m::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model'); 95 95 end 96 96 … … 100 100 md= slm.icecaps{i}; 101 101 if md.solidearth.settings.grdmodel~=0 102 error(sprintf('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i));102 error(sprintf('sealevelmodel.m::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap %i',i)); 103 103 end 104 104 end -
issm/trunk-jpl/src/m/classes/sealevelmodel.py
r26307 r26352 1 1 from copy import deepcopy 2 import warnings3 2 4 3 import numpy as np … … 91 90 for i in range(len(slm.icecaps)): 92 91 if not slm.icecaps[i].transient.iscoupler: 93 warnings.warn('sealevelmodel checkconsistency error: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name))92 print('Warning: sealevelmodel.py::checkconsistency: icecap model {} should have the transient coupler option turned on!'.format(slm.icecaps[i].miscellaneous.name)) 94 93 95 94 if not slm.earth.transient.iscoupler: 96 warnings.warn('sealevelmodel checkconsistency error: earth model should have the transient coupler option turned on!')95 print('Warning: sealevelmodel.py::checkconsistency: earth model should have the transient coupler option turned on!') 97 96 98 97 # Check that the transition vectors have the right size 99 98 for i in range(len(slm.icecaps)): 100 99 if slm.icecaps[i].mesh.numberofvertices != len(slm.earth.slr.transitions[i]): 101 raise Exception('sealevelmodel checkconsistencyissue with size of transition vector for ice cap: {} name: {}'.format(i, slm.icecaps[i].miscellaneous.name))100 raise Exception('sealevelmodel.py::checkconsistency: issue with size of transition vector for ice cap: {} name: {}'.format(i, slm.icecaps[i].miscellaneous.name)) 102 101 103 102 # Check that run frequency is the same everywhere 104 103 for i in range(len(slm.icecaps)): 105 104 if slm.icecaps[i].slr.geodetic_run_frequency != slm.earth.geodetic_run_frequency: 106 raise Exception('sealevelmodel checkconsistency error: icecap model {} should have the same run frequency as earth!'.format(slm.icecaps[i].miscellaneous.name))105 raise Exception('sealevelmodel.py::checkconsistency: icecap model {} should have the same run frequency as earth!'.format(slm.icecaps[i].miscellaneous.name)) 107 106 108 107 # Make sure steric_rate is the same everywhere … … 110 109 md = slm.icecaps[i] 111 110 if np.nonzero(md.slr.steric_rate - slm.earth.slr.steric_rate[slm.earth.slr.transitions[i]]) != []: 112 raise Exception('s teric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name))111 raise Exception('sealevelmodel.py::checkconsistency: steric rate on ice cap {} is not the same as for the earth'.format(md.miscellaneous.name)) 113 112 114 113 # Make sure grd is the same everywhere … … 116 115 md = slm.icecaps[i] 117 116 if md.solidearthsettings.isgrd != slm.earth.solidearthsettings.isgrd: 118 raise RuntimeError(' isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name))117 raise RuntimeError('sealevelmodel.py::checkconsistency: isgrd on ice cap {} is not the same as for the earth\n'.format(md.miscellaneous.name)) 119 118 # Make sure that there is no solid earth external forcing on the basins 120 119 for i in range(len(slm.icecaps)): 121 120 md = slm.icecaps[i] 122 121 if md.solidearth.external: 123 raise RuntimeError(' cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model')122 raise RuntimeError('sealevelmodel.py::checkconsistency: cannot run external forcings on an ice sheet when running a coupling earth/ice sheet model') 124 123 # Make sure that we have the right grd model for computing our sealevel patterns 125 124 for i in range(len(slm.icecaps)): 126 125 md = slm.icecaps[i] 127 126 if md.solidearth.settings.grdmodel != 0: 128 raise RuntimeError('sealevelmodel checkconsistency error message: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i))127 raise RuntimeError('sealevelmodel.py::checkconsistency: ice sheets do not run GRD module, specify solidearth.settings.grdmodel=0 on ice cap {}'.format(i)) 129 128 #}}} 130 129 -
issm/trunk-jpl/src/m/classes/slr.py
r26317 r26352 11 11 12 12 class slr(object): 13 ''' 14 SLR class definition 15 16 Usage: 17 slr = slr() 18 ''' 13 """SLR class definition 14 15 Usage: 16 slr = slr() 17 """ 19 18 def __init__(self): # {{{ 20 19 self.deltathickness = np.nan … … 154 153 els = np.where(maskpos > 0) 155 154 if len(els[0]) > 0: 156 warnings.warn('slr checkconsistency fail: there are elements with ice loads where some vertices are not on the ice!')155 print('Warning: slr.py::checkconsistency: there are elements with ice loads where some vertices are not on the ice!') 157 156 158 157 # Check that if geodetic is requested, we are a mesh3dsurface model (planet), or if we are not, a coupler to a planet model is provided -
issm/trunk-jpl/src/m/classes/solidearthsolution.py
r26317 r26352 54 54 # Transform our time series into time series rates 55 55 if len(np.shape(self.displacementeast)) == 1: 56 print(' External solidearthsolution warning: only one time step provided, assuming the values are rates per year')56 print('solidearthsolution.py::marshall: Warning: only one time step provided, assuming the values are rates per year') 57 57 displacementeast_rate = np.append(np.array(self.displacementeast).reshape(-1, 1), 0) 58 58 displacementnorth_rate = np.append(np.array(self.displacementnorth).reshape(-1, 1), 0) -
issm/trunk-jpl/src/m/dev/devpath.py
r26184 r26352 2 2 import os 3 3 import sys 4 import warnings5 4 6 5 #Recover ISSM_DIR and USERNAME … … 36 35 sys.path.append(jpl_path) 37 36 else: 38 warnings.warn('cluster settings should be in, {}/usr/{}'.format(JPL_SVN, USERNAME))37 print('Warning: devpath.py: cluster settings should be in {}'.format(jpl_path)) 39 38 40 39 from runme import runme #first because plotmodel may fail -
issm/trunk-jpl/src/m/materials/nye.m
r24719 r26352 13 13 if (ice_type==1) 14 14 if (any(temperature>200&temperature<220)) 15 warning(' CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.\nLook at indexes: %s', mat2str(find(temperature>200 & temperature<220))');15 warning('nye.m: CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.\nLook at indexes: %s', mat2str(find(temperature>200 & temperature<220))'); 16 16 end 17 17 if (any(temperature>=220)) 18 warning(' CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\nLook at indexes: %s', mat2str(find(temperature>=220))');18 warning('nye.m: CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.\nLook at indexes: %s', mat2str(find(temperature>=220))'); 19 19 end 20 20 elseif ((ice_type==2)&&(any(temperature>273.15))) 21 warning(' H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\nLook at indexes: %s', mat2str(find(temperature>273.15))');21 warning('nye.m: H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.\nLook at indexes: %s', mat2str(find(temperature>273.15))'); 22 22 end 23 23 -
issm/trunk-jpl/src/m/materials/nye.py
r25125 r26352 1 1 import numpy as np 2 from warnings import warn3 2 4 3 5 4 def nye(temperature, ice_type): 5 """NYE - figure out the rigidity of ice (either CO2 or H2O) for a given 6 temperature rigidity (in s^(1/n)Pa) is the flow law parameter in the flow 7 law sigma=B*e(1/n) (Nye, p2000). Temperature is in Kelvin degrees. 8 9 Usage: 10 rigidity=nye(temperature,ice_type) % ice_type = 1: CO2 ice // ice_type = 2: H2O ice 6 11 """ 7 NYE - figure out the rigidity of ice (either CO2 or H2O) for a given temperature8 rigidity (in s^(1/n)Pa) is the flow law parameter in the flow law sigma=B*e(1/n) (Nye, p2000).9 temperature is in Kelvin degrees10 11 Usage:12 rigidity=nye(temperature,ice_type) % ice_type = 1: CO2 ice // ice_type = 2: H2O ice13 """14 12 15 13 # Declaring temperature and rigidity arrays … … 26 24 for i in range(len(T)): 27 25 if (200 < T[i] < 220): 28 warn('CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.')26 print('Warning: nye.py: CO2 ICE - POSSIBLE MELTING. Some temperature values are between 200K and 220K.') 29 27 break 30 28 if ((T >= 220).any()): 31 warn('CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.')29 print('Warning: nye.py: CO2 ICE - GUARANTEED MELTING. Some temperature values are beyond 220K.') 32 30 elif (ice_type == 2) and ((T > 273.15).any()): 33 warn('H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.')31 print('Warning: nye.py: H2O ICE - GUARANTEED MELTING. Some temperature values are beyond 273.15K.') 34 32 35 33 Rg = 8.3144598 # J mol^-1 K^-1 -
issm/trunk-jpl/src/m/mech/steadystateiceshelftemp.py
r24256 r26352 49 49 temperature[pos] = -((Tb[pos] - Ts[pos]) * ki / wi[pos] + Hi[pos] * Tb[pos] - (Hi[pos] * Ts[pos] + (Tb[pos] - Ts[pos]) * ki / wi[pos]) * np.exp(Hi[pos] * wi[pos] / ki)) / (Hi[pos] * (np.exp(Hi[pos] * wi[pos] / ki) - 1)) 50 50 except FloatingPointError: 51 print(' steadystateiceshelf warning: overflow encountered in multipy / divide /exp, trying another formulation.')51 print('Warning: steadystateiceshelf.py: overflow encountered in multipy/divide/exp, trying another formulation.') 52 52 temperature[pos] = -(((Tb[pos] - Ts[pos]) * ki / wi[pos] + Hi[pos] * Tb[pos]) / np.exp(Hi[pos] * wi[pos] / ki) - Hi[pos] * Ts[pos] + (Tb[pos] - Ts[pos]) * ki / wi[pos]) / (Hi[pos] * (1 - np.exp(-Hi[pos] * wi[pos] / ki))) 53 53 -
issm/trunk-jpl/src/m/parameterization/setflowequation.m
r25609 r26352 60 60 %check that each element has only one flag 61 61 if any(SIAflag+SSAflag+HOflag+L1L2flag+MLHOflag+FSflag>1), 62 disp('setflowequation warning message: some elements have several types, higher order type is used for them')62 disp('setflowequation.m: Warning: some elements have several types, higher order type is used for them') 63 63 SIAflag(find(SIAflag & SSAflag))=0; 64 64 SIAflag(find(SIAflag & HOflag))=0; -
issm/trunk-jpl/src/m/parameterization/setflowequation.py
r25609 r26352 6 6 7 7 def setflowequation(md, *args): 8 """ 9 SETFLOWEQUATION - associate a solution type to each element 10 11 This routine works like plotmodel: it works with an even number of inputs 12 'SIA', 'SSA', 'HO', 'L1L2', 'MLHO', 'FS' and 'fill' are the possible options 13 that must be followed by the corresponding exp file or flags list 14 It can either be a domain file (argus type, .exp extension), or an array of element flags. 15 If user wants every element outside the domain to be 16 setflowequationd, add '~' to the name of the domain file (ex: '~HO.exp') 17 an empty string '' will be considered as an empty domain 18 a string 'all' will be considered as the entire domain 19 You can specify the type of coupling, 'penalties' or 'tiling', to use with the input 'coupling' 20 21 Usage: 22 md = setflowequation(md, varargin) 23 24 Example: 25 md = setflowequation(md, 'HO', 'HO.exp', fill', 'SIA', 'coupling', 'tiling') 8 """SETFLOWEQUATION - associate a solution type to each element 9 10 This routine works like plotmodel: it works with an even number of inputs 11 'SIA', 'SSA', 'HO', 'L1L2', 'MLHO', 'FS' and 'fill' are the possible 12 options that must be followed by the corresponding exp file or flags list. 13 It can either be a domain file (argus type, .exp extension), or an array of 14 element flags. 15 If user wants every element outside the domain to be setflowequationd, add 16 '~' to the name of the domain file (ex: '~HO.exp') an empty string '' will 17 be considered as an empty domain a string 'all' will be considered as the 18 entire domain. 19 You can specify the type of coupling, 'penalties' or 'tiling', to use with 20 the input 'coupling'. 21 22 Usage: 23 md = setflowequation(md, varargin) 24 25 Example: 26 md = setflowequation(md, 'HO', 'HO.exp', fill', 'SIA', 'coupling', 'tiling') 26 27 """ 27 28 … … 61 62 #check that each element has only one flag 62 63 if any(SIAflag + SSAflag + L1L2flag + MLHOflag + HOflag + FSflag > 1): 63 print( "setflowequation warning message: some elements have several types, higher order type is used for them")64 print('Warning: setflowequation.py: some elements have several types, higher order type is used for them') 64 65 SIAflag[np.where(np.logical_and(SIAflag, SSAflag))] = False 65 66 SIAflag[np.where(np.logical_and(SIAflag, HOflag))] = False -
issm/trunk-jpl/src/m/plot/processdata.m
r25627 r26352 164 164 data(pos,:)=maskvalue; 165 165 else 166 disp(' plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');166 disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements'); 167 167 end 168 168 end … … 194 194 data(md.mesh.elements(pos,:),:)=maskvalue; 195 195 else 196 disp(' plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');196 disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements'); 197 197 end 198 198 end … … 236 236 data(md.mesh.elements(pos,:),:)=NaN; 237 237 else 238 disp(' plotmodel warning: mask length not supported yet (supported length are numberofvertices and numberofelements');238 disp('Warning: processdata.m: mask length not supported yet (supported length are numberofvertices and numberofelements'); 239 239 end 240 240 end -
issm/trunk-jpl/src/m/plot/processdata.py
r25685 r26352 89 89 options.addfielddefault('cmap_set_bad', 'w') 90 90 else: 91 print(' plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')91 print('Warning: processdata.py: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements') 92 92 # }}} 93 93 … … 110 110 options.addfielddefault('cmap_set_bad', 'w') 111 111 else: 112 print(' plotmodel warning: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements')112 print('Warning: processdata.py: mask length not supported yet (supported length are md.mesh.numberofvertices and md.mesh.numberofelements') 113 113 # }}} 114 114 # }}}
Note:
See TracChangeset
for help on using the changeset viewer.