Changeset 22136
- Timestamp:
- 10/05/17 11:31:36 (8 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r22105 r22136 1815 1815 IssmDouble* base = xNew<IssmDouble>(numvertices); 1816 1816 IssmDouble* values = xNew<IssmDouble>(numvertices); 1817 1818 parameters->FindParam(&deepwaterel,BasalforcingsDeepwaterElevationEnum); 1819 parameters->FindParam(&upperwaterel,BasalforcingsUpperwaterElevationEnum); 1820 parameters->FindParam(&deepwatermelt,BasalforcingsDeepwaterMeltingRateEnum); 1817 IssmDouble time; 1818 1819 parameters->FindParam(&time,TimeEnum); 1820 parameters->FindParam(&deepwaterel,BasalforcingsDeepwaterElevationEnum,time); 1821 parameters->FindParam(&upperwaterel,BasalforcingsUpperwaterElevationEnum,time); 1822 parameters->FindParam(&deepwatermelt,BasalforcingsDeepwaterMeltingRateEnum,time); 1821 1823 1822 1824 this->GetInputListOnVertices(base,BaseEnum); -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
r22100 r22136 34 34 bool autodiff_mass_flux_present = false; 35 35 bool mass_flux_present = false; 36 bool interp; 36 37 IssmDouble **array = NULL; 37 38 int *mdims_array = NULL; … … 43 44 44 45 IssmDouble *temp = NULL; 46 IssmDouble *transparam = NULL; 45 47 IssmDouble yts; 46 48 int N,M; … … 173 175 break; 174 176 case LinearFloatingMeltRateEnum: 175 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.deepwater_melting_rate",BasalforcingsDeepwaterMeltingRateEnum)); 176 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.deepwater_elevation",BasalforcingsDeepwaterElevationEnum)); 177 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.upperwater_elevation",BasalforcingsUpperwaterElevationEnum)); 177 iomodel->FindConstant(&interp,"md.timestepping.interp_forcings"); 178 iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.deepwater_melting_rate"); 179 parameters->AddObject(new TransientParam(BasalforcingsDeepwaterMeltingRateEnum,&transparam[0],&transparam[M],interp,M)); _assert_(N==2 || N==1); 180 iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.deepwater_elevation"); 181 parameters->AddObject(new TransientParam(BasalforcingsDeepwaterElevationEnum,&transparam[0],&transparam[M],interp,M)); _assert_(N==2 || N==1); 182 iomodel->FetchData(&transparam,&N,&M,"md.basalforcings.upperwater_elevation"); 183 parameters->AddObject(new TransientParam(BasalforcingsUpperwaterElevationEnum,&transparam[0],&transparam[M],interp,M)); _assert_(N==2 || N==1); 178 184 break; 179 185 case MismipFloatingMeltRateEnum: -
issm/trunk-jpl/src/m/classes/linearbasalforcings.m
r21661 r22136 47 47 if ismember('MasstransportAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.ismasstransport==0), 48 48 md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1); 49 md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,' numel',1);50 md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation',' numel',1);51 md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','< ',0,'numel',1);49 md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1); 50 md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1); 51 md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1); 52 52 end 53 53 if ismember('BalancethicknessAnalysis',analyses), 54 54 md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'size',[md.mesh.numberofvertices 1]); 55 md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,' numel',1);56 md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation',' numel',1);57 md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,' numel',1);55 md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1); 56 md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1); 57 md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1); 58 58 end 59 59 if ismember('ThermalAnalysis',analyses) & ~(strcmp(solution,'TransientSolution') & md.transient.isthermal==0), 60 60 md = checkfield(md,'fieldname','basalforcings.groundedice_melting_rate','NaN',1,'Inf',1,'timeseries',1); 61 md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,' numel',1);62 md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation',' numel',1);63 md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','< ',0,'numel',1);61 md = checkfield(md,'fieldname','basalforcings.deepwater_melting_rate','>=',0,'singletimeseries',1); 62 md = checkfield(md,'fieldname','basalforcings.deepwater_elevation','<','basalforcings.upperwater_elevation','singletimeseries',1); 63 md = checkfield(md,'fieldname','basalforcings.upperwater_elevation','<=',0,'singletimeseries',1); 64 64 md = checkfield(md,'fieldname','basalforcings.geothermalflux','NaN',1,'Inf',1,'timeseries',1,'>=',0); 65 65 end … … 80 80 81 81 floatingice_melting_rate=zeros(md.mesh.numberofvertices,1); 82 floatingice_melting_rate(find(md.geometry.base<=md.basalforcings.deepwater_elevation ))=md.basalforcings.deepwater_melting_rate;83 pos=find(md.geometry.base>md.basalforcings.deepwater_elevation & md.geometry.base<md.basalforcings.upperwater_elevation);84 floatingice_melting_rate(pos)=md.basalforcings.deepwater_melting_rate *(md.geometry.base(pos)-md.basalforcings.upperwater_elevation)/(md.basalforcings.deepwater_elevation-md.basalforcings.upperwater_elevation);82 floatingice_melting_rate(find(md.geometry.base<=md.basalforcings.deepwater_elevation(1,1)))=md.basalforcings.deepwater_melting_rate(1,1); 83 pos=find(md.geometry.base>md.basalforcings.deepwater_elevation(1,1) & md.geometry.base<md.basalforcings.upperwater_elevation(1,1)); 84 floatingice_melting_rate(pos)=md.basalforcings.deepwater_melting_rate(1,1)*(md.geometry.base(pos)-md.basalforcings.upperwater_elevation(1,1))/(md.basalforcings.deepwater_elevation(1,1)-md.basalforcings.upperwater_elevation(1,1)); 85 85 WriteData(fid,prefix,'name','md.basalforcings.model','data',2,'format','Integer'); 86 86 WriteData(fid,prefix,'data',floatingice_melting_rate,'format','DoubleMat','name','md.basalforcings.floatingice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts) 87 87 WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','name','md.basalforcings.groundedice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts) 88 88 WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'yts',md.constants.yts); 89 WriteData(fid,prefix,'object',self,'fieldname','deepwater_melting_rate','format','Double ','name','md.basalforcings.deepwater_melting_rate','scale',1./yts)90 WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','format','Double ','name','md.basalforcings.deepwater_elevation')91 WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','format','Double ','name','md.basalforcings.upperwater_elevation')89 WriteData(fid,prefix,'object',self,'fieldname','deepwater_melting_rate','format','DoubleMat','mattype',3,'timeserieslength',2,'name','md.basalforcings.deepwater_melting_rate','scale',1./yts,'yts',md.constants.yts) 90 WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','format','DoubleMat','mattype',3,'name','md.basalforcings.deepwater_elevation','yts',md.constants.yts) 91 WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','format','DoubleMat','mattype',3,'name','md.basalforcings.upperwater_elevation','yts',md.constants.yts) 92 92 end % }}} 93 93 end -
issm/trunk-jpl/src/m/consistency/checkfield.m
r20450 r22136 149 149 lowerbound=getfieldvalue(options,'>='); 150 150 field2=reshape(field,prod(size(field)),1); 151 if getfieldvalue(options,'timeseries',0), field2=reshape(field(1:end-1,:),prod(size(field(1:end-1,:))),1); end151 if (getfieldvalue(options,'timeseries',0) | getfieldvalue(options,'singletimeseries',0)), field2=reshape(field(1:end-1,:),prod(size(field(1:end-1,:))),1); end 152 152 if any(field2<lowerbound), 153 153 md = checkmessage(md,getfieldvalue(options,'message',... … … 158 158 lowerbound=getfieldvalue(options,'>'); 159 159 field2=reshape(field,prod(size(field)),1); 160 if getfieldvalue(options,'timeseries',0), field2=reshape(field(1:end-1,:),prod(size(field(1:end-1,:))),1); end160 if (getfieldvalue(options,'timeseries',0) | getfieldvalue(options,'singletimeseries',0)), field2=reshape(field(1:end-1,:),prod(size(field(1:end-1,:))),1); end 161 161 if any(field2<=lowerbound), 162 162 md = checkmessage(md,getfieldvalue(options,'message',... … … 169 169 upperbound=getfieldvalue(options,'<='); 170 170 field2=reshape(field,prod(size(field)),1); 171 if getfieldvalue(options,'timeseries',0), field2=reshape(field(1:end-1,:),prod(size(field(1:end-1,:))),1); end171 if (getfieldvalue(options,'timeseries',0) | getfieldvalue(options,'singletimeseries',0)), field2=reshape(field(1:end-1,:),prod(size(field(1:end-1,:))),1); end 172 172 if any(field2>upperbound), 173 173 md = checkmessage(md,getfieldvalue(options,'message',... … … 178 178 upperbound=getfieldvalue(options,'<'); 179 179 field2=reshape(field,prod(size(field)),1); 180 if getfieldvalue(options,'timeseries',0), field2=reshape(field(1:end-1,:),prod(size(field(1:end-1,:))),1); end180 if (getfieldvalue(options,'timeseries',0) | getfieldvalue(options,'singletimeseries',0)), field2=reshape(field(1:end-1,:),prod(size(field(1:end-1,:))),1); end 181 181 if any(field2>=upperbound), 182 182 md = checkmessage(md,getfieldvalue(options,'message',... … … 244 244 ['field ''' fieldname ''' columns must not contain duplicate timesteps'])); 245 245 end 246 else 247 md = checkmessage(md,getfieldvalue(options,'message',... 248 ['field ''' fieldname ''' should have 2 lines'])); 249 end 250 end 246 elseif size(field,1)==1, 247 if size(field,2)~=1, 248 md = checkmessage(md,getfieldvalue(options,'message',... 249 ['field ''' fieldname ''' should be either a scalar or have 2 lines'])); 250 end 251 else 252 md = checkmessage(md,getfieldvalue(options,'message',... 253 ['field ''' fieldname ''' should have 2 lines or be a scalar'])); 254 end 255 end
Note:
See TracChangeset
for help on using the changeset viewer.