Changeset 22855
- Timestamp:
- 06/20/18 18:27:22 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/classes/SMBd18opdd.py
r22495 r22855 27 27 self.issetpddfac = 0 28 28 self.istemperaturescaled = 0 29 self.isprecipscaled = 0 29 30 self.delta18o = float('NaN') 30 31 self.delta18o_surface = float('NaN') 31 32 self.temperatures_presentday = float('NaN') 32 33 self.precipitations_presentday = float('NaN') 34 self.temperatures_reconstructed = float('NaN') 35 self.precipitations_reconstructed = float('NaN') 33 36 self.pddfac_snow = float('NaN') 34 37 self.pddfac_ice = float('NaN') … … 50 53 string="%s\n%s"%(string,fielddisplay(self,'temperatures_presentday','monthly present day surface temperatures [K], required if delta18o/mungsm is activated')) 51 54 string="%s\n%s"%(string,fielddisplay(self,'precipitations_presentday','monthly surface precipitation [m/yr water eq], required if delta18o or mungsm is activated')) 52 string="%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 0)')) 55 string="%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)')) 56 string="%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)')) 57 58 if self.istemperaturescaled==0: 59 string="%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')) 60 61 if self.isprecipscaled==0: 62 string="%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')) 63 53 64 string="%s\n%s"%(string,fielddisplay(self,'delta18o','delta18o [per mil], required if pdd is activated and delta18o activated')) 54 65 string="%s\n%s"%(string,fielddisplay(self,'dpermil','degree per mil, required if d18opd is activated')) … … 65 76 66 77 if self.isd18opd: self.temperatures_presentday=project3d(md,'vector',self.temperatures_presentday,'type','node') 78 if self.isd18opd: self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node') 79 if self.istemperaturescaled==0: self.temperatures_reconstructed=project3d(md,'vector',self.temperatures_reconstructed,'type','node') 80 if self.isprecipscaled==0: self.temperatures_reconstructed=project3d(md,'vector',self.precipitations_reconstructed,'type','node') 67 81 if self.isd18opd: self.precipitations_presentday=project3d(md,'vector',self.precipitations_presentday,'type','node') 68 82 if self.issetpddfac: self.pddfac_snow=project3d(md,'vector',self.pddfac_snow,'type','node') … … 94 108 self.isd18opd = 1 95 109 self.istemperaturescaled = 1 110 self.isprecipscaled = 1 96 111 self.desfac = 0.5 97 112 self.rlaps = 6.5 … … 116 131 multt=np.ceil(lent/12.)*12. 117 132 multp=np.ceil(lenp/12.)*12. 118 md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices+1,multt],'NaN',1,'Inf',1,'timeseries',1) 119 md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices+1,multp],'NaN',1,'Inf',1,'timeseries',1) 133 md = checkfield(md,'fieldname','smb.temperatures_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1) 134 md = checkfield(md,'fieldname','smb.precipitations_presentday','size',[md.mesh.numberofvertices+1,12],'NaN',1,'Inf',1,'timeseries',1) 135 136 if self.istemperaturescaled==0: 137 lent=float(np.size(self.temperatures_reconstructed,1)) 138 multt=np.ceil(lent/12.)*12. 139 md = checkfield(md,'fieldname','smb.temperatures_reconstructed','size',[md.mesh.numberofvertices+1,multt],'NaN',1,'Inf',1,'timeseries',1) 140 141 if self.isprecipscaled==0: 142 lenp=float(np.size(self.precipitations_reconstructed,1)) 143 multp=np.ceil(lent/12.)*12. 144 md = checkfield(md,'fieldname','smb.precipitations_reconstructed','size',[md.mesh.numberofvertices+1,multt],'NaN',1,'Inf',1,'timeseries',1) 145 120 146 md = checkfield(md,'fieldname','smb.delta18o','NaN',1,'Inf',1,'size',[2,np.nan],'singletimeseries',1) 121 147 md = checkfield(md,'fieldname','smb.dpermil','>=',0,'numel',[1]) … … 151 177 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts) 152 178 WriteData(fid,prefix,'object',self,'class','smb','fieldname','istemperaturescaled','format','Boolean') 179 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isprecipscaled','format','Boolean') 180 181 if self.istemperaturescaled==0: 182 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_reconstructed','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts) 183 184 if self.isprecipscaled==0: 185 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_reconstructed','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts) 186 153 187 WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2,'yts',md.constants.yts) 154 188 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dpermil','format','Double')
Note:
See TracChangeset
for help on using the changeset viewer.