Changeset 27453
- Timestamp:
- 12/06/22 11:07:54 (2 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 2 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/SMBd18opdd.m
r27405 r27453 172 172 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts); 173 173 WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts); 174 WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format','Integer');175 WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format','Integer');174 WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer'); 175 WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer'); 176 176 177 177 if self.isd18opd -
issm/trunk-jpl/src/m/classes/SMBd18opdd.py
r27415 r27453 40 40 self.requested_outputs = [] 41 41 42 # Set defaults 43 self.setdefaultparameters() 42 if len(args) == 0: 43 self.setdefaultparameters() 44 else: 45 raise Exception('constructor not supported') 44 46 #}}} 45 47 def __repr__(self): # {{{ 46 s tring = " surface forcings parameters:"47 48 s tring = "%s\n%s" % (string, fielddisplay(self, 'isd18opd', 'is delta18o parametrisation from present day temperature and precipitation activated(0 or 1, default is 0)'))49 s tring = "%s\n%s" % (string, fielddisplay(self, 'issetpddfac', 'is user passing in defined pdd factors (0 or 1, default is 0)'))50 s tring = "%s\n%s" % (string, fielddisplay(self, 'desfac', 'desertification elevation factor (between 0 and 1, default is 0.5) [m]'))51 s tring = "%s\n%s" % (string, fielddisplay(self, 's0p', 'should be set to elevation from precipsource (between 0 and a few 1000s m, default is 0) [m]'))52 s tring = "%s\n%s" % (string, fielddisplay(self, 's0t', 'should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]'))53 string = "%s\n%s" % (string, fielddisplay(self, 'rlaps', 'present day lapse rate [degree/km]')) 54 if self.isd18opd: 55 s tring = "%s\n%s" % (string,fielddisplay(self, 'temperatures_presentday', 'monthly present day surface temperatures [K], required if delta18o/mungsm is activated'))56 s tring = "%s\n%s" % (string,fielddisplay(self, 'precipitations_presentday', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated'))57 s tring = "%s\n%s" % (string,fielddisplay(self, 'istemperaturescaled', 'if delta18o parametrisation from present day temperature and precipitation is activated, is temperature scaled to delta18o value? (0 or 1, default is 1)'))58 s tring = "%s\n%s" % (string,fielddisplay(self, 'isprecipscaled', 'if delta18o parametrisation from present day temperature and precipitation is activated, is precipitation scaled to delta18o value? (0 or 1, default is 1)'))48 s = ' surface forcings parameters:\n' 49 s += '{}\n'.format(fielddisplay(self, 'isd18opd', 'is delta18o parametrisation from present day temperature and precipitation activated (0 or 1, default is 0)')) 50 s += '{}\n'.format(fielddisplay(self, 'issetpddfac', 'is user passing in defined pdd factors (0 or 1, default is 0)')) 51 s += '{}\n'.format(fielddisplay(self, 'desfac', 'desertification elevation factor (between 0 and 1, default is 0.5) [m]')) 52 s += '{}\n'.format(ielddisplay(self, 's0p', 'should be set to elevation from precip source (between 0 and a few 1000s m, default is 0) [m]')) 53 s += '{}\n'.format(fielddisplay(self, 's0t', 'should be set to elevation from temperature source (between 0 and a few 1000s m, default is 0) [m]')) 54 s += '{}\n'.format(fielddisplay(self, 'rlaps', 'present day lapse rate [degree/km]')) 55 56 if self.isd18opd: 57 s += '{}\n'.format(fielddisplay(self, 'temperatures_presentday', 'monthly present day surface temperatures [K], required if delta18o/mungsm is activated')) 58 s += '{}\n'.format(fielddisplay(self, 'precipitations_presentday', 'monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated')) 59 s += '{}\n'.format(fielddisplay(self, 'istemperaturescaled', 'if delta18o parametrisation from present day temperature and precipitation is activated, is temperature scaled to delta18o value? (0 or 1, default is 1)')) 60 s += '{}\n'.format(fielddisplay(self, 'isprecipscaled', 'if delta18o parametrisation from present day temperature and precipitation is activated, is precipitation scaled to delta18o value? (0 or 1, default is 1)')) 59 61 60 62 if self.istemperaturescaled == 0: 61 s tring = "%s\n%s" % (string,fielddisplay(self, 'temperatures_reconstructed', 'monthly historical surface temperatures [K], required if delta18o/mungsm/d18opd is activated and istemperaturescaled is not activated'))63 s += '{}\n'.format(fielddisplay(self, 'temperatures_reconstructed', 'monthly historical surface temperatures [K], required if delta18o/mungsm/d18opd is activated and istemperaturescaled is not activated')) 62 64 63 65 if self.isprecipscaled == 0: 64 s tring = "%s\n%s" % (string,fielddisplay(self, 'precipitations_reconstructed', 'monthly historical precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated and isprecipscaled is not activated'))65 66 s tring = "%s\n%s" % (string,fielddisplay(self, 'delta18o', 'delta18o [per mil], required if pdd is activated and delta18o activated'))67 s tring = "%s\n%s" % (string,fielddisplay(self, 'dpermil', 'degree per mil, required if d18opd is activated'))68 s tring = "%s\n%s" % (string,fielddisplay(self, 'f', 'precip/temperature scaling factor, required if d18opd is activated'))66 s += '{}\n'.format(fielddisplay(self, 'precipitations_reconstructed', 'monthly historical precipitation [m/yr water eq], required if delta18o/mungsm/d18opd is activated and isprecipscaled is not activated')) 67 68 s += '{}\n'.format(fielddisplay(self, 'delta18o', 'delta18o [per mil], required if pdd is activated and delta18o activated')) 69 s += '{}\n'.format(fielddisplay(self, 'dpermil', 'degree per mil, required if d18opd is activated')) 70 s += '{}\n'.format(fielddisplay(self, 'f', 'precip/temperature scaling factor, required if d18opd is activated')) 69 71 70 72 if self.issetpddfac == 1: 71 string = "%s\n%s" % (string, fielddisplay(self, 'pddfac_snow', 'Pdd factor for snow for all the domain [mm ice equiv/day/degree C]')) 72 string = "%s\n%s" % (string, fielddisplay(self, 'pddfac_ice', 'Pdd factor for ice for all the domain [mm ice equiv/day/degree C]')) 73 string = "%s\n%s" % (string, fielddisplay(self, 'steps_per_step', 'number of smb steps per time step')) 74 string = "%s\n%s" % (string, fielddisplay(self, 'averaging', 'averaging methods from short to long steps')) 75 string = "%s\n\t\t%s" % (string, '0: Arithmetic (default)') 76 string = "%s\n\t\t%s" % (string, '1: Geometric') 77 string = "%s\n\t\t%s" % (string, '2: Harmonic') 78 79 string = "%s\n%s" % (string, fielddisplay(self, 'requested_outputs', 'additional outputs requested')) 80 81 return string 73 s += '{}\n'.format(fielddisplay(self, 'pddfac_snow', 'Pdd factor for snow for all the domain [mm ice equiv/day/degree C]')) 74 s += '{}\n'.format(fielddisplay(self, 'pddfac_ice', 'Pdd factor for ice for all the domain [mm ice equiv/day/degree C]')) 75 76 s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step')) 77 s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps')) 78 s += '\t\t{}\n'.format('0: Arithmetic (default)') 79 s += '\t\t{}\n'.format('1: Geometric') 80 s += '\t\t{}\n'.format('2: Harmonic') 81 s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested')) 82 return s 82 83 #}}} 83 84 def extrude(self, md): # {{{ … … 205 206 outputs = outputscopy 206 207 WriteData(fid, prefix, 'data', outputs, 'name', 'md.smb.requested_outputs', 'format', 'StringArray') 207 208 208 # }}} -
issm/trunk-jpl/src/m/classes/SMBdebrisML.m
r27403 r27453 11 11 end 12 12 methods 13 function self = SMB henning(varargin) % {{{13 function self = SMBdebrisML(varargin) % {{{ 14 14 switch nargin 15 15 case 0 … … 57 57 58 58 WriteData(fid,prefix,'name','md.smb.model','data',14,'format','Integer'); 59 WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format','Integer');60 WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format','Integer');59 WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer'); 60 WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer'); 61 61 62 62 %process requested outputs -
issm/trunk-jpl/src/m/classes/SMBforcing.m
r27404 r27453 54 54 md = checkfield(md,'fieldname','smb.steps_per_step','>=',1,'numel',[1]); 55 55 md = checkfield(md,'fieldname','smb.requested_outputs','stringrow',1); 56 md = checkfield(md, 'fieldname', 'smb.averaging', 'numel', [1], 'values', [0, 1,2]);56 md = checkfield(md,'fieldname','smb.averaging','numel',[1],'values',[0 1 2]); 57 57 end % }}} 58 58 function disp(self) % {{{ … … 71 71 72 72 WriteData(fid,prefix,'name','md.smb.model','data',1,'format','Integer'); 73 WriteData(fid,prefix,'object',self,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);74 WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format','Integer');75 WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format','Integer');73 WriteData(fid,prefix,'object',self,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 74 WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer'); 75 WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer'); 76 76 77 77 %process requested outputs -
issm/trunk-jpl/src/m/classes/SMBforcing.py
r27417 r27453 20 20 self.averaging = 0 21 21 22 if len(args) == 0: 22 nargs = len(args) 23 if nargs == 0: 24 self.setdefaultparameters() 25 elif nargs == 1: 26 # TODO: Replace the following with constructor 23 27 self.setdefaultparameters() 24 28 else: … … 30 34 s += '{}\n'.format(fielddisplay(self, 'mass_balance', 'surface mass balance [m/yr ice eq]')) 31 35 s += '{}\n'.format(fielddisplay(self, 'steps_per_step', 'number of smb steps per time step')) 32 s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested'))33 36 s += '{}\n'.format(fielddisplay(self, 'averaging', 'averaging methods from short to long steps')) 34 37 s += '\t\t{}\n'.format('0: Arithmetic (default)') 35 38 s += '\t\t{}\n'.format('1: Geometric') 36 39 s += '\t\t{}\n'.format('2: Harmonic') 40 s += '{}\n'.format(fielddisplay(self, 'requested_outputs', 'additional outputs requested')) 37 41 return s 38 42 #}}} -
issm/trunk-jpl/src/m/classes/SMBhenning.m
r27403 r27453 73 73 WriteData(fid,prefix,'name','md.smb.model','data',7,'format','Integer'); 74 74 WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); 75 WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format','Integer');76 WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format','Integer');75 WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer'); 76 WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer'); 77 77 78 78 %process requested outputs -
issm/trunk-jpl/src/m/classes/SMBsemic.m
r27409 r27453 12 12 dailywindspeed = NaN; 13 13 dailypressure = NaN; 14 dailyairdensity = NaN;14 dailyairdensity = NaN; 15 15 dailyairhumidity = NaN; 16 16 dailytemperature = NaN; 17 17 desfac = 0; 18 rlaps 18 rlaps = 0; 19 19 rdl = 0; 20 s0gcm 21 steps_per_step 22 averaging 23 requested_outputs 20 s0gcm = NaN; 21 steps_per_step = 1; 22 averaging = 0; 23 requested_outputs = {}; 24 24 end 25 25 methods … … 115 115 function marshall(self,prefix,md,fid) % {{{ 116 116 117 yts=md.constants.yts; 118 117 119 WriteData(fid,prefix,'name','md.smb.model','data',12,'format','Integer'); 118 120 … … 121 123 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double'); 122 124 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rdl','format','Double'); 123 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailysnowfall','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);124 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyrainfall','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);125 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailydsradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);126 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailydlradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);127 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailywindspeed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);128 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailypressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);129 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyairdensity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);130 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyairhumidity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);131 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailytemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts', md.constants.yts);132 WriteData(fid, prefix, 'object', self, 'fieldname', 'steps_per_step', 'format','Integer');133 WriteData(fid, prefix, 'object', self, 'fieldname', 'averaging', 'format','Integer');125 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailysnowfall','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 126 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyrainfall','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 127 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailydsradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 128 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailydlradiation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 129 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailywindspeed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 130 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailypressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 131 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyairdensity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 132 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailyairhumidity','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 133 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dailytemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',yts); 134 WriteData(fid,prefix,'object',self,'fieldname','steps_per_step','format','Integer'); 135 WriteData(fid,prefix,'object',self,'fieldname','averaging','format','Integer'); 134 136 %process requested outputs 135 137 outputs = self.requested_outputs; -
issm/trunk-jpl/src/m/classes/debris.py
r27424 r27453 8 8 9 9 class debris(object): 10 """ DEBRISclass definition10 """debris class definition 11 11 12 12 Usage: -
issm/trunk-jpl/src/m/classes/frontalforcings.m
r27010 r27453 1 %FRONTAL 1 %FRONTALFORCINGS class definition 2 2 % 3 3 % Usage: -
issm/trunk-jpl/src/m/classes/frontalforcings.py
r27423 r27453 8 8 9 9 class frontalforcings(object): 10 """ 11 FRONTAL FORCINGS class definition 10 """frontalforcings class definition 12 11 13 14 12 Usage: 13 frontalforcings = frontalforcings() 15 14 """ 16 15 -
issm/trunk-jpl/src/m/classes/lovenumbers.py
r27417 r27453 8 8 9 9 class lovenumbers(object): #{{{ 10 """ LOVENUMBERSclass definition10 """lovenumbers class definition 11 11 12 12 Usage: -
issm/trunk-jpl/src/m/classes/model.py
r27430 r27453 75 75 76 76 class model(object): 77 """ MODEL -class definition77 """model class definition 78 78 79 79 Usage: -
issm/trunk-jpl/src/m/classes/sampling.py
r27419 r27453 10 10 11 11 class sampling(object): 12 """ SAMPLINGclass definition12 """sampling class definition 13 13 14 14 Usage: -
issm/trunk-jpl/src/m/classes/solidearthsettings.py
r27417 r27453 7 7 8 8 class solidearthsettings(object): 9 """ SOLIDEARTHSETTINGSclass definition9 """solidearthsettings class definition 10 10 11 11 Usage: -
issm/trunk-jpl/src/m/classes/transient.py
r27417 r27453 30 30 self.requested_outputs = [] 31 31 32 self.setdefaultparameters() 32 if len(args) == 0: 33 self.setdefaultparameters() 34 else: 35 raise Exception('constructor not supported') 33 36 # }}} 34 37 -
issm/trunk-jpl/src/m/coordsystems/gmtmask.py
r27368 r27453 10 10 11 11 def gmtmask(lat, long, *args): 12 ''' 13 GMTMASK - figure out which lat, long points are on the ocean 12 """GMTMASK - figure out which lat, long points are on the ocean 14 13 15 16 17 '''14 Usage: 15 mask.ocean = gmtmask(md.mesh.lat, md.mesh.long) 16 """ 18 17 lenlat = len(lat) 19 18 mask = np.empty(lenlat) … … 30 29 print(('gmtmask: num vertices ' + str(lenlat))) 31 30 32 # Check lat and long size is not more than 50,000. If so, recursively call gmtmask:31 # Check lat and long size is not more than 50,000. If so, recursively call gmtmask. 33 32 if lenlat > 50000: 34 33 for i in range(int(ceil(lenlat / 50000))): … … 39 38 return mask 40 39 41 # First, write our lat, long file for gmt:40 # First, write our lat, long file for gmt 42 41 nv = lenlat 43 42 #print(np.transpose([int, lat, np.arange(1, nv + 1)])) 44 43 np.savetxt('./all_vertices.txt', np.transpose([long, lat, np.arange(1, nv + 1)]), delimiter='\t', fmt='%.10f') 45 44 46 # figure out which vertices are on the ocean, which one on the continent:45 # Figure out which vertices are on the ocean, which one on the continent: 47 46 subprocess.call('gmt select ./all_vertices.txt -h0 -Df -R0/360/-90/90 -A0 -JQ180/200 -Nk/s/s/k/s > ./oce_vertices.txt', shell=True) 48 47 49 # read the con_vertices.txt file and flag our mesh vertices on the continent48 # Read the con_vertices.txt file and flag our mesh vertices on the continent 50 49 fid = open('./oce_vertices.txt', 'r') 51 50 line = fid.readline()
Note:
See TracChangeset
for help on using the changeset viewer.