[24307] | 1 | Index: ../trunk-jpl/src/m/classes/calvinglevermann.py
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/classes/calvinglevermann.py (revision 23657)
|
---|
| 4 | +++ ../trunk-jpl/src/m/classes/calvinglevermann.py (revision 23658)
|
---|
| 5 | @@ -22,13 +22,11 @@
|
---|
| 6 | def __repr__(self): # {{{
|
---|
| 7 | string=' Calving Levermann parameters:'
|
---|
| 8 | string="%s\n%s"%(string,fielddisplay(self,'coeff','proportionality coefficient in Levermann model'))
|
---|
| 9 | - string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
|
---|
| 10 |
|
---|
| 11 | return string
|
---|
| 12 | #}}}
|
---|
| 13 | def extrude(self,md): # {{{
|
---|
| 14 | self.coeff=project3d(md,'vector',self.coeff,'type','node')
|
---|
| 15 | - self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
|
---|
| 16 | return self
|
---|
| 17 | #}}}
|
---|
| 18 | def setdefaultparameters(self): # {{{
|
---|
| 19 | @@ -43,7 +41,6 @@
|
---|
| 20 | return md
|
---|
| 21 |
|
---|
| 22 | md = checkfield(md,'fieldname','calving.coeff','size',[md.mesh.numberofvertices],'>',0)
|
---|
| 23 | - md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>=',0)
|
---|
| 24 | return md
|
---|
| 25 | # }}}
|
---|
| 26 | def marshall(self,prefix,md,fid): # {{{
|
---|
| 27 | @@ -50,5 +47,4 @@
|
---|
| 28 | yts=md.constants.yts
|
---|
| 29 | WriteData(fid,prefix,'name','md.calving.law','data',3,'format','Integer');
|
---|
| 30 | WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1)
|
---|
| 31 | - WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
|
---|
| 32 | # }}}
|
---|
| 33 | Index: ../trunk-jpl/src/m/classes/frontalforcings.py
|
---|
| 34 | ===================================================================
|
---|
| 35 | --- ../trunk-jpl/src/m/classes/frontalforcings.py (revision 23657)
|
---|
| 36 | +++ ../trunk-jpl/src/m/classes/frontalforcings.py (revision 23658)
|
---|
| 37 | @@ -14,11 +14,6 @@
|
---|
| 38 | def __init__(self): # {{{
|
---|
| 39 |
|
---|
| 40 | self.meltingrate = float('NaN')
|
---|
| 41 | - self.melt_parameterization = 0.
|
---|
| 42 | - self.basin = float('NaN')
|
---|
| 43 | - self.numberofbasins = float('NaN')
|
---|
| 44 | - self.subglacial_discharge = float('NaN')
|
---|
| 45 | - self.thermalforcings = float('NaN')
|
---|
| 46 |
|
---|
| 47 | #set defaults
|
---|
| 48 | self.setdefaultparameters()
|
---|
| 49 | @@ -26,14 +21,7 @@
|
---|
| 50 | #}}}
|
---|
| 51 | def __repr__(self): # {{{
|
---|
| 52 | string=' Frontalforcings parameters:'
|
---|
| 53 | - string="%s\n%s"%(string,fielddisplay(self,'melt_parameterization','0: no, 1: Rignot melt parameterization (Rignot et al.,2016)'))
|
---|
| 54 | - if self.melt_parameterization==0:
|
---|
| 55 | - string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
|
---|
| 56 | - elif self.melt_parameterization==1:
|
---|
| 57 | - string="%s\n%s"%(string,fielddisplay(self,'basin','basin ID for vertices'))
|
---|
| 58 | - string="%s\n%s"%(string,fielddisplay(self,'numberofbasins','number of basins'))
|
---|
| 59 | - string="%s\n%s"%(string,fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m/d]'))
|
---|
| 60 | - string="%s\n%s"%(string,fielddisplay(self,'thermalforcing','thermal forcing [C]'))
|
---|
| 61 | + string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
|
---|
| 62 |
|
---|
| 63 | return string
|
---|
| 64 | #}}}
|
---|
| 65 | @@ -48,31 +36,18 @@
|
---|
| 66 | def checkconsistency(self,md,solution,analyses): # {{{
|
---|
| 67 |
|
---|
| 68 | #Early return
|
---|
| 69 | - if (solution!='TransientSolution') or (not md.transient.ismovingfront):
|
---|
| 70 | - return md
|
---|
| 71 | -
|
---|
| 72 | - md = checkfield(md,'fieldname','frontalforcings.melt_parameterization','numel',[1],'values',[0,1]);
|
---|
| 73 | - if self.melt_parameterization==0:
|
---|
| 74 | - md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
|
---|
| 75 | - elif self.melt_parameterization==1:
|
---|
| 76 | - md = checkfield(md,'fieldname','frontalforcings.basin','>',0,'nan',1,'Inf',1);
|
---|
| 77 | - md = checkfield(md,'fieldname','frontalforcings.numberofbasins','numel',[1]);
|
---|
| 78 | - md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'nan',1,'Inf',1,'timeseries',1);
|
---|
| 79 | - md = checkfield(md,'fieldname','frontalforcings.thermalforcing','nan',1,'Inf',1,'timeseries',1);
|
---|
| 80 | + if (solution!='TransientSolution') or (not md.transient.ismovingfront):
|
---|
| 81 | + return md
|
---|
| 82 |
|
---|
| 83 | + md = checkfield(md,'fieldname','frontalforcings.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0);
|
---|
| 84 | +
|
---|
| 85 | return md
|
---|
| 86 | # }}}
|
---|
| 87 | def marshall(self,prefix,md,fid): # {{{
|
---|
| 88 |
|
---|
| 89 | - yts=md.constants.yts
|
---|
| 90 | + yts=md.constants.yts
|
---|
| 91 |
|
---|
| 92 | - WriteData(fid,prefix,'object',self,'fieldname','melt_parameterization','format','Integer');
|
---|
| 93 | - if self.melt_parameterization==0:
|
---|
| 94 | - WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
|
---|
| 95 | - elif self.melt_parameterization==1:
|
---|
| 96 | - WriteData(fid,prefix,'object',self,'fieldname','basin','format','DoubleMat','mattype',1);
|
---|
| 97 | - WriteData(fid,prefix,'object',self,'fieldname','numberofbasins','format','Integer');
|
---|
| 98 | - WriteData(fid,prefix,'object',self,'fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
|
---|
| 99 | - WriteData(fid,prefix,'object',self,'fieldname','thermalforcing','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
|
---|
| 100 | + WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',1,'format','Integer')
|
---|
| 101 | + WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts);
|
---|
| 102 |
|
---|
| 103 | # }}}
|
---|
| 104 | Index: ../trunk-jpl/src/m/classes/calvingminthickness.py
|
---|
| 105 | ===================================================================
|
---|
| 106 | --- ../trunk-jpl/src/m/classes/calvingminthickness.py (revision 23657)
|
---|
| 107 | +++ ../trunk-jpl/src/m/classes/calvingminthickness.py (revision 23658)
|
---|
| 108 | @@ -22,11 +22,9 @@
|
---|
| 109 | def __repr__(self): # {{{
|
---|
| 110 | string=' Calving Minimum thickness:'
|
---|
| 111 | string="%s\n%s"%(string,fielddisplay(self,'min_thickness','minimum thickness below which no ice is allowed'))
|
---|
| 112 | - string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
|
---|
| 113 | return string
|
---|
| 114 | #}}}
|
---|
| 115 | def extrude(self,md): # {{{
|
---|
| 116 | - self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
|
---|
| 117 | return self
|
---|
| 118 | #}}}
|
---|
| 119 | def setdefaultparameters(self): # {{{
|
---|
| 120 | @@ -41,7 +39,6 @@
|
---|
| 121 | return
|
---|
| 122 |
|
---|
| 123 | md = checkfield(md,'fieldname','calving.min_thickness','>',0,'NaN',1,'Inf',1)
|
---|
| 124 | - md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices],'>=',0)
|
---|
| 125 | return md
|
---|
| 126 | # }}}
|
---|
| 127 | def marshall(self,prefix,md,fid): # {{{
|
---|
| 128 | @@ -48,5 +45,4 @@
|
---|
| 129 | yts=md.constants.yts
|
---|
| 130 | WriteData(fid,prefix,'name','md.calving.law','data',4,'format','Integer')
|
---|
| 131 | WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double')
|
---|
| 132 | - WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts)
|
---|
| 133 | # }}}
|
---|
| 134 | Index: ../trunk-jpl/src/m/classes/frontalforcingsrignot.py
|
---|
| 135 | ===================================================================
|
---|
| 136 | --- ../trunk-jpl/src/m/classes/frontalforcingsrignot.py (nonexistent)
|
---|
| 137 | +++ ../trunk-jpl/src/m/classes/frontalforcingsrignot.py (revision 23658)
|
---|
| 138 | @@ -0,0 +1,64 @@
|
---|
| 139 | +from fielddisplay import fielddisplay
|
---|
| 140 | +from project3d import project3d
|
---|
| 141 | +from checkfield import checkfield
|
---|
| 142 | +from WriteData import WriteData
|
---|
| 143 | +
|
---|
| 144 | +class frontalforcingsrignot(object):
|
---|
| 145 | + """
|
---|
| 146 | + FRONTAL FORCINGS Rignot class definition
|
---|
| 147 | +
|
---|
| 148 | + Usage:
|
---|
| 149 | + frontalforcingsrignot=frontalforcingsrignot();
|
---|
| 150 | + """
|
---|
| 151 | +
|
---|
| 152 | + def __init__(self): # {{{
|
---|
| 153 | +
|
---|
| 154 | + self.basin= float('NaN');
|
---|
| 155 | + self.numberofbasins = 0.;
|
---|
| 156 | + self.subglacial_discharge = float('NaN');
|
---|
| 157 | + self.thermalforcing = float('NaN');
|
---|
| 158 | +
|
---|
| 159 | + #set defaults
|
---|
| 160 | + self.setdefaultparameters()
|
---|
| 161 | +
|
---|
| 162 | + #}}}
|
---|
| 163 | + def __repr__(self): # {{{
|
---|
| 164 | + string=' Frontalforcings parameters:'
|
---|
| 165 | + string="%s\n%s"%(string,fielddisplay(self,'basin','basin ID for vertices'))
|
---|
| 166 | + string="%s\n%s"%(string,fielddisplay(self,'numberofbasins','number of basins'))
|
---|
| 167 | + string="%s\n%s"%(string,fielddisplay(self,'subglacial_discharge','sum of subglacial discharge for each basin [m/d]'))
|
---|
| 168 | + string="%s\n%s"%(string,fielddisplay(self,'thermalforcing','thermal forcing [C]'))
|
---|
| 169 | +
|
---|
| 170 | + return string
|
---|
| 171 | + #}}}
|
---|
| 172 | + def extrude(self,md): # {{{
|
---|
| 173 | + return self
|
---|
| 174 | + #}}}
|
---|
| 175 | + def setdefaultparameters(self): # {{{
|
---|
| 176 | +
|
---|
| 177 | + return self
|
---|
| 178 | + #}}}
|
---|
| 179 | + def checkconsistency(self,md,solution,analyses): # {{{
|
---|
| 180 | +
|
---|
| 181 | + #Early return
|
---|
| 182 | + if (solution!='TransientSolution') or (not md.transient.ismovingfront):
|
---|
| 183 | + return md
|
---|
| 184 | +
|
---|
| 185 | + md = checkfield(md,'fieldname','frontalforcings.basin','>',0,'nan',1,'Inf',1);
|
---|
| 186 | + md = checkfield(md,'fieldname','frontalforcings.numberofbasins','numel',[1]);
|
---|
| 187 | + md = checkfield(md,'fieldname','frontalforcings.subglacial_discharge','>=',0,'nan',1,'Inf',1,'timeseries',1);
|
---|
| 188 | + md = checkfield(md,'fieldname','frontalforcings.thermalforcing','nan',1,'Inf',1,'timeseries',1);
|
---|
| 189 | +
|
---|
| 190 | + return md
|
---|
| 191 | + # }}}
|
---|
| 192 | + def marshall(self,prefix,md,fid): # {{{
|
---|
| 193 | +
|
---|
| 194 | + yts=md.constants.yts
|
---|
| 195 | +
|
---|
| 196 | + WriteData(fid,prefix,'name','md.frontalforcings.parameterization','data',2,'format','Integer')
|
---|
| 197 | + WriteData(fid,prefix,'object',self,'fieldname','basin','format','DoubleMat','mattype',1);
|
---|
| 198 | + WriteData(fid,prefix,'object',self,'fieldname','numberofbasins','format','Integer');
|
---|
| 199 | + WriteData(fid,prefix,'object',self,'fieldname','subglacial_discharge','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
|
---|
| 200 | + WriteData(fid,prefix,'object',self,'fieldname','thermalforcing','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);
|
---|
| 201 | +
|
---|
| 202 | + # }}}
|
---|
| 203 | Index: ../trunk-jpl/src/m/classes/calving.py
|
---|
| 204 | ===================================================================
|
---|
| 205 | --- ../trunk-jpl/src/m/classes/calving.py (revision 23657)
|
---|
| 206 | +++ ../trunk-jpl/src/m/classes/calving.py (revision 23658)
|
---|
| 207 | @@ -23,13 +23,11 @@
|
---|
| 208 | def __repr__(self): # {{{
|
---|
| 209 | string=' Calving parameters:'
|
---|
| 210 | string="%s\n%s"%(string,fielddisplay(self,'calvingrate','calving rate at given location [m/a]'))
|
---|
| 211 | - string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
|
---|
| 212 |
|
---|
| 213 | return string
|
---|
| 214 | #}}}
|
---|
| 215 | def extrude(self,md): # {{{
|
---|
| 216 | self.calvingrate=project3d(md,'vector',self.calvingrate,'type','node')
|
---|
| 217 | - self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
|
---|
| 218 | return self
|
---|
| 219 | #}}}
|
---|
| 220 | def setdefaultparameters(self): # {{{
|
---|
| 221 | @@ -43,7 +41,6 @@
|
---|
| 222 | return md
|
---|
| 223 |
|
---|
| 224 | md = checkfield(md,'fieldname','calving.calvingrate','>=',0,'timeseries',1,'NaN',1,'Inf',1);
|
---|
| 225 | - md = checkfield(md,'fieldname','calving.meltingrate','>=',0,'timeseries',1,'NaN',1,'Inf',1);
|
---|
| 226 |
|
---|
| 227 | return md
|
---|
| 228 | # }}}
|
---|
| 229 | @@ -53,5 +50,4 @@
|
---|
| 230 |
|
---|
| 231 | WriteData(fid,prefix,'name','md.calving.law','data',1,'format','Integer');
|
---|
| 232 | WriteData(fid,prefix,'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
|
---|
| 233 | - WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
|
---|
| 234 | # }}}
|
---|
| 235 | Index: ../trunk-jpl/src/m/classes/calvingvonmises.py
|
---|
| 236 | ===================================================================
|
---|
| 237 | --- ../trunk-jpl/src/m/classes/calvingvonmises.py (revision 23657)
|
---|
| 238 | +++ ../trunk-jpl/src/m/classes/calvingvonmises.py (revision 23658)
|
---|
| 239 | @@ -26,11 +26,9 @@
|
---|
| 240 | string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_groundedice','sigma_max applied to grounded ice only [Pa]'))
|
---|
| 241 | string="%s\n%s"%(string,fielddisplay(self,'stress_threshold_floatingice','sigma_max applied to floating ice only [Pa]'))
|
---|
| 242 |
|
---|
| 243 | - string="%s\n%s"%(string,fielddisplay(self,'meltingrate','melting rate at given location [m/a]'))
|
---|
| 244 | return string
|
---|
| 245 | #}}}
|
---|
| 246 | def extrude(self,md): # {{{
|
---|
| 247 | - self.meltingrate=project3d(md,'vector',self.meltingrate,'type','node')
|
---|
| 248 | return self
|
---|
| 249 | #}}}
|
---|
| 250 | def setdefaultparameters(self): # {{{
|
---|
| 251 | @@ -46,7 +44,6 @@
|
---|
| 252 |
|
---|
| 253 | md = checkfield(md,'fieldname','calving.stress_threshold_groundedice','>',0,'nan',1,'Inf',1)
|
---|
| 254 | md = checkfield(md,'fieldname','calving.stress_threshold_floatingice','>',0,'nan',1,'Inf',1)
|
---|
| 255 | - md = checkfield(md,'fieldname','calving.meltingrate','NaN',1,'Inf',1,'timeseries',1,'>=',0)
|
---|
| 256 |
|
---|
| 257 | return md
|
---|
| 258 | # }}}
|
---|
| 259 | @@ -56,5 +53,4 @@
|
---|
| 260 | WriteData(fid,prefix,'name','md.calving.law','data',2,'format','Integer')
|
---|
| 261 | WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_groundedice','format','DoubleMat','mattype',1)
|
---|
| 262 | WriteData(fid,prefix,'object',self,'fieldname','stress_threshold_floatingice','format','DoubleMat','mattype',1)
|
---|
| 263 | - WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts,'scale',1./yts)
|
---|
| 264 | # }}}
|
---|