Changeset 9597
- Timestamp:
- 09/02/11 17:10:47 (14 years ago)
- Location:
- issm/trunk
- Files:
-
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/EnumDefinitions/EnumDefinitions.h
r9571 r9597 363 363 SsetEnum, 364 364 GroundinglineMigrationEnum, 365 YtsEnum,365 ConstantsYtsEnum, 366 366 /*}}}*/ 367 367 /*Interpolation {{{1*/ … … 412 412 VerticesTypeEnum, 413 413 HydroKnEnum, 414 GEnum,414 ConstantsGEnum, 415 415 SpcvzEnum, 416 416 NumberOfNodes2DEnum, … … 446 446 ThermalconductivityEnum, 447 447 MeltingpointEnum, 448 ReferencetemperatureEnum,448 ConstantsReferencetemperatureEnum, 449 449 DhdtEnum, 450 450 GeothermalfluxEnum, -
issm/trunk/src/c/modules/EnumToStringx/EnumToStringx.cpp
r9571 r9597 314 314 case SsetEnum : return "Sset"; 315 315 case GroundinglineMigrationEnum : return "GroundinglineMigration"; 316 case YtsEnum : return "Yts";316 case ConstantsYtsEnum : return "ConstantsYts"; 317 317 case TriangleInterpEnum : return "TriangleInterp"; 318 318 case BilinearInterpEnum : return "BilinearInterp"; … … 355 355 case VerticesTypeEnum : return "VerticesType"; 356 356 case HydroKnEnum : return "HydroKn"; 357 case GEnum : return "G";357 case ConstantsGEnum : return "ConstantsG"; 358 358 case SpcvzEnum : return "Spcvz"; 359 359 case NumberOfNodes2DEnum : return "NumberOfNodes2D"; … … 389 389 case ThermalconductivityEnum : return "Thermalconductivity"; 390 390 case MeltingpointEnum : return "Meltingpoint"; 391 case ReferencetemperatureEnum : return "Referencetemperature";391 case ConstantsReferencetemperatureEnum : return "ConstantsReferencetemperature"; 392 392 case DhdtEnum : return "Dhdt"; 393 393 case GeothermalfluxEnum : return "Geothermalflux"; -
issm/trunk/src/c/modules/ModelProcessorx/CreateParameters.cpp
r9563 r9597 35 35 parameters->AddObject(iomodel->CopyConstantObject(MaxNonlinearIterationsEnum)); 36 36 parameters->AddObject(iomodel->CopyConstantObject(MaxSteadystateIterationsEnum)); 37 parameters->AddObject(iomodel->CopyConstantObject( YtsEnum));37 parameters->AddObject(iomodel->CopyConstantObject(ConstantsYtsEnum)); 38 38 parameters->AddObject(iomodel->CopyConstantObject(DtEnum)); 39 39 parameters->AddObject(iomodel->CopyConstantObject(NdtEnum)); … … 46 46 parameters->AddObject(iomodel->CopyConstantObject(BetaEnum)); 47 47 parameters->AddObject(iomodel->CopyConstantObject(MeltingpointEnum)); 48 parameters->AddObject(iomodel->CopyConstantObject( ReferencetemperatureEnum));48 parameters->AddObject(iomodel->CopyConstantObject(ConstantsReferencetemperatureEnum)); 49 49 parameters->AddObject(iomodel->CopyConstantObject(LatentheatEnum)); 50 50 parameters->AddObject(iomodel->CopyConstantObject(HeatcapacityEnum)); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHoriz/CreateConstraintsDiagnosticHoriz.cpp
r9405 r9597 41 41 /*Fetch parameters: */ 42 42 iomodel->Constant(&dim,DimEnum); 43 iomodel->Constant(&yts, YtsEnum);43 iomodel->Constant(&yts,ConstantsYtsEnum); 44 44 iomodel->Constant(&numberofvertices,NumberOfVerticesEnum); 45 iomodel->Constant(&g, GEnum);45 iomodel->Constant(&g,ConstantsGEnum); 46 46 iomodel->Constant(&rho_ice,RhoIceEnum); 47 47 iomodel->Constant(&stokesreconditioning,StokesreconditioningEnum); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticHutter/CreateConstraintsDiagnosticHutter.cpp
r9405 r9597 28 28 29 29 /*Fetch parameters: */ 30 iomodel->Constant(&yts, YtsEnum);30 iomodel->Constant(&yts,ConstantsYtsEnum); 31 31 iomodel->Constant(&numberofvertices,NumberOfVerticesEnum); 32 32 iomodel->Constant(&ishutter,IshutterEnum); -
issm/trunk/src/c/modules/ModelProcessorx/DiagnosticVert/CreateConstraintsDiagnosticVert.cpp
r9405 r9597 25 25 /*Fetch parameters: */ 26 26 iomodel->Constant(&dim,DimEnum); 27 iomodel->Constant(&yts, YtsEnum);27 iomodel->Constant(&yts,ConstantsYtsEnum); 28 28 iomodel->Constant(&numberofvertices,NumberOfVerticesEnum); 29 29 -
issm/trunk/src/c/modules/ModelProcessorx/Enthalpy/CreateConstraintsEnthalpy.cpp
r9405 r9597 29 29 iomodel->Constant(&numberofvertices,NumberOfVerticesEnum); 30 30 iomodel->Constant(&heatcapacity,HeatcapacityEnum); 31 iomodel->Constant(&referencetemperature, ReferencetemperatureEnum);31 iomodel->Constant(&referencetemperature,ConstantsReferencetemperatureEnum); 32 32 33 33 /*Recover pointer: */ -
issm/trunk/src/c/modules/StringToEnumx/StringToEnumx.cpp
r9571 r9597 312 312 else if (strcmp(name,"Sset")==0) return SsetEnum; 313 313 else if (strcmp(name,"GroundinglineMigration")==0) return GroundinglineMigrationEnum; 314 else if (strcmp(name," Yts")==0) returnYtsEnum;314 else if (strcmp(name,"ConstantsYts")==0) return ConstantsYtsEnum; 315 315 else if (strcmp(name,"TriangleInterp")==0) return TriangleInterpEnum; 316 316 else if (strcmp(name,"BilinearInterp")==0) return BilinearInterpEnum; … … 353 353 else if (strcmp(name,"VerticesType")==0) return VerticesTypeEnum; 354 354 else if (strcmp(name,"HydroKn")==0) return HydroKnEnum; 355 else if (strcmp(name," G")==0) returnGEnum;355 else if (strcmp(name,"ConstantsG")==0) return ConstantsGEnum; 356 356 else if (strcmp(name,"Spcvz")==0) return SpcvzEnum; 357 357 else if (strcmp(name,"NumberOfNodes2D")==0) return NumberOfNodes2DEnum; … … 387 387 else if (strcmp(name,"Thermalconductivity")==0) return ThermalconductivityEnum; 388 388 else if (strcmp(name,"Meltingpoint")==0) return MeltingpointEnum; 389 else if (strcmp(name," Referencetemperature")==0) returnReferencetemperatureEnum;389 else if (strcmp(name,"ConstantsReferencetemperature")==0) return ConstantsReferencetemperatureEnum; 390 390 else if (strcmp(name,"Dhdt")==0) return DhdtEnum; 391 391 else if (strcmp(name,"Geothermalflux")==0) return GeothermalfluxEnum; -
issm/trunk/src/c/objects/Elements/Penta.cpp
r9595 r9597 4846 4846 iomodel->Constant(&numberofvertices,NumberOfVerticesEnum); 4847 4847 iomodel->Constant(&numberofelements,NumberOfElementsEnum); 4848 iomodel->Constant(&yts, YtsEnum);4848 iomodel->Constant(&yts,ConstantsYtsEnum); 4849 4849 4850 4850 /*Branch on type of vector: nodal or elementary: */ … … 5153 5153 5154 5154 /*Fetch parameters: */ 5155 iomodel->Constant(&yts, YtsEnum);5155 iomodel->Constant(&yts,ConstantsYtsEnum); 5156 5156 iomodel->Constant(&control_analysis,ControlAnalysisEnum); 5157 5157 iomodel->Constant(&num_control_type,NumControlTypeEnum); … … 7503 7503 7504 7504 /*Fetch parameters: */ 7505 iomodel->Constant(&yts, YtsEnum);7505 iomodel->Constant(&yts,ConstantsYtsEnum); 7506 7506 iomodel->Constant(&prognostic_DG,PrognosticDGEnum); 7507 7507 iomodel->Constant(&dakota_analysis,DakotaAnalysisEnum); … … 7509 7509 iomodel->Constant(&beta,BetaEnum); 7510 7510 iomodel->Constant(&heatcapacity,HeatcapacityEnum); 7511 iomodel->Constant(&referencetemperature, ReferencetemperatureEnum);7511 iomodel->Constant(&referencetemperature,ConstantsReferencetemperatureEnum); 7512 7512 iomodel->Constant(&meltingpoint,MeltingpointEnum); 7513 7513 iomodel->Constant(&latentheat,LatentheatEnum); -
issm/trunk/src/c/objects/Elements/Tria.cpp
r9595 r9597 3273 3273 iomodel->Constant(&control_analysis,ControlAnalysisEnum); 3274 3274 iomodel->Constant(&num_control_type,NumControlTypeEnum); 3275 iomodel->Constant(&yts, YtsEnum);3275 iomodel->Constant(&yts,ConstantsYtsEnum); 3276 3276 iomodel->Constant(&num_cm_responses,NumCmResponsesEnum); 3277 3277 … … 3900 3900 iomodel->Constant(&numberofvertices,NumberOfVerticesEnum); 3901 3901 iomodel->Constant(&numberofelements,NumberOfElementsEnum); 3902 iomodel->Constant(&yts, YtsEnum);3902 iomodel->Constant(&yts,ConstantsYtsEnum); 3903 3903 3904 3904 /*Branch on type of vector: nodal or elementary: */ … … 4581 4581 4582 4582 /*recover parameters: */ 4583 parameters->FindParam(&yts, YtsEnum);4583 parameters->FindParam(&yts,ConstantsYtsEnum); 4584 4584 parameters->FindParam(&gl_melting_rate,GroundinglineMeltingRateEnum); 4585 4585 … … 5218 5218 5219 5219 /*Fetch parameters: */ 5220 iomodel->Constant(&yts, YtsEnum);5220 iomodel->Constant(&yts,ConstantsYtsEnum); 5221 5221 iomodel->Constant(&prognostic_DG,PrognosticDGEnum); 5222 5222 iomodel->Constant(&dakota_analysis,DakotaAnalysisEnum); -
issm/trunk/src/c/objects/Materials/Matpar.cpp
r9405 r9597 33 33 iomodel->Constant(&this->beta,BetaEnum); 34 34 iomodel->Constant(&this->meltingpoint,MeltingpointEnum); 35 iomodel->Constant(&this->referencetemperature, ReferencetemperatureEnum);35 iomodel->Constant(&this->referencetemperature,ConstantsReferencetemperatureEnum); 36 36 iomodel->Constant(&this->mixed_layer_capacity,MixedLayerCapacityEnum); 37 37 iomodel->Constant(&this->thermal_exchange_velocity,ThermalExchangeVelocityEnum); 38 iomodel->Constant(&this->g, GEnum);38 iomodel->Constant(&this->g,ConstantsGEnum); 39 39 40 40 iomodel->Constant(&this->kn,HydroKnEnum); … … 255 255 break; 256 256 257 case ReferencetemperatureEnum:257 case ConstantsReferencetemperatureEnum: 258 258 this->referencetemperature=constant; 259 259 break; -
issm/trunk/src/c/solutions/convergence.cpp
r6412 r9597 41 41 parameters->FindParam(&eps_rel,EpsRelEnum); 42 42 parameters->FindParam(&eps_abs,EpsAbsEnum); 43 parameters->FindParam(&yts, YtsEnum);43 parameters->FindParam(&yts,ConstantsYtsEnum); 44 44 45 45 /*Display solver caracteristics*/ -
issm/trunk/src/c/solutions/transient_core.cpp
r9356 r9597 31 31 femmodel->parameters->FindParam(&finaltime,NdtEnum); 32 32 femmodel->parameters->FindParam(&dt,DtEnum); 33 femmodel->parameters->FindParam(&yts, YtsEnum);33 femmodel->parameters->FindParam(&yts,ConstantsYtsEnum); 34 34 femmodel->parameters->FindParam(&control_analysis,ControlAnalysisEnum); 35 35 femmodel->parameters->FindParam(&solution_type,SolutionTypeEnum); -
issm/trunk/src/m/classes/model/model.m
r9571 r9597 8 8 % {{{1 9 9 %Careful here: no other class should be used as default value this is a bug of matlab 10 cluster = modelfield('default',0,'marshall',false); 11 verbose = modelfield('default',0,'marshall',true,'preprocess','marshallverbose','format','Integer'); 12 results = modelfield('default',0,'marshall',false); 13 solver = modelfield('default',0,'marshall',false); 14 debug = modelfield('default',0,'marshall',false); 10 cluster = modelfield('default',0,'marshall',false); 11 verbose = modelfield('default',0,'marshall',true,'preprocess','marshallverbose','format','Integer'); 12 results = modelfield('default',0,'marshall',false); 13 solver = modelfield('default',0,'marshall',false); 14 debug = modelfield('default',0,'marshall',false); 15 constants = modelfield('default',0,'marshall',true); 15 16 16 17 %FIXME: all other fields should belong to other classes … … 108 109 thermalconductivity = modelfield('default',0,'marshall',true,'format','Double'); 109 110 meltingpoint = modelfield('default',0,'marshall',true,'format','Double'); 110 referencetemperature = modelfield('default',0,'marshall',true,'format','Double'); %for enthalpy111 111 beta = modelfield('default',0,'marshall',true,'format','Double'); 112 112 mixed_layer_capacity = modelfield('default',0,'marshall',true,'format','Double'); … … 117 117 118 118 %Physical parameters 119 g = modelfield('default',0,'marshall',true,'format','Double'); 120 yts = modelfield('default',0,'marshall',true,'format','Double'); 119 121 120 drag_coefficient = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',1); 122 121 drag_p = modelfield('default',NaN,'marshall',true,'format','DoubleMat','mattype',2); … … 336 335 md = in; 337 336 elseif (isa(in,'numeric') & in==0) 338 %just requesting model, without default parameters, do nothing. 337 %requesting template 338 %FIXME: for now recursive call 339 md2=model; 340 modelprops=properties('model'); 341 for i=1:length(modelprops); 342 fieldname=modelprops{i}; 343 if md.(fieldname).marshall & isobject(md2.(fieldname)) & isempty(md.(fieldname).preprocess), 344 eval(['md.' fieldname '=' fieldname '(0);']); 345 end 346 end 339 347 else 340 348 error('model constructor error message: unknown constructor for ''model'' class object'); … … 438 446 if isfield(structmd,'gridonboundary'), md.nodeonboundary=structmd.gridonboundary; end 439 447 if isfield(structmd,'petscoptions'), md.solver=structmd.petscoptions; end 448 if isfield(structmd,'g'), md.constants.g=structmd.g; end 449 if isfield(structmd,'yts'), md.constants.yts=structmd.yts; end 440 450 if isfield(structmd,'dakota_analysis'), md.dakota_analysis=structmd.dakota_analysis; end 441 451 … … 543 553 md.results=struct(); 544 554 md.debug=debug; 555 md.constants=constants; 545 556 546 557 … … 568 579 md.meltingpoint=273.15; 569 580 570 %the reference temperature for enthalpy model (cf Aschwanden)571 md.referencetemperature=223.15;572 573 581 %rate of change of melting point with pressure (K/Pa) 574 582 md.beta=9.8*10^-8; … … 581 589 582 590 %Physical parameters 583 584 %acceleration due to gravity (m/s^2)585 md.g=9.81;586 587 %converstion from year to seconds588 md.yts=365*24*3600;589 591 590 592 %Solver parameters -
issm/trunk/src/m/model/basalstress.m
r9164 r9597 13 13 14 14 %compute horizontal velocity 15 ub=sqrt(md.vx.^2+md.vy.^2)/md. yts;16 ubx=md.vx/md. yts;17 uby=md.vy/md. yts;15 ub=sqrt(md.vx.^2+md.vy.^2)/md.constants.yts; 16 ubx=md.vx/md.constants.yts; 17 uby=md.vy/md.constants.yts; 18 18 19 19 %compute basal drag 20 bx=(md. g*(md.rho_ice*md.thickness+md.rho_water*md.bed)).^r.*(md.drag_coefficient).^2.*ubx.^s;21 by=(md. g*(md.rho_ice*md.thickness+md.rho_water*md.bed)).^r.*(md.drag_coefficient).^2.*uby.^s;22 b=(md. g*(md.rho_ice*md.thickness+md.rho_water*md.bed)).^r.*(md.drag_coefficient).^2.*ub.^s;20 bx=(md.constants.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)).^r.*(md.drag_coefficient).^2.*ubx.^s; 21 by=(md.constants.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)).^r.*(md.drag_coefficient).^2.*uby.^s; 22 b=(md.constants.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)).^r.*(md.drag_coefficient).^2.*ub.^s; -
issm/trunk/src/m/model/drivingstress.m
r1 r9597 14 14 thickness_bar=(md.thickness(md.elements(:,1))+md.thickness(md.elements(:,2))+md.thickness(md.elements(:,3)))/3; 15 15 16 px=md.rho_ice*md. g*thickness_bar.*sx;17 py=md.rho_ice*md. g*thickness_bar.*sy;16 px=md.rho_ice*md.constants.g*thickness_bar.*sx; 17 py=md.rho_ice*md.constants.g*thickness_bar.*sy; 18 18 pmag=sqrt(px.^2+py.^2); -
issm/trunk/src/m/model/effectivepressure.m
r2881 r9597 10 10 11 11 12 Neff=md.rho_ice*md. g*md.thickness+md.rho_ice*md.g*md.bed;12 Neff=md.rho_ice*md.constants.g*md.thickness+md.rho_ice*md.constants.g*md.bed; 13 13 14 14 -
issm/trunk/src/m/model/extrude.m
r9539 r9597 217 217 %Put lithostatic pressure is there is an existing pressure 218 218 if ~isnan(md.pressure), 219 md.pressure=md. g*md.rho_ice*(md.surface-md.z);219 md.pressure=md.constants.g*md.rho_ice*(md.surface-md.z); 220 220 end 221 221 -
issm/trunk/src/m/model/ismodelselfconsistent.m
r9571 r9597 83 83 %NO NAN {{{1 84 84 fields={'numberofelements','numberofnodes','x','y','z','drag_coefficient','drag_p','drag_q',... 85 'rho_ice','rho_water','rheology_B','elementoniceshelf','surface','thickness','bed',' g','lowmem','nsteps','maxiter',...85 'rho_ice','rho_water','rheology_B','elementoniceshelf','surface','thickness','bed','constants.g','lowmem','nsteps','maxiter',... 86 86 'eps_res','max_nonlinear_iterations','rheology_n','nodeonbed','nodeonsurface','elementonbed','elementonsurface','elementconnectivity'}; 87 87 checknan(md,fields); … … 89 89 %FIELDS >= 0 {{{1 90 90 fields={'numberofelements','numberofnodes','elements','drag_coefficient','drag_p','drag_q',... 91 'rho_ice','rho_water','rheology_B','elementoniceshelf','thickness',' g','eps_res','max_nonlinear_iterations','eps_rel','eps_abs','nsteps','maxiter',...91 'rho_ice','rho_water','rheology_B','elementoniceshelf','thickness','constants.g','eps_res','max_nonlinear_iterations','eps_rel','eps_abs','nsteps','maxiter',... 92 92 'lowmem','rheology_n','nodeonbed','nodeonsurface','elementonbed','elementonsurface'}; 93 93 checkgreater(md,fields,0); … … 95 95 %FIELDS > 0 {{{1 96 96 fields={'numberofelements','numberofnodes','elements','drag_p',... 97 'rho_ice','rho_water','rheology_B','thickness',' g','max_nonlinear_iterations','eps_res','eps_rel','eps_abs','maxiter'};97 'rho_ice','rho_water','rheology_B','thickness','constants.g','max_nonlinear_iterations','eps_res','eps_rel','eps_abs','maxiter'}; 98 98 checkgreaterstrict(md,fields,0); 99 99 %}}} -
issm/trunk/src/m/model/marshall.m
r9557 r9597 18 18 %automatically marshall model md, using template information available from an empty model class. 19 19 template=model.template(); 20 fields=fieldnames(template); 21 for i=1:length(fields), 22 fieldname=fields{i}; 23 if template.(fieldname).marshall, 24 if ~isempty(template.(fieldname).preprocess), 25 eval(['fieldvalue=' template.(fieldname).preprocess '(md.(fieldname));']); 26 else 27 fieldvalue=md.(fieldname); 28 end 29 WriteData(fid,fieldname,fieldvalue,template.(fieldname)); 30 end 31 end 20 MarshallObject(fid,template,md,''); 32 21 33 22 %FIXME add some fields needed by parameters … … 40 29 end 41 30 31 function MarshallObject(fid,template,object,prefix) % {{{ 32 fields=fieldnames(template); 33 for i=1:length(fields), 34 fieldname=fields{i}; 35 if ~isa(template.(fieldname),'modelfield'), 36 %Recursive call 37 MarshallObject(fid,template.(fieldname),object.(fieldname),[prefix fieldname]) 38 elseif template.(fieldname).marshall, 39 if ~isempty(template.(fieldname).preprocess), 40 eval(['fieldvalue=' template.(fieldname).preprocess '(object.(fieldname));']); 41 else 42 fieldvalue=object.(fieldname); 43 end 44 45 %Capitalize for enums 46 fieldnamecap=fieldname; 47 fieldnamecap(1)=upper(fieldname(1)); 48 prefixcap=prefix; 49 if ~isempty(prefix), prefixcap(1)=upper(prefix(1)); end 50 51 %Write Data 52 WriteData(fid,[prefixcap fieldnamecap],fieldvalue,template.(fieldname)); 53 end 54 end 55 % }}} 42 56 function WriteData(fid,fieldname,fieldvalue,fieldprop) % {{{ 43 57 %WRITEDATA - write model field in binary file … … 254 268 255 269 %FIXME: delete this one 256 if strcmp(string,' numberofnodes'),257 string=' numberofvertices';270 if strcmp(string,'Numberofnodes'), 271 string='Numberofvertices'; 258 272 end 259 273 -
issm/trunk/src/m/model/mechanicalproperties.m
r9532 r9597 37 37 38 38 %compute shear 39 vxlist=vx(index)/md. yts;40 vylist=vy(index)/md. yts;39 vxlist=vx(index)/md.constants.yts; 40 vylist=vy(index)/md.constants.yts; 41 41 ux=(vxlist.*alpha)*summation; 42 42 uy=(vxlist.*beta)*summation; -
issm/trunk/src/m/model/misfit.m
r8211 r9597 8 8 % J=misfit(md) 9 9 % 10 11 10 12 11 if md.dim==2, … … 32 31 33 32 %compute delta v on elements 34 deltav=1/2*( (vx-vx_obs).^2+(vy-vy_obs).^2)/md. yts^2;33 deltav=1/2*( (vx-vx_obs).^2+(vy-vy_obs).^2)/md.constants.yts^2; 35 34 deltav_elem=deltav(elements)*[1;1;1]/3; 36 35 -
issm/trunk/src/m/model/plot/plot_basaldrag.m
r8472 r9597 22 22 %compute horizontal velocity 23 23 if strcmpi(type,'basal_drag') 24 ub=sqrt(md.vx.^2+md.vy.^2)/md. yts;24 ub=sqrt(md.vx.^2+md.vy.^2)/md.constants.yts; 25 25 elseif strcmpi(type,'basal_dragx') 26 ub=md.vx/md. yts;26 ub=md.vx/md.constants.yts; 27 27 elseif strcmpi(type,'basal_dragy') 28 ub=md.vy/md. yts;28 ub=md.vy/md.constants.yts; 29 29 end 30 30 31 31 %compute basal drag 32 drag=(max(md. g*(md.rho_ice*md.thickness+md.rho_water*md.bed),0)).^r.*(md.drag_coefficient).^2.*ub.^s/1000;32 drag=(max(md.constants.g*(md.rho_ice*md.thickness+md.rho_water*md.bed),0)).^r.*(md.drag_coefficient).^2.*ub.^s/1000; 33 33 34 34 %Figure out if this is a Section plot -
issm/trunk/src/m/model/plot/plot_gridded.m
r9083 r9597 37 37 data_max=max(data_grid(:)); 38 38 end 39 if whiteup,40 white =data_max + (data_max-data_min)/55;41 options=changefieldvalue(options,'caxis',[data_min white]);42 else43 white =data_min - (data_max-data_min)/55;44 options=changefieldvalue(options,'caxis',[white data_max]);45 end46 data_grid(isnan(data_grid))=white;39 %if whiteup, 40 % white =data_max + (data_max-data_min)/55; 41 % options=changefieldvalue(options,'caxis',[data_min white]); 42 %else 43 % white =data_min - (data_max-data_min)/55; 44 % options=changefieldvalue(options,'caxis',[white data_max]); 45 %end 46 %data_grid(isnan(data_grid))=white; 47 47 48 48 %Select plot area … … 52 52 h=imagesc(xlim,ylim,data_grid);set(gca,'YDir','normal'); 53 53 map=getfieldvalue(options,'colormap',jet); 54 if whiteup,55 map(end,:)=[1 1 1];56 else57 map(1,:)=[1 1 1];58 end59 options=changefieldvalue(options,'colormap',map);54 %if whiteup, 55 % map(end,:)=[1 1 1]; 56 %else 57 % map(1,:)=[1 1 1]; 58 %end 59 %options=changefieldvalue(options,'colormap',map); 60 60 61 61 %last step: mesh gridded? -
issm/trunk/src/m/model/plot/plot_transient_field.m
r8472 r9597 34 34 %process data and change title if needed 35 35 [data datatype]=processdata(md,transient(steps(i)).(field),options); 36 options=changefieldvalue(options,'title',[field ' at time ' num2str(transient(steps(i)).time/md. yts) ' a']);36 options=changefieldvalue(options,'title',[field ' at time ' num2str(transient(steps(i)).time/md.constants.yts) ' a']); 37 37 38 38 %create plot of step i -
issm/trunk/src/m/model/plot/plot_transient_movie.m
r8472 r9597 24 24 [data datatype]=processdata(md,results(i).(field),options); 25 25 26 titlestring=[field ' at time ' num2str(results(i).time/md. yts) ' year'];26 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']; 27 27 plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options) 28 28 apply_options_movie(md,options,titlestring); -
issm/trunk/src/m/model/sia.m
r9367 r9597 22 22 Ael=Bel.^(-3); 23 23 24 velx=-2*(md.rho_ice*md. g)^3*s.^2.*sx.*Ael/4.*hel.^4;25 vely=-2*(md.rho_ice*md. g)^3*s.^2.*sy.*Ael/4.*hel.^4;24 velx=-2*(md.rho_ice*md.constants.g)^3*s.^2.*sx.*Ael/4.*hel.^4; 25 vely=-2*(md.rho_ice*md.constants.g)^3*s.^2.*sy.*Ael/4.*hel.^4; 26 26 vel=sqrt(velx.^2+vely.^2); -
issm/trunk/src/m/solutions/convergence.m
r6321 r9597 5 5 6 6 %Get convergence options 7 yts=parameters. Yts;7 yts=parameters.ConstantsYts; 8 8 eps_res=parameters.EpsRes; 9 9 eps_rel=parameters.EpsRel; -
issm/trunk/src/m/solutions/transient_core.m
r8926 r9597 9 9 ndt=femmodel.parameters.Ndt; 10 10 dt=femmodel.parameters.Dt; 11 yts=femmodel.parameters. Yts;11 yts=femmodel.parameters.ConstantsYts; 12 12 control_analysis=femmodel.parameters.ControlAnalysis; 13 13 solution_type=femmodel.parameters.SolutionType; -
issm/trunk/src/m/utils/Mesh/BuildAdaptedMesh.m
r1 r9597 38 38 %interpolate velocities onto mesh 39 39 disp(' interpolating velocities'); 40 md.vx_obs=DataInterp(x_m,y_m,vx*md. yts,md.x,md.y);41 md.vy_obs=DataInterp(x_m,y_m,vy*md. yts,md.x,md.y);40 md.vx_obs=DataInterp(x_m,y_m,vx*md.constants.yts,md.x,md.y); 41 md.vy_obs=DataInterp(x_m,y_m,vy*md.constants.yts,md.x,md.y); 42 42 md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2); 43 43 … … 49 49 disp(['Final mesh, number of elements: ' num2str(md.numberofelements)]); 50 50 51 md.vx_obs=DataInterp(x_m,y_m,vx*md. yts,md.x,md.y);52 md.vy_obs=DataInterp(x_m,y_m,vy*md. yts,md.x,md.y);51 md.vx_obs=DataInterp(x_m,y_m,vx*md.constants.yts,md.x,md.y); 52 md.vy_obs=DataInterp(x_m,y_m,vy*md.constants.yts,md.x,md.y); 53 53 md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2); 54 54 return; … … 59 59 md=parameterize(md,parameterfile); 60 60 61 %md.vx_obs=DataInterp(x_m,y_m,vx*md. yts,md.x,md.y);62 %md.vy_obs=DataInterp(x_m,y_m,vy*md. yts,md.x,md.y);61 %md.vx_obs=DataInterp(x_m,y_m,vx*md.constants.yts,md.x,md.y); 62 %md.vy_obs=DataInterp(x_m,y_m,vy*md.constants.yts,md.x,md.y); 63 63 %md.vel_obs=sqrt(md.vx_obs.^2+md.vy_obs.^2); 64 64 %return; -
issm/trunk/test/Miscellaneous/connectivity/Square.par
r8307 r9597 2 2 3 3 %dynamics 4 md.dt=1*md. yts; %1 year4 md.dt=1*md.constants.yts; %1 year 5 5 md.ndt=md.dt*10; 6 6 md.artificial_diffusivity=1; -
issm/trunk/test/NightlyRun/test1301.m
r9433 r9597 22 22 %melting heat = geothermal flux 23 23 %Mb*L*rho=G => Mb=G/L*rho 24 melting=md.geothermalflux/(md.rho_ice*md.latentheat)*md. yts;24 melting=md.geothermalflux/(md.rho_ice*md.latentheat)*md.constants.yts; 25 25 26 26 %modeled results -
issm/trunk/test/NightlyRun/test1302.m
r9433 r9597 20 20 %analytical results 21 21 %d2T/dz2-w*rho_ice*c/k*dT/dz=0 T(surface)=0 T(bed)=10 => T=A exp(alpha z)+B 22 alpha=0.1/md. yts*md.rho_ice*md.heatcapacity/md.thermalconductivity; %alpha=w rho_ice c /k and w=0.1m/an22 alpha=0.1/md.constants.yts*md.rho_ice*md.heatcapacity/md.thermalconductivity; %alpha=w rho_ice c /k and w=0.1m/an 23 23 A=10/(exp(alpha*(-1000))-1); %A=T(bed)/(exp(alpha*bed)-1) with bed=-1000 T(bed)=10 24 24 B=-A; -
issm/trunk/test/NightlyRun/test1501.m
r9087 r9597 131 131 [data datatype]=processdata(md,results(i).(field),options); 132 132 133 titlestring=[field ' at time ' num2str(results(i).time/md. yts) ' year'];133 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']; 134 134 plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options) 135 135 options=changefieldvalue(options,'title',titlestring); … … 146 146 [data datatype]=processdata(md,results(i).(field),options); 147 147 148 titlestring=[field ' at time ' num2str(results(i).time/md. yts) ' year'];148 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']; 149 149 plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options) 150 150 options=changefieldvalue(options,'title',titlestring); -
issm/trunk/test/NightlyRun/test1502.m
r9087 r9597 137 137 [data datatype]=processdata(md,results(i).(field),options); 138 138 139 titlestring=[field ' at time ' num2str(results(i).time/md. yts) ' year'];139 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']; 140 140 plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options) 141 141 options=changefieldvalue(options,'title',titlestring); … … 152 152 [data datatype]=processdata(md,results(i).(field),options); 153 153 154 titlestring=[field ' at time ' num2str(results(i).time/md. yts) ' year'];154 titlestring=[field ' at time ' num2str(results(i).time/md.constants.yts) ' year']; 155 155 plot_unit(x,y,z,elements,data,is2d,isplanet,datatype,options) 156 156 options=changefieldvalue(options,'title',titlestring); -
issm/trunk/test/NightlyRun/test233.m
r9463 r9597 61 61 62 62 %create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292. 63 %ey_c=(md.rho_ice*md. g*(1-di)*md.thickness./(4*md.rheology_B)).^3;64 %vy_c=ey_c.*md.y*md. yts;63 %ey_c=(md.rho_ice*md.constants.g*(1-di)*md.thickness./(4*md.rheology_B)).^3; 64 %vy_c=ey_c.*md.y*md.constants.yts; 65 65 66 66 %Fields and tolerances to track changes -
issm/trunk/test/NightlyRun/test234.m
r9463 r9597 61 61 62 62 %create analytical solution: strain rate is constant = ((rho_ice*g*h)/4B)^3 (Paterson, 4th Edition, page 292. 63 %ey_c=(md.rho_ice*md. g*(1-di)*md.thickness./(4*md.rheology_B)).^3;64 %vy_c=ey_c.*md.y*md. yts;63 %ey_c=(md.rho_ice*md.constants.g*(1-di)*md.thickness./(4*md.rheology_B)).^3; 64 %vy_c=ey_c.*md.y*md.constants.yts; 65 65 66 66 %Fields and tolerances to track changes -
issm/trunk/test/NightlyRun/test621.m
r9541 r9597 14 14 md.cm_responses=201*ones(md.nsteps,1); 15 15 md.weights=ones(md.numberofnodes,1); 16 md.optscal=10/md. yts*ones(md.nsteps,1);16 md.optscal=10/md.constants.yts*ones(md.nsteps,1); 17 17 md.maxiter=4*ones(md.nsteps,1); 18 18 md.cm_jump=0.99*ones(md.nsteps,1); -
issm/trunk/test/NightlyRun/test622.m
r9541 r9597 14 14 md.cm_responses=201*ones(md.nsteps,1); 15 15 md.weights=ones(md.numberofnodes,1); 16 md.optscal=10/md. yts*ones(md.nsteps,1);16 md.optscal=10/md.constants.yts*ones(md.nsteps,1); 17 17 md.maxiter=4*ones(md.nsteps,1); 18 18 md.cm_jump=0.99*ones(md.nsteps,1); -
issm/trunk/test/NightlyRun/test623.m
r9541 r9597 15 15 md.cm_responses=201*ones(md.nsteps,1); 16 16 md.weights=ones(md.numberofnodes,1); 17 md.optscal=10/md. yts*ones(md.nsteps,1);17 md.optscal=10/md.constants.yts*ones(md.nsteps,1); 18 18 md.maxiter=4*ones(md.nsteps,1); 19 19 md.cm_jump=0.99*ones(md.nsteps,1); -
issm/trunk/test/NightlyRun/test624.m
r9541 r9597 15 15 md.cm_responses=201*ones(md.nsteps,1); 16 16 md.weights=ones(md.numberofnodes,1); 17 md.optscal=10/md. yts*ones(md.nsteps,1);17 md.optscal=10/md.constants.yts*ones(md.nsteps,1); 18 18 md.maxiter=4*ones(md.nsteps,1); 19 19 md.cm_jump=0.99*ones(md.nsteps,1); -
issm/trunk/test/NightlyRun/test625.m
r9541 r9597 17 17 md.control_type={'Vx' 'Vy'}; 18 18 md.prognostic_DG=0; 19 md.optscal=[10/md. yts*ones(md.nsteps,1) 10/md.yts*ones(md.nsteps,1)];19 md.optscal=[10/md.constants.yts*ones(md.nsteps,1) 10/md.constants.yts*ones(md.nsteps,1)]; 20 20 md.cm_min=[-2000*ones(md.numberofnodes,1) -2000*ones(md.numberofnodes,1)]; 21 21 md.cm_max=[+2000*ones(md.numberofnodes,1) +2000*ones(md.numberofnodes,1)]; -
issm/trunk/test/NightlyRun/test626.m
r9541 r9597 17 17 md.control_type={'Vx' 'Vy'}; 18 18 md.prognostic_DG=0; 19 md.optscal=[10/md. yts*ones(md.nsteps,1) 10/md.yts*ones(md.nsteps,1)];19 md.optscal=[10/md.constants.yts*ones(md.nsteps,1) 10/md.constants.yts*ones(md.nsteps,1)]; 20 20 md.cm_min=[-2000*ones(md.numberofnodes,1) -2000*ones(md.numberofnodes,1)]; 21 21 md.cm_max=[+2000*ones(md.numberofnodes,1) +2000*ones(md.numberofnodes,1)]; -
issm/trunk/test/Par/ISMIPC.par
r9481 r9597 7 7 8 8 disp(' creating drag'); 9 %md.drag_coefficient=sqrt(md. yts.*(1000+1000*sin(md.x*2*pi/max(md.x/2)).*sin(md.y*2*pi/max(md.x/2)))./(md.g*(md.rho_ice*md.thickness+md.rho_water*md.bed)));10 md.drag_coefficient=sqrt(md. yts.*(1000+1000*sin(md.x*2*pi/max(md.x)).*sin(md.y*2*pi/max(md.x))));9 %md.drag_coefficient=sqrt(md.constants.yts.*(1000+1000*sin(md.x*2*pi/max(md.x/2)).*sin(md.y*2*pi/max(md.x/2)))./(md.constants.g*(md.rho_ice*md.thickness+md.rho_water*md.bed))); 10 md.drag_coefficient=sqrt(md.constants.yts.*(1000+1000*sin(md.x*2*pi/max(md.x)).*sin(md.y*2*pi/max(md.x)))); 11 11 %Take care of iceshelves: no basal drag 12 12 pos=find(md.elementoniceshelf); -
issm/trunk/test/Par/ISMIPD.par
r9481 r9597 7 7 8 8 disp(' creating drag'); 9 md.drag_coefficient=sqrt(md. yts.*(1000+1000*sin(md.x*2*pi/max(md.x))));9 md.drag_coefficient=sqrt(md.constants.yts.*(1000+1000*sin(md.x*2*pi/max(md.x)))); 10 10 %Take care of iceshelves: no basal drag 11 11 pos=find(md.elementoniceshelf); -
issm/trunk/test/Par/ISMIPF.par
r9514 r9597 9 9 10 10 disp(' creating drag'); 11 md.drag_coefficient=sqrt(md. yts/(2.140373*10^-7*1000))*ones(md.numberofnodes,1);11 md.drag_coefficient=sqrt(md.constants.yts/(2.140373*10^-7*1000))*ones(md.numberofnodes,1); 12 12 md.drag_p=ones(md.numberofelements,1); 13 13 md.drag_q=zeros(md.numberofelements,1); -
issm/trunk/test/Par/RoundSheetEISMINT.par
r9455 r9597 56 56 md.thermalconductivity=2.1; 57 57 md.latentheat=3.35*10^5; 58 md.beta=8.66*10^-4/(md.rho_ice*md. g); %conversion from K/m to K/Pa59 md. yts=31556926;58 md.beta=8.66*10^-4/(md.rho_ice*md.constants.g); %conversion from K/m to K/Pa 59 md.constants.yts=31556926; -
issm/trunk/test/Par/SquareThermal.par
r9481 r9597 30 30 31 31 disp(' creating surface_mass_balance'); 32 md.surface_mass_balance=ones(md.numberofnodes,1)/md. yts; %1m/a33 md.basal_melting_rate=0*ones(md.numberofnodes,1)/md. yts; %1m/a32 md.surface_mass_balance=ones(md.numberofnodes,1)/md.constants.yts; %1m/a 33 md.basal_melting_rate=0*ones(md.numberofnodes,1)/md.constants.yts; %1m/a 34 34 35 35 %Deal with boundary conditions:
Note:
See TracChangeset
for help on using the changeset viewer.