Changeset 18984
- Timestamp:
- 01/06/15 08:59:53 (10 years ago)
- Location:
- issm/trunk-jpl
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/src/m/classes/SMBpdd.m ¶
r18968 r18984 11 11 s0p = 0; 12 12 s0t = 0; 13 14 15 16 17 13 rlaps = 0; 14 rlapslgm = 0; 15 Pfac = NaN; 16 Tdiff = NaN; 17 sealev = NaN; 18 18 isdelta18o = 0; 19 19 ismungsm = 0; … … 75 75 md = checkfield(md,'fieldname','surfaceforcings.rlapslgm','>=',0,'numel',1); 76 76 if(obj.isdelta18o==0 & obj.ismungsm==0) 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 77 md = checkfield(md,'fieldname','surfaceforcings.monthlytemperatures','forcing',1,'NaN',1); 78 md = checkfield(md,'fieldname','surfaceforcings.precipitation','forcing',1,'NaN',1); 79 elseif(obj.isdelta18o==1) 80 md = checkfield(md,'fieldname','surfaceforcings.delta18o','NaN',1); 81 md = checkfield(md,'fieldname','surfaceforcings.delta18o_surface','NaN',1); 82 md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 83 md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 84 md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 85 md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 86 md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1); 87 md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1); 88 elseif(obj.ismungsm==1) 89 md = checkfield(md,'fieldname','surfaceforcings.temperatures_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 90 md = checkfield(md,'fieldname','surfaceforcings.temperatures_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 91 md = checkfield(md,'fieldname','surfaceforcings.precipitations_presentday','size',[md.mesh.numberofvertices+1 12],'NaN',1); 92 md = checkfield(md,'fieldname','surfaceforcings.precipitations_lgm','size',[md.mesh.numberofvertices+1 12],'NaN',1); 93 md = checkfield(md,'fieldname','surfaceforcings.Pfac','NaN',1,'size',[2,NaN]); 94 md = checkfield(md,'fieldname','surfaceforcings.Tdiff','NaN',1); 95 md = checkfield(md,'fieldname','surfaceforcings.sealev','NaN',1); 96 96 end 97 97 end 98 98 end % }}} 99 99 function disp(obj) % {{{ … … 144 144 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','rlapslgm','format','Double'); 145 145 146 147 148 149 146 if(obj.isdelta18o==0 & obj.ismungsm==0) 147 %WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','monthlytemperatures','format','DoubleMat','mattype',1); 148 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1); 149 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1); 150 150 elseif obj.isdelta18o 151 151 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','temperatures_presentday','format','DoubleMat','mattype',1); … … 155 155 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','delta18o_surface','format','DoubleMat','mattype',1); 156 156 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','delta18o','format','DoubleMat','mattype',1); 157 158 157 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','Tdiff','format','DoubleMat','mattype',1); 158 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','sealev','format','DoubleMat','mattype',1); 159 159 elseif obj.ismungsm 160 160 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','temperatures_presentday','format','DoubleMat','mattype',1); … … 162 162 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitations_presentday','format','DoubleMat','mattype',1); 163 163 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','precipitations_lgm','format','DoubleMat','mattype',1); 164 165 166 164 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','Pfac','format','DoubleMat','mattype',1); 165 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','Tdiff','format','DoubleMat','mattype',1); 166 WriteData(fid,'object',obj,'class','surfaceforcings','fieldname','sealev','format','DoubleMat','mattype',1); 167 167 end 168 168 end % }}} -
TabularUnified issm/trunk-jpl/src/m/classes/SMBpdd.py ¶
r18970 r18984 114 114 md = checkfield(md,'fieldname','surfaceforcings.rlapslgm','>=',0,'numel',[1]) 115 115 116 if not (self.isdelta18o and self.ismungsm):116 if (self.isdelta18o==0 and self.ismungsm==0): 117 117 md = checkfield(md,'fieldname','surfaceforcings.monthlytemperatures','NaN',1) 118 118 md = checkfield(md,'fieldname','surfaceforcings.precipitation','NaN',1) … … 151 151 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','rlapslgm','format','Double') 152 152 153 if not (self.isdelta18o and self.ismungsm):153 if (self.isdelta18o==0 and self.ismungsm==0): 154 154 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','monthlytemperatures','format','DoubleMat','mattype',1) 155 155 WriteData(fid,'object',self,'class','surfaceforcings','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'forcinglength',md.mesh.numberofvertices+1) -
TabularUnified issm/trunk-jpl/test/NightlyRun/test237.py ¶
r18968 r18984 57 57 58 58 # Interpolation factors 59 md.surfaceforcings.Pfac [1,1:md.timestepping.final_time]=0.5;60 md.surfaceforcings.Tdiff [1,1:md.timestepping.final_time]=0.5;61 md.surfaceforcings.sealev [1,1:md.timestepping.final_time]=0.5;59 md.surfaceforcings.Pfac=0.5*numpy.ones((2,md.timestepping.final_time)) 60 md.surfaceforcings.Tdiff=0.5*numpy.ones((2,md.timestepping.final_time)) 61 md.surfaceforcings.sealev=0.5*numpy.ones((2,md.timestepping.final_time)) 62 62 # Year of each data point 63 md.surfaceforcings.Pfac[ 2,1:md.timestepping.final_time]=1:1:md.timestepping.final_time;64 md.surfaceforcings.Tdiff[ 2,1:md.timestepping.final_time]=1:1:md.timestepping.final_time;65 md.surfaceforcings.sealev[ 2,1:md.timestepping.final_time]=1:1:md.timestepping.final_time;63 md.surfaceforcings.Pfac[1,1:md.timestepping.final_time]=numpy.arange(1.,md.timestepping.final_time) 64 md.surfaceforcings.Tdiff[1,1:md.timestepping.final_time]=numpy.arange(1.,md.timestepping.final_time) 65 md.surfaceforcings.sealev[1,1:md.timestepping.final_time]=numpy.arange(1.,md.timestepping.final_time) 66 66 67 67 # time steps and resolution
Note:
See TracChangeset
for help on using the changeset viewer.