Changeset 20690
- Timestamp:
- 06/03/16 10:05:11 (9 years ago)
- Location:
- issm/trunk-jpl/src
- Files:
-
- 241 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/analyses/Balancethickness2Analysis.cpp
r20155 r20690 10 10 11 11 int finiteelement = P1Enum; 12 IoModelToConstraintsx(constraints,iomodel, BalancethicknessSpcthicknessEnum,Balancethickness2AnalysisEnum,finiteelement);12 IoModelToConstraintsx(constraints,iomodel,"md.balancethickness.spcthickness",Balancethickness2AnalysisEnum,finiteelement); 13 13 14 14 }/*}}}*/ … … 30 30 31 31 /*Load variables in element*/ 32 iomodel->FetchDataToInput(elements, ThicknessEnum);33 iomodel->FetchDataToInput(elements, SurfaceEnum);34 iomodel->FetchDataToInput(elements, BaseEnum);35 iomodel->FetchDataToInput(elements, SealevelEnum,0);36 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);37 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);38 iomodel->FetchDataToInput(elements, SmbMassBalanceEnum);39 iomodel->FetchDataToInput(elements, BalancethicknessThickeningRateEnum);40 iomodel->FetchDataToInput(elements, BalancethicknessOmegaEnum);32 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 33 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 34 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 35 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 36 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 37 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 38 iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum); 39 iomodel->FetchDataToInput(elements,"md.balancethickness.thickening_rate",BalancethicknessThickeningRateEnum); 40 iomodel->FetchDataToInput(elements,"md.balancethickness.omega",BalancethicknessOmegaEnum); 41 41 42 42 /*Update elements: */ -
issm/trunk-jpl/src/c/analyses/BalancethicknessAnalysis.cpp
r20645 r20690 10 10 /*Fetch parameters: */ 11 11 int stabilization; 12 iomodel->FindConstant(&stabilization, BalancethicknessStabilizationEnum);12 iomodel->FindConstant(&stabilization,"md.balancethickness.stabilization"); 13 13 14 14 /*Do not add constraints in DG*/ 15 15 if(stabilization!=3){ 16 IoModelToConstraintsx(constraints,iomodel, BalancethicknessSpcthicknessEnum,BalancethicknessAnalysisEnum,P1Enum);16 IoModelToConstraintsx(constraints,iomodel,"md.balancethickness.spcthickness",BalancethicknessAnalysisEnum,P1Enum); 17 17 } 18 18 … … 25 25 26 26 /*Fetch parameters: */ 27 iomodel->FindConstant(&stabilization, BalancethicknessStabilizationEnum);27 iomodel->FindConstant(&stabilization,"md.balancethickness.stabilization"); 28 28 29 29 /*Loads only in DG*/ … … 32 32 /*Get faces and elements*/ 33 33 CreateFaces(iomodel); 34 iomodel->FetchData(1, ThicknessEnum);34 iomodel->FetchData(1,"md.geometry.thickness"); 35 35 36 36 /*First load data:*/ … … 48 48 49 49 /*Free data: */ 50 iomodel->DeleteData(1, ThicknessEnum);50 iomodel->DeleteData(1,"md.geometry.thickness"); 51 51 } 52 52 }/*}}}*/ … … 54 54 55 55 int stabilization; 56 iomodel->FindConstant(&stabilization, BalancethicknessStabilizationEnum);56 iomodel->FindConstant(&stabilization,"md.balancethickness.stabilization"); 57 57 58 58 /*Check in 3d*/ … … 60 60 61 61 /*First fetch data: */ 62 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);62 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 63 63 if(stabilization!=3){ 64 64 ::CreateNodes(nodes,iomodel,BalancethicknessAnalysisEnum,P1Enum); … … 67 67 ::CreateNodes(nodes,iomodel,BalancethicknessAnalysisEnum,P1DGEnum); 68 68 } 69 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);69 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 70 70 }/*}}}*/ 71 71 int BalancethicknessAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 77 77 78 78 /*Fetch data needed: */ 79 iomodel->FindConstant(&stabilization, BalancethicknessStabilizationEnum);79 iomodel->FindConstant(&stabilization,"md.balancethickness.stabilization"); 80 80 81 81 /*Finite element type*/ … … 95 95 } 96 96 97 iomodel->FetchDataToInput(elements, ThicknessEnum);98 iomodel->FetchDataToInput(elements, SurfaceEnum);99 iomodel->FetchDataToInput(elements, BaseEnum);100 iomodel->FetchDataToInput(elements, SealevelEnum,0);101 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);102 iomodel->FetchDataToInput(elements, VxEnum);103 iomodel->FetchDataToInput(elements, VyEnum);104 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);105 iomodel->FetchDataToInput(elements, SmbMassBalanceEnum);106 iomodel->FetchDataToInput(elements, BalancethicknessThickeningRateEnum);97 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 98 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 99 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 100 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 101 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 102 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 103 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 104 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 105 iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum); 106 iomodel->FetchDataToInput(elements,"md.balancethickness.thickening_rate",BalancethicknessThickeningRateEnum); 107 107 108 108 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 109 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);110 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);109 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 110 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 111 111 } 112 112 }/*}}}*/ 113 113 void BalancethicknessAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ 114 parameters->AddObject(iomodel->CopyConstantObject( BalancethicknessStabilizationEnum));114 parameters->AddObject(iomodel->CopyConstantObject("md.balancethickness.stabilization",BalancethicknessStabilizationEnum)); 115 115 }/*}}}*/ 116 116 -
issm/trunk-jpl/src/c/analyses/BalancevelocityAnalysis.cpp
r20155 r20690 9 9 10 10 /*No constraints for now*/ 11 //IoModelToConstraintsx(constraints,iomodel, BalancethicknessSpcthicknessEnum,BalancevelocityAnalysisEnum,P1Enum);11 //IoModelToConstraintsx(constraints,iomodel,"md.balancethickness.spcthickness",BalancevelocityAnalysisEnum,P1Enum); 12 12 }/*}}}*/ 13 13 void BalancevelocityAnalysis::CreateLoads(Loads* loads, IoModel* iomodel){/*{{{*/ … … 38 38 } 39 39 40 iomodel->FetchDataToInput(elements, ThicknessEnum);41 iomodel->FetchDataToInput(elements, SurfaceEnum);42 iomodel->FetchDataToInput(elements, BaseEnum);43 iomodel->FetchDataToInput(elements, SealevelEnum,0);44 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);45 iomodel->FetchDataToInput(elements, VxEnum);46 iomodel->FetchDataToInput(elements, VyEnum);47 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);48 iomodel->FetchDataToInput(elements, SmbMassBalanceEnum);49 iomodel->FetchDataToInput(elements, BalancethicknessThickeningRateEnum);40 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 41 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 42 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 43 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 44 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 45 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 46 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 47 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 48 iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum); 49 iomodel->FetchDataToInput(elements,"md.balancethickness.thickening_rate",BalancethicknessThickeningRateEnum); 50 50 51 51 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 52 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);53 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);52 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 53 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 54 54 } 55 55 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/DamageEvolutionAnalysis.cpp
r20669 r20690 9 9 10 10 int finiteelement; 11 iomodel->FindConstant(&finiteelement, DamageElementinterpEnum);11 iomodel->FindConstant(&finiteelement,"md.damage.elementinterp"); 12 12 13 13 /*Fetch parameters: */ 14 14 int stabilization; 15 iomodel->FindConstant(&stabilization, DamageStabilizationEnum);15 iomodel->FindConstant(&stabilization,"md.damage.stabilization"); 16 16 17 17 /*Do not add constraints in DG, they are weakly imposed*/ 18 18 if(stabilization!=3){ 19 IoModelToConstraintsx(constraints,iomodel, DamageSpcdamageEnum,DamageEvolutionAnalysisEnum,finiteelement);19 IoModelToConstraintsx(constraints,iomodel,"md.damage.spcdamage",DamageEvolutionAnalysisEnum,finiteelement); 20 20 } 21 21 … … 34 34 int finiteelement; 35 35 36 iomodel->FindConstant(&finiteelement, DamageElementinterpEnum);36 iomodel->FindConstant(&finiteelement,"md.damage.elementinterp"); 37 37 ::CreateNodes(nodes,iomodel,DamageEvolutionAnalysisEnum,finiteelement); 38 38 }/*}}}*/ … … 45 45 bool ismovingfront; 46 46 47 iomodel->FindConstant(&finiteelement, DamageElementinterpEnum);48 iomodel->FindConstant(&ismovingfront, TransientIsmovingfrontEnum);47 iomodel->FindConstant(&finiteelement,"md.damage.elementinterp"); 48 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 49 49 50 50 /*Update elements: */ 51 iomodel->FetchData(1, FlowequationElementEquationEnum);51 iomodel->FetchData(1,"md.flowequation.element_equation"); 52 52 int counter=0; 53 53 for(int i=0;i<iomodel->numberofelements;i++){ … … 58 58 } 59 59 } 60 iomodel->DeleteData(1, FlowequationElementEquationEnum);60 iomodel->DeleteData(1,"md.flowequation.element_equation"); 61 61 62 62 /*What input do I need to run my damage evolution model?*/ 63 iomodel->FetchDataToInput(elements, VxEnum);64 iomodel->FetchDataToInput(elements, VyEnum);65 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchDataToInput(elements, VzEnum);66 iomodel->FetchDataToInput(elements, DamageDEnum);67 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);68 iomodel->FetchDataToInput(elements, PressureEnum);63 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 64 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 65 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchDataToInput(elements,"md.initialization.vz",VzEnum); 66 iomodel->FetchDataToInput(elements,"md.damage.D",DamageDEnum); 67 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 68 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 69 69 70 70 }/*}}}*/ … … 76 76 77 77 /*retrieve some parameters: */ 78 parameters->AddObject(iomodel->CopyConstantObject( DamageLawEnum));79 parameters->AddObject(iomodel->CopyConstantObject( DamageStabilizationEnum));80 parameters->AddObject(iomodel->CopyConstantObject( DamageMaxiterEnum));81 parameters->AddObject(iomodel->CopyConstantObject( DamageMaxDamageEnum));82 parameters->AddObject(iomodel->CopyConstantObject( DamageElementinterpEnum));78 parameters->AddObject(iomodel->CopyConstantObject("md.damage.law",DamageLawEnum)); 79 parameters->AddObject(iomodel->CopyConstantObject("md.damage.stabilization",DamageStabilizationEnum)); 80 parameters->AddObject(iomodel->CopyConstantObject("md.damage.maxiter",DamageMaxiterEnum)); 81 parameters->AddObject(iomodel->CopyConstantObject("md.damage.max_damage",DamageMaxDamageEnum)); 82 parameters->AddObject(iomodel->CopyConstantObject("md.damage.elementinterp",DamageElementinterpEnum)); 83 83 84 84 /*Requested outputs*/ 85 iomodel->F etchData(&requestedoutputs,&numoutputs,DamageEvolutionRequestedOutputsEnum);85 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.damage.requested_outputs"); 86 86 parameters->AddObject(new IntParam(DamageEvolutionNumRequestedOutputsEnum,numoutputs)); 87 87 if(numoutputs)parameters->AddObject(new StringArrayParam(DamageEvolutionRequestedOutputsEnum,requestedoutputs,numoutputs)); 88 iomodel->DeleteData(&requestedoutputs,numoutputs, DamageEvolutionRequestedOutputsEnum);88 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.damage.requested_outputs"); 89 89 90 90 /*Retrieve law dependent parameters: */ 91 91 int law; 92 iomodel->FindConstant(&law, DamageLawEnum);92 iomodel->FindConstant(&law,"md.damage.law"); 93 93 if (law==0){ 94 parameters->AddObject(iomodel->CopyConstantObject( DamageStressThresholdEnum));95 parameters->AddObject(iomodel->CopyConstantObject( DamageKappaEnum));94 parameters->AddObject(iomodel->CopyConstantObject("md.damage.stress_threshold",DamageStressThresholdEnum)); 95 parameters->AddObject(iomodel->CopyConstantObject("md.damage.kappa",DamageKappaEnum)); 96 96 } 97 97 else if (law>0){ 98 parameters->AddObject(iomodel->CopyConstantObject( DamageC1Enum));99 parameters->AddObject(iomodel->CopyConstantObject( DamageC2Enum));100 parameters->AddObject(iomodel->CopyConstantObject( DamageC3Enum));101 parameters->AddObject(iomodel->CopyConstantObject( DamageC4Enum));102 parameters->AddObject(iomodel->CopyConstantObject( DamageStressThresholdEnum));103 parameters->AddObject(iomodel->CopyConstantObject( DamageKappaEnum));104 parameters->AddObject(iomodel->CopyConstantObject( DamageHealingEnum));105 parameters->AddObject(iomodel->CopyConstantObject( DamageEquivStressEnum));98 parameters->AddObject(iomodel->CopyConstantObject("md.damage.c1",DamageC1Enum)); 99 parameters->AddObject(iomodel->CopyConstantObject("md.damage.c2",DamageC2Enum)); 100 parameters->AddObject(iomodel->CopyConstantObject("md.damage.c3",DamageC3Enum)); 101 parameters->AddObject(iomodel->CopyConstantObject("md.damage.c4",DamageC4Enum)); 102 parameters->AddObject(iomodel->CopyConstantObject("md.damage.stress_threshold",DamageStressThresholdEnum)); 103 parameters->AddObject(iomodel->CopyConstantObject("md.damage.kappa",DamageKappaEnum)); 104 parameters->AddObject(iomodel->CopyConstantObject("md.damage.healing",DamageHealingEnum)); 105 parameters->AddObject(iomodel->CopyConstantObject("md.damage.equiv_stress",DamageEquivStressEnum)); 106 106 } 107 107 -
issm/trunk-jpl/src/c/analyses/DepthAverageAnalysis.cpp
r18929 r20690 30 30 31 31 if(iomodel->domaintype==Domain2DverticalEnum){ 32 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);32 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 33 33 } 34 34 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/EnthalpyAnalysis.cpp
r20669 r20690 22 22 23 23 /*Fetch parameters: */ 24 iomodel->FindConstant(&heatcapacity, MaterialsHeatcapacityEnum);25 iomodel->FindConstant(&referencetemperature, ConstantsReferencetemperatureEnum);24 iomodel->FindConstant(&heatcapacity,"md.materials.heatcapacity"); 25 iomodel->FindConstant(&referencetemperature,"md.constants.referencetemperature"); 26 26 27 27 /*return if 2d mesh*/ … … 29 29 30 30 /*Fetch data: */ 31 iomodel->FetchData(&spcvector,&M,&N, ThermalSpctemperatureEnum);31 iomodel->FetchData(&spcvector,&M,&N,"md.thermal.spctemperature"); 32 32 33 33 //FIX ME: SHOULD USE IOMODELCREATECONSTRAINTS … … 88 88 89 89 /*Free ressources:*/ 90 iomodel->DeleteData(spcvector, ThermalSpctemperatureEnum);90 iomodel->DeleteData(spcvector,"md.thermal.spctemperature"); 91 91 xDelete<IssmDouble>(times); 92 92 xDelete<IssmDouble>(values); … … 98 98 void EnthalpyAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 99 99 100 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);100 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 101 101 ::CreateNodes(nodes,iomodel,EnthalpyAnalysisEnum,P1Enum); 102 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);102 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 103 103 }/*}}}*/ 104 104 int EnthalpyAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 115 115 116 116 /*Is enthalpy requested?*/ 117 iomodel->FindConstant(&isenthalpy, ThermalIsenthalpyEnum);117 iomodel->FindConstant(&isenthalpy,"md.thermal.isenthalpy"); 118 118 if(!isenthalpy) return; 119 119 120 120 /*Fetch data needed: */ 121 iomodel->FetchData(3, TemperatureEnum,WaterfractionEnum,PressureEnum);121 iomodel->FetchData(3,"md.initialization.temperature","md.initialization.waterfraction","md.initialization.pressure"); 122 122 123 123 /*Update elements: */ … … 131 131 } 132 132 133 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);134 iomodel->FindConstant(&ismovingfront, TransientIsmovingfrontEnum);135 iomodel->FindConstant(&frictionlaw, FrictionLawEnum);136 137 iomodel->FetchDataToInput(elements, ThicknessEnum);138 iomodel->FetchDataToInput(elements, SurfaceEnum);139 iomodel->FetchDataToInput(elements, SealevelEnum,0);140 iomodel->FetchDataToInput(elements, BaseEnum);141 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);142 iomodel->FetchDataToInput(elements, MaskGroundediceLevelsetEnum);133 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 134 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 135 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 136 137 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 138 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 139 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 140 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 141 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 142 iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum); 143 143 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 144 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);145 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);146 } 147 iomodel->FetchDataToInput(elements, MaterialsRheologyBEnum);148 iomodel->FetchDataToInput(elements, MaterialsRheologyNEnum);149 iomodel->FetchDataToInput(elements, PressureEnum);150 iomodel->FetchDataToInput(elements, TemperatureEnum);151 iomodel->FetchDataToInput(elements, WaterfractionEnum);152 iomodel->FetchDataToInput(elements, EnthalpyEnum);153 iomodel->FetchDataToInput(elements, WatercolumnEnum);154 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);155 iomodel->FetchDataToInput(elements, VxEnum);156 iomodel->FetchDataToInput(elements, VyEnum);157 iomodel->FetchDataToInput(elements, VzEnum);144 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 145 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 146 } 147 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum); 148 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 149 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 150 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 151 iomodel->FetchDataToInput(elements,"md.initialization.waterfraction",WaterfractionEnum); 152 iomodel->FetchDataToInput(elements,"md.initialization.enthalpy",EnthalpyEnum); 153 iomodel->FetchDataToInput(elements,"md.initialization.watercolumn",WatercolumnEnum); 154 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 155 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 156 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 157 iomodel->FetchDataToInput(elements,"md.initialization.vz",VzEnum); 158 158 InputUpdateFromConstantx(elements,0.,VxMeshEnum); 159 159 InputUpdateFromConstantx(elements,0.,VyMeshEnum); 160 160 InputUpdateFromConstantx(elements,0.,VzMeshEnum); 161 161 if(ismovingfront){ 162 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum); // required for updating active nodes162 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); // required for updating active nodes 163 163 } 164 164 165 165 /*Basal forcings variables*/ 166 iomodel->FindConstant(&basalforcing_model, BasalforcingsEnum);166 iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model"); 167 167 switch(basalforcing_model){ 168 168 case MantlePlumeGeothermalFluxEnum: 169 169 break; 170 170 default: 171 iomodel->FetchDataToInput(elements, BasalforcingsGeothermalfluxEnum);171 iomodel->FetchDataToInput(elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum); 172 172 break; 173 173 } … … 176 176 switch(frictionlaw){ 177 177 case 1: 178 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);179 iomodel->FetchDataToInput(elements, FrictionPEnum);180 iomodel->FetchDataToInput(elements, FrictionQEnum);178 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 179 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 180 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 181 181 break; 182 182 case 2: 183 iomodel->FetchDataToInput(elements, FrictionCEnum);184 iomodel->FetchDataToInput(elements, FrictionMEnum);183 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 184 iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum); 185 185 break; 186 186 case 3: 187 iomodel->FindConstant(&FrictionCoupling, FrictionCouplingEnum);188 iomodel->FetchDataToInput(elements, FrictionCEnum);189 iomodel->FetchDataToInput(elements, FrictionAsEnum);190 iomodel->FetchDataToInput(elements, FrictionQEnum);187 iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling"); 188 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 189 iomodel->FetchDataToInput(elements,"md.friction.As",FrictionAsEnum); 190 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 191 191 if (FrictionCoupling==0){ 192 iomodel->FetchDataToInput(elements, FrictionEffectivePressureEnum);192 iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum); 193 193 } 194 194 break; 195 195 case 4: 196 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);197 iomodel->FetchDataToInput(elements, FrictionPEnum);198 iomodel->FetchDataToInput(elements, FrictionQEnum);199 iomodel->FetchDataToInput(elements, PressureEnum);200 iomodel->FetchDataToInput(elements, TemperatureEnum);196 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 197 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 198 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 199 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 200 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 201 201 break; 202 202 case 5: 203 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);204 iomodel->FetchDataToInput(elements, FrictionPEnum);205 iomodel->FetchDataToInput(elements, FrictionQEnum);206 iomodel->FetchDataToInput(elements, FrictionWaterLayerEnum);203 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 204 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 205 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 206 iomodel->FetchDataToInput(elements,"md.friction.water_layer",FrictionWaterLayerEnum); 207 207 break; 208 208 case 6: 209 iomodel->FetchDataToInput(elements, FrictionCEnum);210 iomodel->FetchDataToInput(elements, FrictionMEnum);211 iomodel->FetchDataToInput(elements, PressureEnum);212 iomodel->FetchDataToInput(elements, TemperatureEnum);209 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 210 iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum); 211 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 212 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 213 213 break; 214 214 default: 215 215 _error_("not supported"); 216 216 } 217 217 218 /*Free data: */ 218 iomodel->DeleteData(3,TemperatureEnum,WaterfractionEnum,PressureEnum); 219 iomodel->DeleteData(3,"md.initialization.temperature","md.initialization.waterfraction","md.initialization.pressure"); 220 219 221 }/*}}}*/ 220 222 void EnthalpyAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ … … 223 225 char** requestedoutputs = NULL; 224 226 225 parameters->AddObject(iomodel->CopyConstantObject( ThermalStabilizationEnum));226 parameters->AddObject(iomodel->CopyConstantObject( ThermalMaxiterEnum));227 parameters->AddObject(iomodel->CopyConstantObject( ThermalReltolEnum));228 parameters->AddObject(iomodel->CopyConstantObject( ThermalIsenthalpyEnum));229 parameters->AddObject(iomodel->CopyConstantObject( ThermalIsdynamicbasalspcEnum));230 parameters->AddObject(iomodel->CopyConstantObject( FrictionLawEnum));231 232 iomodel->F etchData(&requestedoutputs,&numoutputs,ThermalRequestedOutputsEnum);227 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.stabilization",ThermalStabilizationEnum)); 228 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.maxiter",ThermalMaxiterEnum)); 229 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.reltol",ThermalReltolEnum)); 230 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isenthalpy",ThermalIsenthalpyEnum)); 231 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isdynamicbasalspc",ThermalIsdynamicbasalspcEnum)); 232 parameters->AddObject(iomodel->CopyConstantObject("md.friction.law",FrictionLawEnum)); 233 234 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.thermal.requested_outputs"); 233 235 parameters->AddObject(new IntParam(ThermalNumRequestedOutputsEnum,numoutputs)); 234 236 if(numoutputs)parameters->AddObject(new StringArrayParam(ThermalRequestedOutputsEnum,requestedoutputs,numoutputs)); 235 iomodel->DeleteData(&requestedoutputs,numoutputs, ThermalRequestedOutputsEnum);237 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.thermal.requested_outputs"); 236 238 237 239 /*Deal with friction parameters*/ 238 240 int frictionlaw; 239 iomodel->FindConstant(&frictionlaw, FrictionLawEnum);240 if(frictionlaw==4 || frictionlaw==6) parameters->AddObject(iomodel->CopyConstantObject( FrictionGammaEnum));241 if(frictionlaw==3) parameters->AddObject(iomodel->CopyConstantObject( FrictionCouplingEnum));241 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 242 if(frictionlaw==4 || frictionlaw==6) parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum)); 243 if(frictionlaw==3) parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum)); 242 244 }/*}}}*/ 243 245 -
issm/trunk-jpl/src/c/analyses/ExtrapolationAnalysis.cpp
r20117 r20690 17 17 void ExtrapolationAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 18 18 int finiteelement=P1Enum; 19 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);19 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 20 20 ::CreateNodes(nodes,iomodel,ExtrapolationAnalysisEnum,finiteelement); 21 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);21 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 22 22 } 23 23 /*}}}*/ … … 42 42 } 43 43 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 44 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);45 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);44 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 45 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 46 46 } 47 47 } -
issm/trunk-jpl/src/c/analyses/ExtrudeFromBaseAnalysis.cpp
r20665 r20690 30 30 31 31 if(iomodel->domaintype==Domain2DverticalEnum){ 32 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);32 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 33 33 } 34 34 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/ExtrudeFromTopAnalysis.cpp
r20666 r20690 30 30 31 31 if(iomodel->domaintype==Domain2DverticalEnum){ 32 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);32 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 33 33 } 34 34 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/FreeSurfaceBaseAnalysis.cpp
r20155 r20690 18 18 IssmDouble *vertex_pairing=NULL; 19 19 IssmDouble *nodeonbase=NULL; 20 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL, MasstransportVertexPairingEnum);21 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(&nodeonbase,NULL,NULL, MeshVertexonbaseEnum);20 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing"); 21 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(&nodeonbase,NULL,NULL,"md.mesh.vertexonbase"); 22 22 for(int i=0;i<numvertex_pairing;i++){ 23 23 … … 46 46 47 47 /*free ressources: */ 48 iomodel->DeleteData(vertex_pairing, MasstransportVertexPairingEnum);49 iomodel->DeleteData(nodeonbase, MeshVertexonbaseEnum);48 iomodel->DeleteData(vertex_pairing,"md.masstransport.vertex_pairing"); 49 iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase"); 50 50 }/*}}}*/ 51 51 void FreeSurfaceBaseAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 52 52 53 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);53 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 54 54 ::CreateNodes(nodes,iomodel,FreeSurfaceBaseAnalysisEnum,P1Enum); 55 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);55 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 56 56 }/*}}}*/ 57 57 int FreeSurfaceBaseAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 76 76 } 77 77 78 iomodel->FetchDataToInput(elements, SurfaceEnum);79 iomodel->FetchDataToInput(elements, SealevelEnum,0);80 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);81 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);82 iomodel->FetchDataToInput(elements, BasalforcingsFloatingiceMeltingRateEnum);83 iomodel->FetchDataToInput(elements, VxEnum);84 iomodel->FetchDataToInput(elements, VyEnum);78 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 79 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 80 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 81 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 82 iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum); 83 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 84 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 85 85 if(iomodel->domaindim==3){ 86 iomodel->FetchDataToInput(elements, VzEnum);86 iomodel->FetchDataToInput(elements,"md.initialization.vz",VzEnum); 87 87 } 88 88 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 89 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);90 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);89 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 90 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 91 91 } 92 92 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/FreeSurfaceTopAnalysis.cpp
r20645 r20690 18 18 IssmDouble *vertex_pairing=NULL; 19 19 IssmDouble *nodeonsurface=NULL; 20 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL, MasstransportVertexPairingEnum);21 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(&nodeonsurface,NULL,NULL, MeshVertexonsurfaceEnum);20 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing"); 21 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(&nodeonsurface,NULL,NULL,"md.mesh.vertexonsurface"); 22 22 for(int i=0;i<numvertex_pairing;i++){ 23 23 … … 46 46 47 47 /*free ressources: */ 48 iomodel->DeleteData(vertex_pairing, MasstransportVertexPairingEnum);49 iomodel->DeleteData(nodeonsurface, MeshVertexonsurfaceEnum);48 iomodel->DeleteData(vertex_pairing,"md.masstransport.vertex_pairing"); 49 iomodel->DeleteData(nodeonsurface,"md.mesh.vertexonsurface"); 50 50 }/*}}}*/ 51 51 void FreeSurfaceTopAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 52 52 53 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);53 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 54 54 ::CreateNodes(nodes,iomodel,FreeSurfaceTopAnalysisEnum,P1Enum); 55 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);55 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 56 56 }/*}}}*/ 57 57 int FreeSurfaceTopAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 67 67 68 68 /*Fetch data needed: */ 69 iomodel->FindConstant(&smb_model, SmbEnum);69 iomodel->FindConstant(&smb_model,"md.smb.model"); 70 70 71 71 /*Update elements: */ … … 79 79 } 80 80 81 iomodel->FetchDataToInput(elements, SurfaceEnum);82 iomodel->FetchDataToInput(elements, SealevelEnum,0);83 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);84 iomodel->FetchDataToInput(elements, VxEnum);81 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 82 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 83 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 84 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 85 85 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 86 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);87 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);86 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 87 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 88 88 } 89 89 if(iomodel->domaindim==3){ 90 iomodel->FetchDataToInput(elements, VzEnum);90 iomodel->FetchDataToInput(elements,"md.initialization.vz",VzEnum); 91 91 } 92 92 switch(smb_model){ 93 93 case SMBforcingEnum: 94 iomodel->FetchDataToInput(elements, SmbMassBalanceEnum,0.);94 iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum,0.); 95 95 break; 96 96 default: -
issm/trunk-jpl/src/c/analyses/GiaAnalysis.cpp
r20476 r20690 30 30 } 31 31 32 iomodel->FetchDataToInput(elements, ThicknessEnum);33 iomodel->FetchDataToInput(elements, GiaMantleViscosityEnum);34 iomodel->FetchDataToInput(elements, GiaLithosphereThicknessEnum);35 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);32 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 33 iomodel->FetchDataToInput(elements,"md.gia.mantle_viscosity",GiaMantleViscosityEnum); 34 iomodel->FetchDataToInput(elements,"md.gia.lithosphere_thickness",GiaLithosphereThicknessEnum); 35 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 36 36 }/*}}}*/ 37 37 void GiaAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ -
issm/trunk-jpl/src/c/analyses/HydrologyDCEfficientAnalysis.cpp
r20669 r20690 16 16 bool isefficientlayer; 17 17 /*retrieve some parameters: */ 18 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);18 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 19 19 20 20 /*Now, do we really want DC?*/ … … 22 22 23 23 /*Do we want an efficient layer*/ 24 iomodel->FindConstant(&isefficientlayer, HydrologydcIsefficientlayerEnum);24 iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer"); 25 25 26 26 /*If not return*/ … … 28 28 29 29 /*If yes, initialize a flip flop counter*/ 30 iomodel->FetchData(&eplflip_lock, HydrologydcEplflipLockEnum);30 iomodel->FetchData(&eplflip_lock,"md.hydrology.eplflip_lock"); 31 31 parameters->AddObject(new IntParam(HydrologydcEplflipLockEnum,eplflip_lock)); 32 32 33 iomodel->FetchData(&eplthickcomp, HydrologydcEplThickCompEnum);33 iomodel->FetchData(&eplthickcomp,"md.hydrology.epl_thick_comp"); 34 34 parameters->AddObject(new IntParam(HydrologydcEplThickCompEnum,eplthickcomp)); 35 35 … … 42 42 43 43 /*Now, do we really want DC?*/ 44 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);44 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 45 45 if(hydrology_model!=HydrologydcEnum) return; 46 46 47 47 /*Do we want an efficient layer*/ 48 iomodel->FindConstant(&isefficientlayer, HydrologydcIsefficientlayerEnum);48 iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer"); 49 49 if(!isefficientlayer) return; 50 50 … … 58 58 } 59 59 } 60 iomodel->FetchDataToInput(elements,ThicknessEnum); 61 iomodel->FetchDataToInput(elements,BaseEnum); 62 iomodel->FetchDataToInput(elements,MaskIceLevelsetEnum); 63 iomodel->FetchDataToInput(elements,EplHeadEnum); 64 iomodel->FetchDataToInput(elements,SedimentHeadEnum); 65 iomodel->FetchDataToInput(elements,HydrologydcEplInitialThicknessEnum); 66 iomodel->FetchDataToInput(elements,HydrologydcEplMaxThicknessEnum); 67 iomodel->FetchDataToInput(elements,HydrologydcEplThicknessEnum); 60 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 61 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 62 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 63 iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadEnum); 64 iomodel->FetchDataToInput(elements,"md.initialization.sediment_head",SedimentHeadEnum); 65 iomodel->FetchDataToInput(elements,"md.initialization.epl_thickness",HydrologydcEplThicknessEnum); 68 66 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 69 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);70 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);67 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 68 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 71 69 } 72 70 }/*}}}*/ … … 76 74 /*Now, do we really want DC?*/ 77 75 int hydrology_model; 78 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);76 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 79 77 if(hydrology_model!=HydrologydcEnum) return; 80 78 81 79 /*Do we want an efficient layer*/ 82 80 bool isefficientlayer; 83 iomodel->FindConstant(&isefficientlayer, HydrologydcIsefficientlayerEnum);81 iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer"); 84 82 if(!isefficientlayer) return; 85 83 86 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);84 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 87 85 ::CreateNodes(nodes,iomodel,HydrologyDCEfficientAnalysisEnum,P1Enum); 88 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);86 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 89 87 }/*}}}*/ 90 88 … … 93 91 /*Do we really want DC?*/ 94 92 int hydrology_model; 95 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);93 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 96 94 if(hydrology_model!=HydrologydcEnum) return; 97 95 98 96 /*Do we want an efficient layer*/ 99 97 bool isefficientlayer; 100 iomodel->FindConstant(&isefficientlayer, HydrologydcIsefficientlayerEnum);98 iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer"); 101 99 if(!isefficientlayer) return; 102 100 103 IoModelToConstraintsx(constraints,iomodel, HydrologydcSpceplHeadEnum,HydrologyDCEfficientAnalysisEnum,P1Enum);101 IoModelToConstraintsx(constraints,iomodel,"md.hydrology.spcepl_head",HydrologyDCEfficientAnalysisEnum,P1Enum); 104 102 }/*}}}*/ 105 103 -
issm/trunk-jpl/src/c/analyses/HydrologyDCInefficientAnalysis.cpp
r20669 r20690 25 25 26 26 /*retrieve some parameters: */ 27 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);27 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 28 28 29 29 /*Now, do we really want DC?*/ 30 30 if(hydrology_model!=HydrologydcEnum) return; 31 31 32 iomodel->FetchData(&isefficientlayer, HydrologydcIsefficientlayerEnum);33 iomodel->FetchData(&sedimentlimit_flag, HydrologydcSedimentlimitFlagEnum);34 iomodel->FetchData(&transfer_flag, HydrologydcTransferFlagEnum);35 iomodel->FetchData(&penalty_factor, HydrologydcPenaltyFactorEnum);36 iomodel->FetchData(&rel_tol, HydrologydcRelTolEnum);37 iomodel->FetchData(&penalty_lock, HydrologydcPenaltyLockEnum);38 iomodel->FetchData(&hydro_maxiter, HydrologydcMaxIterEnum);32 iomodel->FetchData(&isefficientlayer, "md.hydrology.isefficientlayer"); 33 iomodel->FetchData(&sedimentlimit_flag, "md.hydrology.sedimentlimit_flag" ); 34 iomodel->FetchData(&transfer_flag, "md.hydrology.transfer_flag" ); 35 iomodel->FetchData(&penalty_factor, "md.hydrology.penalty_factor" ); 36 iomodel->FetchData(&rel_tol, "md.hydrology.rel_tol" ); 37 iomodel->FetchData(&penalty_lock, "md.hydrology.penalty_lock" ); 38 iomodel->FetchData(&hydro_maxiter, "md.hydrology.max_iter" ); 39 39 40 40 if(sedimentlimit_flag==1){ 41 iomodel->FetchData(&sedimentlimit, HydrologydcSedimentlimitEnum);41 iomodel->FetchData(&sedimentlimit,"md.hydrology.sedimentlimit"); 42 42 parameters->AddObject(new DoubleParam(HydrologydcSedimentlimitEnum,sedimentlimit)); 43 43 } 44 44 45 45 if(transfer_flag==1){ 46 iomodel->FetchData(&leakagefactor, HydrologydcLeakageFactorEnum);46 iomodel->FetchData(&leakagefactor,"md.hydrology.leakage_factor"); 47 47 parameters->AddObject(new DoubleParam(HydrologydcLeakageFactorEnum,leakagefactor)); 48 48 } … … 65 65 66 66 /*Fetch data needed: */ 67 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);67 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 68 68 69 69 /*Now, do we really want DC?*/ … … 71 71 72 72 /*Fetch data needed: */ 73 iomodel->FindConstant(&isefficientlayer, HydrologydcIsefficientlayerEnum);73 iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer"); 74 74 75 75 /*Update elements: */ … … 83 83 } 84 84 85 iomodel->FetchDataToInput(elements, ThicknessEnum);86 iomodel->FetchDataToInput(elements, BaseEnum);87 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);88 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);89 iomodel->FetchDataToInput(elements, HydrologydcBasalMoulinInputEnum);90 iomodel->FetchDataToInput(elements, SedimentHeadEnum);91 iomodel->FetchDataToInput(elements, HydrologydcSedimentTransmitivityEnum);85 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 86 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 87 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 88 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 89 iomodel->FetchDataToInput(elements,"md.hydrology.basal_moulin_input",HydrologydcBasalMoulinInputEnum); 90 iomodel->FetchDataToInput(elements,"md.initialization.sediment_head",SedimentHeadEnum); 91 iomodel->FetchDataToInput(elements,"md.hydrology.sediment_transmitivity",HydrologydcSedimentTransmitivityEnum); 92 92 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 93 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);94 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);93 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 94 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 95 95 } 96 96 97 97 if(isefficientlayer){ 98 iomodel->FetchDataToInput(elements, HydrologydcMaskEplactiveNodeEnum);98 iomodel->FetchDataToInput(elements,"md.hydrology.mask_eplactive_node",HydrologydcMaskEplactiveNodeEnum); 99 99 } 100 100 }/*}}}*/ … … 104 104 /*Fetch parameters: */ 105 105 int hydrology_model; 106 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);106 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 107 107 108 108 /*Now, do we really want DC?*/ 109 109 if(hydrology_model!=HydrologydcEnum) return; 110 110 111 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);111 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 112 112 ::CreateNodes(nodes,iomodel,HydrologyDCInefficientAnalysisEnum,P1Enum); 113 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);113 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 114 114 }/*}}}*/ 115 115 … … 118 118 /*retrieve some parameters: */ 119 119 int hydrology_model; 120 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);120 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 121 121 if(hydrology_model!=HydrologydcEnum) return; 122 122 123 IoModelToConstraintsx(constraints,iomodel, HydrologydcSpcsedimentHeadEnum,HydrologyDCInefficientAnalysisEnum,P1Enum);123 IoModelToConstraintsx(constraints,iomodel,"md.hydrology.spcsediment_head",HydrologyDCInefficientAnalysisEnum,P1Enum); 124 124 }/*}}}*/ 125 125 … … 128 128 /*Fetch parameters: */ 129 129 int hydrology_model; 130 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);130 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 131 131 if(hydrology_model!=HydrologydcEnum) return; 132 132 133 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(1, MeshVertexonbaseEnum);133 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(1,"md.mesh.vertexonbase"); 134 134 135 135 //create penalties for nodes: no node can have water above the max … … 142 142 } 143 143 } 144 else if(reCast<int>(iomodel->Data( MeshVertexonbaseEnum)[i])){144 else if(reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){ 145 145 if(iomodel->my_vertices[i]){ 146 146 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,HydrologyDCInefficientAnalysisEnum)); … … 148 148 } 149 149 } 150 iomodel->DeleteData(1, MeshVertexonbaseEnum);150 iomodel->DeleteData(1,"md.mesh.vertexonbase"); 151 151 }/*}}}*/ 152 152 -
issm/trunk-jpl/src/c/analyses/HydrologyShreveAnalysis.cpp
r20669 r20690 10 10 /*retrieve some parameters: */ 11 11 int hydrology_model; 12 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);12 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 13 13 14 14 if(hydrology_model!=HydrologyshreveEnum) return; 15 15 16 IoModelToConstraintsx(constraints,iomodel, HydrologyshreveSpcwatercolumnEnum,HydrologyShreveAnalysisEnum,P1Enum);16 IoModelToConstraintsx(constraints,iomodel,"md.hydrologyshreve.spcwatercolumn",HydrologyShreveAnalysisEnum,P1Enum); 17 17 18 18 }/*}}}*/ … … 24 24 /*Fetch parameters: */ 25 25 int hydrology_model; 26 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);26 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 27 27 28 28 /*Now, do we really want Shreve?*/ 29 29 if(hydrology_model!=HydrologyshreveEnum) return; 30 30 31 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);31 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 32 32 ::CreateNodes(nodes,iomodel,HydrologyShreveAnalysisEnum,P1Enum); 33 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);33 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 34 34 }/*}}}*/ 35 35 int HydrologyShreveAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 40 40 /*Fetch data needed: */ 41 41 int hydrology_model; 42 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);42 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 43 43 44 44 /*Now, do we really want Shreve?*/ … … 55 55 } 56 56 57 iomodel->FetchDataToInput(elements, ThicknessEnum);58 iomodel->FetchDataToInput(elements, SurfaceEnum);59 iomodel->FetchDataToInput(elements, BaseEnum);60 iomodel->FetchDataToInput(elements, SealevelEnum,0);57 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 58 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 59 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 60 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 61 61 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 62 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);63 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);64 } 65 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);66 iomodel->FetchDataToInput(elements, MaskGroundediceLevelsetEnum);67 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);68 iomodel->FetchDataToInput(elements, WatercolumnEnum);62 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 63 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 64 } 65 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 66 iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum); 67 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 68 iomodel->FetchDataToInput(elements,"md.initialization.watercolumn",WatercolumnEnum); 69 69 70 70 elements->InputDuplicate(WatercolumnEnum,WaterColumnOldEnum); … … 74 74 /*retrieve some parameters: */ 75 75 int hydrology_model; 76 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);76 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 77 77 78 78 /*Now, do we really want Shreve?*/ … … 80 80 81 81 parameters->AddObject(new IntParam(HydrologyModelEnum,hydrology_model)); 82 parameters->AddObject(iomodel->CopyConstantObject( HydrologyshreveStabilizationEnum));82 parameters->AddObject(iomodel->CopyConstantObject("md.hydrology.stabilization",HydrologyshreveStabilizationEnum)); 83 83 84 84 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/HydrologySommersAnalysis.cpp
r20669 r20690 14 14 /*retrieve some parameters: */ 15 15 int hydrology_model; 16 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);16 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 17 17 18 18 if(hydrology_model!=HydrologysommersEnum) return; 19 19 20 IoModelToConstraintsx(constraints,iomodel, HydrologySpcheadEnum,HydrologySommersAnalysisEnum,P1Enum);20 IoModelToConstraintsx(constraints,iomodel,"md.hydrology.spchead",HydrologySommersAnalysisEnum,P1Enum); 21 21 22 22 }/*}}}*/ … … 25 25 /*Fetch parameters: */ 26 26 int hydrology_model; 27 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);27 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 28 28 29 29 /*Now, do we really want Sommers?*/ … … 39 39 } 40 40 } 41 else if(reCast<int>(iomodel->Data( MeshVertexonbaseEnum)[i])){41 else if(reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){ 42 42 if(iomodel->my_vertices[i]){ 43 43 loads->AddObject(new Moulin(iomodel->loadcounter+i+1,i,iomodel,HydrologySommersAnalysisEnum)); … … 45 45 } 46 46 } 47 iomodel->DeleteData(1, MeshVertexonbaseEnum);47 iomodel->DeleteData(1,"md.mesh.vertexonbase"); 48 48 49 49 /*Deal with Neumann BC*/ 50 50 int M,N; 51 51 int *segments = NULL; 52 iomodel->FetchData(&segments,&M,&N, MeshSegmentsEnum);52 iomodel->FetchData(&segments,&M,&N,"md.mesh.segments"); 53 53 54 54 /*Check that the size seem right*/ … … 67 67 /*Fetch parameters: */ 68 68 int hydrology_model; 69 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);69 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 70 70 71 71 /*Now, do we really want Sommers?*/ 72 72 if(hydrology_model!=HydrologysommersEnum) return; 73 73 74 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);74 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 75 75 ::CreateNodes(nodes,iomodel,HydrologySommersAnalysisEnum,P1Enum); 76 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);76 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 77 77 }/*}}}*/ 78 78 int HydrologySommersAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 83 83 /*Fetch data needed: */ 84 84 int hydrology_model,frictionlaw; 85 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);85 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 86 86 87 87 /*Now, do we really want Sommers?*/ … … 98 98 } 99 99 100 iomodel->FetchDataToInput(elements, ThicknessEnum);101 iomodel->FetchDataToInput(elements, BaseEnum);100 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 101 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 102 102 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 103 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);104 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);105 } 106 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);107 iomodel->FetchDataToInput(elements, MaskGroundediceLevelsetEnum);108 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);109 iomodel->FetchDataToInput(elements, BasalforcingsGeothermalfluxEnum);110 iomodel->FetchDataToInput(elements, HydrologyHeadEnum);111 iomodel->FetchDataToInput(elements, HydrologyGapHeightEnum);112 iomodel->FetchDataToInput(elements, HydrologyEnglacialInputEnum);113 iomodel->FetchDataToInput(elements, HydrologyMoulinInputEnum);114 iomodel->FetchDataToInput(elements, HydrologyBumpSpacingEnum);115 iomodel->FetchDataToInput(elements, HydrologyBumpHeightEnum);116 iomodel->FetchDataToInput(elements, HydrologyReynoldsEnum);117 iomodel->FetchDataToInput(elements, HydrologyNeumannfluxEnum);118 iomodel->FetchDataToInput(elements, VxEnum);119 iomodel->FetchDataToInput(elements, VyEnum);120 121 iomodel->FindConstant(&frictionlaw, FrictionLawEnum);103 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 104 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 105 } 106 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 107 iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum); 108 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 109 iomodel->FetchDataToInput(elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum); 110 iomodel->FetchDataToInput(elements,"md.hydrology.head",HydrologyHeadEnum); 111 iomodel->FetchDataToInput(elements,"md.hydrology.gap_height",HydrologyGapHeightEnum); 112 iomodel->FetchDataToInput(elements,"md.hydrology.englacial_input",HydrologyEnglacialInputEnum); 113 iomodel->FetchDataToInput(elements,"md.hydrology.moulin_input",HydrologyMoulinInputEnum); 114 iomodel->FetchDataToInput(elements,"md.hydrology.bump_spacing",HydrologyBumpSpacingEnum); 115 iomodel->FetchDataToInput(elements,"md.hydrology.bump_height",HydrologyBumpHeightEnum); 116 iomodel->FetchDataToInput(elements,"md.hydrology.reynolds",HydrologyReynoldsEnum); 117 iomodel->FetchDataToInput(elements,"md.hydrology.neumannflux",HydrologyNeumannfluxEnum); 118 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 119 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 120 121 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 122 122 /*Friction law variables*/ 123 123 switch(frictionlaw){ 124 124 case 1: 125 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);126 iomodel->FetchDataToInput(elements, FrictionPEnum);127 iomodel->FetchDataToInput(elements, FrictionQEnum);125 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 126 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 127 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 128 128 break; 129 129 case 8: 130 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);130 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 131 131 break; 132 132 default: … … 138 138 /*retrieve some parameters: */ 139 139 int hydrology_model; 140 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);140 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 141 141 142 142 /*Now, do we really want Sommers?*/ … … 144 144 145 145 parameters->AddObject(new IntParam(HydrologyModelEnum,hydrology_model)); 146 parameters->AddObject(iomodel->CopyConstantObject( FrictionLawEnum));146 parameters->AddObject(iomodel->CopyConstantObject("md.friction.law",FrictionLawEnum)); 147 147 }/*}}}*/ 148 148 -
issm/trunk-jpl/src/c/analyses/L2ProjectionBaseAnalysis.cpp
r20155 r20690 17 17 18 18 if(iomodel->domaintype==Domain3DEnum){ 19 iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);19 iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 20 20 } 21 21 else if(iomodel->domaintype==Domain2DverticalEnum){ 22 iomodel->FetchData(1, MeshVertexonbaseEnum);22 iomodel->FetchData(1,"md.mesh.vertexonbase"); 23 23 } 24 24 ::CreateNodes(nodes,iomodel,L2ProjectionBaseAnalysisEnum,P1Enum); 25 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);25 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 26 26 }/*}}}*/ 27 27 int L2ProjectionBaseAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 40 40 } 41 41 42 iomodel->FetchDataToInput(elements, SurfaceEnum);43 iomodel->FetchDataToInput(elements, BaseEnum);44 iomodel->FetchDataToInput(elements, SealevelEnum,0);45 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);42 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 43 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 44 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 45 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 46 46 if(iomodel->domaintype!=Domain2DhorizontalEnum & iomodel->domaintype!=Domain3DsurfaceEnum){ 47 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);48 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);47 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 48 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 49 49 } 50 50 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/L2ProjectionEPLAnalysis.cpp
r20645 r20690 17 17 /*Now, do we really want DC?*/ 18 18 int hydrology_model; 19 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);19 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 20 20 if(hydrology_model!=HydrologydcEnum) return; 21 21 22 22 /*Do we want an efficient layer*/ 23 23 bool isefficientlayer; 24 iomodel->FindConstant(&isefficientlayer, HydrologydcIsefficientlayerEnum);24 iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer"); 25 25 if(!isefficientlayer) return; 26 26 27 27 if(iomodel->domaintype==Domain3DEnum){ 28 iomodel->FetchData(1, MeshVertexonbaseEnum);28 iomodel->FetchData(1,"md.mesh.vertexonbase"); 29 29 } 30 30 else if(iomodel->domaintype==Domain2DverticalEnum){ 31 iomodel->FetchData(1, MeshVertexonbaseEnum);31 iomodel->FetchData(1,"md.mesh.vertexonbase"); 32 32 } 33 33 ::CreateNodes(nodes,iomodel,L2ProjectionEPLAnalysisEnum,P1Enum); 34 iomodel->DeleteData(1, MeshVertexonbaseEnum);34 iomodel->DeleteData(1,"md.mesh.vertexonbase"); 35 35 }/*}}}*/ 36 36 int L2ProjectionEPLAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 43 43 44 44 /*Now, do we really want DC?*/ 45 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);45 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 46 46 if(hydrology_model!=HydrologydcEnum) return; 47 47 48 48 /*Do we want an efficient layer*/ 49 iomodel->FindConstant(&isefficientlayer, HydrologydcIsefficientlayerEnum);49 iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer"); 50 50 if(!isefficientlayer) return; 51 51 … … 60 60 } 61 61 62 iomodel->FetchDataToInput(elements, EplHeadEnum);63 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);62 iomodel->FetchDataToInput(elements,"md.initialization.epl_head",EplHeadEnum); 63 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 64 64 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 65 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);66 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);65 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 66 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 67 67 } 68 68 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/LevelsetAnalysis.cpp
r20645 r20690 12 12 13 13 void LevelsetAnalysis::CreateConstraints(Constraints* constraints,IoModel* iomodel){/*{{{*/ 14 IoModelToConstraintsx(constraints,iomodel, SpclevelsetEnum,LevelsetAnalysisEnum,P1Enum);14 IoModelToConstraintsx(constraints,iomodel,"md.levelset.spclevelset",LevelsetAnalysisEnum,P1Enum); 15 15 } 16 16 /*}}}*/ … … 20 20 void LevelsetAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 21 21 int finiteelement=P1Enum; 22 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);22 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 23 23 ::CreateNodes(nodes,iomodel,LevelsetAnalysisEnum,finiteelement); 24 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);24 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 25 25 } 26 26 /*}}}*/ … … 44 44 } 45 45 46 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);47 iomodel->FetchDataToInput(elements, VxEnum);48 iomodel->FetchDataToInput(elements, VyEnum);46 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 47 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 48 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 49 49 50 50 /*Get moving front parameters*/ 51 51 int calvinglaw; 52 iomodel->FindConstant(&calvinglaw, CalvingLawEnum);52 iomodel->FindConstant(&calvinglaw,"md.calving.law"); 53 53 switch(calvinglaw){ 54 54 case DefaultCalvingEnum: 55 iomodel->FetchDataToInput(elements, CalvingCalvingrateEnum);56 iomodel->FetchDataToInput(elements, CalvingMeltingrateEnum);55 iomodel->FetchDataToInput(elements,"md.calving.calvingrate",CalvingCalvingrateEnum); 56 iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum); 57 57 break; 58 58 case CalvingLevermannEnum: 59 iomodel->FetchDataToInput(elements, CalvinglevermannCoeffEnum);60 iomodel->FetchDataToInput(elements, CalvinglevermannMeltingrateEnum);59 iomodel->FetchDataToInput(elements,"md.calving.coeff",CalvinglevermannCoeffEnum); 60 iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvinglevermannMeltingrateEnum); 61 61 break; 62 62 case CalvingDevEnum: 63 iomodel->FetchDataToInput(elements, CalvingdevCoeffEnum);64 iomodel->FetchDataToInput(elements, CalvingMeltingrateEnum);63 iomodel->FetchDataToInput(elements,"md.calving.coeff",CalvingdevCoeffEnum); 64 iomodel->FetchDataToInput(elements,"md.calving.meltingrate",CalvingMeltingrateEnum); 65 65 break; 66 66 default: … … 70 70 /*}}}*/ 71 71 void LevelsetAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ 72 parameters->AddObject(iomodel->CopyConstantObject( LevelsetStabilizationEnum));72 parameters->AddObject(iomodel->CopyConstantObject("md.levelset.stabilization",LevelsetStabilizationEnum)); 73 73 return; 74 74 } -
issm/trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp
r19094 r20690 18 18 void LsfReinitializationAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 19 19 int finiteelement=P1Enum; 20 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);20 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 21 21 ::CreateNodes(nodes,iomodel,LsfReinitializationAnalysisEnum,finiteelement); 22 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);22 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 23 23 }/*}}}*/ 24 24 int LsfReinitializationAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 41 41 } 42 42 43 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);43 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 44 44 }/*}}}*/ 45 45 void LsfReinitializationAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ -
issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp
r20669 r20690 10 10 /*Fetch parameters: */ 11 11 int stabilization; 12 iomodel->FindConstant(&stabilization, MasstransportStabilizationEnum);12 iomodel->FindConstant(&stabilization,"md.masstransport.stabilization"); 13 13 14 14 /*Do not add constraints in DG, they are weakly imposed*/ 15 15 if(stabilization!=3){ 16 IoModelToConstraintsx(constraints,iomodel, MasstransportSpcthicknessEnum,MasstransportAnalysisEnum,P1Enum);16 IoModelToConstraintsx(constraints,iomodel,"md.masstransport.spcthickness",MasstransportAnalysisEnum,P1Enum); 17 17 } 18 18 … … 32 32 33 33 /*Fetch parameters: */ 34 iomodel->FindConstant(&stabilization, MasstransportStabilizationEnum);34 iomodel->FindConstant(&stabilization,"md.masstransport.stabilization"); 35 35 36 36 /*Loads only in DG*/ … … 39 39 /*Get faces and elements*/ 40 40 CreateFaces(iomodel); 41 iomodel->FetchData(1, ThicknessEnum);41 iomodel->FetchData(1,"md.geometry.thickness"); 42 42 43 43 /*First load data:*/ … … 55 55 56 56 /*Free data: */ 57 iomodel->DeleteData(1, ThicknessEnum);57 iomodel->DeleteData(1,"md.geometry.thickness"); 58 58 } 59 59 … … 61 61 IssmDouble *vertex_pairing=NULL; 62 62 IssmDouble *nodeonbase=NULL; 63 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL, MasstransportVertexPairingEnum);64 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(&nodeonbase,NULL,NULL, MeshVertexonbaseEnum);63 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing"); 64 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(&nodeonbase,NULL,NULL,"md.mesh.vertexonbase"); 65 65 66 66 for(int i=0;i<numvertex_pairing;i++){ … … 90 90 91 91 /*free ressources: */ 92 iomodel->DeleteData(vertex_pairing, MasstransportVertexPairingEnum);93 iomodel->DeleteData(nodeonbase, MeshVertexonbaseEnum);92 iomodel->DeleteData(vertex_pairing,"md.masstransport.vertex_pairing"); 93 iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase"); 94 94 95 95 }/*}}}*/ … … 98 98 /*Fetch parameters: */ 99 99 int stabilization; 100 iomodel->FindConstant(&stabilization, MasstransportStabilizationEnum);100 iomodel->FindConstant(&stabilization,"md.masstransport.stabilization"); 101 101 102 102 /*Check in 3d*/ … … 104 104 105 105 /*Create Nodes either DG or CG depending on stabilization*/ 106 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);106 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 107 107 if(stabilization!=3){ 108 108 ::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1Enum); … … 111 111 ::CreateNodes(nodes,iomodel,MasstransportAnalysisEnum,P1DGEnum); 112 112 } 113 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);113 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 114 114 }/*}}}*/ 115 115 int MasstransportAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 125 125 126 126 /*Fetch data needed: */ 127 iomodel->FindConstant(&stabilization, MasstransportStabilizationEnum);128 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);129 iomodel->FindConstant(&isgroundingline, TransientIsgroundinglineEnum);130 iomodel->FindConstant(&ismovingfront, TransientIsmovingfrontEnum);131 iomodel->FindConstant(&issmb, TransientIssmbEnum);127 iomodel->FindConstant(&stabilization,"md.masstransport.stabilization"); 128 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 129 iomodel->FindConstant(&isgroundingline,"md.transient.isgroundingline"); 130 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 131 iomodel->FindConstant(&issmb,"md.transient.issmb"); 132 132 133 133 /*Finite element type*/ … … 147 147 } 148 148 149 iomodel->FetchDataToInput(elements, ThicknessEnum);150 iomodel->FetchDataToInput(elements, SurfaceEnum);151 iomodel->FetchDataToInput(elements, BaseEnum);152 iomodel->FetchDataToInput(elements, SealevelEnum,0);153 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);154 iomodel->FetchDataToInput(elements, MaskGroundediceLevelsetEnum);155 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);156 iomodel->FetchDataToInput(elements, BasalforcingsFloatingiceMeltingRateEnum);157 iomodel->FetchDataToInput(elements, VxEnum);158 iomodel->FetchDataToInput(elements, VyEnum);149 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 150 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 151 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 152 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 153 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 154 iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum); 155 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 156 iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum); 157 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 158 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 159 159 160 160 if(!issmb){ 161 iomodel->FetchDataToInput(elements, SmbMassBalanceEnum);161 iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum); 162 162 } 163 163 if(stabilization==3){ 164 iomodel->FetchDataToInput(elements, MasstransportSpcthicknessEnum); //for DG, we need the spc in the element164 iomodel->FetchDataToInput(elements,"md.masstransport.spcthickness",MasstransportSpcthicknessEnum); //for DG, we need the spc in the element 165 165 } 166 166 if(stabilization==4){ 167 iomodel->FetchDataToInput(elements, MasstransportSpcthicknessEnum); //for FCT, we need the spc in the element (penlaties)167 iomodel->FetchDataToInput(elements,"md.masstransport.spcthickness",MasstransportSpcthicknessEnum); //for FCT, we need the spc in the element (penlaties) 168 168 } 169 169 170 170 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 171 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);172 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);171 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 172 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 173 173 } 174 174 }/*}}}*/ … … 178 178 char** requestedoutputs = NULL; 179 179 180 parameters->AddObject(iomodel->CopyConstantObject( FlowequationIsFSEnum));181 parameters->AddObject(iomodel->CopyConstantObject( MasstransportIsfreesurfaceEnum));182 parameters->AddObject(iomodel->CopyConstantObject( MasstransportHydrostaticAdjustmentEnum));183 parameters->AddObject(iomodel->CopyConstantObject( MasstransportStabilizationEnum));184 parameters->AddObject(iomodel->CopyConstantObject( MasstransportMinThicknessEnum));185 parameters->AddObject(iomodel->CopyConstantObject( MasstransportPenaltyFactorEnum));186 187 iomodel->F etchData(&requestedoutputs,&numoutputs,MasstransportRequestedOutputsEnum);180 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isFS",FlowequationIsFSEnum)); 181 parameters->AddObject(iomodel->CopyConstantObject("md.masstransport.isfreesurface",MasstransportIsfreesurfaceEnum)); 182 parameters->AddObject(iomodel->CopyConstantObject("md.masstransport.hydrostatic_adjustment",MasstransportHydrostaticAdjustmentEnum)); 183 parameters->AddObject(iomodel->CopyConstantObject("md.masstransport.stabilization",MasstransportStabilizationEnum)); 184 parameters->AddObject(iomodel->CopyConstantObject("md.masstransport.min_thickness",MasstransportMinThicknessEnum)); 185 parameters->AddObject(iomodel->CopyConstantObject("md.masstransport.penalty_factor",MasstransportPenaltyFactorEnum)); 186 187 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.masstransport.requested_outputs"); 188 188 parameters->AddObject(new IntParam(MasstransportNumRequestedOutputsEnum,numoutputs)); 189 189 if(numoutputs)parameters->AddObject(new StringArrayParam(MasstransportRequestedOutputsEnum,requestedoutputs,numoutputs)); 190 iomodel->DeleteData(&requestedoutputs,numoutputs, MasstransportRequestedOutputsEnum);190 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.masstransport.requested_outputs"); 191 191 192 192 -
issm/trunk-jpl/src/c/analyses/MeltingAnalysis.cpp
r20155 r20690 15 15 16 16 //create penalties for nodes: no node can have a temperature over the melting point 17 iomodel->FetchData(1, MeshVertexonbaseEnum);17 iomodel->FetchData(1,"md.mesh.vertexonbase"); 18 18 CreateSingleNodeToElementConnectivity(iomodel); 19 19 20 20 for(int i=0;i<iomodel->numberofvertices;i++){ 21 21 if(iomodel->my_vertices[i]){ 22 if (reCast<int>(iomodel->Data( MeshVertexonbaseEnum)[i])){22 if (reCast<int>(iomodel->Data("md.mesh.vertexonbase")[i])){ 23 23 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,MeltingAnalysisEnum)); 24 24 } 25 25 } 26 26 } 27 iomodel->DeleteData(1, MeshVertexonbaseEnum);27 iomodel->DeleteData(1,"md.mesh.vertexonbase"); 28 28 29 29 }/*}}}*/ 30 30 void MeltingAnalysis::CreateNodes(Nodes* nodes,IoModel* iomodel){/*{{{*/ 31 31 32 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);32 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 33 33 ::CreateNodes(nodes,iomodel,MeltingAnalysisEnum,P1Enum); 34 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);34 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 35 35 }/*}}}*/ 36 36 int MeltingAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 55 55 56 56 /*Create inputs: */ 57 iomodel->FetchDataToInput(elements, ThicknessEnum);58 iomodel->FetchDataToInput(elements, SurfaceEnum);59 iomodel->FetchDataToInput(elements, BaseEnum);60 iomodel->FetchDataToInput(elements, SealevelEnum,0);61 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);57 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 58 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 59 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 60 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 61 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 62 62 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 63 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);64 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);63 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 64 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 65 65 } 66 iomodel->FetchDataToInput(elements, PressureEnum);66 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 67 67 }/*}}}*/ 68 68 void MeltingAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ -
issm/trunk-jpl/src/c/analyses/SealevelriseAnalysis.cpp
r20345 r20690 31 31 32 32 /*Create inputs: */ 33 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);34 iomodel->FetchDataToInput(elements, MaskOceanLevelsetEnum);35 iomodel->FetchDataToInput(elements, MaskLandLevelsetEnum);36 iomodel->FetchDataToInput(elements, SealevelriseDeltathicknessEnum);37 iomodel->FetchDataToInput(elements, SealevelEnum,0);33 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 34 iomodel->FetchDataToInput(elements,"md.mask.ocean_levelset",MaskOceanLevelsetEnum); 35 iomodel->FetchDataToInput(elements,"md.mask.land_levelset",MaskLandLevelsetEnum); 36 iomodel->FetchDataToInput(elements,"md.sealevelrise.deltathickness",SealevelriseDeltathicknessEnum); 37 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 38 38 39 39 }/*}}}*/ … … 60 60 61 61 /*some constant parameters: */ 62 parameters->AddObject(iomodel->CopyConstantObject( SealevelriseReltolEnum));63 parameters->AddObject(iomodel->CopyConstantObject( SealevelriseAbstolEnum));64 parameters->AddObject(iomodel->CopyConstantObject( SealevelriseMaxiterEnum));65 parameters->AddObject(iomodel->CopyConstantObject( SealevelriseRigidEnum));66 parameters->AddObject(iomodel->CopyConstantObject( SealevelriseElasticEnum));67 68 iomodel->FetchData(&elastic, SealevelriseElasticEnum);62 parameters->AddObject(iomodel->CopyConstantObject("md.slr.reltol",SealevelriseReltolEnum)); 63 parameters->AddObject(iomodel->CopyConstantObject("md.slr.abstol",SealevelriseAbstolEnum)); 64 parameters->AddObject(iomodel->CopyConstantObject("md.slr.maxiter",SealevelriseMaxiterEnum)); 65 parameters->AddObject(iomodel->CopyConstantObject("md.slr.rigid",SealevelriseRigidEnum)); 66 parameters->AddObject(iomodel->CopyConstantObject("md.slr.elastic",SealevelriseElasticEnum)); 67 68 iomodel->FetchData(&elastic,"md.slr.elastic"); 69 69 if(elastic){ 70 70 71 71 /*love numbers: */ 72 iomodel->FetchData(&love_h,&nl,NULL, SealevelriseLoveHEnum);73 iomodel->FetchData(&love_k,&nl,NULL, SealevelriseLoveKEnum);72 iomodel->FetchData(&love_h,&nl,NULL,"md.slr.love_h"); 73 iomodel->FetchData(&love_k,&nl,NULL,"md.slr.love_k"); 74 74 75 75 /*compute elastic green function for a range of angles*/ 76 iomodel->FetchData(°acc, SealevelriseDegaccEnum);76 iomodel->FetchData(°acc,"md.slr.degacc"); 77 77 M=reCast<int,IssmDouble>(180./degacc+1.); 78 78 G_elastic=xNew<IssmDouble>(M); … … 133 133 134 134 /*Transitions: */ 135 iomodel->FetchData(&transitions,&transitions_M,&transitions_N,&ntransitions, SealevelriseTransitionsEnum);135 iomodel->FetchData(&transitions,&transitions_M,&transitions_N,&ntransitions,"md.slr.transitions"); 136 136 if(transitions){ 137 137 parameters->AddObject(new DoubleMatArrayParam(SealevelriseTransitionsEnum,transitions,ntransitions,transitions_M,transitions_N)); … … 147 147 148 148 /*Requested outputs*/ 149 iomodel->F etchData(&requestedoutputs,&numoutputs,SealevelriseRequestedOutputsEnum);149 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.slr.requested_outputs"); 150 150 parameters->AddObject(new IntParam(SealevelriseNumRequestedOutputsEnum,numoutputs)); 151 151 if(numoutputs)parameters->AddObject(new StringArrayParam(SealevelriseRequestedOutputsEnum,requestedoutputs,numoutputs)); 152 iomodel->DeleteData(&requestedoutputs,numoutputs, SealevelriseRequestedOutputsEnum);152 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.slr.requested_outputs"); 153 153 154 154 -
issm/trunk-jpl/src/c/analyses/SmbAnalysis.cpp
r20645 r20690 34 34 35 35 /*Figure out smb model: */ 36 iomodel->FindConstant(&smb_model,SmbEnum); 37 36 iomodel->FindConstant(&smb_model,"md.smb.model"); 38 37 39 38 switch(smb_model){ 40 39 case SMBforcingEnum: 41 iomodel->FetchDataToInput(elements, SmbMassBalanceEnum,0.);40 iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum,0.); 42 41 break; 43 42 case SMBgembEnum: 44 iomodel->FetchDataToInput(elements, SmbTaEnum);45 iomodel->FetchDataToInput(elements, SmbVEnum);46 iomodel->FetchDataToInput(elements, SmbDswrfEnum);47 iomodel->FetchDataToInput(elements, SmbDlwrfEnum);48 iomodel->FetchDataToInput(elements, SmbPEnum);49 iomodel->FetchDataToInput(elements, SmbEAirEnum);50 iomodel->FetchDataToInput(elements, SmbPAirEnum);51 iomodel->FetchDataToInput(elements, SmbZTopEnum);52 iomodel->FetchDataToInput(elements, SmbDzTopEnum);53 iomodel->FetchDataToInput(elements, SmbDzMinEnum);54 iomodel->FetchDataToInput(elements, SmbZYEnum);55 iomodel->FetchDataToInput(elements, SmbZMaxEnum);56 iomodel->FetchDataToInput(elements, SmbZMinEnum);57 iomodel->FetchDataToInput(elements, SmbTmeanEnum);58 iomodel->FetchDataToInput(elements, SmbCEnum);59 iomodel->FetchDataToInput(elements, SmbTzEnum);60 iomodel->FetchDataToInput(elements, SmbVzEnum);43 iomodel->FetchDataToInput(elements,"md.smb.Ta",SmbTaEnum); 44 iomodel->FetchDataToInput(elements,"md.smb.V",SmbVEnum); 45 iomodel->FetchDataToInput(elements,"md.smb.dswrf",SmbDswrfEnum); 46 iomodel->FetchDataToInput(elements,"md.smb.dlwrf",SmbDlwrfEnum); 47 iomodel->FetchDataToInput(elements,"md.smb.P",SmbPEnum); 48 iomodel->FetchDataToInput(elements,"md.smb.eAir",SmbEAirEnum); 49 iomodel->FetchDataToInput(elements,"md.smb.pAir",SmbPAirEnum); 50 iomodel->FetchDataToInput(elements,"md.smb.zTop",SmbZTopEnum); 51 iomodel->FetchDataToInput(elements,"md.smb.dzTop",SmbDzTopEnum); 52 iomodel->FetchDataToInput(elements,"md.smb.dzMin",SmbDzMinEnum); 53 iomodel->FetchDataToInput(elements,"md.smb.zY",SmbZYEnum); 54 iomodel->FetchDataToInput(elements,"md.smb.zMax",SmbZMaxEnum); 55 iomodel->FetchDataToInput(elements,"md.smb.zMin",SmbZMinEnum); 56 iomodel->FetchDataToInput(elements,"md.smb.Tmean",SmbTmeanEnum); 57 iomodel->FetchDataToInput(elements,"md.smb.C",SmbCEnum); 58 iomodel->FetchDataToInput(elements,"md.smb.Tz",SmbTzEnum); 59 iomodel->FetchDataToInput(elements,"md.smb.Vz",SmbVzEnum); 61 60 break; 62 61 case SMBpddEnum: 63 iomodel->FindConstant(&isdelta18o, SmbIsdelta18oEnum);64 iomodel->FindConstant(&ismungsm, SmbIsmungsmEnum);65 iomodel->FetchDataToInput(elements, ThermalSpctemperatureEnum);66 iomodel->FetchDataToInput(elements, SmbS0pEnum);67 iomodel->FetchDataToInput(elements, SmbS0tEnum);62 iomodel->FindConstant(&isdelta18o,"md.smb.isdelta18o"); 63 iomodel->FindConstant(&ismungsm,"md.smb.ismungsm"); 64 iomodel->FetchDataToInput(elements,"md.thermal.spctemperature",ThermalSpctemperatureEnum); 65 iomodel->FetchDataToInput(elements,"md.smb.s0p",SmbS0pEnum); 66 iomodel->FetchDataToInput(elements,"md.smb.s0t",SmbS0tEnum); 68 67 if(isdelta18o || ismungsm){ 69 iomodel->FetchDataToInput(elements, SmbTemperaturesLgmEnum);70 iomodel->FetchDataToInput(elements, SmbTemperaturesPresentdayEnum);71 iomodel->FetchDataToInput(elements, SmbPrecipitationsPresentdayEnum);72 iomodel->FetchDataToInput(elements, SmbPrecipitationsLgmEnum);68 iomodel->FetchDataToInput(elements,"md.smb.temperatures_lgm",SmbTemperaturesLgmEnum); 69 iomodel->FetchDataToInput(elements,"md.smb.temperatures_presentday",SmbTemperaturesPresentdayEnum); 70 iomodel->FetchDataToInput(elements,"md.smb.precipitations_presentday",SmbPrecipitationsPresentdayEnum); 71 iomodel->FetchDataToInput(elements,"md.smb.precipitations_lgm",SmbPrecipitationsLgmEnum); 73 72 } 74 73 else{ 75 iomodel->FetchDataToInput(elements, SmbPrecipitationEnum);76 iomodel->FetchDataToInput(elements, SmbMonthlytemperaturesEnum);74 iomodel->FetchDataToInput(elements,"md.smb.precipitation",SmbPrecipitationEnum); 75 iomodel->FetchDataToInput(elements,"md.smb.monthlytemperatures",SmbMonthlytemperaturesEnum); 77 76 } 78 77 break; 79 78 case SMBd18opddEnum: 80 iomodel->FindConstant(&ismungsm, SmbIsmungsmEnum);81 iomodel->FindConstant(&isd18opd, SmbIsd18opdEnum);82 iomodel->FetchDataToInput(elements, ThermalSpctemperatureEnum);83 iomodel->FetchDataToInput(elements, SmbS0pEnum);84 iomodel->FetchDataToInput(elements, SmbS0tEnum);85 if 86 iomodel->FetchDataToInput(elements,SmbTemperaturesPresentdayEnum);87 iomodel->FetchDataToInput(elements,SmbPrecipitationsPresentdayEnum);79 iomodel->FindConstant(&ismungsm,"md.smb.ismungsm"); 80 iomodel->FindConstant(&isd18opd,"md.smb.isd18opd"); 81 iomodel->FetchDataToInput(elements,"md.thermal.spctemperature",ThermalSpctemperatureEnum); 82 iomodel->FetchDataToInput(elements,"md.smb.s0p",SmbS0pEnum); 83 iomodel->FetchDataToInput(elements,"md.smb.s0t",SmbS0tEnum); 84 if(isd18opd){ 85 iomodel->FetchDataToInput(elements,"md.smb.temperatures_presentday",SmbTemperaturesPresentdayEnum); 86 iomodel->FetchDataToInput(elements,"md.smb.precipitations_presentday",SmbPrecipitationsPresentdayEnum); 88 87 } 89 88 90 89 break; 91 90 case SMBgradientsEnum: 92 iomodel->FetchDataToInput(elements, SmbHrefEnum);93 iomodel->FetchDataToInput(elements, SmbSmbrefEnum);94 iomodel->FetchDataToInput(elements, SmbBPosEnum);95 iomodel->FetchDataToInput(elements, SmbBNegEnum);91 iomodel->FetchDataToInput(elements,"md.smb.href",SmbHrefEnum); 92 iomodel->FetchDataToInput(elements,"md.smb.smbref",SmbSmbrefEnum); 93 iomodel->FetchDataToInput(elements,"md.smb.b_pos",SmbBPosEnum); 94 iomodel->FetchDataToInput(elements,"md.smb.b_neg",SmbBNegEnum); 96 95 break; 97 96 case SMBhenningEnum: 98 iomodel->FetchDataToInput(elements, SmbSmbrefEnum,0.);97 iomodel->FetchDataToInput(elements,"md.smb.smbref",SmbSmbrefEnum,0.); 99 98 break; 100 99 case SMBcomponentsEnum: 101 iomodel->FetchDataToInput(elements, SmbAccumulationEnum,0.);102 iomodel->FetchDataToInput(elements, SmbEvaporationEnum,0.);103 iomodel->FetchDataToInput(elements, SmbRunoffEnum,0.);100 iomodel->FetchDataToInput(elements,"md.smb.accumulation",SmbAccumulationEnum,0.); 101 iomodel->FetchDataToInput(elements,"md.smb.evaporation",SmbEvaporationEnum,0.); 102 iomodel->FetchDataToInput(elements,"md.smb.runoff",SmbRunoffEnum,0.); 104 103 break; 105 104 case SMBmeltcomponentsEnum: 106 iomodel->FetchDataToInput(elements, SmbAccumulationEnum,0.);107 iomodel->FetchDataToInput(elements, SmbEvaporationEnum,0.);108 iomodel->FetchDataToInput(elements, SmbMeltEnum,0.);109 iomodel->FetchDataToInput(elements, SmbRefreezeEnum,0.);105 iomodel->FetchDataToInput(elements,"md.smb.accumulation",SmbAccumulationEnum,0.); 106 iomodel->FetchDataToInput(elements,"md.smb.evaporation",SmbEvaporationEnum,0.); 107 iomodel->FetchDataToInput(elements,"md.smb.melt",SmbMeltEnum,0.); 108 iomodel->FetchDataToInput(elements,"md.smb.refreeze",SmbRefreezeEnum,0.); 110 109 break; 111 110 default: … … 125 124 int N,M; 126 125 127 parameters->AddObject(iomodel->CopyConstantObject( SmbEnum));128 129 iomodel->FindConstant(&smb_model, SmbEnum);130 iomodel->FindConstant(&interp, TimesteppingInterpForcingsEnum);126 parameters->AddObject(iomodel->CopyConstantObject("md.smb.model",SmbEnum)); 127 128 iomodel->FindConstant(&smb_model,"md.smb.model"); 129 iomodel->FindConstant(&interp,"md.timestepping.interp_forcings"); 131 130 132 131 switch(smb_model){ … … 135 134 break; 136 135 case SMBgembEnum: 137 parameters->AddObject(iomodel->CopyConstantObject( SmbAIdxEnum));138 parameters->AddObject(iomodel->CopyConstantObject( SmbSwIdxEnum));139 parameters->AddObject(iomodel->CopyConstantObject( SmbDenIdxEnum));140 parameters->AddObject(iomodel->CopyConstantObject( SmbOutputFreqEnum));141 parameters->AddObject(iomodel->CopyConstantObject( SmbCldFracEnum));142 parameters->AddObject(iomodel->CopyConstantObject( SmbT0wetEnum));143 parameters->AddObject(iomodel->CopyConstantObject( SmbT0dryEnum));144 parameters->AddObject(iomodel->CopyConstantObject( SmbKEnum));145 parameters->AddObject(iomodel->CopyConstantObject( SmbASnowEnum));146 parameters->AddObject(iomodel->CopyConstantObject( SmbAIceEnum));147 parameters->AddObject(iomodel->CopyConstantObject( SmbDtEnum));148 parameters->AddObject(iomodel->CopyConstantObject( SmbIsgraingrowthEnum));149 parameters->AddObject(iomodel->CopyConstantObject( SmbIsalbedoEnum));150 parameters->AddObject(iomodel->CopyConstantObject( SmbIsshortwaveEnum));151 parameters->AddObject(iomodel->CopyConstantObject( SmbIsthermalEnum));152 parameters->AddObject(iomodel->CopyConstantObject( SmbIsaccumulationEnum));153 parameters->AddObject(iomodel->CopyConstantObject( SmbIsmeltEnum));154 parameters->AddObject(iomodel->CopyConstantObject( SmbIsdensificationEnum));155 parameters->AddObject(iomodel->CopyConstantObject( SmbIsturbulentfluxEnum));156 parameters->AddObject(iomodel->CopyConstantObject( SmbInitDensityScalingEnum));136 parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIdx",SmbAIdxEnum)); 137 parameters->AddObject(iomodel->CopyConstantObject("md.smb.swIdx",SmbSwIdxEnum)); 138 parameters->AddObject(iomodel->CopyConstantObject("md.smb.denIdx",SmbDenIdxEnum)); 139 parameters->AddObject(iomodel->CopyConstantObject("md.smb.outputFreq",SmbOutputFreqEnum)); 140 parameters->AddObject(iomodel->CopyConstantObject("md.smb.cldFrac",SmbCldFracEnum)); 141 parameters->AddObject(iomodel->CopyConstantObject("md.smb.t0wet",SmbT0wetEnum)); 142 parameters->AddObject(iomodel->CopyConstantObject("md.smb.t0dry",SmbT0dryEnum)); 143 parameters->AddObject(iomodel->CopyConstantObject("md.smb.K",SmbKEnum)); 144 parameters->AddObject(iomodel->CopyConstantObject("md.smb.aSnow",SmbASnowEnum)); 145 parameters->AddObject(iomodel->CopyConstantObject("md.smb.aIce",SmbAIceEnum)); 146 parameters->AddObject(iomodel->CopyConstantObject("md.smb.dt",SmbDtEnum)); 147 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isgraingrowth",SmbIsgraingrowthEnum)); 148 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isalbedo",SmbIsalbedoEnum)); 149 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isshortwave",SmbIsshortwaveEnum)); 150 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isthermal",SmbIsthermalEnum)); 151 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isaccumulation",SmbIsaccumulationEnum)); 152 parameters->AddObject(iomodel->CopyConstantObject("md.smb.ismelt",SmbIsmeltEnum)); 153 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdensification",SmbIsdensificationEnum)); 154 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isturbulentflux",SmbIsturbulentfluxEnum)); 155 parameters->AddObject(iomodel->CopyConstantObject("md.smb.InitDensityScaling",SmbInitDensityScalingEnum)); 157 156 break; 158 157 case SMBpddEnum: 159 parameters->AddObject(iomodel->CopyConstantObject( SmbIsdelta18oEnum));160 parameters->AddObject(iomodel->CopyConstantObject( SmbIsmungsmEnum));161 parameters->AddObject(iomodel->CopyConstantObject( SmbDesfacEnum));162 parameters->AddObject(iomodel->CopyConstantObject( SmbRlapsEnum));163 parameters->AddObject(iomodel->CopyConstantObject( SmbRlapslgmEnum));164 iomodel->FindConstant(&isdelta18o, SmbIsdelta18oEnum);165 iomodel->FindConstant(&ismungsm, SmbIsmungsmEnum);158 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isdelta18o",SmbIsdelta18oEnum)); 159 parameters->AddObject(iomodel->CopyConstantObject("md.smb.ismungsm",SmbIsmungsmEnum)); 160 parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum)); 161 parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum)); 162 parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlapslgm",SmbRlapslgmEnum)); 163 iomodel->FindConstant(&isdelta18o,"md.smb.isdelta18o"); 164 iomodel->FindConstant(&ismungsm,"md.smb.ismungsm"); 166 165 167 166 if(ismungsm){ 168 iomodel->FetchData(&temp,&N,&M, SmbPfacEnum); _assert_(N==2);167 iomodel->FetchData(&temp,&N,&M,"md.smb.Pfac"); _assert_(N==2); 169 168 parameters->AddObject(new TransientParam(SmbPfacEnum,&temp[0],&temp[M],interp,M)); 170 iomodel->DeleteData(temp, SmbPfacEnum);169 iomodel->DeleteData(temp,"md.smb.Pfac"); 171 170 172 iomodel->FetchData(&temp,&N,&M, SmbTdiffEnum); _assert_(N==2);171 iomodel->FetchData(&temp,&N,&M,"md.smb.Tdiff"); _assert_(N==2); 173 172 parameters->AddObject(new TransientParam(SmbTdiffEnum,&temp[0],&temp[M],interp,M)); 174 iomodel->DeleteData(temp, SmbTdiffEnum);175 176 iomodel->FetchData(&temp,&N,&M, SmbSealevEnum); _assert_(N==2);173 iomodel->DeleteData(temp,"md.smb.Tdiff"); 174 175 iomodel->FetchData(&temp,&N,&M,"md.smb.sealev"); _assert_(N==2); 177 176 parameters->AddObject(new TransientParam(SmbSealevEnum,&temp[0],&temp[M],interp,M)); 178 iomodel->DeleteData(temp, SmbSealevEnum);177 iomodel->DeleteData(temp,"md.smb.sealev"); 179 178 } 180 179 if(isdelta18o){ 181 iomodel->FetchData(&temp,&N,&M, SmbDelta18oEnum); _assert_(N==2);180 iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o"); _assert_(N==2); 182 181 parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,M)); 183 iomodel->DeleteData(temp, SmbDelta18oEnum);184 185 iomodel->FetchData(&temp,&N,&M, SmbDelta18oSurfaceEnum); _assert_(N==2);182 iomodel->DeleteData(temp,"md.smb.delta18o"); 183 184 iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o_surface"); _assert_(N==2); 186 185 parameters->AddObject(new TransientParam(SmbDelta18oSurfaceEnum,&temp[0],&temp[M],interp,M)); 187 iomodel->DeleteData(temp, SmbDelta18oSurfaceEnum);186 iomodel->DeleteData(temp,"md.smb.delta18o_surface"); 188 187 } 189 188 break; 190 189 case SMBd18opddEnum: 191 parameters->AddObject(iomodel->CopyConstantObject( SmbIsmungsmEnum));192 parameters->AddObject(iomodel->CopyConstantObject( SmbIsd18opdEnum));193 parameters->AddObject(iomodel->CopyConstantObject( SmbDesfacEnum));194 parameters->AddObject(iomodel->CopyConstantObject( SmbRlapsEnum));195 parameters->AddObject(iomodel->CopyConstantObject( SmbRlapslgmEnum));196 iomodel->FindConstant(&ismungsm, SmbIsmungsmEnum);197 iomodel->FindConstant(&isd18opd, SmbIsd18opdEnum);190 parameters->AddObject(iomodel->CopyConstantObject("md.smb.ismungsm",SmbIsmungsmEnum)); 191 parameters->AddObject(iomodel->CopyConstantObject("md.smb.isd18opd",SmbIsd18opdEnum)); 192 parameters->AddObject(iomodel->CopyConstantObject("md.smb.desfac",SmbDesfacEnum)); 193 parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlaps",SmbRlapsEnum)); 194 parameters->AddObject(iomodel->CopyConstantObject("md.smb.rlapslgm",SmbRlapslgmEnum)); 195 iomodel->FindConstant(&ismungsm,"md.smb.ismungsm"); 196 iomodel->FindConstant(&isd18opd,"md.smb.isd18opd"); 198 197 if(isd18opd){ 199 iomodel->FetchData(&temp,&N,&M, SmbDelta18oEnum); _assert_(N==2);198 iomodel->FetchData(&temp,&N,&M,"md.smb.delta18o"); _assert_(N==2); 200 199 parameters->AddObject(new TransientParam(SmbDelta18oEnum,&temp[0],&temp[M],interp,M)); 201 iomodel->DeleteData(temp, SmbDelta18oEnum);200 iomodel->DeleteData(temp,"md.smb.delta18o"); 202 201 203 parameters->AddObject(iomodel->CopyConstantObject( SmbDpermilEnum));202 parameters->AddObject(iomodel->CopyConstantObject("md.smb.dpermil",SmbDpermilEnum)); 204 203 } 205 204 break; … … 220 219 } 221 220 222 iomodel->F etchData(&requestedoutputs,&numoutputs,SmbRequestedOutputsEnum);221 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.smb.requested_outputs"); 223 222 parameters->AddObject(new IntParam(SmbNumRequestedOutputsEnum,numoutputs)); 224 223 if(numoutputs)parameters->AddObject(new StringArrayParam(SmbRequestedOutputsEnum,requestedoutputs,numoutputs)); 225 iomodel->DeleteData(&requestedoutputs,numoutputs, SmbRequestedOutputsEnum);224 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.smb.requested_outputs"); 226 225 227 226 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp
r20669 r20690 41 41 42 42 /*Fetch parameters: */ 43 iomodel->FindConstant(&g, ConstantsGEnum);44 iomodel->FindConstant(&rho_ice, MaterialsRhoIceEnum);45 iomodel->FindConstant(&FSreconditioning, StressbalanceFSreconditioningEnum);46 iomodel->FindConstant(&isSIA, FlowequationIsSIAEnum);47 iomodel->FindConstant(&isSSA, FlowequationIsSSAEnum);48 iomodel->FindConstant(&isL1L2, FlowequationIsL1L2Enum);49 iomodel->FindConstant(&isHO, FlowequationIsHOEnum);50 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);43 iomodel->FindConstant(&g,"md.constants.g"); 44 iomodel->FindConstant(&rho_ice,"md.materials.rho_ice"); 45 iomodel->FindConstant(&FSreconditioning,"md.stressbalance.FSreconditioning"); 46 iomodel->FindConstant(&isSIA,"md.flowequation.isSIA"); 47 iomodel->FindConstant(&isSSA,"md.flowequation.isSSA"); 48 iomodel->FindConstant(&isL1L2,"md.flowequation.isL1L2"); 49 iomodel->FindConstant(&isHO,"md.flowequation.isHO"); 50 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 51 51 52 52 /*Now, is the flag macayaealHO on? otherwise, do nothing: */ … … 63 63 64 64 /*Get finite element type*/ 65 if(isSSA) iomodel->FindConstant(&finiteelement, FlowequationFeSSAEnum);65 if(isSSA) iomodel->FindConstant(&finiteelement,"md.flowequation.fe_SSA"); 66 66 else if(isL1L2) finiteelement = P1Enum; 67 else if(isHO) iomodel->FindConstant(&finiteelement, FlowequationFeHOEnum);68 else if(isFS){ iomodel->FindConstant(&finiteelement, FlowequationFeFSEnum);67 else if(isHO) iomodel->FindConstant(&finiteelement,"md.flowequation.fe_HO"); 68 else if(isFS){ iomodel->FindConstant(&finiteelement,"md.flowequation.fe_FS"); 69 69 /*Deduce velocity interpolation from finite element*/ 70 70 switch(finiteelement){ … … 89 89 90 90 /*Constraint at the bedrock interface (v.n = vz = 0) (Coordinates will be updated according to the bed slope)*/ 91 iomodel->FetchData(&vertices_type,NULL,NULL, FlowequationVertexEquationEnum);92 iomodel->FetchData(&nodeonFS,NULL,NULL, FlowequationBorderFSEnum);93 iomodel->FetchData(&nodeonbase,NULL,NULL, MeshVertexonbaseEnum);94 iomodel->FetchData(&groundedice_ls,NULL,NULL, MaskGroundediceLevelsetEnum);91 iomodel->FetchData(&vertices_type,NULL,NULL,"md.flowequation.vertex_equation"); 92 iomodel->FetchData(&nodeonFS,NULL,NULL,"md.flowequation.borderFS"); 93 iomodel->FetchData(&nodeonbase,NULL,NULL,"md.mesh.vertexonbase"); 94 iomodel->FetchData(&groundedice_ls,NULL,NULL,"md.mask.groundedice_levelset"); 95 95 if(iomodel->domaintype==Domain3DEnum){ 96 iomodel->FetchData(&spcvz,&Mz,&Nz, StressbalanceSpcvzEnum);96 iomodel->FetchData(&spcvz,&Mz,&Nz,"md.stressbalance.spcvz"); 97 97 } 98 98 else if (iomodel->domaintype==Domain2DverticalEnum){ 99 iomodel->FetchData(&spcvz,&Mz,&Nz, StressbalanceSpcvyEnum);99 iomodel->FetchData(&spcvz,&Mz,&Nz,"md.stressbalance.spcvy"); 100 100 } 101 101 else{ … … 103 103 } 104 104 if(iomodel->domaintype==Domain3DEnum){ 105 IoModelToConstraintsx(constraints,iomodel, StressbalanceSpcvxEnum,StressbalanceAnalysisEnum,finiteelement,0);106 IoModelToConstraintsx(constraints,iomodel, StressbalanceSpcvyEnum,StressbalanceAnalysisEnum,finiteelement,1);105 IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0); 106 IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1); 107 107 IoModelToConstraintsx(constraints,iomodel,spcvz,Mz,Nz,StressbalanceAnalysisEnum,finiteelement,2); 108 iomodel->DeleteData(spcvz, StressbalanceSpcvzEnum);108 iomodel->DeleteData(spcvz,"md.stressbalance.spcvz"); 109 109 } 110 110 else if (iomodel->domaintype==Domain2DverticalEnum){ 111 IoModelToConstraintsx(constraints,iomodel, StressbalanceSpcvxEnum,StressbalanceAnalysisEnum,finiteelement,0);111 IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0); 112 112 IoModelToConstraintsx(constraints,iomodel,spcvz,Mz,Nz,StressbalanceAnalysisEnum,finiteelement,1); 113 iomodel->DeleteData(spcvz, StressbalanceSpcvyEnum);113 iomodel->DeleteData(spcvz,"md.stressbalance.spcvy"); 114 114 } 115 115 else{ 116 116 _error_("not supported yet"); 117 117 } 118 iomodel->DeleteData(vertices_type, FlowequationVertexEquationEnum);119 iomodel->DeleteData(nodeonFS, FlowequationBorderFSEnum);120 iomodel->DeleteData(nodeonbase, MeshVertexonbaseEnum);121 iomodel->DeleteData(groundedice_ls, MaskGroundediceLevelsetEnum);118 iomodel->DeleteData(vertices_type,"md.flowequation.vertex_equation"); 119 iomodel->DeleteData(nodeonFS,"md.flowequation.borderFS"); 120 iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase"); 121 iomodel->DeleteData(groundedice_ls,"md.mask.groundedice_levelset"); 122 122 123 123 /*Pressure spc*/ 124 124 count = constraints->Size(); 125 iomodel->FetchData(&vertices_type,NULL,NULL, FlowequationVertexEquationEnum);126 iomodel->FetchData(&surface,NULL,NULL, SurfaceEnum);127 iomodel->FetchData(&z,NULL,NULL, MeshZEnum);125 iomodel->FetchData(&vertices_type,NULL,NULL,"md.flowequation.vertex_equation"); 126 iomodel->FetchData(&surface,NULL,NULL,"md.geometry.surface"); 127 iomodel->FetchData(&z,NULL,NULL,"md.mesh.z"); 128 128 switch(finiteelement){ 129 129 case P1Enum: … … 173 173 _error_("not implemented yet"); 174 174 } 175 iomodel->DeleteData(vertices_type, FlowequationVertexEquationEnum);176 iomodel->DeleteData(surface, SurfaceEnum);177 iomodel->DeleteData(z, MeshZEnum);175 iomodel->DeleteData(vertices_type,"md.flowequation.vertex_equation"); 176 iomodel->DeleteData(surface,"md.geometry.surface"); 177 iomodel->DeleteData(z,"md.mesh.z"); 178 178 } 179 179 else{ 180 IoModelToConstraintsx(constraints,iomodel, StressbalanceSpcvxEnum,StressbalanceAnalysisEnum,finiteelement,0);180 IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceAnalysisEnum,finiteelement,0); 181 181 if(iomodel->domaintype!=Domain2DverticalEnum){ 182 IoModelToConstraintsx(constraints,iomodel, StressbalanceSpcvyEnum,StressbalanceAnalysisEnum,finiteelement,1);182 IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceAnalysisEnum,finiteelement,1); 183 183 } 184 184 } … … 188 188 189 189 /*Constraints: fetch data: */ 190 iomodel->FetchData(&spcvx,&Mx,&Nx, StressbalanceSpcvxEnum);191 iomodel->FetchData(&spcvy,&My,&Ny, StressbalanceSpcvyEnum);192 iomodel->FetchData(&spcvz,&Mz,&Nz, StressbalanceSpcvzEnum);193 iomodel->FetchData(&nodeonSSA,NULL,NULL, FlowequationBorderSSAEnum);194 if(iomodel->domaintype==Domain3DEnum)iomodel->FetchData(&nodeonHO,NULL,NULL, FlowequationBorderHOEnum);195 if(iomodel->domaintype==Domain3DEnum)iomodel->FetchData(&nodeonFS,NULL,NULL, FlowequationBorderFSEnum);196 if(iomodel->domaintype==Domain3DEnum)iomodel->FetchData(&nodeonbase,NULL,NULL, MeshVertexonbaseEnum);197 if(iomodel->domaintype==Domain3DEnum)iomodel->FetchData(&groundedice_ls,NULL,NULL, MaskGroundediceLevelsetEnum);198 iomodel->FetchData(&vertices_type,NULL,NULL, FlowequationVertexEquationEnum);199 iomodel->FetchData(&surface,NULL,NULL, SurfaceEnum);200 iomodel->FetchData(&z,NULL,NULL, MeshZEnum);190 iomodel->FetchData(&spcvx,&Mx,&Nx,"md.stressbalance.spcvx"); 191 iomodel->FetchData(&spcvy,&My,&Ny,"md.stressbalance.spcvy"); 192 iomodel->FetchData(&spcvz,&Mz,&Nz,"md.stressbalance.spcvz"); 193 iomodel->FetchData(&nodeonSSA,NULL,NULL,"md.flowequation.borderSSA"); 194 if(iomodel->domaintype==Domain3DEnum)iomodel->FetchData(&nodeonHO,NULL,NULL,"md.flowequation.borderHO"); 195 if(iomodel->domaintype==Domain3DEnum)iomodel->FetchData(&nodeonFS,NULL,NULL,"md.flowequation.borderFS"); 196 if(iomodel->domaintype==Domain3DEnum)iomodel->FetchData(&nodeonbase,NULL,NULL,"md.mesh.vertexonbase"); 197 if(iomodel->domaintype==Domain3DEnum)iomodel->FetchData(&groundedice_ls,NULL,NULL,"md.mask.groundedice_levelset"); 198 iomodel->FetchData(&vertices_type,NULL,NULL,"md.flowequation.vertex_equation"); 199 iomodel->FetchData(&surface,NULL,NULL,"md.geometry.surface"); 200 iomodel->FetchData(&z,NULL,NULL,"md.mesh.z"); 201 201 202 202 /*Initialize counter: */ … … 418 418 419 419 /*Free data: */ 420 iomodel->DeleteData(spcvx, StressbalanceSpcvxEnum);421 iomodel->DeleteData(spcvy, StressbalanceSpcvyEnum);422 iomodel->DeleteData(spcvz, StressbalanceSpcvzEnum);423 iomodel->DeleteData(nodeonSSA, FlowequationBorderSSAEnum);424 if(iomodel->domaintype==Domain3DEnum)iomodel->DeleteData(nodeonHO, FlowequationBorderHOEnum);425 if(iomodel->domaintype==Domain3DEnum)iomodel->DeleteData(nodeonFS, FlowequationBorderFSEnum);426 if(iomodel->domaintype==Domain3DEnum)iomodel->DeleteData(nodeonbase, MeshVertexonbaseEnum);427 if(iomodel->domaintype==Domain3DEnum)iomodel->DeleteData(groundedice_ls, MaskGroundediceLevelsetEnum);428 iomodel->DeleteData(vertices_type, FlowequationVertexEquationEnum);429 iomodel->DeleteData(surface, SurfaceEnum);430 iomodel->DeleteData(z, MeshZEnum);420 iomodel->DeleteData(spcvx,"md.stressbalance.spcvx"); 421 iomodel->DeleteData(spcvy,"md.stressbalance.spcvy"); 422 iomodel->DeleteData(spcvz,"md.stressbalance.spcvz"); 423 iomodel->DeleteData(nodeonSSA,"md.flowequation.borderSSA"); 424 if(iomodel->domaintype==Domain3DEnum)iomodel->DeleteData(nodeonHO,"md.flowequation.borderHO"); 425 if(iomodel->domaintype==Domain3DEnum)iomodel->DeleteData(nodeonFS,"md.flowequation.borderFS"); 426 if(iomodel->domaintype==Domain3DEnum)iomodel->DeleteData(nodeonbase,"md.mesh.vertexonbase"); 427 if(iomodel->domaintype==Domain3DEnum)iomodel->DeleteData(groundedice_ls,"md.mask.groundedice_levelset"); 428 iomodel->DeleteData(vertices_type,"md.flowequation.vertex_equation"); 429 iomodel->DeleteData(surface,"md.geometry.surface"); 430 iomodel->DeleteData(z,"md.mesh.z"); 431 431 432 432 /*Free resources:*/ … … 451 451 452 452 /*Fetch parameters: */ 453 iomodel->FindConstant(&isL1L2, FlowequationIsL1L2Enum);454 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);455 iomodel->FindConstant(&isSSA, FlowequationIsSSAEnum);456 iomodel->FindConstant(&isHO, FlowequationIsHOEnum);457 iomodel->FindConstant(&numrifts, RiftsNumriftsEnum);453 iomodel->FindConstant(&isL1L2,"md.flowequation.isL1L2"); 454 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 455 iomodel->FindConstant(&isSSA,"md.flowequation.isSSA"); 456 iomodel->FindConstant(&isHO,"md.flowequation.isHO"); 457 iomodel->FindConstant(&numrifts,"md.rifts.numrifts"); 458 458 459 459 /*Now, is the flag macayaealHO on? otherwise, do nothing: */ … … 464 464 465 465 /*Create Penpair for penalties: */ 466 iomodel->FetchData(&penalties,&numpenalties,NULL, StressbalanceVertexPairingEnum);466 iomodel->FetchData(&penalties,&numpenalties,NULL,"md.stressbalance.vertex_pairing"); 467 467 468 468 for(i=0;i<numpenalties;i++){ … … 484 484 485 485 /*free ressources: */ 486 iomodel->DeleteData(penalties, StressbalanceVertexPairingEnum);486 iomodel->DeleteData(penalties,"md.stressbalance.vertex_pairing"); 487 487 488 488 /*Create Riffront loads for rifts: */ 489 489 if(numrifts){ 490 iomodel->FetchData(&riftinfo,&numriftsegments,NULL, RiftsRiftstructEnum);491 iomodel->FetchData(5, RiftsRiftstructEnum,ThicknessEnum,BaseEnum,SurfaceEnum,MaskGroundediceLevelsetEnum);490 iomodel->FetchData(&riftinfo,&numriftsegments,NULL,"md.rifts.riftstruct"); 491 iomodel->FetchData(5,"md.rifts.riftstruct","md.geometry.thickness","md.geometry.base","md.geometry.surface","md.mask.groundedice_levelset"); 492 492 for(i=0;i<numriftsegments;i++){ 493 493 if(iomodel->my_elements[reCast<int,IssmDouble>(*(riftinfo+RIFTINFOSIZE*i+2))-1]){ … … 496 496 } 497 497 } 498 iomodel->DeleteData(5, RiftsRiftstructEnum,ThicknessEnum,BaseEnum,SurfaceEnum,MaskGroundediceLevelsetEnum);498 iomodel->DeleteData(5,"md.rifts.riftstruct","md.geometry.thickness","md.geometry.base","md.geometry.surface","md.mask.groundedice_levelset"); 499 499 xDelete<IssmDouble>(riftinfo); 500 500 } … … 507 507 508 508 /*Fetch parameters: */ 509 iomodel->FindConstant(&isSSA, FlowequationIsSSAEnum);510 iomodel->FindConstant(&isL1L2, FlowequationIsL1L2Enum);511 iomodel->FindConstant(&isHO, FlowequationIsHOEnum);512 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);509 iomodel->FindConstant(&isSSA,"md.flowequation.isSSA"); 510 iomodel->FindConstant(&isL1L2,"md.flowequation.isL1L2"); 511 iomodel->FindConstant(&isHO,"md.flowequation.isHO"); 512 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 513 513 514 514 /*Now, check that we have non SIA elements */ … … 527 527 if(isSSA){ 528 528 approximation=SSAApproximationEnum; 529 iomodel->FindConstant(&finiteelement, FlowequationFeSSAEnum);529 iomodel->FindConstant(&finiteelement,"md.flowequation.fe_SSA"); 530 530 } 531 531 else if(isL1L2){ … … 535 535 else if(isHO){ 536 536 approximation = HOApproximationEnum; 537 iomodel->FindConstant(&finiteelement, FlowequationFeHOEnum);537 iomodel->FindConstant(&finiteelement,"md.flowequation.fe_HO"); 538 538 } 539 539 else if(isFS){ 540 540 approximation = FSApproximationEnum; 541 iomodel->FindConstant(&finiteelement, FlowequationFeFSEnum);542 } 543 iomodel->FetchData(3, FlowequationBorderSSAEnum,FlowequationVertexEquationEnum,StressbalanceReferentialEnum);544 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(3, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum,FlowequationBorderFSEnum);541 iomodel->FindConstant(&finiteelement,"md.flowequation.fe_FS"); 542 } 543 iomodel->FetchData(3,"md.flowequation.borderSSA","md.flowequation.vertex_equation","md.stressbalance.referential"); 544 if(iomodel->domaintype!=Domain2DhorizontalEnum) iomodel->FetchData(3,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderFS"); 545 545 ::CreateNodes(nodes,iomodel,StressbalanceAnalysisEnum,finiteelement,approximation); 546 iomodel->DeleteData(6, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum,547 FlowequationVertexEquationEnum,StressbalanceReferentialEnum);546 iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.vertex_equation", 547 "md.stressbalance.referential","md.flowequation.borderFS"); 548 548 } 549 549 else{ … … 554 554 if(!nodes) nodes = new Nodes(); 555 555 556 iomodel->FetchData(6, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum,557 FlowequationVertexEquationEnum,StressbalanceReferentialEnum);556 iomodel->FetchData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.borderFS", 557 "md.flowequation.vertex_equation","md.stressbalance.referential"); 558 558 if(isFS){ 559 559 /*P1+ velocity*/ 560 560 for(int i=0;i<iomodel->numberofvertices;i++){ 561 561 if(iomodel->my_vertices[i]){ 562 approximation=reCast<int>(iomodel->Data( FlowequationVertexEquationEnum)[i]);562 approximation=reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]); 563 563 if(approximation==FSApproximationEnum) approximation=FSvelocityEnum; 564 564 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,lid++,i,iomodel,StressbalanceAnalysisEnum,approximation)); … … 575 575 for(int i=0;i<iomodel->numberofvertices;i++){ 576 576 if(iomodel->my_vertices[i]){ 577 approximation=reCast<int>(iomodel->Data( FlowequationVertexEquationEnum)[i]);577 approximation=reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]); 578 578 node = new Node(iomodel->nodecounter+iomodel->numberofvertices+iomodel->numberofelements+i+1,iomodel->numberofvertices+iomodel->numberofelements+i,lid++,i,iomodel,StressbalanceAnalysisEnum,FSpressureEnum); 579 579 if(approximation==HOApproximationEnum || approximation==SSAApproximationEnum){ … … 587 587 for(int i=0;i<iomodel->numberofvertices;i++){ 588 588 if(iomodel->my_vertices[i]){ 589 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,lid++,i,iomodel,StressbalanceAnalysisEnum,reCast<int>(iomodel->Data( FlowequationVertexEquationEnum)[i])));589 nodes->AddObject(new Node(iomodel->nodecounter+i+1,i,lid++,i,iomodel,StressbalanceAnalysisEnum,reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i]))); 590 590 } 591 591 } 592 592 } 593 iomodel->DeleteData(6, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum,594 FlowequationVertexEquationEnum,StressbalanceReferentialEnum);593 iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.borderFS", 594 "md.flowequation.vertex_equation","md.stressbalance.referential"); 595 595 } 596 596 }/*}}}*/ … … 681 681 682 682 /*Fetch constants needed: */ 683 iomodel->FindConstant(&isSSA, FlowequationIsSSAEnum);684 iomodel->FindConstant(&isL1L2, FlowequationIsL1L2Enum);685 iomodel->FindConstant(&isHO, FlowequationIsHOEnum);686 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);687 iomodel->FindConstant(&control_analysis, InversionIscontrolEnum);688 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);689 iomodel->FindConstant(&materials_type, MaterialsEnum);690 iomodel->FindConstant(&ismovingfront, TransientIsmovingfrontEnum);691 iomodel->FindConstant(&frictionlaw, FrictionLawEnum);683 iomodel->FindConstant(&isSSA,"md.flowequation.isSSA"); 684 iomodel->FindConstant(&isL1L2,"md.flowequation.isL1L2"); 685 iomodel->FindConstant(&isHO,"md.flowequation.isHO"); 686 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 687 iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol"); 688 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 689 iomodel->FindConstant(&materials_type,"md.materials.type"); 690 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 691 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 692 692 693 693 /*return if no processing required*/ … … 695 695 696 696 /*Fetch data needed and allocate vectors: */ 697 iomodel->FetchData(1, FlowequationElementEquationEnum);697 iomodel->FetchData(1,"md.flowequation.element_equation"); 698 698 finiteelement_list=xNewZeroInit<int>(iomodel->numberofelements); 699 699 … … 706 706 /*Get finite element type*/ 707 707 if(!iscoupling){ 708 if(isSSA) iomodel->FindConstant(&finiteelement, FlowequationFeSSAEnum);708 if(isSSA) iomodel->FindConstant(&finiteelement,"md.flowequation.fe_SSA"); 709 709 else if(isL1L2) finiteelement = P1Enum; 710 else if(isHO) iomodel->FindConstant(&finiteelement, FlowequationFeHOEnum);711 else if(isFS) iomodel->FindConstant(&finiteelement, FlowequationFeFSEnum);710 else if(isHO) iomodel->FindConstant(&finiteelement,"md.flowequation.fe_HO"); 711 else if(isFS) iomodel->FindConstant(&finiteelement,"md.flowequation.fe_FS"); 712 712 for(int i=0;i<iomodel->numberofelements;i++){ 713 713 finiteelement_list[i]=finiteelement; … … 717 717 if(isFS){ 718 718 for(int i=0;i<iomodel->numberofelements;i++){ 719 approximation=reCast<int>(iomodel->Data( FlowequationElementEquationEnum)[i]);719 approximation=reCast<int>(iomodel->Data("md.flowequation.element_equation")[i]); 720 720 if(approximation==FSApproximationEnum || approximation==HOFSApproximationEnum || approximation==SSAFSApproximationEnum){ 721 721 finiteelement_list[i]=MINIcondensedEnum; … … 745 745 746 746 /*Create inputs: */ 747 iomodel->FetchDataToInput(elements, ThicknessEnum);748 iomodel->FetchDataToInput(elements, SurfaceEnum);749 iomodel->FetchDataToInput(elements, BaseEnum);750 iomodel->FetchDataToInput(elements, SealevelEnum,0);751 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);752 iomodel->FetchDataToInput(elements, MaskGroundediceLevelsetEnum);753 iomodel->FetchDataToInput(elements, VxEnum,0.);754 iomodel->FetchDataToInput(elements, VyEnum,0.);755 iomodel->FetchDataToInput(elements, LoadingforceXEnum);756 iomodel->FetchDataToInput(elements, LoadingforceYEnum);747 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 748 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 749 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 750 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 751 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 752 iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum); 753 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum,0.); 754 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum,0.); 755 iomodel->FetchDataToInput(elements,"md.stressbalance.loadingforcex",LoadingforceXEnum); 756 iomodel->FetchDataToInput(elements,"md.stressbalance.loadingforcey",LoadingforceYEnum); 757 757 #ifdef LATERALFRICTION 758 iomodel->FetchDataToInput(elements, MeshVertexonboundaryEnum);758 iomodel->FetchDataToInput(elements,"md.mesh.vertexonboundary",MeshVertexonboundaryEnum); 759 759 #endif 760 760 761 761 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 762 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);763 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);762 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 763 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 764 764 } 765 765 if(iomodel->domaintype==Domain3DEnum){ 766 iomodel->FetchDataToInput(elements, FlowequationBorderFSEnum);767 iomodel->FetchDataToInput(elements, LoadingforceZEnum);768 iomodel->FetchDataToInput(elements, VzEnum,0.);766 iomodel->FetchDataToInput(elements,"md.flowequation.borderFS",FlowequationBorderFSEnum); 767 iomodel->FetchDataToInput(elements,"md.stressbalance.loadingforcez",LoadingforceZEnum); 768 iomodel->FetchDataToInput(elements,"md.initialization.vz",VzEnum,0.); 769 769 } 770 770 if(isFS){ 771 iomodel->FetchDataToInput(elements, PressureEnum,0.);772 iomodel->FetchDataToInput(elements, BasalforcingsFloatingiceMeltingRateEnum,0.);771 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum,0.); 772 iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum,0.); 773 773 } 774 774 /*LATH parameters*/ 775 iomodel->FindConstant(&fe_FS, FlowequationFeFSEnum);775 iomodel->FindConstant(&fe_FS,"md.flowequation.fe_FS"); 776 776 if(fe_FS==LATaylorHoodEnum || fe_FS==LACrouzeixRaviartEnum){ 777 777 InputUpdateFromConstantx(elements,0.,SigmaNNEnum); … … 781 781 switch(frictionlaw){ 782 782 case 1: 783 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);784 iomodel->FetchDataToInput(elements, FrictionPEnum);785 iomodel->FetchDataToInput(elements, FrictionQEnum);783 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 784 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 785 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 786 786 break; 787 787 case 2: 788 iomodel->FetchDataToInput(elements, FrictionCEnum);789 iomodel->FetchDataToInput(elements, FrictionMEnum);788 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 789 iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum); 790 790 break; 791 791 case 3: 792 iomodel->FindConstant(&FrictionCoupling, FrictionCouplingEnum);793 iomodel->FetchDataToInput(elements, FrictionCEnum);794 iomodel->FetchDataToInput(elements, FrictionAsEnum);795 iomodel->FetchDataToInput(elements, FrictionQEnum);796 if 797 iomodel->FetchDataToInput(elements, FrictionEffectivePressureEnum);792 iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling"); 793 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 794 iomodel->FetchDataToInput(elements,"md.friction.As",FrictionAsEnum); 795 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 796 if(FrictionCoupling==0){ 797 iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum); 798 798 } 799 799 break; 800 800 case 4: 801 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);802 iomodel->FetchDataToInput(elements, FrictionPEnum);803 iomodel->FetchDataToInput(elements, FrictionQEnum);804 iomodel->FetchDataToInput(elements, PressureEnum);805 iomodel->FetchDataToInput(elements, TemperatureEnum);801 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 802 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 803 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 804 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 805 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 806 806 break; 807 807 case 5: 808 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);809 iomodel->FetchDataToInput(elements, FrictionPEnum);810 iomodel->FetchDataToInput(elements, FrictionQEnum);811 iomodel->FetchDataToInput(elements, FrictionWaterLayerEnum);808 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 809 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 810 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 811 iomodel->FetchDataToInput(elements,"md.friction.water_layer",FrictionWaterLayerEnum); 812 812 break; 813 813 case 6: 814 iomodel->FetchDataToInput(elements, FrictionCEnum);815 iomodel->FetchDataToInput(elements, FrictionMEnum);816 iomodel->FetchDataToInput(elements, PressureEnum);817 iomodel->FetchDataToInput(elements, TemperatureEnum);814 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 815 iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum); 816 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 817 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 818 818 break; 819 819 case 7: 820 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);821 iomodel->FetchDataToInput(elements, FrictionCoefficientcoulombEnum);822 iomodel->FetchDataToInput(elements, FrictionPEnum);823 iomodel->FetchDataToInput(elements, FrictionQEnum);820 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 821 iomodel->FetchDataToInput(elements,"md.friction.coefficientcoulomb",FrictionCoefficientcoulombEnum); 822 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 823 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 824 824 break; 825 825 default: … … 832 832 833 833 /*Free data: */ 834 iomodel->DeleteData(1, FlowequationElementEquationEnum);834 iomodel->DeleteData(1,"md.flowequation.element_equation"); 835 835 xDelete<int>(finiteelement_list); 836 836 }/*}}}*/ … … 843 843 int materials_type; 844 844 845 parameters->AddObject(iomodel->CopyConstantObject( FlowequationIsSIAEnum));846 parameters->AddObject(iomodel->CopyConstantObject( FlowequationIsSSAEnum));847 parameters->AddObject(iomodel->CopyConstantObject( FlowequationIsL1L2Enum));848 parameters->AddObject(iomodel->CopyConstantObject( FlowequationIsHOEnum));849 parameters->AddObject(iomodel->CopyConstantObject( FlowequationIsFSEnum));850 parameters->AddObject(iomodel->CopyConstantObject( FlowequationFeFSEnum));851 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceRestolEnum));852 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceReltolEnum));853 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceAbstolEnum));854 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceIsnewtonEnum));855 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceMaxiterEnum));856 parameters->AddObject(iomodel->CopyConstantObject( StressbalancePenaltyFactorEnum));857 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceRiftPenaltyThresholdEnum));858 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceFSreconditioningEnum));859 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceShelfDampeningEnum));860 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceViscosityOvershootEnum));861 parameters->AddObject(iomodel->CopyConstantObject( FrictionLawEnum));845 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isSIA",FlowequationIsSIAEnum)); 846 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isSSA",FlowequationIsSSAEnum)); 847 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isL1L2",FlowequationIsL1L2Enum)); 848 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isHO",FlowequationIsHOEnum)); 849 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isFS",FlowequationIsFSEnum)); 850 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.fe_FS",FlowequationFeFSEnum)); 851 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.restol",StressbalanceRestolEnum)); 852 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.reltol",StressbalanceReltolEnum)); 853 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.abstol",StressbalanceAbstolEnum)); 854 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.isnewton",StressbalanceIsnewtonEnum)); 855 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.maxiter",StressbalanceMaxiterEnum)); 856 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.penalty_factor",StressbalancePenaltyFactorEnum)); 857 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.rift_penalty_threshold",StressbalanceRiftPenaltyThresholdEnum)); 858 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.FSreconditioning",StressbalanceFSreconditioningEnum)); 859 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.shelf_dampening",StressbalanceShelfDampeningEnum)); 860 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.viscosity_overshoot",StressbalanceViscosityOvershootEnum)); 861 parameters->AddObject(iomodel->CopyConstantObject("md.friction.law",FrictionLawEnum)); 862 862 863 863 /*XTH LATH parameters*/ 864 iomodel->FindConstant(&fe_FS, FlowequationFeFSEnum);864 iomodel->FindConstant(&fe_FS,"md.flowequation.fe_FS"); 865 865 if(fe_FS==XTaylorHoodEnum || fe_FS==LATaylorHoodEnum || fe_FS==LACrouzeixRaviartEnum){ 866 parameters->AddObject(iomodel->CopyConstantObject( AugmentedLagrangianREnum));867 parameters->AddObject(iomodel->CopyConstantObject( AugmentedLagrangianRlambdaEnum));868 parameters->AddObject(iomodel->CopyConstantObject( AugmentedLagrangianThetaEnum));869 } 870 871 iomodel->FindConstant(&materials_type, MaterialsEnum);866 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.augmented_lagrangian_r",AugmentedLagrangianREnum)); 867 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.augmented_lagrangian_rlambda",AugmentedLagrangianRlambdaEnum)); 868 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.XTH_theta",AugmentedLagrangianThetaEnum)); 869 } 870 871 iomodel->FindConstant(&materials_type,"md.materials.type"); 872 872 if(materials_type==MatdamageiceEnum){ 873 parameters->AddObject(iomodel->CopyConstantObject( DamageLawEnum));874 parameters->AddObject(iomodel->CopyConstantObject( DamageKappaEnum));875 parameters->AddObject(iomodel->CopyConstantObject( DamageStressThresholdEnum));873 parameters->AddObject(iomodel->CopyConstantObject("md.damage.law",DamageLawEnum)); 874 parameters->AddObject(iomodel->CopyConstantObject("md.damage.kappa",DamageKappaEnum)); 875 parameters->AddObject(iomodel->CopyConstantObject("md.damage.stress_threshold",DamageStressThresholdEnum)); 876 876 } 877 877 878 878 /*Requested outputs*/ 879 iomodel->F etchData(&requestedoutputs,&numoutputs,StressbalanceRequestedOutputsEnum);879 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.stressbalance.requested_outputs"); 880 880 parameters->AddObject(new IntParam(StressbalanceNumRequestedOutputsEnum,numoutputs)); 881 881 if(numoutputs)parameters->AddObject(new StringArrayParam(StressbalanceRequestedOutputsEnum,requestedoutputs,numoutputs)); 882 iomodel->DeleteData(&requestedoutputs,numoutputs, StressbalanceRequestedOutputsEnum);882 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.stressbalance.requested_outputs"); 883 883 884 884 /*Deal with friction parameters*/ 885 885 int frictionlaw; 886 iomodel->FindConstant(&frictionlaw, FrictionLawEnum);887 if(frictionlaw==4 || frictionlaw==6) parameters->AddObject(iomodel->CopyConstantObject( FrictionGammaEnum));888 if(frictionlaw==3) parameters->AddObject(iomodel->CopyConstantObject( FrictionCouplingEnum));889 if(frictionlaw==5) parameters->AddObject(iomodel->CopyConstantObject( FrictionFEnum));886 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 887 if(frictionlaw==4 || frictionlaw==6) parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum)); 888 if(frictionlaw==3) parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum)); 889 if(frictionlaw==5) parameters->AddObject(iomodel->CopyConstantObject("md.friction.f",FrictionFEnum)); 890 890 891 891 }/*}}}*/ -
issm/trunk-jpl/src/c/analyses/StressbalanceSIAAnalysis.cpp
r20669 r20690 13 13 14 14 /*Fetch parameters: */ 15 iomodel->FindConstant(&isSIA, FlowequationIsSIAEnum);16 iomodel->FindConstant(&isSSA, FlowequationIsSSAEnum);17 iomodel->FindConstant(&isL1L2, FlowequationIsL1L2Enum);18 iomodel->FindConstant(&isHO, FlowequationIsHOEnum);19 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);15 iomodel->FindConstant(&isSIA,"md.flowequation.isSIA"); 16 iomodel->FindConstant(&isSSA,"md.flowequation.isSSA"); 17 iomodel->FindConstant(&isL1L2,"md.flowequation.isL1L2"); 18 iomodel->FindConstant(&isHO,"md.flowequation.isHO"); 19 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 20 20 21 21 /*Now, is the flag isSIA on? otherwise, do nothing: */ … … 30 30 /*If no coupling, call Regular IoModelToConstraintsx, else, OLD stuff, keep for now*/ 31 31 if(!iscoupling){ 32 IoModelToConstraintsx(constraints,iomodel, StressbalanceSpcvxEnum,StressbalanceSIAAnalysisEnum,P1Enum,0);33 IoModelToConstraintsx(constraints,iomodel, StressbalanceSpcvyEnum,StressbalanceSIAAnalysisEnum,P1Enum,1);32 IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvx",StressbalanceSIAAnalysisEnum,P1Enum,0); 33 IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvy",StressbalanceSIAAnalysisEnum,P1Enum,1); 34 34 } 35 35 else{ 36 36 /*Fetch data: */ 37 iomodel->FetchData(3, StressbalanceSpcvxEnum,StressbalanceSpcvyEnum,FlowequationVertexEquationEnum);37 iomodel->FetchData(3,"md.stressbalance.spcvx","md.stressbalance.spcvy","md.flowequation.vertex_equation"); 38 38 39 39 /*Initialize conunter*/ … … 44 44 /*keep only this partition's nodes:*/ 45 45 if((iomodel->my_vertices[i])){ 46 if (reCast<int,IssmDouble>(iomodel->Data( FlowequationVertexEquationEnum)[i])!=SIAApproximationEnum){46 if (reCast<int,IssmDouble>(iomodel->Data("md.flowequation.vertex_equation")[i])!=SIAApproximationEnum){ 47 47 48 48 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,0,StressbalanceSIAAnalysisEnum)); … … 53 53 } 54 54 else{ 55 if (!xIsNan<IssmDouble>(iomodel->Data( StressbalanceSpcvxEnum)[i])){56 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,iomodel->Data( StressbalanceSpcvxEnum)[i],StressbalanceSIAAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx.55 if (!xIsNan<IssmDouble>(iomodel->Data("md.stressbalance.spcvx")[i])){ 56 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,iomodel->Data("md.stressbalance.spcvx")[i],StressbalanceSIAAnalysisEnum)); //add count'th spc, on node i+1, setting dof 1 to vx. 57 57 count++; 58 58 } 59 59 60 if (!xIsNan<IssmDouble>(iomodel->Data( StressbalanceSpcvyEnum)[i])){61 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->Data( StressbalanceSpcvyEnum)[i],StressbalanceSIAAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy60 if (!xIsNan<IssmDouble>(iomodel->Data("md.stressbalance.spcvy")[i])){ 61 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,1,iomodel->Data("md.stressbalance.spcvy")[i],StressbalanceSIAAnalysisEnum)); //add count'th spc, on node i+1, setting dof 2 to vy 62 62 count++; 63 63 } … … 68 68 69 69 /*Free data: */ 70 iomodel->DeleteData(3, StressbalanceSpcvxEnum,StressbalanceSpcvyEnum,FlowequationVertexEquationEnum);70 iomodel->DeleteData(3,"md.stressbalance.spcvx","md.stressbalance.spcvy","md.flowequation.vertex_equation"); 71 71 72 72 }/*}}}*/ … … 83 83 84 84 /*Fetch parameters: */ 85 iomodel->FindConstant(&isSIA, FlowequationIsSIAEnum);85 iomodel->FindConstant(&isSIA,"md.flowequation.isSIA"); 86 86 87 87 /*Now, is the flag isSIA on? otherwise, do nothing: */ … … 90 90 /*First create nodes*/ 91 91 int lid=0; 92 iomodel->FetchData(4, FlowequationBorderSSAEnum,FlowequationBorderFSEnum,FlowequationVertexEquationEnum,StressbalanceReferentialEnum);92 iomodel->FetchData(4,"md.flowequation.borderSSA","md.flowequation.borderFS","md.flowequation.vertex_equation","md.stressbalance.referential"); 93 93 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 94 iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);94 iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 95 95 } 96 96 … … 99 99 100 100 /*Create new node if is in this processor's partition*/ 101 node = new Node(iomodel->nodecounter+i+1,i,lid++,i,iomodel,StressbalanceSIAAnalysisEnum,reCast<int>(iomodel->Data( FlowequationVertexEquationEnum)[i]));101 node = new Node(iomodel->nodecounter+i+1,i,lid++,i,iomodel,StressbalanceSIAAnalysisEnum,reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i])); 102 102 103 103 /*Deactivate node if not SIA*/ 104 if(reCast<int>(iomodel->Data( FlowequationVertexEquationEnum)[i])!=SIAApproximationEnum){104 if(reCast<int>(iomodel->Data("md.flowequation.vertex_equation")[i])!=SIAApproximationEnum){ 105 105 node->Deactivate(); 106 106 } … … 111 111 } 112 112 113 iomodel->DeleteData(6,MeshVertexonbaseEnum,MeshVertexonsurfaceEnum,FlowequationBorderSSAEnum,FlowequationBorderFSEnum, 114 FlowequationVertexEquationEnum,StressbalanceReferentialEnum); 113 iomodel->DeleteData(6,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.borderSSA","md.flowequation.borderFS","md.flowequation.vertex_equation","md.stressbalance.referential"); 115 114 116 115 }/*}}}*/ … … 124 123 bool ismovingfront; 125 124 int frictionlaw; 126 iomodel->FindConstant(&isSIA, FlowequationIsSIAEnum);127 iomodel->FindConstant(&ismovingfront, TransientIsmovingfrontEnum);128 iomodel->FindConstant(&frictionlaw, FrictionLawEnum);125 iomodel->FindConstant(&isSIA,"md.flowequation.isSIA"); 126 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 127 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 129 128 130 129 /*Now, is the flag SIA on? otherwise, do nothing: */ 131 130 if (!isSIA)return; 132 131 133 iomodel->FetchData(1, FlowequationElementEquationEnum);132 iomodel->FetchData(1,"md.flowequation.element_equation"); 134 133 135 134 /*Update elements: */ … … 146 145 switch(frictionlaw){ 147 146 case 1: 148 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);149 iomodel->FetchDataToInput(elements, FrictionPEnum);150 iomodel->FetchDataToInput(elements, FrictionQEnum);147 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 148 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 149 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 151 150 break; 152 151 case 2: 153 iomodel->FetchDataToInput(elements, FrictionCEnum);154 iomodel->FetchDataToInput(elements, FrictionMEnum);152 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 153 iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum); 155 154 break; 156 155 case 6: 157 iomodel->FetchDataToInput(elements, FrictionCEnum);158 iomodel->FetchDataToInput(elements, FrictionMEnum);159 iomodel->FetchDataToInput(elements, PressureEnum);160 iomodel->FetchDataToInput(elements, TemperatureEnum);156 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 157 iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum); 158 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 159 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 161 160 break; 162 161 default: … … 164 163 } 165 164 166 iomodel->FetchDataToInput(elements, ThicknessEnum);167 iomodel->FetchDataToInput(elements, MaskGroundediceLevelsetEnum);165 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 166 iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum); 168 167 if(ismovingfront){ 169 168 if(iomodel->domaintype!=Domain2DhorizontalEnum) 170 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum); // required for updating active nodes169 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); // required for updating active nodes 171 170 } 172 171 173 172 /*Free data: */ 174 iomodel->DeleteData(1, FlowequationElementEquationEnum);173 iomodel->DeleteData(1,"md.flowequation.element_equation"); 175 174 }/*}}}*/ 176 175 void StressbalanceSIAAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ -
issm/trunk-jpl/src/c/analyses/StressbalanceVerticalAnalysis.cpp
r20669 r20690 18 18 19 19 /*Fetch parameters: */ 20 iomodel->FindConstant(&isSIA, FlowequationIsSIAEnum);21 iomodel->FindConstant(&isSSA, FlowequationIsSSAEnum);22 iomodel->FindConstant(&isL1L2, FlowequationIsL1L2Enum);23 iomodel->FindConstant(&isHO, FlowequationIsHOEnum);24 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);20 iomodel->FindConstant(&isSIA,"md.flowequation.isSIA"); 21 iomodel->FindConstant(&isSSA,"md.flowequation.isSSA"); 22 iomodel->FindConstant(&isL1L2,"md.flowequation.isL1L2"); 23 iomodel->FindConstant(&isHO,"md.flowequation.isHO"); 24 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 25 25 26 26 /*Do we have coupling*/ … … 33 33 /*If no coupling, call Regular IoModelToConstraintsx, else, use P1 elements only*/ 34 34 if(!iscoupling){ 35 IoModelToConstraintsx(constraints,iomodel, StressbalanceSpcvzEnum,StressbalanceVerticalAnalysisEnum,P1Enum,0);35 IoModelToConstraintsx(constraints,iomodel,"md.stressbalance.spcvz",StressbalanceVerticalAnalysisEnum,P1Enum,0); 36 36 } 37 37 else{ 38 38 /*Fetch data: */ 39 iomodel->FetchData(1, FlowequationBorderFSEnum);39 iomodel->FetchData(1,"md.flowequation.borderFS"); 40 40 /*Fetch Spc*/ 41 iomodel->FetchData(&spcvz,&Mz,&Nz, StressbalanceSpcvzEnum);41 iomodel->FetchData(&spcvz,&Mz,&Nz,"md.stressbalance.spcvz"); 42 42 if(Nz>1) _error_("not supported yet (needs to be coded)"); 43 43 … … 51 51 if(iomodel->my_vertices[i]){ 52 52 53 if (reCast<int,IssmDouble>(iomodel->Data( FlowequationBorderFSEnum)[i])){53 if (reCast<int,IssmDouble>(iomodel->Data("md.flowequation.borderFS")[i])){ 54 54 constraints->AddObject(new SpcStatic(iomodel->constraintcounter+count+1,iomodel->nodecounter+i+1,0,0,StressbalanceVerticalAnalysisEnum)); //spc to zero as vertical velocity is done in Horiz for FS 55 55 count++; … … 65 65 66 66 /*Free data: */ 67 iomodel->DeleteData(1, FlowequationBorderFSEnum);68 iomodel->DeleteData(spcvz, StressbalanceSpcvzEnum);67 iomodel->DeleteData(1,"md.flowequation.borderFS"); 68 iomodel->DeleteData(spcvz,"md.stressbalance.spcvz"); 69 69 } 70 70 … … 80 80 if(iomodel->domaintype!=Domain3DEnum) return; 81 81 82 iomodel->FetchData(3, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum,FlowequationVertexEquationEnum);82 iomodel->FetchData(3,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.vertex_equation"); 83 83 ::CreateNodes(nodes,iomodel,StressbalanceVerticalAnalysisEnum,P1Enum); 84 iomodel->DeleteData(3, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum,FlowequationVertexEquationEnum);84 iomodel->DeleteData(3,"md.mesh.vertexonbase","md.mesh.vertexonsurface","md.flowequation.vertex_equation"); 85 85 }/*}}}*/ 86 86 int StressbalanceVerticalAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 102 102 } 103 103 104 iomodel->FetchDataToInput(elements, ThicknessEnum);105 iomodel->FetchDataToInput(elements, SurfaceEnum);106 iomodel->FetchDataToInput(elements, BaseEnum);107 iomodel->FetchDataToInput(elements, SealevelEnum,0);108 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);104 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 105 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 106 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 107 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 108 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 109 109 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 110 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);111 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);112 } 113 iomodel->FetchDataToInput(elements, BasalforcingsGroundediceMeltingRateEnum);114 iomodel->FetchDataToInput(elements, BasalforcingsFloatingiceMeltingRateEnum);115 //iomodel->FetchDataToInput(elements, SmbMassBalanceEnum);116 iomodel->FetchDataToInput(elements, VxEnum,0.);117 iomodel->FetchDataToInput(elements, VyEnum,0.);110 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 111 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 112 } 113 iomodel->FetchDataToInput(elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum); 114 iomodel->FetchDataToInput(elements,"md.basalforcings.floatingice_melting_rate",BasalforcingsFloatingiceMeltingRateEnum); 115 //iomodel->FetchDataToInput(elements,"md.smb.mass_balance",SmbMassBalanceEnum); 116 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum,0.); 117 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum,0.); 118 118 }/*}}}*/ 119 119 void StressbalanceVerticalAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ -
issm/trunk-jpl/src/c/analyses/ThermalAnalysis.cpp
r20669 r20690 24 24 else if (iomodel->solution_enum==TransientSolutionEnum){ 25 25 int smb_model; 26 iomodel->FindConstant(&smb_model, SmbEnum);26 iomodel->FindConstant(&smb_model,"md.smb.model"); 27 27 if(smb_model==SMBpddEnum) isdynamic=true; 28 28 if(smb_model==SMBd18opddEnum) isdynamic=true; … … 33 33 34 34 if(isdynamic){ 35 IoModelToDynamicConstraintsx(constraints,iomodel, ThermalSpctemperatureEnum,ThermalAnalysisEnum,finiteelement);35 IoModelToDynamicConstraintsx(constraints,iomodel,"md.thermal.spctemperature",ThermalAnalysisEnum,finiteelement); 36 36 } 37 37 else{ 38 IoModelToConstraintsx(constraints,iomodel, ThermalSpctemperatureEnum,ThermalAnalysisEnum,finiteelement);38 IoModelToConstraintsx(constraints,iomodel,"md.thermal.spctemperature",ThermalAnalysisEnum,finiteelement); 39 39 } 40 40 … … 45 45 46 46 /*create penalties for nodes: no node can have a temperature over the melting point*/ 47 iomodel->FetchData(1, ThermalSpctemperatureEnum);47 iomodel->FetchData(1,"md.thermal.spctemperature"); 48 48 CreateSingleNodeToElementConnectivity(iomodel); 49 49 … … 52 52 /*keep only this partition's nodes:*/ 53 53 if(iomodel->my_vertices[i]){ 54 if (xIsNan<IssmDouble>(iomodel->Data( ThermalSpctemperatureEnum)[i])){ //No penalty applied on spc nodes!54 if (xIsNan<IssmDouble>(iomodel->Data("md.thermal.spctemperature")[i])){ //No penalty applied on spc nodes! 55 55 loads->AddObject(new Pengrid(iomodel->loadcounter+i+1,i,iomodel,ThermalAnalysisEnum)); 56 56 } 57 57 } 58 58 } 59 iomodel->DeleteData(1, ThermalSpctemperatureEnum);59 iomodel->DeleteData(1,"md.thermal.spctemperature"); 60 60 61 61 }/*}}}*/ … … 64 64 int finiteelement = P1Enum; 65 65 66 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);66 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 67 67 ::CreateNodes(nodes,iomodel,ThermalAnalysisEnum,finiteelement); 68 iomodel->DeleteData(2, MeshVertexonbaseEnum,MeshVertexonsurfaceEnum);68 iomodel->DeleteData(2,"md.mesh.vertexonbase","md.mesh.vertexonsurface"); 69 69 }/*}}}*/ 70 70 int ThermalAnalysis::DofsPerNode(int** doflist,int domaintype,int approximation){/*{{{*/ … … 90 90 91 91 bool dakota_analysis, ismovingfront; 92 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);93 iomodel->FindConstant(&ismovingfront, TransientIsmovingfrontEnum);94 iomodel->FindConstant(&frictionlaw, FrictionLawEnum);95 96 iomodel->FetchDataToInput(elements, ThicknessEnum);97 iomodel->FetchDataToInput(elements, SurfaceEnum);98 iomodel->FetchDataToInput(elements, BaseEnum);99 iomodel->FetchDataToInput(elements, SealevelEnum,0);100 iomodel->FetchDataToInput(elements, MaskIceLevelsetEnum);101 iomodel->FetchDataToInput(elements, MaskGroundediceLevelsetEnum);92 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 93 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 94 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 95 96 iomodel->FetchDataToInput(elements,"md.geometry.thickness",ThicknessEnum); 97 iomodel->FetchDataToInput(elements,"md.geometry.surface",SurfaceEnum); 98 iomodel->FetchDataToInput(elements,"md.geometry.base",BaseEnum); 99 iomodel->FetchDataToInput(elements,"md.slr.sealevel",SealevelEnum,0); 100 iomodel->FetchDataToInput(elements,"md.mask.ice_levelset",MaskIceLevelsetEnum); 101 iomodel->FetchDataToInput(elements,"md.mask.groundedice_levelset",MaskGroundediceLevelsetEnum); 102 102 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 103 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);104 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);105 } 106 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum);107 iomodel->FetchDataToInput(elements, MeshVertexonsurfaceEnum);108 iomodel->FetchDataToInput(elements, MaterialsRheologyBEnum);109 iomodel->FetchDataToInput(elements, MaterialsRheologyNEnum);110 iomodel->FetchDataToInput(elements, PressureEnum);111 iomodel->FetchDataToInput(elements, TemperatureEnum);112 iomodel->FetchDataToInput(elements, VxEnum);113 iomodel->FetchDataToInput(elements, VyEnum);114 iomodel->FetchDataToInput(elements, VzEnum);103 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 104 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 105 } 106 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); 107 iomodel->FetchDataToInput(elements,"md.mesh.vertexonsurface",MeshVertexonsurfaceEnum); 108 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum); 109 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 110 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 111 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 112 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum); 113 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum); 114 iomodel->FetchDataToInput(elements,"md.initialization.vz",VzEnum); 115 115 InputUpdateFromConstantx(elements,0.,VxMeshEnum); 116 116 InputUpdateFromConstantx(elements,0.,VyMeshEnum); 117 117 InputUpdateFromConstantx(elements,0.,VzMeshEnum); 118 118 if(ismovingfront){ 119 iomodel->FetchDataToInput(elements, MeshVertexonbaseEnum); // required for updating active nodes119 iomodel->FetchDataToInput(elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum); // required for updating active nodes 120 120 } 121 121 /*Basal forcings variables*/ 122 iomodel->FindConstant(&basalforcing_model, BasalforcingsEnum);122 iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model"); 123 123 switch(basalforcing_model){ 124 124 case MantlePlumeGeothermalFluxEnum: 125 125 break; 126 126 default: 127 iomodel->FetchDataToInput(elements, BasalforcingsGeothermalfluxEnum);127 iomodel->FetchDataToInput(elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum); 128 128 break; 129 129 } … … 131 131 switch(frictionlaw){ 132 132 case 1: 133 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);134 iomodel->FetchDataToInput(elements, FrictionPEnum);135 iomodel->FetchDataToInput(elements, FrictionQEnum);133 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 134 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 135 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 136 136 break; 137 137 case 2: 138 iomodel->FetchDataToInput(elements, FrictionCEnum);139 iomodel->FetchDataToInput(elements, FrictionMEnum);138 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 139 iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum); 140 140 break; 141 141 case 3: 142 iomodel->FindConstant(&FrictionCoupling, FrictionCouplingEnum);143 iomodel->FetchDataToInput(elements, FrictionCEnum);144 iomodel->FetchDataToInput(elements, FrictionAsEnum);145 iomodel->FetchDataToInput(elements, FrictionQEnum);142 iomodel->FindConstant(&FrictionCoupling,"md.friction.coupling"); 143 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 144 iomodel->FetchDataToInput(elements,"md.friction.As",FrictionAsEnum); 145 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 146 146 if (FrictionCoupling==0){ 147 iomodel->FetchDataToInput(elements, FrictionEffectivePressureEnum);147 iomodel->FetchDataToInput(elements,"md.friction.effective_pressure",FrictionEffectivePressureEnum); 148 148 } 149 149 break; 150 150 case 4: 151 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);152 iomodel->FetchDataToInput(elements, FrictionPEnum);153 iomodel->FetchDataToInput(elements, FrictionQEnum);154 iomodel->FetchDataToInput(elements, PressureEnum);155 iomodel->FetchDataToInput(elements, TemperatureEnum);151 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 152 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 153 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 154 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 155 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 156 156 break; 157 157 case 5: 158 iomodel->FetchDataToInput(elements, FrictionCoefficientEnum);159 iomodel->FetchDataToInput(elements, FrictionPEnum);160 iomodel->FetchDataToInput(elements, FrictionQEnum);161 iomodel->FetchDataToInput(elements, FrictionWaterLayerEnum);158 iomodel->FetchDataToInput(elements,"md.friction.coefficient",FrictionCoefficientEnum); 159 iomodel->FetchDataToInput(elements,"md.friction.p",FrictionPEnum); 160 iomodel->FetchDataToInput(elements,"md.friction.q",FrictionQEnum); 161 iomodel->FetchDataToInput(elements,"md.friction.water_layer",FrictionWaterLayerEnum); 162 162 break; 163 163 case 6: 164 iomodel->FetchDataToInput(elements, FrictionCEnum);165 iomodel->FetchDataToInput(elements, FrictionMEnum);166 iomodel->FetchDataToInput(elements, PressureEnum);167 iomodel->FetchDataToInput(elements, TemperatureEnum);164 iomodel->FetchDataToInput(elements,"md.friction.C",FrictionCEnum); 165 iomodel->FetchDataToInput(elements,"md.friction.m",FrictionMEnum); 166 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum); 167 iomodel->FetchDataToInput(elements,"md.initialization.temperature",TemperatureEnum); 168 168 break; 169 169 default: … … 176 176 char** requestedoutputs = NULL; 177 177 178 parameters->AddObject(iomodel->CopyConstantObject( ThermalMaxiterEnum));179 parameters->AddObject(iomodel->CopyConstantObject( ThermalStabilizationEnum));180 parameters->AddObject(iomodel->CopyConstantObject( ThermalPenaltyFactorEnum));181 parameters->AddObject(iomodel->CopyConstantObject( ThermalPenaltyThresholdEnum));182 parameters->AddObject(iomodel->CopyConstantObject( ThermalPenaltyLockEnum));183 parameters->AddObject(iomodel->CopyConstantObject( ThermalIsenthalpyEnum));184 parameters->AddObject(iomodel->CopyConstantObject( ThermalIsdynamicbasalspcEnum));185 parameters->AddObject(iomodel->CopyConstantObject( FrictionLawEnum));186 187 iomodel->F etchData(&requestedoutputs,&numoutputs,ThermalRequestedOutputsEnum);178 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.maxiter",ThermalMaxiterEnum)); 179 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.stabilization",ThermalStabilizationEnum)); 180 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.penalty_factor",ThermalPenaltyFactorEnum)); 181 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.penalty_threshold",ThermalPenaltyThresholdEnum)); 182 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.penalty_lock",ThermalPenaltyLockEnum)); 183 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isenthalpy",ThermalIsenthalpyEnum)); 184 parameters->AddObject(iomodel->CopyConstantObject("md.thermal.isdynamicbasalspc",ThermalIsdynamicbasalspcEnum)); 185 parameters->AddObject(iomodel->CopyConstantObject("md.friction.law",FrictionLawEnum)); 186 187 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.thermal.requested_outputs"); 188 188 parameters->AddObject(new IntParam(ThermalNumRequestedOutputsEnum,numoutputs)); 189 189 if(numoutputs)parameters->AddObject(new StringArrayParam(ThermalRequestedOutputsEnum,requestedoutputs,numoutputs)); 190 iomodel->DeleteData(&requestedoutputs,numoutputs, ThermalRequestedOutputsEnum);190 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.thermal.requested_outputs"); 191 191 192 192 /*Deal with friction parameters*/ 193 193 int frictionlaw; 194 iomodel->FindConstant(&frictionlaw, FrictionLawEnum);195 if(frictionlaw==4 || frictionlaw==6) parameters->AddObject(iomodel->CopyConstantObject( FrictionGammaEnum));196 if(frictionlaw==3) parameters->AddObject(iomodel->CopyConstantObject( FrictionCouplingEnum));194 iomodel->FindConstant(&frictionlaw,"md.friction.law"); 195 if(frictionlaw==4 || frictionlaw==6) parameters->AddObject(iomodel->CopyConstantObject("md.friction.gamma",FrictionGammaEnum)); 196 if(frictionlaw==3) parameters->AddObject(iomodel->CopyConstantObject("md.friction.coupling",FrictionCouplingEnum)); 197 197 }/*}}}*/ 198 198 -
issm/trunk-jpl/src/c/analyses/UzawaPressureAnalysis.cpp
r20645 r20690 17 17 int fe_FS; 18 18 19 iomodel->FindConstant(&fe_FS, FlowequationFeFSEnum);19 iomodel->FindConstant(&fe_FS,"md.flowequation.fe_FS"); 20 20 if(fe_FS==LATaylorHoodEnum) finiteelement = P1Enum; 21 21 else if(fe_FS==LACrouzeixRaviartEnum) finiteelement = P1DGEnum; … … 34 34 int fe_FS; 35 35 36 iomodel->FindConstant(&fe_FS, FlowequationFeFSEnum);36 iomodel->FindConstant(&fe_FS,"md.flowequation.fe_FS"); 37 37 if(fe_FS==LATaylorHoodEnum) finiteelement = P1Enum; 38 38 else if(fe_FS==LACrouzeixRaviartEnum) finiteelement = P1DGEnum; … … 47 47 } 48 48 49 iomodel->FetchDataToInput(elements, VxEnum,0.);50 iomodel->FetchDataToInput(elements, VyEnum,0.);51 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchDataToInput(elements, VzEnum,0.);52 iomodel->FetchDataToInput(elements, PressureEnum,0.);49 iomodel->FetchDataToInput(elements,"md.initialization.vx",VxEnum,0.); 50 iomodel->FetchDataToInput(elements,"md.initialization.vy",VyEnum,0.); 51 if(iomodel->domaintype==Domain3DEnum) iomodel->FetchDataToInput(elements,"md.initialization.vz",VzEnum,0.); 52 iomodel->FetchDataToInput(elements,"md.initialization.pressure",PressureEnum,0.); 53 53 InputUpdateFromConstantx(elements,0.,SigmaNNEnum); 54 54 }/*}}}*/ 55 55 void UzawaPressureAnalysis::UpdateParameters(Parameters* parameters,IoModel* iomodel,int solution_enum,int analysis_enum){/*{{{*/ 56 56 57 parameters->AddObject(iomodel->CopyConstantObject( AugmentedLagrangianRhopEnum));58 parameters->AddObject(iomodel->CopyConstantObject( AugmentedLagrangianRholambdaEnum));57 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.augmented_lagrangian_rhop",AugmentedLagrangianRhopEnum)); 58 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.augmented_lagrangian_rholambda",AugmentedLagrangianRholambdaEnum)); 59 59 }/*}}}*/ 60 60 -
issm/trunk-jpl/src/c/classes/Elements/Penta.cpp
r20687 r20690 30 30 31 31 /*Checks in debugging mode*/ 32 _assert_(iomodel->Data( MeshUpperelementsEnum));33 _assert_(iomodel->Data( MeshLowerelementsEnum));32 _assert_(iomodel->Data("md.mesh.upperelements")); 33 _assert_(iomodel->Data("md.mesh.lowerelements")); 34 34 35 35 /*id: */ … … 38 38 39 39 /*Build neighbors list*/ 40 if (xIsNan<IssmDouble>(iomodel->Data( MeshUpperelementsEnum)[index]) || iomodel->Data(MeshUpperelementsEnum)[index]==-1.) penta_elements_ids[1]=this->id; //upper penta is the same penta41 else penta_elements_ids[1]=reCast<int,IssmDouble>((iomodel->Data( MeshUpperelementsEnum)[index]));42 if (xIsNan<IssmDouble>(iomodel->Data( MeshLowerelementsEnum)[index]) || iomodel->Data(MeshLowerelementsEnum)[index]==-1.) penta_elements_ids[0]=this->id; //lower penta is the same penta43 else penta_elements_ids[0]=reCast<int,IssmDouble>((iomodel->Data( MeshLowerelementsEnum)[index]));40 if (xIsNan<IssmDouble>(iomodel->Data("md.mesh.upperelements")[index]) || iomodel->Data("md.mesh.upperelements")[index]==-1.) penta_elements_ids[1]=this->id; //upper penta is the same penta 41 else penta_elements_ids[1]=reCast<int,IssmDouble>((iomodel->Data("md.mesh.upperelements")[index])); 42 if (xIsNan<IssmDouble>(iomodel->Data("md.mesh.lowerelements")[index]) || iomodel->Data("md.mesh.lowerelements")[index]==-1.) penta_elements_ids[0]=this->id; //lower penta is the same penta 43 else penta_elements_ids[0]=reCast<int,IssmDouble>((iomodel->Data("md.mesh.lowerelements")[index])); 44 44 this->InitHookNeighbors(penta_elements_ids); 45 45 … … 1403 1403 IssmDouble yts; 1404 1404 bool control_analysis; 1405 char** controls = NULL; 1405 1406 int num_control_type,num_responses; 1406 1407 1407 1408 /*Fetch parameters: */ 1408 iomodel->FindConstant(&yts, ConstantsYtsEnum);1409 iomodel->FindConstant(&control_analysis, InversionIscontrolEnum);1410 if(control_analysis) iomodel->FindConstant(&num_control_type, InversionNumControlParametersEnum);1411 if(control_analysis) iomodel->FindConstant(&num_responses, InversionNumCostFunctionsEnum);1409 iomodel->FindConstant(&yts,"md.constants.yts"); 1410 iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol"); 1411 if(control_analysis) iomodel->FindConstant(&num_control_type,"md.inversion.num_control_parameters"); 1412 if(control_analysis) iomodel->FindConstant(&num_responses,"md.inversion.num_cost_functions"); 1412 1413 1413 1414 /*Recover vertices ids needed to initialize inputs*/ … … 1418 1419 1419 1420 /*Control Inputs*/ 1420 if (control_analysis && iomodel->Data(InversionControlParametersEnum)){ 1421 if (control_analysis){ 1422 iomodel->FindConstant(&controls,NULL,"md.inversion.control_parameters"); 1421 1423 for(i=0;i<num_control_type;i++){ 1422 int control = reCast<int>(iomodel->Data(InversionControlParametersEnum)[i]); 1424 _assert_(controls[i]); 1425 int control = StringToEnumx(controls[i]); 1423 1426 switch(control){ 1424 /*yts conversion*/1425 1427 case BalancethicknessThickeningRateEnum: 1426 case VxEnum: 1427 case VyEnum: 1428 if(iomodel->Data(control)){ 1429 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data(control)[penta_vertex_ids[j]-1]; 1430 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 1431 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 1432 this->inputs->AddInput(new ControlInput(control,PentaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1428 if (iomodel->Data("md.balancethickness.thickening_rate")){ 1429 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.balancethickness.thickening_rate")[penta_vertex_ids[j]-1]; 1430 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 1431 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 1432 this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,PentaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1433 1433 } 1434 1434 break; 1435 1436 /*No yts conversion*/ 1437 case ThicknessEnum: 1438 case FrictionCoefficientEnum: 1439 case FrictionAsEnum: 1440 case MaterialsRheologyBEnum: 1441 if(iomodel->Data(control)){ 1442 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data(control)[penta_vertex_ids[j]-1]; 1443 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]; 1444 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i]; 1445 this->inputs->AddInput(new ControlInput(control,PentaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1435 case VxEnum: 1436 if (iomodel->Data("md.initialization.vx")){ 1437 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.initialization.vx")[penta_vertex_ids[j]-1]; 1438 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 1439 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 1440 this->inputs->AddInput(new ControlInput(VxEnum,PentaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1446 1441 } 1447 1442 break; 1448 1449 /*Special cases (depth averaged quantities)*/ 1443 case VyEnum: 1444 if (iomodel->Data("md.initialization.vy")){ 1445 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.initialization.vy")[penta_vertex_ids[j]-1]; 1446 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 1447 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]/yts; 1448 this->inputs->AddInput(new ControlInput(VyEnum,PentaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1449 } 1450 break; 1451 case FrictionCoefficientEnum: 1452 if (iomodel->Data("md.friction.coefficient")){ 1453 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.friction.coefficient")[penta_vertex_ids[j]-1]; 1454 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]; 1455 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]; 1456 this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,PentaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1457 } 1458 break; 1450 1459 case MaterialsRheologyBbarEnum: 1451 if(iomodel->Data( MaterialsRheologyBEnum)){1452 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data( MaterialsRheologyBEnum)[penta_vertex_ids[j]-1];1453 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];1454 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];1460 if(iomodel->Data("md.materials.rheology_B")){ 1461 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data("md.materials.rheology_B")[penta_vertex_ids[j]-1]; 1462 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]; 1463 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]; 1455 1464 this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,PentaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1456 1465 } 1457 1466 break; 1458 1467 case DamageDbarEnum: 1459 if(iomodel->Data( DamageDEnum)){1460 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data( DamageDEnum)[penta_vertex_ids[j]-1];1461 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];1462 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(penta_vertex_ids[j]-1)*num_control_type+i];1468 if(iomodel->Data("md.damage.D")){ 1469 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data("md.damage.D")[penta_vertex_ids[j]-1]; 1470 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]; 1471 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(penta_vertex_ids[j]-1)*num_control_type+i]; 1463 1472 this->inputs->AddInput(new ControlInput(DamageDEnum,PentaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1464 1473 } … … 1468 1477 } 1469 1478 } 1479 for(i=0;i<num_control_type;i++) xDelete<char>(controls[i]); 1480 xDelete<char*>(controls); 1470 1481 } 1471 1482 1472 1483 /*Need to know the type of approximation for this element*/ 1473 if(iomodel->Data( FlowequationElementEquationEnum)){1474 this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<int>(iomodel->Data( FlowequationElementEquationEnum)[index])));1484 if(iomodel->Data("md.flowequation.element_equation")){ 1485 this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<int>(iomodel->Data("md.flowequation.element_equation")[index]))); 1475 1486 } 1476 1487 1477 1488 /*DatasetInputs*/ 1478 if (control_analysis && iomodel->Data(InversionCostFunctionsCoefficientsEnum)) {1489 if(control_analysis && iomodel->Data("md.inversion.cost_functions_coefficients")) { 1479 1490 1480 1491 /*Create inputs and add to DataSetInput*/ 1481 1492 DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum); 1482 1493 for(i=0;i<num_responses;i++){ 1483 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data( InversionCostFunctionsCoefficientsEnum)[(penta_vertex_ids[j]-1)*num_responses+i];1484 datasetinput->AddInput(new PentaInput(InversionCostFunctionsCoefficientsEnum,nodeinputs,P1Enum),reCast<int>(iomodel->Data( InversionCostFunctionsEnum)[i]));1494 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.inversion.cost_functions_coefficients")[(penta_vertex_ids[j]-1)*num_responses+i]; 1495 datasetinput->AddInput(new PentaInput(InversionCostFunctionsCoefficientsEnum,nodeinputs,P1Enum),reCast<int>(iomodel->Data("md.inversion.cost_functions")[i])); 1485 1496 } 1486 1497 … … 2710 2721 2711 2722 /*Fetch parameters: */ 2712 iomodel->FindConstant(&yts, ConstantsYtsEnum);2713 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);2723 iomodel->FindConstant(&yts,"md.constants.yts"); 2724 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 2714 2725 2715 2726 /*Checks if debuging*/ … … 3064 3075 3065 3076 case StressbalanceAnalysisEnum: 3066 _assert_(iomodel->Data( FlowequationElementEquationEnum));3067 3068 if(*(iomodel->Data( FlowequationElementEquationEnum)+index)==HOFSApproximationEnum){3077 _assert_(iomodel->Data("md.flowequation.element_equation")); 3078 3079 if(*(iomodel->Data("md.flowequation.element_equation")+index)==HOFSApproximationEnum){ 3069 3080 /*Create VzHO and VzFS Enums*/ 3070 if(iomodel->Data( VzEnum) && iomodel->Data(FlowequationBorderFSEnum)){3071 for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data( VzEnum)[penta_vertex_ids[i]-1]*iomodel->Data(FlowequationBorderFSEnum)[penta_vertex_ids[i]-1];3081 if(iomodel->Data("md.initialization.vz") && iomodel->Data("md.flowequation.borderFS")){ 3082 for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data("md.initialization.vz")[penta_vertex_ids[i]-1]*iomodel->Data("md.flowequation.borderFS")[penta_vertex_ids[i]-1]; 3072 3083 this->inputs->AddInput(new PentaInput(VzFSEnum,nodeinputs,P1Enum)); 3073 for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data( VzEnum)[penta_vertex_ids[i]-1]*(1-iomodel->Data(FlowequationBorderFSEnum)[penta_vertex_ids[i]-1]);3084 for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data("md.initialization.vz")[penta_vertex_ids[i]-1]*(1-iomodel->Data("md.flowequation.borderFS")[penta_vertex_ids[i]-1]); 3074 3085 this->inputs->AddInput(new PentaInput(VzHOEnum,nodeinputs,P1Enum)); 3075 3086 } … … 3080 3091 } 3081 3092 } 3082 if(*(iomodel->Data( FlowequationElementEquationEnum)+index)==SSAFSApproximationEnum){3093 if(*(iomodel->Data("md.flowequation.element_equation")+index)==SSAFSApproximationEnum){ 3083 3094 /*Create VzSSA and VzFS Enums*/ 3084 if(iomodel->Data( VzEnum) && iomodel->Data(FlowequationBorderFSEnum)){3085 for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data( VzEnum)[penta_vertex_ids[i]-1]*iomodel->Data(FlowequationBorderFSEnum)[penta_vertex_ids[i]-1];3095 if(iomodel->Data("md.initialization.vz") && iomodel->Data("md.flowequation.borderFS")){ 3096 for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data("md.initialization.vz")[penta_vertex_ids[i]-1]*iomodel->Data("md.flowequation.borderFS")[penta_vertex_ids[i]-1]; 3086 3097 this->inputs->AddInput(new PentaInput(VzFSEnum,nodeinputs,P1Enum)); 3087 for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data( VzEnum)[penta_vertex_ids[i]-1]*(1-iomodel->Data(FlowequationBorderFSEnum)[penta_vertex_ids[i]-1]);3098 for(i=0;i<6;i++) nodeinputs[i]=iomodel->Data("md.initialization.vz")[penta_vertex_ids[i]-1]*(1-iomodel->Data("md.flowequation.borderFS")[penta_vertex_ids[i]-1]); 3088 3099 this->inputs->AddInput(new PentaInput(VzSSAEnum,nodeinputs,P1Enum)); 3089 3100 } -
issm/trunk-jpl/src/c/classes/Elements/Tetra.cpp
r20669 r20690 367 367 IssmDouble yts; 368 368 bool control_analysis; 369 char** controls = NULL; 369 370 int num_control_type,num_responses; 370 371 371 372 /*Fetch parameters: */ 372 iomodel->FindConstant(&yts, ConstantsYtsEnum);373 iomodel->FindConstant(&control_analysis, InversionIscontrolEnum);374 if(control_analysis) iomodel->FindConstant(&num_control_type, InversionNumControlParametersEnum);375 if(control_analysis) iomodel->FindConstant(&num_responses, InversionNumCostFunctionsEnum);373 iomodel->FindConstant(&yts,"md.constants.yts"); 374 iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol"); 375 if(control_analysis) iomodel->FindConstant(&num_control_type,"md.inversion.num_control_parameters"); 376 if(control_analysis) iomodel->FindConstant(&num_responses,"md.inversion.num_cost_functions"); 376 377 377 378 /*Recover vertices ids needed to initialize inputs*/ … … 382 383 383 384 /*Control Inputs*/ 384 if (control_analysis && iomodel->Data(InversionControlParametersEnum)){ 385 if (control_analysis){ 386 iomodel->FindConstant(&controls,NULL,"md.inversion.control_parameters"); 385 387 for(i=0;i<num_control_type;i++){ 386 switch(reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])){ 388 _assert_(controls[i]); 389 int control = StringToEnumx(controls[i]); 390 switch(control){ 387 391 case BalancethicknessThickeningRateEnum: 388 if (iomodel->Data( BalancethicknessThickeningRateEnum)){389 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data( BalancethicknessThickeningRateEnum)[tetra_vertex_ids[j]-1]/yts;390 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts;391 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts;392 if (iomodel->Data("md.balancethickness.thickening_rate")){ 393 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.balancethickness.thickening_rate")[tetra_vertex_ids[j]-1]; 394 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts; 395 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts; 392 396 this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,TetraInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 393 397 } 394 398 break; 395 399 case VxEnum: 396 if (iomodel->Data( VxEnum)){397 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data( VxEnum)[tetra_vertex_ids[j]-1]/yts;398 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts;399 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts;400 if (iomodel->Data("md.initialization.vx")){ 401 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.initialization.vx")[tetra_vertex_ids[j]-1]; 402 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts; 403 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts; 400 404 this->inputs->AddInput(new ControlInput(VxEnum,TetraInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 401 405 } 402 406 break; 403 407 case VyEnum: 404 if (iomodel->Data( VyEnum)){405 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data( VyEnum)[tetra_vertex_ids[j]-1]/yts;406 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts;407 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts;408 if (iomodel->Data("md.initialization.vy")){ 409 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.initialization.vy")[tetra_vertex_ids[j]-1]; 410 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts; 411 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]/yts; 408 412 this->inputs->AddInput(new ControlInput(VyEnum,TetraInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 409 413 } 410 414 break; 411 415 case FrictionCoefficientEnum: 412 if (iomodel->Data( FrictionCoefficientEnum)){413 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data( FrictionCoefficientEnum)[tetra_vertex_ids[j]-1];414 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i];415 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i];416 if (iomodel->Data("md.friction.coefficient")){ 417 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.friction.coefficient")[tetra_vertex_ids[j]-1]; 418 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]; 419 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]; 416 420 this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,TetraInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 417 421 } 418 422 break; 419 423 case MaterialsRheologyBbarEnum: 420 if(iomodel->Data( MaterialsRheologyBEnum)){421 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data( MaterialsRheologyBEnum)[tetra_vertex_ids[j]-1];422 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i];423 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i];424 if(iomodel->Data("md.materials.rheology_B")){ 425 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data("md.materials.rheology_B")[tetra_vertex_ids[j]-1]; 426 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]; 427 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]; 424 428 this->inputs->AddInput(new ControlInput(MaterialsRheologyBEnum,TetraInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 425 429 } 426 430 break; 427 431 case DamageDbarEnum: 428 if(iomodel->Data( DamageDEnum)){429 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data( DamageDEnum)[tetra_vertex_ids[j]-1];430 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i];431 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(tetra_vertex_ids[j]-1)*num_control_type+i];432 if(iomodel->Data("md.damage.D")){ 433 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data("md.damage.D")[tetra_vertex_ids[j]-1]; 434 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]; 435 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tetra_vertex_ids[j]-1)*num_control_type+i]; 432 436 this->inputs->AddInput(new ControlInput(DamageDEnum,TetraInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 433 437 } 434 438 break; 435 439 default: 436 _error_("Control " << EnumToStringx( reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i])) << " not implemented yet");440 _error_("Control " << EnumToStringx(control) << " not implemented yet"); 437 441 } 438 442 } 443 for(i=0;i<num_control_type;i++) xDelete<char>(controls[i]); 444 xDelete<char*>(controls); 439 445 } 440 446 441 447 /*Need to know the type of approximation for this element*/ 442 if(iomodel->Data( FlowequationElementEquationEnum)){443 this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<int>(iomodel->Data( FlowequationElementEquationEnum)[index])));448 if(iomodel->Data("md.flowequation.element_equation")){ 449 this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<int>(iomodel->Data("md.flowequation.element_equation")[index]))); 444 450 } 445 451 446 452 /*DatasetInputs*/ 447 if (control_analysis && iomodel->Data( InversionCostFunctionsCoefficientsEnum)) {453 if (control_analysis && iomodel->Data("md.inversion.cost_functions_coefficients")) { 448 454 449 455 /*Create inputs and add to DataSetInput*/ 450 456 DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum); 451 457 for(i=0;i<num_responses;i++){ 452 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data( InversionCostFunctionsCoefficientsEnum)[(tetra_vertex_ids[j]-1)*num_responses+i];453 datasetinput->AddInput(new TetraInput(InversionCostFunctionsCoefficientsEnum,nodeinputs,P1Enum),reCast<int>(iomodel->Data( InversionCostFunctionsEnum)[i]));458 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.inversion.cost_functions_coefficients")[(tetra_vertex_ids[j]-1)*num_responses+i]; 459 datasetinput->AddInput(new TetraInput(InversionCostFunctionsCoefficientsEnum,nodeinputs,P1Enum),reCast<int>(iomodel->Data("md.inversion.cost_functions")[i])); 454 460 } 455 461 … … 875 881 876 882 /*Fetch parameters: */ 877 iomodel->FindConstant(&yts, ConstantsYtsEnum);878 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);879 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);883 iomodel->FindConstant(&yts,"md.constants.yts"); 884 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 885 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 880 886 881 887 /*Checks if debuging*/ -
issm/trunk-jpl/src/c/classes/Elements/Tria.cpp
r20669 r20690 1823 1823 bool control_analysis = false; 1824 1824 int num_control_type,num_responses; 1825 char** controls = NULL; 1825 1826 IssmDouble yts; 1826 1827 1827 1828 /*Get parameters: */ 1828 iomodel->FindConstant(&yts, ConstantsYtsEnum);1829 iomodel->FindConstant(&control_analysis, InversionIscontrolEnum);1830 if(control_analysis) iomodel->FindConstant(&num_control_type, InversionNumControlParametersEnum);1831 if(control_analysis) iomodel->FindConstant(&num_responses, InversionNumCostFunctionsEnum);1829 iomodel->FindConstant(&yts,"md.constants.yts"); 1830 iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol"); 1831 if(control_analysis) iomodel->FindConstant(&num_control_type,"md.inversion.num_control_parameters"); 1832 if(control_analysis) iomodel->FindConstant(&num_responses,"md.inversion.num_cost_functions"); 1832 1833 1833 1834 /*Recover vertices ids needed to initialize inputs*/ … … 1837 1838 1838 1839 /*Need to know the type of approximation for this element*/ 1839 if(iomodel->Data( FlowequationElementEquationEnum)){1840 this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<int>(iomodel->Data( FlowequationElementEquationEnum)[index])));1840 if(iomodel->Data("md.flowequation.element_equation")){ 1841 this->inputs->AddInput(new IntInput(ApproximationEnum,reCast<int>(iomodel->Data("md.flowequation.element_equation")[index]))); 1841 1842 } 1842 1843 1843 1844 /*Control Inputs*/ 1844 if (control_analysis && iomodel->Data(InversionControlParametersEnum)){ 1845 if (control_analysis){ 1846 iomodel->FindConstant(&controls,NULL,"md.inversion.control_parameters"); 1845 1847 for(i=0;i<num_control_type;i++){ 1846 int control = reCast<int>(iomodel->Data(InversionControlParametersEnum)[i]); 1848 _assert_(controls[i]); 1849 int control = StringToEnumx(controls[i]); 1847 1850 switch(control){ 1848 /*yts conversion*/1849 1851 case BalancethicknessThickeningRateEnum: 1850 case BalancethicknessApparentMassbalanceEnum: 1851 case VxEnum: 1852 case VyEnum: 1853 if(iomodel->Data(control)){ 1854 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data(control)[tria_vertex_ids[j]-1]; 1855 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 1856 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 1857 this->inputs->AddInput(new ControlInput(control,TriaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1852 if (iomodel->Data("md.balancethickness.thickening_rate")){ 1853 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.balancethickness.thickening_rate")[tria_vertex_ids[j]-1]; 1854 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 1855 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 1856 this->inputs->AddInput(new ControlInput(BalancethicknessThickeningRateEnum,TriaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1858 1857 } 1859 1858 break; 1860 1861 /*No yts conversion*/ 1862 case ThicknessEnum: 1863 case BalancethicknessOmegaEnum: 1864 case FrictionCoefficientEnum: 1865 case FrictionAsEnum: 1866 case MaterialsRheologyBEnum: 1867 if(iomodel->Data(control)){ 1868 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data(control)[tria_vertex_ids[j]-1]; 1869 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data(InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]; 1870 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data(InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i]; 1871 this->inputs->AddInput(new ControlInput(control,TriaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1859 case VxEnum: 1860 if (iomodel->Data("md.initialization.vx")){ 1861 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.initialization.vx")[tria_vertex_ids[j]-1]; 1862 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 1863 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 1864 this->inputs->AddInput(new ControlInput(VxEnum,TriaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1872 1865 } 1873 1866 break; 1874 1875 /*Special cases (depth averaged quantities)*/ 1867 case VyEnum: 1868 if (iomodel->Data("md.initialization.vy")){ 1869 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.initialization.vy")[tria_vertex_ids[j]-1]; 1870 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 1871 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]/yts; 1872 this->inputs->AddInput(new ControlInput(VyEnum,TriaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1873 } 1874 break; 1875 case FrictionCoefficientEnum: 1876 if (iomodel->Data("md.friction.coefficient")){ 1877 for(j=0;j<NUMVERTICES;j++)nodeinputs[j]=iomodel->Data("md.friction.coefficient")[tria_vertex_ids[j]-1]; 1878 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]; 1879 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]; 1880 this->inputs->AddInput(new ControlInput(FrictionCoefficientEnum,TriaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1881 } 1882 break; 1876 1883 case MaterialsRheologyBbarEnum: 1877 if(iomodel->Data( MaterialsRheologyBEnum)){1878 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data( MaterialsRheologyBEnum)[tria_vertex_ids[j]-1];1879 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];1880 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];1884 if(iomodel->Data("md.materials.rheology_B")){ 1885 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data("md.materials.rheology_B")[tria_vertex_ids[j]-1]; 1886 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]; 1887 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]; 1881 1888 this->inputs->AddInput(new ControlInput(MaterialsRheologyBbarEnum,TriaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1882 1889 } 1883 1890 break; 1884 1891 case DamageDbarEnum: 1885 if(iomodel->Data( DamageDEnum)){1886 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data( DamageDEnum)[tria_vertex_ids[j]-1];1887 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data( InversionMinParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];1888 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data( InversionMaxParametersEnum)[(tria_vertex_ids[j]-1)*num_control_type+i];1892 if(iomodel->Data("md.damage.D")){ 1893 for(j=0;j<NUMVERTICES;j++) nodeinputs[j]=iomodel->Data("md.damage.D")[tria_vertex_ids[j]-1]; 1894 for(j=0;j<NUMVERTICES;j++)cmmininputs[j]=iomodel->Data("md.inversion.min_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]; 1895 for(j=0;j<NUMVERTICES;j++)cmmaxinputs[j]=iomodel->Data("md.inversion.max_parameters")[(tria_vertex_ids[j]-1)*num_control_type+i]; 1889 1896 this->inputs->AddInput(new ControlInput(DamageDbarEnum,TriaInputEnum,nodeinputs,cmmininputs,cmmaxinputs,i+1)); 1890 1897 } … … 1894 1901 } 1895 1902 } 1903 for(i=0;i<num_control_type;i++) xDelete<char>(controls[i]); 1904 xDelete<char*>(controls); 1896 1905 } 1897 1906 1898 1907 /*DatasetInputs*/ 1899 if (control_analysis && iomodel->Data( InversionCostFunctionsCoefficientsEnum)){1908 if (control_analysis && iomodel->Data("md.inversion.cost_functions_coefficients")){ 1900 1909 1901 1910 /*Create inputs and add to DataSetInput*/ 1902 1911 DatasetInput* datasetinput=new DatasetInput(InversionCostFunctionsCoefficientsEnum); 1903 1912 for(i=0;i<num_responses;i++){ 1904 for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data( InversionCostFunctionsCoefficientsEnum)[(tria_vertex_ids[j]-1)*num_responses+i];1905 datasetinput->AddInput(new TriaInput(InversionCostFunctionsCoefficientsEnum,nodeinputs,P1Enum),reCast<int>(iomodel->Data( InversionCostFunctionsEnum)[i]));1913 for(j=0;j<3;j++)nodeinputs[j]=iomodel->Data("md.inversion.cost_functions_coefficients")[(tria_vertex_ids[j]-1)*num_responses+i]; 1914 datasetinput->AddInput(new TriaInput(InversionCostFunctionsCoefficientsEnum,nodeinputs,P1Enum),reCast<int>(iomodel->Data("md.inversion.cost_functions")[i])); 1906 1915 } 1907 1916 -
issm/trunk-jpl/src/c/classes/FemModel.cpp
r20645 r20690 101 101 102 102 /*Create femmodel from input files, with trace activated: */ 103 profiler->Tag(STARTINIT); 103 104 this->InitFromFiles(rootpath,inputfilename,outputfilename,toolkitsfilename,lockfilename,restartfilename, solution_type,traceon,X); 105 profiler->Tag(FINISHINIT); 104 106 105 107 /*Save communicator in the parameters dataset: */ … … 438 440 bool isSIA,isFS; 439 441 int fe_FS; 440 iomodel->FindConstant(&fe_FS, FlowequationFeFSEnum);441 iomodel->FindConstant(&isSIA, FlowequationIsSIAEnum);442 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);442 iomodel->FindConstant(&fe_FS,"md.flowequation.fe_FS"); 443 iomodel->FindConstant(&isSIA,"md.flowequation.isSIA"); 444 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 443 445 analyses_temp[numanalyses++]=StressbalanceAnalysisEnum; 444 446 analyses_temp[numanalyses++]=StressbalanceVerticalAnalysisEnum; … … 457 459 case SteadystateSolutionEnum:{ 458 460 bool isSIA,isenthalpy; 459 iomodel->FindConstant(&isSIA, FlowequationIsSIAEnum);460 iomodel->FindConstant(&isenthalpy, ThermalIsenthalpyEnum);461 iomodel->FindConstant(&isSIA,"md.flowequation.isSIA"); 462 iomodel->FindConstant(&isenthalpy,"md.thermal.isenthalpy"); 461 463 analyses_temp[numanalyses++]=StressbalanceAnalysisEnum; 462 464 analyses_temp[numanalyses++]=StressbalanceVerticalAnalysisEnum; … … 477 479 case ThermalSolutionEnum:{ 478 480 bool isenthalpy; 479 iomodel->FindConstant(&isenthalpy, ThermalIsenthalpyEnum);481 iomodel->FindConstant(&isenthalpy,"md.thermal.isenthalpy"); 480 482 if(isenthalpy){ 481 483 analyses_temp[numanalyses++]=EnthalpyAnalysisEnum; … … 546 548 case TransientSolutionEnum:{ 547 549 bool isSIA,isFS,isthermal,isenthalpy,ismasstransport,isgroundingline,isstressbalance,ismovingfront,ishydrology,isdamage,issmb,isslr,isgia; 548 iomodel->FindConstant(&isSIA, FlowequationIsSIAEnum);549 iomodel->FindConstant(&isFS, FlowequationIsFSEnum);550 iomodel->FindConstant(&isthermal, TransientIsthermalEnum);551 iomodel->FindConstant(&isenthalpy, ThermalIsenthalpyEnum);552 iomodel->FindConstant(&ismovingfront, TransientIsmovingfrontEnum);553 iomodel->FindConstant(&ismasstransport, TransientIsmasstransportEnum);554 iomodel->FindConstant(&isstressbalance, TransientIsstressbalanceEnum);555 iomodel->FindConstant(&isgroundingline, TransientIsgroundinglineEnum);556 iomodel->FindConstant(&isdamage, TransientIsdamageevolutionEnum);557 iomodel->FindConstant(&ishydrology, TransientIshydrologyEnum);558 iomodel->FindConstant(&issmb, TransientIssmbEnum);559 iomodel->FindConstant(&isslr, TransientIsslrEnum);560 iomodel->FindConstant(&isgia, TransientIsgiaEnum);550 iomodel->FindConstant(&isSIA,"md.flowequation.isSIA"); 551 iomodel->FindConstant(&isFS,"md.flowequation.isFS"); 552 iomodel->FindConstant(&isthermal,"md.transient.isthermal"); 553 iomodel->FindConstant(&isenthalpy,"md.thermal.isenthalpy"); 554 iomodel->FindConstant(&ismovingfront,"md.transient.ismovingfront"); 555 iomodel->FindConstant(&ismasstransport,"md.transient.ismasstransport"); 556 iomodel->FindConstant(&isstressbalance,"md.transient.isstressbalance"); 557 iomodel->FindConstant(&isgroundingline,"md.transient.isgroundingline"); 558 iomodel->FindConstant(&isdamage,"md.transient.isdamageevolution"); 559 iomodel->FindConstant(&ishydrology,"md.transient.ishydrology"); 560 iomodel->FindConstant(&issmb,"md.transient.issmb"); 561 iomodel->FindConstant(&isslr,"md.transient.isslr"); 562 iomodel->FindConstant(&isgia,"md.transient.isgia"); 561 563 if(isstressbalance){ 562 564 int fe_FS; 563 iomodel->FindConstant(&fe_FS, FlowequationFeFSEnum);565 iomodel->FindConstant(&fe_FS,"md.flowequation.fe_FS"); 564 566 analyses_temp[numanalyses++]=StressbalanceAnalysisEnum; 565 567 analyses_temp[numanalyses++]=StressbalanceVerticalAnalysisEnum; … … 2668 2670 /*Open output file once for all and add output file descriptor to parameters*/ 2669 2671 output_fid=open_memstream(&outputbuffer,&outputsize); 2670 if(output_fid==NULL)_error_(" FemModel::InitFromBuffers error message:could not initialize output stream");2672 if(output_fid==NULL)_error_("could not initialize output stream"); 2671 2673 this->parameters->SetParam(output_fid,OutputFilePointerEnum); 2672 2674 this->parameters->AddObject(new GenericParam<char**>(&outputbuffer,OutputBufferPointerEnum)); -
issm/trunk-jpl/src/c/classes/IoModel.cpp
r20654 r20690 30 30 IoConstant::IoConstant(){/*{{{*/ 31 31 this->isindependent = false; 32 this->data_enum = -1;33 32 this->name = NULL; 34 33 this->constant = NULL; … … 40 39 } 41 40 /*}}}*/ 42 IoConstant::IoConstant(bool value, int enum_in){/*{{{*/41 IoConstant::IoConstant(bool value,const char* name_in){/*{{{*/ 43 42 this->isindependent = false; 44 this->data_enum = enum_in; 45 this->name = NULL; 46 this->constant = new BoolParam(enum_in,value); 47 } 48 /*}}}*/ 49 IoConstant::IoConstant(int value,int enum_in){/*{{{*/ 43 this->constant = new BoolParam(0,value); 44 45 _assert_(name_in); 46 int len=strlen(name_in); 47 this->name=xNew<char>(len+1); 48 memcpy(this->name,name_in,(len+1)*sizeof(char)); 49 } 50 /*}}}*/ 51 IoConstant::IoConstant(int value,const char* name_in){/*{{{*/ 50 52 this->isindependent = false; 51 this->data_enum = enum_in; 52 this->name = NULL; 53 this->constant = new IntParam(enum_in,value); 54 } 55 /*}}}*/ 56 IoConstant::IoConstant(IssmDouble value,int enum_in){/*{{{*/ 53 this->constant = new IntParam(0,value); 54 55 _assert_(name_in); 56 int len=strlen(name_in); 57 this->name=xNew<char>(len+1); 58 memcpy(this->name,name_in,(len+1)*sizeof(char)); 59 } 60 /*}}}*/ 61 IoConstant::IoConstant(IssmDouble value,const char* name_in){/*{{{*/ 57 62 this->isindependent = false; 58 this->data_enum = enum_in; 59 this->name = NULL; 60 this->constant = new DoubleParam(enum_in,value); 61 } 62 /*}}}*/ 63 IoConstant::IoConstant(char* value,int enum_in){/*{{{*/ 63 this->constant = new DoubleParam(0,value); 64 65 _assert_(name_in); 66 int len=strlen(name_in); 67 this->name=xNew<char>(len+1); 68 memcpy(this->name,name_in,(len+1)*sizeof(char)); 69 } 70 /*}}}*/ 71 IoConstant::IoConstant(char* value,const char* name_in){/*{{{*/ 64 72 this->isindependent = false; 65 this->data_enum = enum_in; 66 this->name = NULL; 67 this->constant = new StringParam(enum_in,value); 73 this->constant = new StringParam(0,value); 74 75 _assert_(name_in); 76 int len=strlen(name_in); 77 this->name=xNew<char>(len+1); 78 memcpy(this->name,name_in,(len+1)*sizeof(char)); 79 } 80 /*}}}*/ 81 IoConstant::IoConstant(char** value,int numstrings,const char* name_in){/*{{{*/ 82 this->isindependent = false; 83 this->constant = new StringArrayParam(0,value,numstrings); 84 85 _assert_(name_in); 86 int len=strlen(name_in); 87 this->name=xNew<char>(len+1); 88 memcpy(this->name,name_in,(len+1)*sizeof(char)); 68 89 } 69 90 /*}}}*/ … … 72 93 IoData::IoData(){/*{{{*/ 73 94 this->isindependent = false; 74 this->data_enum = -1;75 95 this->name = NULL; 76 96 this->code = -1; … … 86 106 } 87 107 /*}}}*/ 88 IoData::IoData(IssmDouble* matrix,int code_in,int layout_in,int M_in,int N_in, int enum_in){/*{{{*/108 IoData::IoData(IssmDouble* matrix,int code_in,int layout_in,int M_in,int N_in,const char* name_in){/*{{{*/ 89 109 this->isindependent = false; 90 this->data_enum = enum_in;91 this->name = NULL;92 110 this->code = code_in; 93 111 this->layout = layout_in; … … 96 114 this->data = matrix; /*do not copy*/ 97 115 _assert_(code_in==5 || code_in==6 || code_in==7); 116 117 _assert_(name_in); 118 int len=strlen(name_in); 119 this->name=xNew<char>(len+1); 120 memcpy(this->name,name_in,(len+1)*sizeof(char)); 98 121 } 99 122 /*}}}*/ … … 138 161 139 162 /*Check that Enums are Synchronized*/ 140 this->Check EnumSync();163 this->CheckFile(); 141 164 142 165 /*Keep track of solution*/ … … 153 176 154 177 /*Is this an autodiff run?*/ 155 this->FindConstant(&autodiff, AutodiffIsautodiffEnum);156 this->FindConstant(&iscontrol, InversionIscontrolEnum);178 this->FindConstant(&autodiff,"md.autodiff.isautodiff"); 179 this->FindConstant(&iscontrol,"md.inversion.iscontrol"); 157 180 if(trace){ 158 181 autodiff=true; … … 164 187 autodiff=false; 165 188 } 166 this->AddConstant(new IoConstant(autodiff, AutodiffIsautodiffEnum));189 this->AddConstant(new IoConstant(autodiff,"md.autodiff.isautodiff")); 167 190 168 191 /*Initialize permanent data: */ … … 170 193 this->my_vertices = NULL; 171 194 172 FetchData(&this->domaintype, DomainTypeEnum);173 FetchData(&this->domaindim, DomainDimensionEnum);174 FetchData(&this->meshelementtype, MeshElementtypeEnum);175 FetchData(&this->numberofvertices, MeshNumberofverticesEnum);176 FetchData(&this->numberofelements, MeshNumberofelementsEnum);177 FetchData(&this->elements,NULL,NULL, MeshElementsEnum);195 FetchData(&this->domaintype,"md.mesh.domain_type"); 196 FetchData(&this->domaindim,"md.mesh.domain_dimension"); 197 FetchData(&this->meshelementtype,"md.mesh.elementtype"); 198 FetchData(&this->numberofvertices,"md.mesh.numberofvertices"); 199 FetchData(&this->numberofelements,"md.mesh.numberofelements"); 200 FetchData(&this->elements,NULL,NULL,"md.mesh.elements"); 178 201 this->facescols = -1; 179 202 this->faces = NULL; … … 203 226 #if defined(_ISSM_DEBUG_) 204 227 if(!(*iter2)->isindependent){ 205 _printf0_("WARNING: IoData " << EnumToStringx((*iter2)->data_enum) <<" has not been freed (DeleteData has not been called)\n");228 _printf0_("WARNING: IoData \"" << (*iter2)->name << "\" has not been freed (DeleteData has not been called)\n"); 206 229 } 207 230 #endif … … 232 255 233 256 for(iter=constants.begin();iter<constants.end();iter++){ 234 if( (*iter)->data_enum==in_constant->data_enum){257 if(strcmp((*iter)->name,in_constant->name)==0){ 235 258 delete in_constant; 236 259 return; … … 260 283 261 284 for(iter=data.begin();iter<data.end();iter++){ 262 if( (*iter)->data_enum==in_data->data_enum){285 if(strcmp((*iter)->name,in_data->name)==0){ 263 286 delete in_data; 264 287 return; … … 280 303 } 281 304 /*}}}*/ 282 void IoModel::CheckEnumSync(void){/*{{{*/ 283 284 int record_enum,record_length; 305 void IoModel::CheckFile(void){/*{{{*/ 306 307 bool found; 308 int record_enum,record_length,record_name_size; 309 char *record_name = NULL; 310 const char *mddot = "md."; 285 311 286 312 /*recover my_rank:*/ … … 296 322 fseek(this->fid,0,SEEK_SET); 297 323 298 /*Get first Enum*/299 if(fread(&record_enum,sizeof(int),1,this->fid)==0){300 _error_("Marshalled file is empty");301 }302 else{303 if(record_enum!=MaximumNumberOfDefinitionsEnum){304 _printf0_("\n");305 _printf0_("=========================================================================\n");306 _printf0_(" Enums in marshalled file are not compatible with compiled code \n");307 _printf0_(" \n");308 _printf0_(" * If you are running ISSM on your local machine: \n");309 _printf0_(" make sure that all the code is compiled and installed (make install)\n");310 _printf0_(" * If you are running ISSM on a remote cluster: \n");311 _printf0_(" make sure that you are using the same version of ISSM on your local \n");312 _printf0_(" machine and remote cluster (you might need to run svn update) \n");313 _printf0_(" * If you are a developer and just added a new Enum: \n");314 _printf0_(" you might need to run ./Synchronize.sh in src/c/shared/Enum \n");315 _printf0_(" and recompile \n");316 _printf0_("=========================================================================\n");317 _printf0_("\n");318 _error_("Enums not consistent (See error message above)");319 }320 }321 322 /*Get last enum*/323 bool found = false;324 int last_enum = 0;325 326 /*First set FILE* position to the beginning of the file: */327 fseek(fid,0,SEEK_SET);328 324 for(;;){ 329 /*Have we reached the end of file ?*/ 330 if(fread(&record_enum,sizeof(int),1,fid)==0){ 325 /*Read size of first string name: */ 326 if(fread(&record_name_size,sizeof(int),1,fid)==0){ 327 /*we have reached the end of the file. break: */ 328 xDelete<char>(record_name); 331 329 break; 332 330 } 333 334 /*Have we found the last Enum ?*/ 335 if(record_enum==MaximumNumberOfDefinitionsEnum+1){ 331 if(record_name_size<3 || record_name_size>80){ 332 _error_("error while looking in binary file. Found a string of size "<<record_name_size); 333 } 334 335 /*Allocate string of correct size: */ 336 record_name=xNew<char>(record_name_size+1); 337 record_name[record_name_size]='\0'; 338 339 /*Read record_name: */ 340 if(fread(record_name,record_name_size*sizeof(char),1,fid)==0){ 341 /*we have reached the end of the file. break: */ 342 found=false; 343 xDelete<char>(record_name); 344 break; 345 } 346 //_printf_(" reading "<< record_name<<"...\n"); 347 if(strncmp(record_name,mddot,3)!=0){ 348 _error_("error while reading binary file: record does not start with \"md.\": "<<record_name); 349 } 350 351 /*Have we found the last string?*/ 352 if(strncmp(record_name,"md.EOF",6)==0){ 336 353 found = true; 354 xDelete<char>(record_name); 337 355 break; 338 }339 340 /*Check that record_enum is an enum*/341 if(record_enum>=0 && record_enum<=MaximumNumberOfDefinitionsEnum){342 if(record_enum>0) last_enum = record_enum;343 356 } 344 357 … … 346 359 if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length"); 347 360 fseek(fid,record_length,SEEK_CUR); 361 xDelete<char>(record_name); 348 362 } 349 363 if(!found){ … … 352 366 _printf0_(" Marshalled file is corrupted \n"); 353 367 _printf0_(" \n"); 354 _printf0_(" * If you are running an old model, send it to the ISSM developers \n"); 355 _printf0_(" so that a check is added before marshall \n"); 356 _printf0_(" * Last Enum found: " << EnumToStringx(last_enum)<<"Enum ("<<last_enum<<")\n"); 368 _printf0_(" * Last record found is : \n"); 357 369 _printf0_(" the corresponding model field has probably been marshalled \n"); 358 370 _printf0_(" incorrectly \n"); … … 365 377 } 366 378 /*}}}*/ 367 void IoModel::FetchIndependentConstant(int* pXcount,IssmPDouble* X, intname){/*{{{*/379 void IoModel::FetchIndependentConstant(int* pXcount,IssmPDouble* X,const char* constant_name){/*{{{*/ 368 380 369 381 /*recover my_rank:*/ … … 382 394 383 395 /*Set file pointer to beginning of the data: */ 384 fid=this->SetFilePointerToData(&code,NULL, name);385 if(code!=3) _error_("expecting a IssmDouble for enum " << EnumToStringx(name));396 fid=this->SetFilePointerToData(&code,NULL,constant_name); 397 if(code!=3) _error_("expecting a IssmDouble for \"" << constant_name<<"\""); 386 398 387 399 /*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */ … … 400 412 401 413 ISSM_MPI_Bcast(&scalar,1,ISSM_MPI_DOUBLE,0,IssmComm::GetComm()); 402 this->AddConstantIndependent(new IoConstant(scalar, name));414 this->AddConstantIndependent(new IoConstant(scalar,constant_name)); 403 415 404 416 /*increment offset into X vector, now that we have read 1 value:*/ … … 407 419 } 408 420 /*}}}*/ 409 void IoModel::FetchIndependentData(int* pXcount,IssmPDouble* X, intname){/*{{{*/421 void IoModel::FetchIndependentData(int* pXcount,IssmPDouble* X,const char* data_name){/*{{{*/ 410 422 411 423 /*recover my_rank:*/ … … 425 437 426 438 /*Set file pointer to beginning of the data: */ 427 fid=this->SetFilePointerToData(&code,&layout, name);428 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(name));439 fid=this->SetFilePointerToData(&code,&layout,data_name); 440 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for \"" << data_name<<"\""); 429 441 430 442 /*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */ … … 462 474 xDelete<IssmPDouble>(buffer); 463 475 } 464 else _error_("cannot declare the independent variable " << EnumToStringx(name) << "if it's empty!");476 else _error_("cannot declare the independent variable \"" << data_name << "\" if it's empty!"); 465 477 466 478 /*Add to data as independent*/ 467 this->AddDataIndependent(new IoData(matrix,code,layout,M,N, name));479 this->AddDataIndependent(new IoData(matrix,code,layout,M,N,data_name)); 468 480 469 481 /*increment offset into X vector, now that we have read M*N values:*/ … … 472 484 } 473 485 /*}}}*/ 474 void IoModel::FindConstant(bool* pvalue, int constant_enum){/*{{{*/486 void IoModel::FindConstant(bool* pvalue,const char* constant_name){/*{{{*/ 475 487 476 488 /*Intermediary*/ … … 480 492 IoConstant* ioconstant=*iter; 481 493 482 if( ioconstant->data_enum==constant_enum){494 if(strcmp(ioconstant->name,constant_name)==0){ 483 495 ioconstant->constant->GetParameterValue(pvalue); 484 496 return; … … 487 499 488 500 for(vector<IoConstant*>::iterator iter=constants.begin();iter<constants.end();iter++) (*iter)->constant->Echo(); 489 _error_("Could not find constant \""<< EnumToStringx(constant_enum)<<"\"");490 } 491 /*}}}*/ 492 void IoModel::FindConstant(int* pvalue, int constant_enum){/*{{{*/501 _error_("Could not find constant \""<<constant_name<<"\""); 502 } 503 /*}}}*/ 504 void IoModel::FindConstant(int* pvalue,const char* constant_name){/*{{{*/ 493 505 494 506 /*Intermediary*/ … … 498 510 IoConstant* ioconstant=*iter; 499 511 500 if( ioconstant->data_enum==constant_enum){512 if(strcmp(ioconstant->name,constant_name)==0){ 501 513 ioconstant->constant->GetParameterValue(pvalue); 502 514 return; … … 504 516 } 505 517 506 _error_("Could not find constant \""<< EnumToStringx(constant_enum)<<"\"");507 } 508 /*}}}*/ 509 void IoModel::FindConstant(IssmDouble* pvalue, int constant_enum){/*{{{*/518 _error_("Could not find constant \""<<constant_name <<"\""); 519 } 520 /*}}}*/ 521 void IoModel::FindConstant(IssmDouble* pvalue,const char* constant_name){/*{{{*/ 510 522 511 523 /*Intermediary*/ … … 515 527 IoConstant* ioconstant=*iter; 516 528 517 if( ioconstant->data_enum==constant_enum){529 if(strcmp(ioconstant->name,constant_name)==0){ 518 530 ioconstant->constant->GetParameterValue(pvalue); 519 531 return; … … 521 533 } 522 534 523 _error_("Could not find constant \""<< EnumToStringx(constant_enum)<<"\"");524 } 525 /*}}}*/ 526 void IoModel::FindConstant(char** pvalue, int constant_enum){/*{{{*/535 _error_("Could not find constant \""<<constant_name <<"\""); 536 } 537 /*}}}*/ 538 void IoModel::FindConstant(char** pvalue,const char* constant_name){/*{{{*/ 527 539 528 540 /*Intermediary*/ … … 532 544 IoConstant* ioconstant=*iter; 533 545 534 if( ioconstant->data_enum==constant_enum){546 if(strcmp(ioconstant->name,constant_name)==0){ 535 547 ioconstant->constant->GetParameterValue(pvalue); 536 548 return; … … 538 550 } 539 551 540 _error_("Could not find constant \""<<EnumToStringx(constant_enum) <<"\""); 552 _error_("Could not find constant \""<<constant_name <<"\""); 553 } 554 /*}}}*/ 555 void IoModel::FindConstant(char*** pvalue,int* psize,const char* constant_name){/*{{{*/ 556 557 /*Intermediary*/ 558 vector<IoConstant*>::iterator iter; 559 560 for(iter=constants.begin();iter<constants.end();iter++){ 561 IoConstant* ioconstant=*iter; 562 563 if(strcmp(ioconstant->name,constant_name)==0){ 564 ioconstant->constant->GetParameterValue(pvalue,psize); 565 return; 566 } 567 } 568 569 _error_("Could not find constant \""<<constant_name <<"\""); 541 570 } 542 571 /*}}}*/ … … 592 621 } 593 622 /*}}}*/ 594 Param* IoModel::CopyConstantObject( int constant_enum){/*{{{*/623 Param* IoModel::CopyConstantObject(const char* constant_name,int param_enum){/*{{{*/ 595 624 596 625 /*Intermediary*/ … … 600 629 IoConstant* ioconstant=*iter; 601 630 602 if(ioconstant->data_enum==constant_enum){ 603 return ioconstant->constant->copy(); 604 } 605 } 606 607 _error_("Constant " << EnumToStringx(constant_enum) << " not found in iomodel"); 631 if(strcmp(ioconstant->name,constant_name)==0){ 632 Param* output = ioconstant->constant->copy(); 633 output->SetEnum(param_enum); 634 return output; 635 } 636 } 637 638 _error_("Constant \"" << constant_name << "\" not found in iomodel"); 608 639 return NULL; 609 640 } 610 641 /*}}}*/ 611 IssmDouble* IoModel::Data( int data_enum){/*{{{*/642 IssmDouble* IoModel::Data(const char* data_name){/*{{{*/ 612 643 613 644 /*Intermediary*/ … … 616 647 for(iter=data.begin();iter<data.end();iter++){ 617 648 IoData* iodata=*iter; 618 if( iodata->data_enum==data_enum) return iodata->data;649 if(strcmp(iodata->name,data_name)==0) return iodata->data; 619 650 } 620 651 … … 636 667 int my_rank=IssmComm::GetRank(); 637 668 638 this->FetchData(&autodiff, AutodiffIsautodiffEnum);639 this->FetchData(&iscontrol, InversionIscontrolEnum);669 this->FetchData(&autodiff,"md.autodiff.isautodiff"); 670 this->FetchData(&iscontrol,"md.inversion.iscontrol"); 640 671 641 672 if(trace || (autodiff && !iscontrol)){ 642 673 #ifdef _HAVE_ADOLC_ 643 674 /*Retrieve parameters: */ 644 this->FetchData(&keep, AutodiffKeepEnum);675 this->FetchData(&keep,"md.autodiff.keep"); 645 676 int keepTaylors=keep?1:0; 646 this->FetchData(&gcTriggerRatio, AutodiffGcTriggerRatioEnum);647 this->FetchData(&gcTriggerMaxSize, AutodiffGcTriggerMaxSizeEnum);648 this->FetchData(&obufsize, AutodiffObufsizeEnum);649 this->FetchData(&lbufsize, AutodiffLbufsizeEnum);650 this->FetchData(&cbufsize, AutodiffCbufsizeEnum);651 this->FetchData(&tbufsize, AutodiffTbufsizeEnum);677 this->FetchData(&gcTriggerRatio,"md.autodiff.gcTriggerRatio"); 678 this->FetchData(&gcTriggerMaxSize,"md.autodiff.gcTriggerMaxSize"); 679 this->FetchData(&obufsize,"md.autodiff.obufsize"); 680 this->FetchData(&lbufsize,"md.autodiff.lbufsize"); 681 this->FetchData(&cbufsize,"md.autodiff.cbufsize"); 682 this->FetchData(&tbufsize,"md.autodiff.tbufsize"); 652 683 653 684 /*Set garbage collection parameters: */ … … 668 699 int Xcount=0; 669 700 670 int *names = NULL;701 char** names = NULL; 671 702 int *types = NULL; 672 703 673 704 /*Initialize array detecting whether data[i] is an independent AD mode variable: */ 674 this->FetchData(&autodiff, AutodiffIsautodiffEnum);675 this->FetchData(&iscontrol, InversionIscontrolEnum);705 this->FetchData(&autodiff,"md.autodiff.isautodiff"); 706 this->FetchData(&iscontrol,"md.inversion.iscontrol"); 676 707 677 708 if(trace || (autodiff && !iscontrol)){ 678 709 679 710 #ifdef _HAVE_ADOLC_ 680 this->FetchData(&num_independent_objects, AutodiffNumIndependentObjectsEnum);711 this->FetchData(&num_independent_objects,"md.autodiff.num_independent_objects"); 681 712 if(num_independent_objects){ 682 this->F etchData(&names,NULL,NULL,AutodiffIndependentObjectNamesEnum);683 this->FetchData(&types,NULL,NULL, AutodiffIndependentObjectTypesEnum);713 this->FindConstant(&names,NULL,"md.autodiff.independent_object_names"); 714 this->FetchData(&types,NULL,NULL,"md.autodiff_independent_object_types"); 684 715 685 716 /*create independent objects, and at the same time, fetch the corresponding independent variables, … … 699 730 } 700 731 } 701 xDelete<int>(names); 732 for(int i=0;i<num_independent_objects;i++) xDelete<char>(names[i]); 733 xDelete<char*>(names); 702 734 xDelete<int>(types); 703 735 } … … 712 744 713 745 /*Intermediaries*/ 714 va_list ap; 715 int dataenum; 716 vector<IoData*>::iterator iter; 746 va_list ap; 747 char *data_name = NULL; 748 const char *mddot = "md."; 749 vector<IoData *>::iterator iter; 717 750 718 751 /*Go through the entire list of data and delete the corresponding data from the iomodel-data dataset: */ 719 752 va_start(ap,num); 720 753 for(int i=0;i<num;i++){ 721 dataenum=va_arg(ap,int); 754 data_name=va_arg(ap,char*); 755 756 if(strncmp(data_name,mddot,3)!=0) _error_("String provided does not start with \"md.\" ("<<data_name<<")"); 722 757 723 758 for(iter=data.begin();iter<data.end();iter++){ 724 759 IoData* iodata=*iter; 725 if( iodata->data_enum==dataenum&& !iodata->isindependent){760 if(strcmp(iodata->name,data_name)==0 && !iodata->isindependent){ 726 761 delete *iter; 727 762 this->data.erase(iter); … … 732 767 va_end(ap); 733 768 } /*}}}*/ 734 void IoModel::DeleteData(IssmDouble* vector_in, int dataenum){/*{{{*/769 void IoModel::DeleteData(IssmDouble* vector_in,const char* data_name){/*{{{*/ 735 770 736 771 vector<IoData*>::iterator iter; … … 742 777 for(iter=data.begin();iter<data.end();iter++){ 743 778 IoData* iodata=*iter; 744 if( iodata->data_enum==dataenum&& iodata->isindependent){779 if(strcmp(iodata->name,data_name)==0 && iodata->isindependent){ 745 780 return; 746 781 } … … 750 785 xDelete<IssmDouble>(vector_in); 751 786 } /*}}}*/ 752 void IoModel::DeleteData(char*** pstringarray, int numstrings, int dataenum){/*{{{*/ 753 754 int i; 787 void IoModel::DeleteData(char*** pstringarray, int numstrings,const char* data_name){/*{{{*/ 788 755 789 char** stringarray=*pstringarray; 756 790 757 if 758 for (i=0;i<numstrings;i++){791 if(numstrings){ 792 for(int i=0;i<numstrings;i++){ 759 793 char* string=stringarray[i]; 760 794 xDelete<char>(string); … … 767 801 768 802 /*record descriptions; */ 769 int record_enum; 803 const char* mddot = "md."; 804 char* record_name = NULL; 805 int record_name_size; 770 806 int record_length; 771 807 int record_code; //1 to 7 number … … 777 813 IssmDouble scalar = 0; 778 814 char *string = NULL; 779 int string_size; 815 char **strings = NULL; 816 int string_size,numstrings; 780 817 781 818 /*recover my_rank:*/ … … 793 830 /*Now march through file looking for the correct data identifiers (bool,int,IssmDouble or string): */ 794 831 for(;;){ 795 if(fread(&record_enum,sizeof(int),1,this->fid)==0){ 796 797 /*Ok, we have reached the end of the file. break: */ 832 833 /*Read size of first string name: */ 834 if(fread(&record_name_size,sizeof(int),1,fid)==0){ 835 /*we have reached the end of the file. break: */ 798 836 record_code=0; //0 means bailout 799 837 ISSM_MPI_Bcast(&record_code,1,ISSM_MPI_INT,0,IssmComm::GetComm()); /*tell others cpus we are bailing: */ 800 838 break; 801 839 } 802 else{ 803 804 /* Read the record length and the data type code: */ 805 if(fread(&record_length,sizeof(int),1,this->fid)!=1) _error_("Cound not read record_length"); 806 if(fread(&record_code ,sizeof(int),1,this->fid)!=1) _error_("Cound not read record_code"); 807 808 /*Tell other cpus what we are doing: */ 809 ISSM_MPI_Bcast(&record_code,1,ISSM_MPI_INT,0,IssmComm::GetComm()); /*tell other cpus what we are going to do: */ 810 811 /*Tell other cpus the name of the data, then branch according to the data type: */ 812 ISSM_MPI_Bcast(&record_enum,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 813 ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 814 815 switch(record_code){ 816 case 1: 817 /*Read the boolean and broadcast it to other cpus:*/ 818 if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_("could not read boolean "); 819 ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 820 821 /*create BoolParam: */ 822 if(record_enum!=MaximumNumberOfDefinitionsEnum && record_enum!=MaximumNumberOfDefinitionsEnum+1) 823 this->AddConstant(new IoConstant((bool)booleanint,record_enum)); //cast to boolean 824 825 break; 826 case 2: 827 /*Read the integer and broadcast it to other cpus:*/ 828 if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_("could not read integer "); 829 ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 830 831 /*create IntParam: */ 832 this->AddConstant(new IoConstant(integer,record_enum)); 833 834 break; 835 case 3: 836 { 837 /*IssmDouble, check whether it is already there (from "declare independents")*/ 838 bool exists = false; 839 vector<IoConstant*>::iterator iter; 840 for(iter=constants.begin();iter<constants.end();iter++){ 841 IoConstant* ioconstant=*iter; 842 if(ioconstant->data_enum==record_enum){ 843 exists = true; 844 break; 845 } 840 if(record_name_size<3 || record_name_size>80){ 841 _error_("error while looking in binary file. Found a string of size "<<record_name_size); 842 } 843 844 /*Allocate string of correct size: */ 845 record_name=xNew<char>(record_name_size+1); 846 record_name[record_name_size]='\0'; 847 848 /*Read record_name: */ 849 if(fread(record_name,record_name_size*sizeof(char),1,fid)==0){ 850 _error_("Could not read record name"); 851 } 852 if(strncmp(record_name,mddot,3)!=0){ 853 _error_("error while reading binary file: record does not start with \"md.\": "<<record_name); 854 } 855 //_printf_("reading "<<record_name<<"...\n"); 856 857 /* Read the record length and the data type code: */ 858 if(fread(&record_length,sizeof(int),1,this->fid)!=1) _error_("Cound not read record_length"); 859 if(fread(&record_code ,sizeof(int),1,this->fid)!=1) _error_("Cound not read record_code"); 860 861 /*Tell other cpus what we are doing: */ 862 ISSM_MPI_Bcast(&record_code,1,ISSM_MPI_INT,0,IssmComm::GetComm()); /*tell other cpus what we are going to do: */ 863 864 /*Tell other cpus the name of the data, then branch according to the data type: */ 865 ISSM_MPI_Bcast(&record_name_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 866 ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 867 ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 868 869 switch(record_code){ 870 case 1: 871 /*Read the boolean and broadcast it to other cpus:*/ 872 if(fread(&booleanint,sizeof(int),1,this->fid)!=1) _error_("could not read boolean "); 873 ISSM_MPI_Bcast(&booleanint,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 874 875 /*create BoolParam: */ 876 this->AddConstant(new IoConstant((bool)booleanint,record_name)); //cast to boolean 877 878 break; 879 case 2: 880 /*Read the integer and broadcast it to other cpus:*/ 881 if(fread(&integer,sizeof(int),1,this->fid)!=1) _error_("could not read integer "); 882 ISSM_MPI_Bcast(&integer,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 883 884 /*create IntParam: */ 885 this->AddConstant(new IoConstant(integer,record_name)); 886 887 break; 888 case 3: 889 { 890 /*IssmDouble, check whether it is already there (from "declare independents")*/ 891 bool exists = false; 892 vector<IoConstant*>::iterator iter; 893 for(iter=constants.begin();iter<constants.end();iter++){ 894 IoConstant* ioconstant=*iter; 895 if(strcmp(ioconstant->name,record_name)==0){ 896 exists = true; 897 break; 846 898 } 847 if(!exists){ 848 if(fread(&pscalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar "); 849 ISSM_MPI_Bcast(&pscalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 850 scalar=pscalar; 851 852 /*create DoubleParam: */ 853 this->AddConstant(new IoConstant(scalar,record_enum)); 899 } 900 if(!exists){ 901 if(fread(&pscalar,sizeof(IssmPDouble),1,this->fid)!=1) _error_("could not read scalar "); 902 ISSM_MPI_Bcast(&pscalar,1,ISSM_MPI_PDOUBLE,0,IssmComm::GetComm()); 903 scalar=pscalar; 904 905 /*create DoubleParam: */ 906 this->AddConstant(new IoConstant(scalar,record_name)); 907 } 908 } 909 break; 910 case 4: 911 /*We have to read a string from disk. First read the dimensions of the string, then the string: */ 912 if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_("could not read length of string "); 913 ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 914 915 if(string_size){ 916 string=xNew<char>(string_size+1); 917 string[string_size]='\0'; 918 919 /*Read string, then broadcast: */ 920 if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string "); 921 ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 922 } 923 else{ 924 string=xNew<char>(1); 925 string[0]='\0'; 926 } 927 928 /*Add string to parameters: */ 929 this->AddConstant(new IoConstant(string,record_name)); 930 931 /*Free string*/ 932 xDelete<char>(string); 933 break; 934 case 5: 935 case 6: 936 case 7: 937 case 8: 938 /*We are not interested in this record, too memory intensive. Skip it: */ 939 /*skip: */ 940 fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer 941 fseek(fid,record_length,SEEK_CUR); 942 break; 943 case 9: 944 /*String Array*/ 945 if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_("could not read length of string array"); 946 ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 947 /*Now allocate string array: */ 948 if(numstrings){ 949 strings=xNew<char*>(numstrings); 950 for(int i=0;i<numstrings;i++)strings[i]=NULL; 951 952 /*Go through strings, and read: */ 953 for(int i=0;i<numstrings;i++){ 954 955 if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string "); 956 ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 957 if(string_size){ 958 string=xNew<char>((string_size+1)); 959 string[string_size]='\0'; 960 if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string "); 961 ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 854 962 } 855 } 856 break; 857 case 4: 858 /*We have to read a string from disk. First read the dimensions of the string, then the string: */ 859 if(fread(&string_size,sizeof(int),1,this->fid)!=1) _error_("could not read length of string "); 860 ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 861 862 if(string_size){ 863 string=xNew<char>(string_size+1); 864 string[string_size]='\0'; 865 866 /*Read string, then broadcast: */ 867 if(fread(string,string_size*sizeof(char),1,this->fid)!=1)_error_(" could not read string "); 868 ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 963 else{ 964 string=xNew<char>(1); 965 string[0]='\0'; 966 } 967 strings[i]=string; 869 968 } 870 else{ 871 string=xNew<char>(1); 872 string[0]='\0'; 873 } 874 875 /*Add string to parameters: */ 876 this->AddConstant(new IoConstant(string,record_enum)); 877 878 /*Free string*/ 879 xDelete<char>(string); 880 break; 881 case 5: 882 case 6: 883 case 7: 884 case 8: 885 case 9: 886 /*We are not interested in this record, too memory intensive. Skip it: */ 887 /*skip: */ 888 fseek(fid,-sizeof(int),SEEK_CUR); //backtrak 1 integer 889 fseek(fid,record_length,SEEK_CUR); 890 break; 891 default: 892 _error_("unknown record type:" << record_code); 893 break; 894 } 895 } 969 } 970 971 /*Add strings to parameters: */ 972 this->AddConstant(new IoConstant(strings,numstrings,record_name)); 973 974 /*Free string*/ 975 for(int i=0;i<numstrings;i++) xDelete<char>(strings[i]); 976 xDelete<char*>(strings); 977 break; 978 default: 979 _error_("unknown record type:" << record_code); 980 break; 981 } 982 xDelete<char>(record_name); 896 983 } 897 984 } //}}} … … 903 990 } 904 991 else{ 905 ISSM_MPI_Bcast(&record_enum,1,ISSM_MPI_INT,0,IssmComm::GetComm()); //get from cpu 0 name of the data 992 ISSM_MPI_Bcast(&record_name_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 993 _assert_(record_name_size); 994 record_name=xNew<char>((record_name_size+1)); record_name[record_name_size]='\0'; 995 ISSM_MPI_Bcast(record_name,record_name_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 906 996 ISSM_MPI_Bcast(&record_length,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 907 997 switch(record_code){ … … 911 1001 912 1002 /*create BoolParam: */ 913 if(record_enum!=MaximumNumberOfDefinitionsEnum && record_enum!=MaximumNumberOfDefinitionsEnum+1) 914 this->AddConstant(new IoConstant((bool)booleanint,record_enum)); //cast to a boolean 1003 this->AddConstant(new IoConstant((bool)booleanint,record_name)); //cast to a boolean 915 1004 break; 916 1005 … … 920 1009 921 1010 /*create IntParam: */ 922 this->AddConstant(new IoConstant(integer,record_enum)); 923 1011 this->AddConstant(new IoConstant(integer,record_name)); 924 1012 break; 925 1013 case 3: … … 931 1019 for(iter=constants.begin();iter<constants.end();iter++){ 932 1020 IoConstant* ioconstant=*iter; 933 if( ioconstant->data_enum==record_enum){1021 if(strcmp(ioconstant->name,record_name)==0){ 934 1022 exists = true; 935 1023 break; … … 940 1028 scalar=pscalar; 941 1029 /*create DoubleParam: */ 942 this->AddConstant(new IoConstant(scalar,record_ enum));1030 this->AddConstant(new IoConstant(scalar,record_name)); 943 1031 } 944 1032 } … … 958 1046 } 959 1047 /*Add string to parameters: */ 960 this->AddConstant(new IoConstant(string,record_ enum));1048 this->AddConstant(new IoConstant(string,record_name)); 961 1049 962 1050 /*Free string*/ … … 968 1056 case 7: break; //do nothing. not interested in this type of data, which is memory intensive. 969 1057 case 8: break; //do nothing. not interested in this type of data, which is memory intensive. 970 case 9: break; //do nothing. not interested in this type of data, which is memory intensive. 971 1058 case 9: 1059 ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1060 /*Now allocate string array: */ 1061 if(numstrings){ 1062 strings=xNew<char*>(numstrings); 1063 for(int i=0;i<numstrings;i++)strings[i]=NULL; 1064 1065 /*Go through strings, and read: */ 1066 for(int i=0;i<numstrings;i++){ 1067 1068 ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1069 if(string_size){ 1070 string=xNew<char>((string_size+1)); 1071 string[string_size]='\0'; 1072 ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 1073 } 1074 else{ 1075 string=xNew<char>(1); 1076 string[0]='\0'; 1077 } 1078 strings[i]=string; 1079 } 1080 } 1081 1082 /*Add strings to parameters: */ 1083 this->AddConstant(new IoConstant(strings,numstrings,record_name)); 1084 1085 /*Free string*/ 1086 for(int i=0;i<numstrings;i++) xDelete<char>(strings[i]); 1087 xDelete<char*>(strings); 1088 break; 972 1089 default: 973 1090 _error_("unknown record type:" << record_code); … … 980 1097 } 981 1098 /*}}}*/ 982 void IoModel::FetchData(bool* pboolean, int data_enum){/*{{{*/1099 void IoModel::FetchData(bool* pboolean,const char* data_name){/*{{{*/ 983 1100 984 1101 /*output: */ … … 990 1107 991 1108 /*Set file pointer to beginning of the data: */ 992 fid=this->SetFilePointerToData(&code,NULL,data_ enum);993 994 if(code!=1)_error_("expecting a boolean for enum " << EnumToStringx(data_enum));1109 fid=this->SetFilePointerToData(&code,NULL,data_name); 1110 1111 if(code!=1)_error_("expecting a boolean for \"" << data_name<<"\""); 995 1112 996 1113 /*We have to read a boolean from disk. */ … … 1006 1123 } 1007 1124 /*}}}*/ 1008 void IoModel::FetchData(int* pinteger, int data_enum){/*{{{*/1125 void IoModel::FetchData(int* pinteger,const char* data_name){/*{{{*/ 1009 1126 1010 1127 /*output: */ … … 1016 1133 1017 1134 /*Set file pointer to beginning of the data: */ 1018 fid=this->SetFilePointerToData(&code,NULL,data_ enum);1019 1020 if(code!=2)_error_("expecting an integer for enum " << EnumToStringx(data_enum));1135 fid=this->SetFilePointerToData(&code,NULL,data_name); 1136 1137 if(code!=2)_error_("expecting an integer for \"" << data_name<<"\""); 1021 1138 1022 1139 /*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */ … … 1031 1148 } 1032 1149 /*}}}*/ 1033 void IoModel::FetchData(IssmDouble* pscalar, int data_enum){/*{{{*/1150 void IoModel::FetchData(IssmDouble* pscalar,const char* data_name){/*{{{*/ 1034 1151 1035 1152 /*output: */ … … 1041 1158 1042 1159 /*Set file pointer to beginning of the data: */ 1043 fid=this->SetFilePointerToData(&code,NULL,data_ enum);1044 1045 if(code!=3)_error_("expecting a IssmDouble for enum " << EnumToStringx(data_enum));1160 fid=this->SetFilePointerToData(&code,NULL,data_name); 1161 1162 if(code!=3)_error_("expecting a IssmDouble for \""<<data_name<<"\""); 1046 1163 1047 1164 /*We have to read a scalar from disk. First read the dimensions of the scalar, then the scalar: */ … … 1056 1173 } 1057 1174 /*}}}*/ 1058 void IoModel::FetchData(char** pstring, int data_enum){/*{{{*/1175 void IoModel::FetchData(char** pstring,const char* data_name){/*{{{*/ 1059 1176 1060 1177 /*output: */ … … 1067 1184 1068 1185 /*Set file pointer to beginning of the data: */ 1069 fid=this->SetFilePointerToData(&code,NULL,data_ enum);1070 1071 if(code!=4)_error_("expecting a string for enum " << EnumToStringx(data_enum));1186 fid=this->SetFilePointerToData(&code,NULL,data_name); 1187 1188 if(code!=4)_error_("expecting a string for \""<<data_name<<"\""); 1072 1189 1073 1190 /*Now fetch: */ … … 1100 1217 } 1101 1218 /*}}}*/ 1102 void IoModel::FetchData(int** pmatrix,int* pM,int* pN, int data_enum){/*{{{*/1219 void IoModel::FetchData(int** pmatrix,int* pM,int* pN,const char* data_name){/*{{{*/ 1103 1220 int i,j; 1104 1221 … … 1113 1230 1114 1231 /*Set file pointer to beginning of the data: */ 1115 fid=this->SetFilePointerToData(&code,NULL,data_ enum);1116 1117 if(code!=5 && code!=6 && code!=7)_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum)<<" (Code is "<<code<<")");1232 fid=this->SetFilePointerToData(&code,NULL,data_name); 1233 1234 if(code!=5 && code!=6 && code!=7)_error_("expecting a IssmDouble, integer or boolean matrix for \""<<data_name<<"\""<<" (Code is "<<code<<")"); 1118 1235 1119 1236 /*Now fetch: */ … … 1166 1283 } 1167 1284 /*}}}*/ 1168 void IoModel::FetchData(IssmDouble** pmatrix,int* pM,int* pN, int data_enum){/*{{{*/1285 void IoModel::FetchData(IssmDouble** pmatrix,int* pM,int* pN,const char* data_name){/*{{{*/ 1169 1286 1170 1287 /*First, look if has already been loaded (might be an independent variable)*/ … … 1172 1289 for(iter=data.begin();iter<data.end();iter++){ 1173 1290 IoData* iodata=*iter; 1174 if( iodata->data_enum==data_enum){1291 if(strcmp(iodata->name,data_name)==0){ 1175 1292 *pmatrix=iodata->data; 1176 1293 if(pM) *pM=iodata->M; … … 1189 1306 1190 1307 /*Set file pointer to beginning of the data: */ 1191 fid=this->SetFilePointerToData(&code,NULL,data_ enum);1192 if(code!=5 && code!=6 && code!=7)_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum)<<" (Code is "<<code<<")");1308 fid=this->SetFilePointerToData(&code,NULL,data_name); 1309 if(code!=5 && code!=6 && code!=7)_error_("expecting a IssmDouble, integer or boolean matrix for \""<<data_name<<"\""<<" (Code is "<<code<<")"); 1193 1310 1194 1311 /*Now fetch: */ … … 1227 1344 } 1228 1345 /*}}}*/ 1229 void IoModel::FetchData(char*** pstrings,int* pnumstrings,int data_enum){/*{{{*/ 1230 1231 int i; 1232 1233 /*output: */ 1234 int numstrings=0; 1235 char** strings=NULL; 1236 1237 /*intermediary: */ 1238 char* string=NULL; 1239 int string_size; 1240 int code; 1241 1242 /*recover my_rank:*/ 1243 int my_rank=IssmComm::GetRank(); 1244 1245 /*Set file pointer to beginning of the data: */ 1246 fid=this->SetFilePointerToData(&code,NULL,data_enum); 1247 1248 if(code!=9)_error_("expecting a string array for enum " << EnumToStringx(data_enum)); 1249 1250 /*We have to read a bunch of strings from disk. First read the number of strings, and allocate: */ 1251 if(my_rank==0){ 1252 if(fread(&numstrings,sizeof(int),1,fid)!=1) _error_("could not read length of string array"); 1253 } 1254 ISSM_MPI_Bcast(&numstrings,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1255 1256 /*Now allocate string array: */ 1257 if(numstrings){ 1258 strings=xNew<char*>(numstrings); 1259 for(i=0;i<numstrings;i++)strings[i]=NULL; 1260 1261 /*Go through strings, and read: */ 1262 for(i=0;i<numstrings;i++){ 1263 1264 if(my_rank==0){ 1265 if(fread(&string_size,sizeof(int),1,fid)!=1) _error_("could not read length of string "); 1266 } 1267 ISSM_MPI_Bcast(&string_size,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 1268 if(string_size){ 1269 string=xNew<char>((string_size+1)); 1270 string[string_size]='\0'; 1271 1272 /*Read string on node 0, then broadcast: */ 1273 if(my_rank==0){ 1274 if(fread(string,string_size*sizeof(char),1,fid)!=1)_error_(" could not read string "); 1275 } 1276 ISSM_MPI_Bcast(string,string_size,ISSM_MPI_CHAR,0,IssmComm::GetComm()); 1277 } 1278 else{ 1279 string=xNew<char>(1); 1280 string[0]='\0'; 1281 } 1282 1283 strings[i]=string; 1284 } 1285 } 1286 1287 /*Assign output pointers: */ 1288 *pstrings=strings; 1289 *pnumstrings=numstrings; 1290 } 1291 /*}}}*/ 1292 void IoModel::FetchData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum){/*{{{*/ 1346 void IoModel::FetchData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,const char* data_name){/*{{{*/ 1293 1347 1294 1348 int i; … … 1308 1362 1309 1363 /*Set file pointer to beginning of the data: */ 1310 fid=this->SetFilePointerToData(&code,NULL,data_ enum);1311 if(code!=8)_error_("expecting a IssmDouble mat array for enum " << EnumToStringx(data_enum));1364 fid=this->SetFilePointerToData(&code,NULL,data_name); 1365 if(code!=8)_error_("expecting a IssmDouble mat array for \""<<data_name<<"\""); 1312 1366 1313 1367 /*Now fetch: */ … … 1374 1428 void IoModel::FetchData(Option** poption,int index){/*{{{*/ 1375 1429 1430 _error_("not implemented yet"); 1431 1376 1432 /*output: */ 1377 int code;1378 char *name = NULL;1379 1380 / *First get option name*/1381 this->FetchData(&name,index);1382 1383 / *Get option value*/1384 fid=this->SetFilePointerToData(&code,NULL,index+1);1385 switch(code){1386 case 3: {//IssmDouble1387 GenericOption<IssmDouble>* option;1388 IssmDouble value;1389 FetchData(&value,index+1);1390 option = new GenericOption<IssmDouble>();1391 option->value = value;1392 option->name = name;1393 option->numel = 1;1394 option->ndims = 1;1395 option->size = NULL;1396 /*Assign output pointers: */1397 *poption=option;1398 break;1399 }1400 case 4: {//char1401 GenericOption<char*>* option;1402 char* value = NULL;1403 FetchData(&value,index+1);1404 option = new GenericOption<char*>();1405 option->value = value;1406 option->name = name;1407 option->numel = 1;1408 option->ndims = 1;1409 option->size = NULL;1410 *poption=option;1411 break;1412 }1413 default:1414 _error_("Option of format " << code << " not supported yet");1415 }1433 //int code; 1434 //char *name = NULL; 1435 1436 ///*First get option name*/ 1437 //this->FetchData(&name,index); 1438 1439 ///*Get option value*/ 1440 //fid=this->SetFilePointerToData(&code,NULL,index+1); 1441 //switch(code){ 1442 // case 3: {//IssmDouble 1443 // GenericOption<IssmDouble>* option; 1444 // IssmDouble value; 1445 // FetchData(&value,index+1); 1446 // option = new GenericOption<IssmDouble>(); 1447 // option->value = value; 1448 // option->name = name; 1449 // option->numel = 1; 1450 // option->ndims = 1; 1451 // option->size = NULL; 1452 // /*Assign output pointers: */ 1453 // *poption=option; 1454 // break; 1455 // } 1456 // case 4: {//char 1457 // GenericOption<char*>* option; 1458 // char* value = NULL; 1459 // FetchData(&value,index+1); 1460 // option = new GenericOption<char*>(); 1461 // option->value = value; 1462 // option->name = name; 1463 // option->numel = 1; 1464 // option->ndims = 1; 1465 // option->size = NULL; 1466 // *poption=option; 1467 // break; 1468 // } 1469 // default: 1470 // _error_("Option of format " << code << " not supported yet"); 1471 //} 1416 1472 1417 1473 } … … 1420 1476 1421 1477 va_list ap; 1422 int dataenum,code,layout;1478 int code,layout; 1423 1479 IssmDouble *matrix = NULL; 1480 char* data_name; 1424 1481 int M,N; 1425 1482 bool exists; 1483 const char *mddot = "md."; 1426 1484 vector<IoData*>::iterator iter; 1427 1485 1428 /*Go through the entire list of enums and fetch the corresponding data. Add it to the iomodel->data dataset. Everything1486 /*Go through the entire list of names and fetch the corresponding data. Add it to the iomodel->data dataset. Everything 1429 1487 *we fetch is a IssmDouble* : */ 1430 1488 … … 1432 1490 for(int i=0; i<num; i++){ 1433 1491 1434 dataenum=va_arg(ap, int); 1492 data_name=va_arg(ap,char*); 1493 if(strncmp(data_name,mddot,3)!=0) _error_("String provided does not start with \"md.\" ("<<data_name<<")"); 1494 1435 1495 exists = false; 1436 1496 1437 1497 for(iter=data.begin();iter<data.end();iter++){ 1438 1498 IoData* iodata=*iter; 1439 if( iodata->data_enum==dataenum){1499 if(strcmp(iodata->name,data_name)==0){ 1440 1500 /*Already there, no need to fetch it*/ 1441 1501 _assert_(iodata->isindependent); … … 1451 1511 else{ 1452 1512 /*Add to this->data: */ 1453 this->SetFilePointerToData(&code,&layout,data enum);1454 this->FetchData(&matrix,&M,&N,data enum);1455 this->AddData(new IoData(matrix,code,layout,M,N,data enum));1513 this->SetFilePointerToData(&code,&layout,data_name); 1514 this->FetchData(&matrix,&M,&N,data_name); 1515 this->AddData(new IoData(matrix,code,layout,M,N,data_name)); 1456 1516 } 1457 1517 } … … 1459 1519 } 1460 1520 /*}}}*/ 1461 void IoModel::FetchMultipleData(char*** pstrings,int* pnumstrings, int data_enum){/*{{{*/1521 void IoModel::FetchMultipleData(char*** pstrings,int* pnumstrings,const char* data_name){/*{{{*/ 1462 1522 1463 1523 int num_instances; … … 1478 1538 1479 1539 /*Get file pointers to beginning of the data (multiple instances of it): */ 1480 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_ enum);1540 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_name); 1481 1541 1482 1542 if(num_instances){ … … 1487 1547 if(my_rank==0){ 1488 1548 /*check we are indeed finding a string, not something else: */ 1489 if(codes[i]!=4)_error_("expecting a string for enum " << EnumToStringx(data_enum));1549 if(codes[i]!=4)_error_("expecting a string for \""<<data_name<<"\""); 1490 1550 1491 1551 /*We have to read a string from disk. First read the dimensions of the string, then the string: */ … … 1523 1583 } 1524 1584 /*}}}*/ 1525 void IoModel::FetchMultipleData(int** pvector, int* pnum_instances, int data_enum){/*{{{*/1585 void IoModel::FetchMultipleData(int** pvector, int* pnum_instances,const char* data_name){/*{{{*/ 1526 1586 1527 1587 int num_instances; … … 1540 1600 1541 1601 /*Get file pointers to beginning of the data (multiple instances of it): */ 1542 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_ enum);1602 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_name); 1543 1603 1544 1604 if(num_instances){ … … 1552 1612 code=codes[i]; 1553 1613 1554 if(code!=2)_error_("expecting an integer for enum " << EnumToStringx(data_enum));1614 if(code!=2)_error_("expecting an integer for \""<<data_name<<"\""); 1555 1615 1556 1616 /*We have to read a integer from disk. First read the dimensions of the integer, then the integer: */ … … 1576 1636 } 1577 1637 /*}}}*/ 1578 void IoModel::FetchMultipleData(IssmDouble** pvector, int* pnum_instances, int data_enum){/*{{{*/1638 void IoModel::FetchMultipleData(IssmDouble** pvector, int* pnum_instances,const char* data_name){/*{{{*/ 1579 1639 1580 1640 int num_instances; … … 1593 1653 1594 1654 /*Get file pointers to beginning of the data (multiple instances of it): */ 1595 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_ enum);1655 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_name); 1596 1656 1597 1657 if(num_instances){ … … 1605 1665 code=codes[i]; 1606 1666 1607 if(code!=3)_error_("expecting a double for enum " << EnumToStringx(data_enum));1667 if(code!=3)_error_("expecting a double for \""<<data_name<<"\""); 1608 1668 1609 1669 /*We have to read a double from disk: */ … … 1629 1689 } 1630 1690 /*}}}*/ 1631 void IoModel::FetchMultipleData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords, int data_enum){/*{{{*/1691 void IoModel::FetchMultipleData(IssmDouble*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,const char* data_name){/*{{{*/ 1632 1692 1633 1693 int num_instances; … … 1650 1710 1651 1711 /*Get file pointers to beginning of the data (multiple instances of it): */ 1652 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_ enum);1712 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_name); 1653 1713 1654 1714 if(num_instances){ … … 1664 1724 code=codes[i]; 1665 1725 1666 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));1726 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for \""<<data_name<<"\""); 1667 1727 1668 1728 /*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */ … … 1732 1792 } 1733 1793 /*}}}*/ 1734 void IoModel::FetchMultipleData(int*** pmatrices,int** pmdims,int** pndims, int* pnumrecords, int data_enum){/*{{{*/1794 void IoModel::FetchMultipleData(int*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,const char* data_name){/*{{{*/ 1735 1795 1736 1796 int num_instances; … … 1754 1814 1755 1815 /*Get file pointers to beginning of the data (multiple instances of it): */ 1756 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_ enum);1816 file_positions=this->SetFilePointersToData(&codes,NULL,&num_instances,data_name); 1757 1817 1758 1818 if(num_instances){ … … 1768 1828 code=codes[i]; 1769 1829 1770 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for enum " << EnumToStringx(data_enum));1830 if((code!=5) && (code!=6) && (code!=7))_error_("expecting a IssmDouble, integer or boolean matrix for \""<<data_name<<"\""); 1771 1831 1772 1832 /*We have to read a matrix from disk. First read the dimensions of the matrix, then the whole matrix: */ … … 1837 1897 } 1838 1898 /*}}}*/ 1839 void IoModel::FetchDataToInput(Elements* elements, int vector_enum,IssmDouble default_value){/*{{{*/1899 void IoModel::FetchDataToInput(Elements* elements,const char* vector_name,int input_enum,IssmDouble default_value){/*{{{*/ 1840 1900 1841 1901 /*First, look whether it is not already loaded in this->data*/ … … 1843 1903 for(iter=data.begin();iter<data.end();iter++){ 1844 1904 IoData* iodata=*iter; 1845 if( iodata->data_enum==vector_enum){1905 if(strcmp(iodata->name,vector_name)==0){ 1846 1906 _assert_(iodata->code==7); 1847 1907 for(int i=0;i<elements->Size();i++){ 1848 1908 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1849 element->InputCreate(iodata->data,this,iodata->M,iodata->N,iodata->layout, vector_enum,iodata->code);//we need i to index into elements.1909 element->InputCreate(iodata->data,this,iodata->M,iodata->N,iodata->layout,input_enum,iodata->code);//we need i to index into elements. 1850 1910 } 1851 1911 return; … … 1858 1918 int M,N; 1859 1919 1860 /*First of, find the record for the enum, and get code of data type: */1861 this->SetFilePointerToData(&code, &vector_layout,vector_ enum);1920 /*First of, find the record for the name, and get code of data type: */ 1921 this->SetFilePointerToData(&code, &vector_layout,vector_name); 1862 1922 1863 1923 /*Defaulting only supported for double arrays*/ 1864 if(code!=7) _error_( EnumToStringx(vector_enum)<<" is not a double array");1865 1866 this->FetchData(&doublearray,&M,&N,vector_ enum);1924 if(code!=7) _error_(vector_name<<" is not a double array"); 1925 1926 this->FetchData(&doublearray,&M,&N,vector_name); 1867 1927 1868 1928 for(int i=0;i<elements->Size();i++){ 1869 1929 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1870 if(!doublearray) element->AddInput( vector_enum,&default_value,P0Enum);1871 else element->InputCreate(doublearray,this,M,N,vector_layout, vector_enum,code);//we need i to index into elements.1930 if(!doublearray) element->AddInput(input_enum,&default_value,P0Enum); 1931 else element->InputCreate(doublearray,this,M,N,vector_layout,input_enum,code);//we need i to index into elements. 1872 1932 } 1873 1933 … … 1876 1936 } 1877 1937 /*}}}*/ 1878 void IoModel::FetchDataToInput(Elements* elements, int vector_enum){/*{{{*/1938 void IoModel::FetchDataToInput(Elements* elements,const char* vector_name,int input_enum){/*{{{*/ 1879 1939 1880 1940 /*First, look whether it is not already loaded in this->data*/ … … 1882 1942 for(iter=data.begin();iter<data.end();iter++){ 1883 1943 IoData* iodata=*iter; 1884 if( iodata->data_enum==vector_enum){1944 if(strcmp(iodata->name,vector_name)==0){ 1885 1945 for(int i=0;i<elements->Size();i++){ 1886 1946 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1887 element->InputCreate(iodata->data,this,iodata->M,iodata->N,iodata->layout, vector_enum,iodata->code);//we need i to index into elements.1947 element->InputCreate(iodata->data,this,iodata->M,iodata->N,iodata->layout,input_enum,iodata->code);//we need i to index into elements. 1888 1948 } 1889 1949 return; … … 1903 1963 int M,N; 1904 1964 1905 /*First of, find the record for the enum, and get code of data type: */1906 this->SetFilePointerToData(&code, &vector_layout,vector_ enum);1965 /*First of, find the record for the name, and get code of data type: */ 1966 this->SetFilePointerToData(&code, &vector_layout,vector_name); 1907 1967 1908 1968 switch(code){ 1909 1969 case 1: //boolean constant 1910 this->FetchData(&boolean,vector_ enum);1970 this->FetchData(&boolean,vector_name); 1911 1971 for(i=0;i<elements->Size();i++){ 1912 1972 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1913 element->InputUpdateFromConstant(boolean, vector_enum);1973 element->InputUpdateFromConstant(boolean,input_enum); 1914 1974 } 1915 1975 break; 1916 1976 case 2: //integer constant 1917 this->FetchData(&integer,vector_ enum);1977 this->FetchData(&integer,vector_name); 1918 1978 for(i=0;i<elements->Size();i++){ 1919 1979 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1920 element->InputUpdateFromConstant(integer, vector_enum);1980 element->InputUpdateFromConstant(integer,input_enum); 1921 1981 } 1922 1982 break; 1923 1983 case 3: //IssmDouble constant 1924 this->FetchData(&scalar,vector_ enum);1984 this->FetchData(&scalar,vector_name); 1925 1985 for(i=0;i<elements->Size();i++){ 1926 1986 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1927 element->InputUpdateFromConstant(scalar, vector_enum);1987 element->InputUpdateFromConstant(scalar,input_enum); 1928 1988 } 1929 1989 break; 1930 1990 case 5: //boolean vector 1931 this->FetchData(&doublearray,&M,&N,vector_ enum); //we still have a doublearray, because it might include times in transient mode1932 if(!doublearray) _error_( EnumToStringx(vector_enum)<<" not found in binary file");1991 this->FetchData(&doublearray,&M,&N,vector_name); //we still have a doublearray, because it might include times in transient mode 1992 if(!doublearray) _error_("\""<<vector_name<<"\" not found in binary file"); 1933 1993 for(i=0;i<elements->Size();i++){ 1934 1994 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1935 element->InputCreate(doublearray,this,M,N,vector_layout, vector_enum,code);//we need i to index into elements.1995 element->InputCreate(doublearray,this,M,N,vector_layout,input_enum,code);//we need i to index into elements. 1936 1996 } 1937 1997 break; 1938 1998 case 6: //int vector 1939 this->FetchData(&doublearray,&M,&N,vector_ enum); //we still have a doublearray, because it might include times in transient mode1940 if(!doublearray) _error_( EnumToStringx(vector_enum)<<" not found in binary file");1999 this->FetchData(&doublearray,&M,&N,vector_name); //we still have a doublearray, because it might include times in transient mode 2000 if(!doublearray) _error_("\""<<vector_name<<"\" not found in binary file"); 1941 2001 for(i=0;i<elements->Size();i++){ 1942 2002 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1943 element->InputCreate(doublearray,this,M,N,vector_layout, vector_enum,code);//we need i to index into elements.2003 element->InputCreate(doublearray,this,M,N,vector_layout,input_enum,code);//we need i to index into elements. 1944 2004 } 1945 2005 break; 1946 2006 case 7: //IssmDouble vector 1947 this->FetchData(&doublearray,&M,&N,vector_ enum);1948 if(!doublearray) _error_( EnumToStringx(vector_enum)<<" not found in binary file");2007 this->FetchData(&doublearray,&M,&N,vector_name); 2008 if(!doublearray) _error_("\""<<vector_name<<"\" not found in binary file"); 1949 2009 for(i=0;i<elements->Size();i++){ 1950 2010 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i)); 1951 element->InputCreate(doublearray,this,M,N,vector_layout, vector_enum,code);//we need i to index into elements.2011 element->InputCreate(doublearray,this,M,N,vector_layout,input_enum,code);//we need i to index into elements. 1952 2012 } 1953 2013 break; 1954 2014 default: 1955 _error_("data code " << code << " not supported yet !");2015 _error_("data code " << code << " not supported yet (detected while processing \""<<vector_name<<"\")"); 1956 2016 break; 1957 2017 } … … 1978 2038 /*Now march through file looking for the correct data identifier: */ 1979 2039 for(;;){ 1980 /*Read enumfor this size of first string name: */2040 /*Read name for this size of first string name: */ 1981 2041 if(fread(&index,sizeof(int),1,fid)==0){ 1982 2042 /*Ok, we have reached the end of the file. break: */ … … 1997 2057 } 1998 2058 /*}}}*/ 1999 FILE* IoModel::SetFilePointerToData(int* pcode,int* pvector_type, int data_enum){/*{{{*/2059 FILE* IoModel::SetFilePointerToData(int* pcode,int* pvector_type,const char* data_name){/*{{{*/ 2000 2060 2001 2061 int my_rank; 2002 2062 2003 int found = 0; 2004 int record_enum; 2063 int found = 0; 2064 const char* mddot = "md."; 2065 char* record_name = NULL; 2066 int record_name_size; 2005 2067 int record_length; 2006 2068 int record_code; //1 to 7 number … … 2009 2071 /*recover my_rank:*/ 2010 2072 my_rank=IssmComm::GetRank(); 2073 _assert_(strncmp(data_name,mddot,3)==0); 2011 2074 2012 2075 /*Go find in the binary file, the position of the data we want to fetch: */ … … 2018 2081 /*Now march through file looking for the correct data identifier: */ 2019 2082 for(;;){ 2020 /*Read enum for this size of first string name: */ 2021 if(fread(&record_enum,sizeof(int),1,fid)==0){ 2022 /*Ok, we have reached the end of the file. break: */ 2083 /*Read size of first string name: */ 2084 if(fread(&record_name_size,sizeof(int),1,fid)==0){ 2085 /*we have reached the end of the file. break: */ 2086 xDelete<char>(record_name); 2087 break; 2088 } 2089 if(record_name_size<3 || record_name_size>80){ 2090 _error_("error while looking in binary file. Found a string of size "<<record_name_size); 2091 } 2092 2093 /*Allocate string of correct size: */ 2094 record_name=xNew<char>(record_name_size+1); 2095 record_name[record_name_size]='\0'; 2096 2097 /*Read record_name: */ 2098 if(fread(record_name,record_name_size*sizeof(char),1,fid)==0){ 2099 /*we have reached the end of the file. break: */ 2023 2100 found=0; 2101 xDelete<char>(record_name); 2024 2102 break; 2025 2103 } 2104 if(strncmp(record_name,mddot,3)!=0){ 2105 _error_("error while reading binary file: record does not start with \"md.\": "<<record_name); 2106 } 2026 2107 2027 2108 /*Is this the record sought for? : */ 2028 if (data_enum==record_enum){2109 if(strcmp(record_name,data_name)==0){ 2029 2110 /*Ok, we have found the correct string. Pass the record length, and read data type code: */ 2030 2111 fseek(fid,sizeof(int),SEEK_CUR); … … 2036 2117 } 2037 2118 found=1; 2119 xDelete<char>(record_name); 2038 2120 break; 2039 2121 } … … 2043 2125 /*skip: */ 2044 2126 fseek(fid,record_length,SEEK_CUR); 2127 xDelete<char>(record_name); 2045 2128 } 2046 2129 } 2047 2130 } 2048 2131 ISSM_MPI_Bcast(&found,1,ISSM_MPI_INT,0,IssmComm::GetComm()); 2049 if(!found)_error_("could not find data with name " << EnumToStringx(data_enum) <<" in binary file");2132 if(!found)_error_("could not find data with name \"" << data_name << "\" in binary file"); 2050 2133 2051 2134 /*Broadcast code and vector type: */ … … 2060 2143 } 2061 2144 /*}}}*/ 2062 fpos_t* IoModel::SetFilePointersToData(int** pcodes,int** pvector_types, int* pnum_instances, int data_enum){/*{{{*/2145 fpos_t* IoModel::SetFilePointersToData(int** pcodes,int** pvector_types, int* pnum_instances,const char* data_name){/*{{{*/ 2063 2146 2064 2147 int found = 0; 2065 int record_enum; 2148 const char* mddot = "md."; 2149 char* record_name = NULL; 2150 int record_name_size; 2066 2151 int record_length; 2067 2152 int record_code; //1 to 7 number … … 2075 2160 /*recover my_rank:*/ 2076 2161 int my_rank=IssmComm::GetRank(); 2162 _assert_(strncmp(data_name,mddot,3)==0); 2077 2163 2078 2164 /*Go find in the binary file, the data we want to fetch and count the number of … … 2085 2171 /*Now march through file looking for the correct data identifier: */ 2086 2172 for(;;){ 2087 /*Read enum for this size of first string name: */ 2088 if(fread(&record_enum,sizeof(int),1,fid)==0){ 2089 /*Ok, we have reached the end of the file. break: */ 2173 /*Read size of first string name: */ 2174 if(fread(&record_name_size,sizeof(int),1,fid)==0){ 2175 /*we have reached the end of the file. break: */ 2176 xDelete<char>(record_name); 2090 2177 break; 2091 2178 } 2179 if(record_name_size<3 || record_name_size>80){ 2180 _error_("error while looking in binary file. Found a string of size "<<record_name_size); 2181 } 2182 2183 /*Allocate string of correct size: */ 2184 record_name=xNew<char>(record_name_size+1); 2185 record_name[record_name_size]='\0'; 2186 2187 /*Read record_name: */ 2188 if(fread(record_name,record_name_size*sizeof(char),1,fid)==0){ 2189 break; 2190 } 2191 if(strncmp(record_name,mddot,3)!=0){ 2192 _error_("error while reading binary file: record does not start with \"md.\": "<<record_name); 2193 } 2092 2194 2093 2195 /*Is this the record sought for? : */ 2094 if (data_enum==record_enum) num_instances++;2196 if(strcmp(record_name,data_name)==0) num_instances++; 2095 2197 2096 2198 /*Read the record length, and use it to skip the record: */ 2097 2199 if(fread(&record_length,sizeof(int),1,fid)!=1) _error_("Could not read record_length"); 2098 2200 fseek(fid,record_length,SEEK_CUR); 2201 xDelete<char>(record_name); 2099 2202 } 2100 2203 … … 2112 2215 2113 2216 for(;;){ 2114 /*Read enum for thissize of first string name: */2115 if(fread(&record_ enum,sizeof(int),1,fid)==0){2116 /* Ok,we have reached the end of the file. break: */2217 /*Read size of first string name: */ 2218 if(fread(&record_name_size,sizeof(int),1,fid)==0){ 2219 /*we have reached the end of the file. break: */ 2117 2220 break; 2118 2221 } 2222 if(record_name_size<3 || record_name_size>80){ 2223 _error_("error while looking in binary file. Found a string of size "<<record_name_size); 2224 } 2225 2226 /*Allocate string of correct size: */ 2227 record_name=xNew<char>(record_name_size+1); 2228 record_name[record_name_size]='\0'; 2229 2230 /*Read record_name: */ 2231 if(fread(record_name,record_name_size*sizeof(char),1,fid)==0){ 2232 /*we have reached the end of the file. break: */ 2233 xDelete<char>(record_name); 2234 break; 2235 } 2236 if(strncmp(record_name,mddot,3)!=0){ 2237 _error_("error while reading binary file: record does not start with \"md.\": "<<record_name); 2238 } 2119 2239 2120 2240 /*Is this the record sought for? : */ 2121 if (data_enum==record_enum){2241 if(strcmp(record_name,data_name)==0){ 2122 2242 /*Ok, we have found the correct string. Pass the record length, and read data type code: */ 2123 2243 fseek(fid,sizeof(int),SEEK_CUR); … … 2145 2265 /*skip: */ 2146 2266 fseek(fid,record_length,SEEK_CUR); 2267 xDelete<char>(record_name); 2147 2268 } 2148 2269 } -
issm/trunk-jpl/src/c/classes/IoModel.h
r20653 r20690 19 19 public: 20 20 bool isindependent; 21 int data_enum;22 21 char* name; 23 22 Param* constant; … … 25 24 ~IoConstant(); 26 25 IoConstant(); 27 IoConstant(bool value,int enum_in); 28 IoConstant(int value,int enum_in); 29 IoConstant(IssmDouble value,int enum_in); 30 IoConstant(char* value,int enum_in); 26 IoConstant(bool value,const char* name_in); 27 IoConstant(int value,const char* name_in); 28 IoConstant(IssmDouble value,const char* name_in); 29 IoConstant(char* value,const char* name_in); 30 IoConstant(char** value,int numstrings,const char* name_in); 31 31 }; 32 32 … … 34 34 public: 35 35 bool isindependent; 36 int data_enum;37 36 char* name; 38 37 int M,N; … … 43 42 ~IoData(); 44 43 IoData(); 45 IoData(IssmDouble* matrix,int code,int layout_in,int M,int N, int enum_in);44 IoData(IssmDouble* matrix,int code,int layout_in,int M,int N,const char* name_in); 46 45 }; 47 46 … … 99 98 void AddData(IoData* data_in); 100 99 void AddDataIndependent(IoData* data_in); 101 void FindConstant(bool* pvalue,int constant_enum); 102 void FindConstant(int* pvalue,int constant_enum); 103 void FindConstant(IssmDouble* pvalue,int constant_enum); 104 void FindConstant(char **pvalue,int constant_enum); 105 void FetchIndependentConstant(int* pXcount,IssmPDouble* X,int name); 106 void FetchIndependentData(int* pXcount,IssmPDouble* X,int name); 100 void FindConstant(bool* pvalue,const char* constant_name); 101 void FindConstant(int* pvalue,const char* constant_name); 102 void FindConstant(IssmDouble* pvalue,const char* constant_name); 103 void FindConstant(char **pvalue,const char* constant_name); 104 void FindConstant(char ***pvalue,int* psize,const char* constant_name); 105 void FetchIndependentConstant(int* pXcount,IssmPDouble* X,const char* name); 106 void FetchIndependentData(int* pXcount,IssmPDouble* X,const char* name); 107 107 int NumIndependents(); 108 108 void FillIndependents(IssmDouble* xp); 109 109 110 110 /*Input/Output*/ 111 void Check EnumSync(void);112 Param *CopyConstantObject( int constant_enum);113 IssmDouble *Data( int dataenum);111 void CheckFile(void); 112 Param *CopyConstantObject(const char* constant_name,int param_enum); 113 IssmDouble *Data(const char* data_name); 114 114 void DeleteData(int num,...); 115 void DeleteData(IssmDouble* vector, int dataenum);116 void DeleteData(char*** pstringarray, int numstrings, int dataenum);115 void DeleteData(IssmDouble* vector,const char* data_name); 116 void DeleteData(char*** pstringarray, int numstrings,const char* data_name); 117 117 void FetchConstants(void); 118 void FetchData(bool* pboolean,int data_enum); 119 void FetchData(int* pinteger,int data_enum); 120 void FetchData(IssmDouble* pscalar,int data_enum); 121 void FetchData(char** pstring,int data_enum); 122 void FetchData(int** pmatrix,int* pM,int* pN,int data_enum); 123 void FetchData(IssmDouble** pscalarmatrix,int* pM,int* pN,int data_enum); 124 void FetchData(char*** pstringarray,int* pnumstrings,int data_enum); 125 void FetchData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum); 126 void FetchMultipleData(char*** pstringarray,int* pnumstrings,int data_enum); 127 void FetchMultipleData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,int data_enum); 128 void FetchMultipleData(int*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,int data_enum); 129 void FetchMultipleData(int** pvector, int* pnum_instances,int data_enum); 130 void FetchMultipleData(IssmDouble** pvector, int* pnum_instances,int data_enum); 131 void FetchData(Option **poption,int data_enum); 118 void FetchData(bool* pboolean,const char* data_name); 119 void FetchData(int* pinteger,const char* data_name); 120 void FetchData(IssmDouble* pscalar,const char* data_name); 121 void FetchData(char** pstring,const char* data_name); 122 void FetchData(int** pmatrix,int* pM,int* pN,const char* data_name); 123 void FetchData(IssmDouble** pscalarmatrix,int* pM,int* pN,const char* data_name); 124 void FetchData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,const char* data_name); 125 void FetchMultipleData(char*** pstringarray,int* pnumstrings,const char* data_name); 126 void FetchMultipleData(IssmDouble*** pmatrixarray,int** pmdims,int** pndims, int* pnumrecords,const char* data_name); 127 void FetchMultipleData(int*** pmatrices,int** pmdims,int** pndims, int* pnumrecords,const char* data_name); 128 void FetchMultipleData(int** pvector, int* pnum_instances,const char* data_name); 129 void FetchMultipleData(IssmDouble** pvector, int* pnum_instances,const char* data_name); 130 void FetchData(Option **poption,int index); 132 131 void FetchData(int num,...); 133 void FetchDataToInput(Elements* elements, int vector_enum);134 void FetchDataToInput(Elements* elements, int vector_enum,IssmDouble default_value);132 void FetchDataToInput(Elements* elements,const char* vector_name,int input_enum); 133 void FetchDataToInput(Elements* elements,const char* vector_name,int input_enum,IssmDouble default_value); 135 134 void LastIndex(int *pindex); 136 FILE* SetFilePointerToData(int* pcode,int* pvector_type, int data_enum);137 fpos_t* SetFilePointersToData(int** pcodes,int** pvector_types, int* pnum_instances, int data_enum);135 FILE* SetFilePointerToData(int* pcode,int* pvector_type, const char* data_name); 136 fpos_t* SetFilePointersToData(int** pcodes,int** pvector_types, int* pnum_instances, const char* data_name); 138 137 void DeclareIndependents(bool trace,IssmPDouble* X); 139 138 void StartTrace(bool trace); 140 void FetchIndependent( int dependent_enum);139 void FetchIndependent(const char* dependent_name); 141 140 }; 142 141 -
issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp
r20645 r20690 46 46 47 47 /*Fetch parameters: */ 48 iomodel->FindConstant(&penalty_lock, StressbalanceRiftPenaltyLockEnum);48 iomodel->FindConstant(&penalty_lock,"md.stressbalance.rift_penalty_lock"); 49 49 50 50 /*Ok, retrieve all the data needed to add a penalty between the two nodes: */ 51 el1=reCast<int,IssmDouble>(*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+2));52 el2=reCast<int,IssmDouble>(*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+3)) ;53 54 node1=reCast<int,IssmDouble>(*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+0));55 node2=reCast<int,IssmDouble>(*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+1));51 el1=reCast<int,IssmDouble>(*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+2)); 52 el2=reCast<int,IssmDouble>(*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+3)) ; 53 54 node1=reCast<int,IssmDouble>(*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+0)); 55 node2=reCast<int,IssmDouble>(*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+1)); 56 56 57 57 /*id: */ … … 78 78 this->penalty_lock=penalty_lock; 79 79 this->material_converged=0; 80 this->normal[0]=*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+4);81 this->normal[1]=*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+5);82 this->length=*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+6);83 this->fraction=*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+9);84 this->state=reCast<int,IssmDouble>(*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+11));80 this->normal[0]=*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+4); 81 this->normal[1]=*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+5); 82 this->length=*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+6); 83 this->fraction=*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+9); 84 this->state=reCast<int,IssmDouble>(*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+11)); 85 85 86 86 //intialize properties 87 87 this->type=SegmentRiftfrontEnum; 88 this->fill = reCast<int,IssmDouble>(*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+7));89 this->friction=*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+8);90 this->fractionincrement=*(iomodel->Data( RiftsRiftstructEnum)+RIFTINFOSIZE*i+10);91 this->shelf=reCast<bool,IssmDouble>(iomodel->Data( MaskGroundediceLevelsetEnum)[node1-1]<0.);88 this->fill = reCast<int,IssmDouble>(*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+7)); 89 this->friction=*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+8); 90 this->fractionincrement=*(iomodel->Data("md.rifts.riftstruct")+RIFTINFOSIZE*i+10); 91 this->shelf=reCast<bool,IssmDouble>(iomodel->Data("md.mask.groundedice_levelset")[node1-1]<0.); 92 92 93 93 //parameters and hooked fields: we still can't point to them, they may not even exist. Configure will handle this. -
issm/trunk-jpl/src/c/classes/Materials/Matice.cpp
r20665 r20690 49 49 /*Other perporties*/ 50 50 int materialtype; 51 iomodel->FindConstant(&materialtype, MaterialsEnum);51 iomodel->FindConstant(&materialtype,"md.materials.type"); 52 52 if(materialtype==MatdamageiceEnum) this->isdamaged = true; 53 53 else if(materialtype==MaticeEnum) this->isdamaged = false; -
issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp
r20687 r20690 19 19 Matpar::Matpar(int matpar_mid, IoModel* iomodel){/*{{{*/ 20 20 21 rho_ice =0;22 rho_water =0;23 rho_freshwater =0;24 mu_water =0;25 heatcapacity =0;26 thermalconductivity =0;27 temperateiceconductivity =0;28 latentheat =0;29 beta =0;30 meltingpoint =0;31 referencetemperature =0;32 mixed_layer_capacity =0;33 thermal_exchange_velocity =0;34 g =0;35 omega =0;36 desfac =0;37 rlaps =0;38 rlapslgm =0;39 dpermil =0;40 41 albedo_snow =0;42 albedo_ice =0;43 44 sediment_compressibility =0;45 sediment_porosity =0;46 sediment_thickness =0;47 water_compressibility =0;48 49 epl_compressibility =0;50 epl_porosity =0;51 epl_init_thickness =0;52 epl_colapse_thickness =0;53 epl_max_thickness =0;54 epl_conductivity =0;55 56 lithosphere_shear_modulus =0;57 lithosphere_density =0;58 mantle_shear_modulus =0;59 mantle_density =0;21 rho_ice = 0; 22 rho_water = 0; 23 rho_freshwater = 0; 24 mu_water = 0; 25 heatcapacity = 0; 26 thermalconductivity = 0; 27 temperateiceconductivity = 0; 28 latentheat = 0; 29 beta = 0; 30 meltingpoint = 0; 31 referencetemperature = 0; 32 mixed_layer_capacity = 0; 33 thermal_exchange_velocity = 0; 34 g = 0; 35 omega = 0; 36 desfac = 0; 37 rlaps = 0; 38 rlapslgm = 0; 39 dpermil = 0; 40 41 albedo_snow = 0; 42 albedo_ice = 0; 43 44 sediment_compressibility = 0; 45 sediment_porosity = 0; 46 sediment_thickness = 0; 47 water_compressibility = 0; 48 49 epl_compressibility = 0; 50 epl_porosity = 0; 51 epl_init_thickness = 0; 52 epl_colapse_thickness = 0; 53 epl_max_thickness = 0; 54 epl_conductivity = 0; 55 56 lithosphere_shear_modulus = 0; 57 lithosphere_density = 0; 58 mantle_shear_modulus = 0; 59 mantle_density = 0; 60 60 61 earth_density =0;62 63 poisson =0;64 young_modulus =0;65 ridging_exponent =0;66 cohesion =0;67 internal_friction_coef =0;68 compression_coef =0;69 traction_coef =0;70 time_relaxation_stress =0;71 time_relaxation_damage =0;61 earth_density = 0; 62 63 poisson = 0; 64 young_modulus = 0; 65 ridging_exponent = 0; 66 cohesion = 0; 67 internal_friction_coef = 0; 68 compression_coef = 0; 69 traction_coef = 0; 70 time_relaxation_stress = 0; 71 time_relaxation_damage = 0; 72 72 73 73 bool isefficientlayer; 74 74 int hydrology_model,smb_model,materials_type; 75 iomodel->FindConstant(&hydrology_model, HydrologyModelEnum);76 iomodel->FindConstant(&smb_model, SmbEnum);77 iomodel->FindConstant(&materials_type, MaterialsEnum);75 iomodel->FindConstant(&hydrology_model,"md.hydrology.model"); 76 iomodel->FindConstant(&smb_model,"md.smb.model"); 77 iomodel->FindConstant(&materials_type,"md.materials.type"); 78 78 79 79 this->mid = matpar_mid; … … 83 83 case MatdamageiceEnum: 84 84 case MatestarEnum: 85 iomodel->FindConstant(&this->rho_ice, MaterialsRhoIceEnum);86 iomodel->FindConstant(&this->rho_water, MaterialsRhoSeawaterEnum);87 iomodel->FindConstant(&this->rho_freshwater, MaterialsRhoFreshwaterEnum);88 iomodel->FindConstant(&this->mu_water, MaterialsMuWaterEnum);89 iomodel->FindConstant(&this->heatcapacity, MaterialsHeatcapacityEnum);90 iomodel->FindConstant(&this->thermalconductivity, MaterialsThermalconductivityEnum);91 iomodel->FindConstant(&this->temperateiceconductivity, MaterialsTemperateiceconductivityEnum);92 iomodel->FindConstant(&this->latentheat, MaterialsLatentheatEnum);93 iomodel->FindConstant(&this->beta, MaterialsBetaEnum);94 iomodel->FindConstant(&this->meltingpoint, MaterialsMeltingpointEnum);95 iomodel->FindConstant(&this->referencetemperature, ConstantsReferencetemperatureEnum);96 iomodel->FindConstant(&this->mixed_layer_capacity, MaterialsMixedLayerCapacityEnum);97 iomodel->FindConstant(&this->thermal_exchange_velocity, MaterialsThermalExchangeVelocityEnum);98 iomodel->FindConstant(&this->g, ConstantsGEnum);85 iomodel->FindConstant(&this->rho_ice,"md.materials.rho_ice"); 86 iomodel->FindConstant(&this->rho_water,"md.materials.rho_water"); 87 iomodel->FindConstant(&this->rho_freshwater,"md.materials.rho_freshwater"); 88 iomodel->FindConstant(&this->mu_water,"md.materials.mu_water"); 89 iomodel->FindConstant(&this->heatcapacity,"md.materials.heatcapacity"); 90 iomodel->FindConstant(&this->thermalconductivity,"md.materials.thermalconductivity"); 91 iomodel->FindConstant(&this->temperateiceconductivity,"md.materials.temperateiceconductivity"); 92 iomodel->FindConstant(&this->latentheat,"md.materials.latentheat"); 93 iomodel->FindConstant(&this->beta,"md.materials.beta"); 94 iomodel->FindConstant(&this->meltingpoint,"md.materials.meltingpoint"); 95 iomodel->FindConstant(&this->referencetemperature,"md.constants.referencetemperature"); 96 iomodel->FindConstant(&this->mixed_layer_capacity,"md.materials.mixed_layer_capacity"); 97 iomodel->FindConstant(&this->thermal_exchange_velocity,"md.materials.thermal_exchange_velocity"); 98 iomodel->FindConstant(&this->g,"md.constants.g"); 99 99 100 100 switch(smb_model){ … … 103 103 break; 104 104 case SMBgembEnum: 105 iomodel->FindConstant(&this->albedo_ice, SmbAIceEnum);106 iomodel->FindConstant(&this->albedo_snow, SmbASnowEnum);105 iomodel->FindConstant(&this->albedo_ice,"md.smb.aIce"); 106 iomodel->FindConstant(&this->albedo_snow,"md.smb.aSnow"); 107 107 break; 108 108 case SMBpddEnum: 109 iomodel->FindConstant(&this->desfac, SmbDesfacEnum);110 iomodel->FindConstant(&this->rlaps, SmbRlapsEnum);111 iomodel->FindConstant(&this->rlapslgm, SmbRlapslgmEnum);109 iomodel->FindConstant(&this->desfac,"md.smb.desfac"); 110 iomodel->FindConstant(&this->rlaps,"md.smb.rlaps"); 111 iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm"); 112 112 break; 113 113 case SMBd18opddEnum: 114 iomodel->FindConstant(&this->desfac, SmbDesfacEnum);115 iomodel->FindConstant(&this->rlaps, SmbRlapsEnum);116 iomodel->FindConstant(&this->rlapslgm, SmbRlapslgmEnum);117 iomodel->FindConstant(&this->dpermil, SmbDpermilEnum);114 iomodel->FindConstant(&this->desfac,"md.smb.desfac"); 115 iomodel->FindConstant(&this->rlaps,"md.smb.rlaps"); 116 iomodel->FindConstant(&this->rlapslgm,"md.smb.rlapslgm"); 117 iomodel->FindConstant(&this->dpermil,"md.smb.dpermil"); 118 118 case SMBgradientsEnum: 119 119 break; … … 133 133 } 134 134 if(hydrology_model==HydrologydcEnum){ 135 iomodel->FindConstant(&this->sediment_compressibility, HydrologydcSedimentCompressibilityEnum);136 iomodel->FindConstant(&this->sediment_porosity, HydrologydcSedimentPorosityEnum);137 iomodel->FindConstant(&this->sediment_thickness, HydrologydcSedimentThicknessEnum);138 iomodel->FindConstant(&this->water_compressibility, HydrologydcWaterCompressibilityEnum);139 iomodel->FindConstant(&isefficientlayer, HydrologydcIsefficientlayerEnum);135 iomodel->FindConstant(&this->sediment_compressibility,"md.hydrology.sediment_compressibility"); 136 iomodel->FindConstant(&this->sediment_porosity,"md.hydrology.sediment_porosity"); 137 iomodel->FindConstant(&this->sediment_thickness,"md.hydrology.sediment_thickness"); 138 iomodel->FindConstant(&this->water_compressibility,"md.hydrology.water_compressibility"); 139 iomodel->FindConstant(&isefficientlayer,"md.hydrology.isefficientlayer"); 140 140 141 141 if(isefficientlayer){ 142 iomodel->FindConstant(&this->epl_compressibility, HydrologydcEplCompressibilityEnum);143 iomodel->FindConstant(&this->epl_porosity, HydrologydcEplPorosityEnum);144 iomodel->FindConstant(&this->epl_init_thickness, HydrologydcEplInitialThicknessEnum);145 iomodel->FindConstant(&this->epl_colapse_thickness, HydrologydcEplColapseThicknessEnum);146 iomodel->FindConstant(&this->epl_max_thickness, HydrologydcEplMaxThicknessEnum);147 iomodel->FindConstant(&this->epl_conductivity, HydrologydcEplConductivityEnum);142 iomodel->FindConstant(&this->epl_compressibility,"md.hydrology.epl_compressibility"); 143 iomodel->FindConstant(&this->epl_porosity,"md.hydrology.epl_porosity"); 144 iomodel->FindConstant(&this->epl_init_thickness,"md.hydrology.epl_initial_thickness"); 145 iomodel->FindConstant(&this->epl_colapse_thickness,"md.hydrology.epl_colapse_thickness"); 146 iomodel->FindConstant(&this->epl_max_thickness,"md.hydrology.epl_max_thickness"); 147 iomodel->FindConstant(&this->epl_conductivity,"md.hydrology.epl_conductivity"); 148 148 } 149 149 } … … 159 159 160 160 /*gia: */ 161 iomodel->FindConstant(&this->lithosphere_shear_modulus, MaterialsLithosphereShearModulusEnum);162 iomodel->FindConstant(&this->lithosphere_density, MaterialsLithosphereDensityEnum);163 iomodel->FindConstant(&this->mantle_shear_modulus, MaterialsMantleShearModulusEnum);164 iomodel->FindConstant(&this->mantle_density, MaterialsMantleDensityEnum);161 iomodel->FindConstant(&this->lithosphere_shear_modulus,"md.materials.lithosphere_shear_modulus"); 162 iomodel->FindConstant(&this->lithosphere_density,"md.materials.lithosphere_density"); 163 iomodel->FindConstant(&this->mantle_shear_modulus,"md.materials.mantle_shear_modulus"); 164 iomodel->FindConstant(&this->mantle_density,"md.materials.mantle_density"); 165 165 166 166 /*slr:*/ 167 iomodel->FindConstant(&this->earth_density, MaterialsEarthDensityEnum);167 iomodel->FindConstant(&this->earth_density,"md.materials.earth_density"); 168 168 169 169 break; -
issm/trunk-jpl/src/c/classes/Node.cpp
r20462 r20690 55 55 56 56 /*Coordinate system provided, convert to coord_system matrix*/ 57 _assert_(iomodel->Data( StressbalanceReferentialEnum));58 XZvectorsToCoordinateSystem(&this->coord_system[0][0],&iomodel->Data( StressbalanceReferentialEnum)[io_index*6]);57 _assert_(iomodel->Data("md.stressbalance.referential")); 58 XZvectorsToCoordinateSystem(&this->coord_system[0][0],&iomodel->Data("md.stressbalance.referential")[io_index*6]); 59 59 _assert_(sqrt( coord_system[0][0]*coord_system[0][0] + coord_system[1][0]*coord_system[1][0]) >1.e-4); 60 60 61 61 if(iomodel->domaintype!=Domain2DhorizontalEnum & iomodel->domaintype!=Domain3DsurfaceEnum){ 62 62 /*We have a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 63 _assert_(iomodel->Data( MeshVertexonbaseEnum));64 _assert_(iomodel->Data( FlowequationVertexEquationEnum));65 if(in_approximation==SSAApproximationEnum && !reCast<int>(iomodel->Data( MeshVertexonbaseEnum)[io_index])){63 _assert_(iomodel->Data("md.mesh.vertexonbase")); 64 _assert_(iomodel->Data("md.flowequation.vertex_equation")); 65 if(in_approximation==SSAApproximationEnum && !reCast<int>(iomodel->Data("md.mesh.vertexonbase")[io_index])){ 66 66 this->HardDeactivate(); 67 67 } 68 if(in_approximation==L1L2ApproximationEnum && !reCast<int>(iomodel->Data( MeshVertexonbaseEnum)[io_index])){68 if(in_approximation==L1L2ApproximationEnum && !reCast<int>(iomodel->Data("md.mesh.vertexonbase")[io_index])){ 69 69 this->HardDeactivate(); 70 70 } 71 if(in_approximation==SSAHOApproximationEnum && reCast<int>(iomodel->Data( FlowequationBorderSSAEnum)[io_index])){72 if(!reCast<int>(iomodel->Data( MeshVertexonbaseEnum)[io_index])){71 if(in_approximation==SSAHOApproximationEnum && reCast<int>(iomodel->Data("md.flowequation.borderSSA")[io_index])){ 72 if(!reCast<int>(iomodel->Data("md.mesh.vertexonbase")[io_index])){ 73 73 this->HardDeactivate(); 74 74 } 75 75 } 76 if(in_approximation==SSAFSApproximationEnum && reCast<int>(iomodel->Data( FlowequationBorderSSAEnum)[io_index])){77 if(!reCast<int>(iomodel->Data( MeshVertexonbaseEnum)[io_index])){76 if(in_approximation==SSAFSApproximationEnum && reCast<int>(iomodel->Data("md.flowequation.borderSSA")[io_index])){ 77 if(!reCast<int>(iomodel->Data("md.mesh.vertexonbase")[io_index])){ 78 78 for(k=0;k<=1;k++) this->FreezeDof(k); 79 79 } … … 99 99 if(iomodel->domaintype!=Domain2DhorizontalEnum & iomodel->domaintype!=Domain3DsurfaceEnum & iomodel->domaintype!=Domain3DsurfaceEnum){ 100 100 /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 101 _assert_(iomodel->Data( MeshVertexonbaseEnum));102 if(!(reCast<bool>(iomodel->Data( MeshVertexonbaseEnum)[io_index]))){101 _assert_(iomodel->Data("md.mesh.vertexonbase")); 102 if(!(reCast<bool>(iomodel->Data("md.mesh.vertexonbase")[io_index]))){ 103 103 this->HardDeactivate(); 104 104 } … … 110 110 if(iomodel->domaintype!=Domain2DhorizontalEnum){ 111 111 /*On a 3d mesh, we may have collapsed elements, hence dead nodes. Freeze them out: */ 112 _assert_(iomodel->Data( MeshVertexonsurfaceEnum));113 if(!(reCast<bool>(iomodel->Data( MeshVertexonsurfaceEnum)[io_index]))){112 _assert_(iomodel->Data("md.mesh.vertexonsurface")); 113 if(!(reCast<bool>(iomodel->Data("md.mesh.vertexonsurface")[io_index]))){ 114 114 this->HardDeactivate(); 115 115 } -
issm/trunk-jpl/src/c/classes/Params/BoolParam.h
r20635 r20690 69 69 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 70 70 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 71 void SetEnum(int enum_in){this->enum_type = enum_in;}; 71 72 /*}}}*/ 72 73 }; -
issm/trunk-jpl/src/c/classes/Params/DataSetParam.h
r20635 r20690 71 71 void SetValue(DataSet* dataset){_error_("DataSet param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a DataSet yet");} 72 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("DataSet param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");} 73 void SetEnum(int enum_in){this->enum_type = enum_in;}; 73 74 /*}}}*/ 74 75 }; -
issm/trunk-jpl/src/c/classes/Params/DoubleMatArrayParam.h
r20635 r20690 72 72 void SetValue(FILE* fid){_error_("Bool param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 73 73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array); 74 void SetEnum(int enum_in){this->enum_type = enum_in;}; 74 75 /*}}}*/ 75 76 }; -
issm/trunk-jpl/src/c/classes/Params/DoubleMatParam.h
r20635 r20690 71 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 void SetEnum(int enum_in){this->enum_type = enum_in;}; 73 74 /*}}}*/ 74 75 /*DoubleMatParam specific routines:{{{*/ -
issm/trunk-jpl/src/c/classes/Params/DoubleParam.h
r20635 r20690 70 70 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 71 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 72 void SetEnum(int enum_in){this->enum_type = enum_in;}; 72 73 /*}}}*/ 73 74 }; -
issm/trunk-jpl/src/c/classes/Params/DoubleVecParam.h
r20635 r20690 70 70 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 71 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 72 void SetEnum(int enum_in){this->enum_type = enum_in;}; 72 73 /*}}}*/ 73 74 /*DoubleVecParam specific routines:{{{*/ -
issm/trunk-jpl/src/c/classes/Params/FileParam.h
r20635 r20690 69 69 void SetValue(FILE* fid){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 70 70 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("File param of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold an array of matrices");} 71 void SetEnum(int enum_in){this->enum_type = enum_in;}; 71 72 /*}}}*/ 72 73 }; -
issm/trunk-jpl/src/c/classes/Params/GenericParam.h
r20635 r20690 94 94 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold a FILE");} 95 95 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(myEnumVal) << " cannot hold an array of matrices");} 96 void SetEnum(int enum_in){this->myEnumVal = enum_in;}; 96 97 97 98 /*}}}*/ -
issm/trunk-jpl/src/c/classes/Params/IntMatParam.h
r20635 r20690 71 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 void SetEnum(int enum_in){this->enum_type = enum_in;}; 73 74 /*}}}*/ 74 75 }; -
issm/trunk-jpl/src/c/classes/Params/IntParam.h
r20635 r20690 70 70 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 71 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 72 void SetEnum(int enum_in){this->enum_type = enum_in;}; 72 73 /*}}}*/ 73 74 }; -
issm/trunk-jpl/src/c/classes/Params/IntVecParam.h
r20635 r20690 71 71 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 72 72 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 73 void SetEnum(int enum_in){this->enum_type = enum_in;}; 73 74 /*}}}*/ 74 75 }; -
issm/trunk-jpl/src/c/classes/Params/MatrixParam.h
r20635 r20690 70 70 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 71 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 72 void SetEnum(int enum_in){this->enum_type = enum_in;}; 72 73 /*}}}*/ 73 74 }; -
issm/trunk-jpl/src/c/classes/Params/Param.h
r20636 r20690 59 59 virtual void SetValue(FILE* fid)=0; 60 60 virtual void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array)=0; 61 virtual void SetEnum(int enum_in)=0; 61 62 }; 62 63 #endif -
issm/trunk-jpl/src/c/classes/Params/StringArrayParam.cpp
r20635 r20690 135 135 136 136 /*Assign output pointers:*/ 137 *pM=M;137 if(pM) *pM=M; 138 138 *pstringarray=outstrings; 139 139 } -
issm/trunk-jpl/src/c/classes/Params/StringArrayParam.h
r20635 r20690 70 70 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 71 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 72 void SetEnum(int enum_in){this->enum_type = enum_in;}; 72 73 /*}}}*/ 73 74 }; -
issm/trunk-jpl/src/c/classes/Params/StringParam.h
r20635 r20690 70 70 void SetValue(FILE* fid){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold a FILE");} 71 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 72 void SetEnum(int enum_in){this->enum_type = enum_in;}; 72 73 /*}}}*/ 73 74 }; -
issm/trunk-jpl/src/c/classes/Params/TransientParam.h
r20635 r20690 72 72 void SetValue(FILE* fid){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold a FILE");} 73 73 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Parameter " <<EnumToStringx(enum_type) << " cannot hold an array of matrices");} 74 void SetEnum(int enum_in){this->enum_type = enum_in;}; 74 75 /*}}}*/ 75 76 }; -
issm/trunk-jpl/src/c/classes/Params/VectorParam.h
r20635 r20690 70 70 void SetValue(FILE* fid){_error_("Vector of enum " << enum_type << " (" << EnumToStringx(enum_type) << ") cannot hold a FILE");} 71 71 void SetValue(IssmDouble** array, int M, int* mdim_array, int* ndim_array){_error_("Param "<< EnumToStringx(enum_type) << " cannot hold an array of matrices");} 72 void SetEnum(int enum_in){this->enum_type = enum_in;}; 72 73 /*}}}*/ 73 74 }; -
issm/trunk-jpl/src/c/classes/Vertex.cpp
r20665 r20690 26 26 this->pid = UNDEF; 27 27 28 _assert_(iomodel->Data( MeshXEnum) && iomodel->Data(MeshYEnum) && iomodel->Data(MeshZEnum));29 this->x = iomodel->Data( MeshXEnum)[i];30 this->y = iomodel->Data( MeshYEnum)[i];31 this->z = iomodel->Data( MeshZEnum)[i];28 _assert_(iomodel->Data("md.mesh.x") && iomodel->Data("md.mesh.y") && iomodel->Data("md.mesh.z")); 29 this->x = iomodel->Data("md.mesh.x")[i]; 30 this->y = iomodel->Data("md.mesh.y")[i]; 31 this->z = iomodel->Data("md.mesh.z")[i]; 32 32 this->domaintype = iomodel->domaintype; 33 33 34 34 switch(iomodel->domaintype){ 35 35 case Domain3DEnum: 36 _assert_(iomodel->Data( BaseEnum) && iomodel->Data(ThicknessEnum));37 this->sigma = (iomodel->Data( MeshZEnum)[i]-iomodel->Data(BaseEnum)[i])/(iomodel->Data(ThicknessEnum)[i]);36 _assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness")); 37 this->sigma = (iomodel->Data("md.mesh.z")[i]-iomodel->Data("md.geometry.base")[i])/(iomodel->Data("md.geometry.thickness")[i]); 38 38 break; 39 39 case Domain3DsurfaceEnum: 40 this->latitute = iomodel->Data( MeshLatEnum)[i];41 this->longitude = iomodel->Data( MeshLongEnum)[i];42 this->R = iomodel->Data( MeshREnum)[i];40 this->latitute = iomodel->Data("md.mesh.lat")[i]; 41 this->longitude = iomodel->Data("md.mesh.long")[i]; 42 this->R = iomodel->Data("md.mesh.r")[i]; 43 43 break; 44 44 case Domain2DhorizontalEnum: … … 46 46 break; 47 47 case Domain2DverticalEnum: 48 _assert_(iomodel->Data( BaseEnum) && iomodel->Data(ThicknessEnum));49 this->sigma = (iomodel->Data( MeshYEnum)[i]-iomodel->Data(BaseEnum)[i])/(iomodel->Data(ThicknessEnum)[i]);48 _assert_(iomodel->Data("md.geometry.base") && iomodel->Data("md.geometry.thickness")); 49 this->sigma = (iomodel->Data("md.mesh.y")[i]-iomodel->Data("md.geometry.base")[i])/(iomodel->Data("md.geometry.thickness")[i]); 50 50 break; 51 51 } -
issm/trunk-jpl/src/c/main/kriging.cpp
r20653 r20690 144 144 IoModel* iomodel = new IoModel(); 145 145 iomodel->fid=fid; 146 iomodel->Check EnumSync();147 iomodel->FetchData(&x,&M,&N, 0); nobs=M*N;148 iomodel->FetchData(&y,&M,&N, 1); _assert_(M*N==nobs);149 iomodel->FetchData(&data,&M,&N, 2); _assert_(M*N==nobs);150 iomodel->FetchData(&x_interp,&M,&N, 3); ninterp=M*N;151 iomodel->FetchData(&y_interp,&M,&N, 4); _assert_(M*N==ninterp);146 iomodel->CheckFile(); 147 iomodel->FetchData(&x,&M,&N,"md.0"); nobs=M*N; 148 iomodel->FetchData(&y,&M,&N,"md.1"); _assert_(M*N==nobs); 149 iomodel->FetchData(&data,&M,&N,"md.2"); _assert_(M*N==nobs); 150 iomodel->FetchData(&x_interp,&M,&N,"md.3"); ninterp=M*N; 151 iomodel->FetchData(&y_interp,&M,&N,"md.4"); _assert_(M*N==ninterp); 152 152 153 153 /*Read options*/ -
issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp
r19117 r20690 8 8 #include "../ModelProcessorx/ModelProcessorx.h" 9 9 10 void IoModelToConstraintsx(Constraints* constraints,IoModel* iomodel, int vector_enum,int analysis_type,int finite_element,int dof){10 void IoModelToConstraintsx(Constraints* constraints,IoModel* iomodel,const char* spc_name,int analysis_type,int finite_element,int dof){ 11 11 12 12 /*intermediary: */ … … 16 16 17 17 /*First of, find the record for the enum, and get code of data type: */ 18 iomodel->SetFilePointerToData(&code, &vector_layout, vector_enum);19 if(code!=7)_error_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));20 if(vector_layout!=1)_error_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));18 iomodel->SetFilePointerToData(&code, &vector_layout,spc_name); 19 if(code!=7)_error_("expecting a IssmDouble vector for constraints " << spc_name); 20 if(vector_layout!=1)_error_("expecting a nodal vector for constraints " << spc_name); 21 21 22 22 /*Fetch vector:*/ 23 iomodel->FetchData(&spcdata,&M,&N, vector_enum);23 iomodel->FetchData(&spcdata,&M,&N,spc_name); 24 24 25 25 /*Call IoModelToConstraintsx*/ … … 29 29 xDelete<IssmDouble>(spcdata); 30 30 } 31 void IoModelToDynamicConstraintsx(Constraints* constraints,IoModel* iomodel, int vector_enum,int analysis_type,int finite_element,int dof){31 void IoModelToDynamicConstraintsx(Constraints* constraints,IoModel* iomodel,const char* spc_name,int analysis_type,int finite_element,int dof){ 32 32 33 33 /*intermediary: */ … … 37 37 38 38 /*First of, find the record for the enum, and get code of data type: */ 39 iomodel->SetFilePointerToData(&code, &vector_layout, vector_enum);40 if(code!=7)_error_("expecting a IssmDouble vector for constraints with enum " << EnumToStringx(vector_enum));41 if(vector_layout!=1)_error_("expecting a nodal vector for constraints with enum " << EnumToStringx(vector_enum));39 iomodel->SetFilePointerToData(&code, &vector_layout,spc_name); 40 if(code!=7)_error_("expecting a IssmDouble vector for constraints " << spc_name); 41 if(vector_layout!=1)_error_("expecting a nodal vector for constraints " << spc_name); 42 42 43 43 /*Fetch vector:*/ 44 iomodel->FetchData(&spcdata,&M,&N, vector_enum);44 iomodel->FetchData(&spcdata,&M,&N,spc_name); 45 45 46 46 /*Call IoModelToConstraintsx*/ -
issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.h
r19117 r20690 8 8 9 9 /* local prototypes: */ 10 void IoModelToConstraintsx(Constraints* constraints,IoModel* iomodel, int vector_enum,int analysis_type,int finite_element,int dof=0);10 void IoModelToConstraintsx(Constraints* constraints,IoModel* iomodel,const char* spc_name,int analysis_type,int finite_element,int dof=0); 11 11 void IoModelToConstraintsx(Constraints* constraints,IoModel* iomodel,IssmDouble* spcdata,int M,int N,int analysis_type,int finite_element,int dof=0); 12 void IoModelToDynamicConstraintsx(Constraints* constraints,IoModel* iomodel, int vector_enum,int analysis_type,int finite_element,int dof=0);12 void IoModelToDynamicConstraintsx(Constraints* constraints,IoModel* iomodel,const char* spc_name,int analysis_type,int finite_element,int dof=0); 13 13 void IoModelToDynamicConstraintsx(Constraints* constraints,IoModel* iomodel,IssmDouble* spcdata,int M,int N,int analysis_type,int finite_element,int dof=0); 14 14 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Autodiff/CreateParametersAutodiff.cpp
r20653 r20690 11 11 12 12 int i; 13 bool autodiff_analysis;13 bool isautodiff; 14 14 int num_dependent_objects; 15 15 int num_dep=0; … … 28 28 29 29 /*retrieve some parameters: */ 30 iomodel->FindConstant(& autodiff_analysis,AutodiffIsautodiffEnum);30 iomodel->FindConstant(&isautodiff,"md.autodiff.isautodiff"); 31 31 32 32 #ifdef _HAVE_ADOLC_ … … 72 72 /*}}}*/ 73 73 74 if( autodiff_analysis){74 if(isautodiff){ 75 75 /*Copy some parameters from IoModel to parameters dataset: {{{*/ 76 parameters->AddObject(iomodel->CopyConstantObject( AutodiffKeepEnum));77 parameters->AddObject(iomodel->CopyConstantObject( AutodiffObufsizeEnum));78 parameters->AddObject(iomodel->CopyConstantObject( AutodiffCbufsizeEnum));79 parameters->AddObject(iomodel->CopyConstantObject( AutodiffLbufsizeEnum));80 parameters->AddObject(iomodel->CopyConstantObject( AutodiffTbufsizeEnum));81 parameters->AddObject(iomodel->CopyConstantObject( AutodiffGcTriggerRatioEnum));82 parameters->AddObject(iomodel->CopyConstantObject( AutodiffGcTriggerMaxSizeEnum));76 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.keep",AutodiffKeepEnum)); 77 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.obuffsize",AutodiffObufsizeEnum)); 78 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.cbuffsize",AutodiffCbufsizeEnum)); 79 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.lbuffsize",AutodiffLbufsizeEnum)); 80 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.tbuffsize",AutodiffTbufsizeEnum)); 81 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.gcTriggerRatio",AutodiffGcTriggerRatioEnum)); 82 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.gcTriggerMaxSize",AutodiffGcTriggerMaxSizeEnum)); 83 83 /*}}}*/ 84 84 /*retrieve driver: {{{*/ 85 iomodel->FindConstant(&autodiff_driver, AutodiffDriverEnum);86 parameters->AddObject(iomodel->CopyConstantObject( AutodiffDriverEnum));85 iomodel->FindConstant(&autodiff_driver,"md.autodiff.driver"); 86 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.driver",AutodiffDriverEnum)); 87 87 88 88 if(strcmp(autodiff_driver,"fos_forward")==0){ 89 parameters->AddObject(iomodel->CopyConstantObject( AutodiffFosForwardIndexEnum));89 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.fos_forward_index",AutodiffFosForwardIndexEnum)); 90 90 } 91 91 else if(strcmp(autodiff_driver,"fos_reverse")==0){ 92 parameters->AddObject(iomodel->CopyConstantObject( AutodiffFosReverseIndexEnum));92 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.fos_reverse_index",AutodiffFosReverseIndexEnum)); 93 93 } 94 94 else if(strcmp(autodiff_driver,"fov_forward")==0){ 95 95 /*Retrieve list of indices: */ 96 iomodel->FetchData(&indices,&num_indices,&dummy, AutodiffFovForwardIndicesEnum);96 iomodel->FetchData(&indices,&num_indices,&dummy,"md.autodiff.fov_forward_indices"); 97 97 parameters->AddObject(new IntMatParam(AutodiffFovForwardIndicesEnum,indices,num_indices,1)); 98 98 xDelete<int>(indices); … … 101 101 /*}}}*/ 102 102 /*Deal with dependents first: {{{*/ 103 iomodel->FindConstant(&num_dependent_objects, AutodiffNumDependentObjectsEnum);103 iomodel->FindConstant(&num_dependent_objects,"md.autodiff.num_dependent_objects"); 104 104 dependent_objects=new DataSet(); 105 105 num_dep=0; 106 106 107 107 if(num_dependent_objects){ 108 iomodel->F etchData(&names,&dummy,AutodiffDependentObjectNamesEnum);109 iomodel->FetchData(&types,&dummy,&dummy, AutodiffDependentObjectTypesEnum);110 iomodel->FetchData(&indices,&dummy,&dummy, AutodiffDependentObjectIndicesEnum);108 iomodel->FindConstant(&names,&dummy,"md.autodiff.dependent_object_names"); 109 iomodel->FetchData(&types,&dummy,&dummy,"md.autodiff.dependent_object_types"); 110 iomodel->FetchData(&indices,&dummy,&dummy,"md.autodiff.dependent_object_indices"); 111 111 112 112 for(i=0;i<num_dependent_objects;i++){ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/CreateParametersControl.cpp
r20645 r20690 15 15 int num_controls; 16 16 int num_costfunc; 17 int *control_type= NULL;18 int *maxiter 19 int *cm_responses 20 IssmDouble *cm_jump 21 IssmDouble *optscal 17 char** controls = NULL; 18 int *maxiter = NULL; 19 int *cm_responses = NULL; 20 IssmDouble *cm_jump = NULL; 21 IssmDouble *optscal = NULL; 22 22 IssmDouble *control_scaling_factors = NULL; 23 23 24 24 /*retrieve some parameters: */ 25 iomodel->FindConstant(&control_analysis, InversionIscontrolEnum);26 iomodel->FindConstant(&inversiontype, InversionTypeEnum);25 iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol"); 26 iomodel->FindConstant(&inversiontype,"md.inversion.type"); 27 27 28 28 if(control_analysis){ 29 29 30 30 /*How many controls and how many responses?*/ 31 parameters->AddObject(iomodel->CopyConstantObject( InversionNumControlParametersEnum));32 parameters->AddObject(iomodel->CopyConstantObject( InversionNumCostFunctionsEnum));31 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.num_control_parameters",InversionNumControlParametersEnum)); 32 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.num_cost_functions",InversionNumCostFunctionsEnum)); 33 33 34 34 /*What solution type?*/ … … 40 40 } 41 41 42 /*Now, recover fit, optscal and maxiter as vectors: */ 43 iomodel->FetchData(&control_type,NULL,&num_controls,InversionControlParametersEnum); 44 iomodel->FetchData(&cm_responses,NULL,&num_costfunc,InversionCostFunctionsEnum); 45 parameters->AddObject(new IntVecParam(InversionControlParametersEnum,control_type,num_controls)); 42 /*recover controls and convert to Enums*/ 43 iomodel->FindConstant(&controls,&num_controls,"md.inversion.control_parameters"); 44 if(num_controls<1) _error_("no controls found"); 45 int* control_enums=xNew<int>(num_controls); 46 for(int i=0;i<num_controls;i++){ 47 control_enums[i]=StringToEnumx(controls[i]); 48 xDelete<char>(controls[i]); 49 } 50 xDelete<char*>(controls); 51 parameters->AddObject(new IntVecParam(InversionControlParametersEnum,control_enums,num_controls)); 52 53 iomodel->FetchData(&cm_responses,NULL,&num_costfunc,"md.inversion.cost_functions"); 46 54 parameters->AddObject(new IntVecParam(InversionCostFunctionsEnum,cm_responses,num_costfunc)); 55 xDelete<int>(control_enums); 47 56 48 57 /*Inversion type specifics*/ 49 58 switch(inversiontype){ 50 59 case 0:/*Brent Search*/ 51 parameters->AddObject(iomodel->CopyConstantObject( InversionIncompleteAdjointEnum));52 parameters->AddObject(iomodel->CopyConstantObject( InversionNstepsEnum));53 parameters->AddObject(iomodel->CopyConstantObject( InversionCostFunctionThresholdEnum));54 iomodel->FetchData(&cm_jump,&nsteps,NULL, InversionStepThresholdEnum);55 iomodel->FetchData(&optscal,NULL,NULL, InversionGradientScalingEnum);56 iomodel->FetchData(&maxiter,NULL,NULL, InversionMaxiterPerStepEnum);60 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.incomplete_adjoint",InversionIncompleteAdjointEnum)); 61 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.nsteps",InversionNstepsEnum)); 62 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.cost_function_threshold",InversionCostFunctionThresholdEnum)); 63 iomodel->FetchData(&cm_jump,&nsteps,NULL,"md.inversion.step_threshold"); 64 iomodel->FetchData(&optscal,NULL,NULL,"md.inversion.gradient_scaling"); 65 iomodel->FetchData(&maxiter,NULL,NULL,"md.inversion.maxiter_per_step"); 57 66 parameters->AddObject(new DoubleMatParam(InversionGradientScalingEnum,optscal,nsteps,num_controls)); 58 67 parameters->AddObject(new DoubleVecParam(InversionStepThresholdEnum,cm_jump,nsteps)); … … 60 69 break; 61 70 case 1:/*TAO*/ 62 parameters->AddObject(iomodel->CopyConstantObject( InversionIncompleteAdjointEnum));63 parameters->AddObject(iomodel->CopyConstantObject( InversionFatolEnum));64 parameters->AddObject(iomodel->CopyConstantObject( InversionFrtolEnum));65 parameters->AddObject(iomodel->CopyConstantObject( InversionGatolEnum));66 parameters->AddObject(iomodel->CopyConstantObject( InversionGrtolEnum));67 parameters->AddObject(iomodel->CopyConstantObject( InversionGttolEnum));68 parameters->AddObject(iomodel->CopyConstantObject( InversionMaxstepsEnum));69 parameters->AddObject(iomodel->CopyConstantObject( InversionMaxiterEnum));70 parameters->AddObject(iomodel->CopyConstantObject( InversionAlgorithmEnum));71 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.incomplete_adjoint",InversionIncompleteAdjointEnum)); 72 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.fatol",InversionFatolEnum)); 73 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.frtol",InversionFrtolEnum)); 74 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.gatol",InversionGatolEnum)); 75 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.grtol",InversionGrtolEnum)); 76 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.gttol",InversionGttolEnum)); 77 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.maxsteps",InversionMaxstepsEnum)); 78 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.maxiter",InversionMaxiterEnum)); 79 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.algorithm",InversionAlgorithmEnum)); 71 80 break; 72 81 case 2:/*M1QN3*/ 73 parameters->AddObject(iomodel->CopyConstantObject( InversionIncompleteAdjointEnum));74 parameters->AddObject(iomodel->CopyConstantObject( InversionDxminEnum));75 parameters->AddObject(iomodel->CopyConstantObject( InversionGttolEnum));76 parameters->AddObject(iomodel->CopyConstantObject( InversionMaxstepsEnum));77 parameters->AddObject(iomodel->CopyConstantObject( InversionMaxiterEnum));78 iomodel->FetchData(&control_scaling_factors,NULL,NULL, InversionControlScalingFactorsEnum);82 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.incomplete_adjoint",InversionIncompleteAdjointEnum)); 83 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.dxmin",InversionDxminEnum)); 84 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.gttol",InversionGttolEnum)); 85 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.maxsteps",InversionMaxstepsEnum)); 86 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.maxiter",InversionMaxiterEnum)); 87 iomodel->FetchData(&control_scaling_factors,NULL,NULL,"md.inversion.control_scaling_factors"); 79 88 parameters->AddObject(new DoubleVecParam(InversionControlScalingFactorsEnum,control_scaling_factors,num_controls)); 80 89 break; 81 90 case 3:/*Validation*/ 82 parameters->AddObject(iomodel->CopyConstantObject( InversionIncompleteAdjointEnum));83 iomodel->FetchData(&control_scaling_factors,NULL,NULL, InversionControlScalingFactorsEnum);91 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.incomplete_adjoint",InversionIncompleteAdjointEnum)); 92 iomodel->FetchData(&control_scaling_factors,NULL,NULL,"md.inversion.control_scaling_factors"); 84 93 parameters->AddObject(new DoubleVecParam(InversionControlScalingFactorsEnum,control_scaling_factors,num_controls)); 85 94 break; 86 95 case 4:/*M1QN3 AD*/ 87 parameters->AddObject(iomodel->CopyConstantObject( InversionDxminEnum));88 parameters->AddObject(iomodel->CopyConstantObject( InversionGttolEnum));89 parameters->AddObject(iomodel->CopyConstantObject( InversionMaxstepsEnum));90 parameters->AddObject(iomodel->CopyConstantObject( InversionMaxiterEnum));91 iomodel->FetchData(&control_scaling_factors,NULL,NULL, InversionControlScalingFactorsEnum);96 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.dxmin",InversionDxminEnum)); 97 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.gttol",InversionGttolEnum)); 98 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.maxsteps",InversionMaxstepsEnum)); 99 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.maxiter",InversionMaxiterEnum)); 100 iomodel->FetchData(&control_scaling_factors,NULL,NULL,"md.inversion.control_scaling_factors"); 92 101 parameters->AddObject(new DoubleVecParam(InversionControlScalingFactorsEnum,control_scaling_factors,num_controls)); 93 102 break; … … 97 106 } 98 107 99 xDelete<int>(control_ type);108 xDelete<int>(control_enums); 100 109 xDelete<int>(cm_responses); 101 110 xDelete<int>(maxiter); 102 111 xDelete<IssmDouble>(control_scaling_factors); 103 iomodel->DeleteData(cm_jump, InversionStepThresholdEnum);104 iomodel->DeleteData(optscal, InversionGradientScalingEnum);112 iomodel->DeleteData(cm_jump,"md.inversion.step_threshold"); 113 iomodel->DeleteData(optscal,"md.inversion.gradient_scaling"); 105 114 } 106 115 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Control/UpdateElementsAndMaterialsControl.cpp
r20645 r20690 15 15 Element *element = NULL; 16 16 Material *material = NULL; 17 int num_control_type,num_cost_functions; 17 int num_controls,num_cost_functions; 18 int* control_enums = NULL; 19 char** controls; 18 20 bool control_analysis; 19 21 20 22 /*Fetch parameters: */ 21 iomodel->FindConstant(&control_analysis, InversionIscontrolEnum);22 if(control_analysis) iomodel->FindConstant(&num_control _type,InversionNumControlParametersEnum);23 iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol"); 24 if(control_analysis) iomodel->FindConstant(&num_controls,"md.inversion.num_control_parameters"); 23 25 24 26 /*Now, return if no control*/ 25 27 if(!control_analysis) return; 26 28 27 iomodel->FetchData(5,InversionControlParametersEnum,InversionCostFunctionsEnum,InversionCostFunctionsCoefficientsEnum,InversionMinParametersEnum,InversionMaxParametersEnum); 29 /*Process controls and convert from string to enums*/ 30 iomodel->FindConstant(&controls,&num_controls,"md.inversion.control_parameters"); 31 if(num_controls<1) _error_("no controls found"); 32 control_enums=xNew<int>(num_controls); 33 for(int i=0;i<num_controls;i++){ 34 control_enums[i]=StringToEnumx(controls[i]); 35 } 36 37 iomodel->FetchData(4,"md.inversion.cost_functions","md.inversion.cost_functions_coefficients","md.inversion.min_parameters","md.inversion.max_parameters"); 28 38 29 39 /*Fetch Observations */ 30 iomodel->FindConstant(&num_cost_functions, InversionNumCostFunctionsEnum);31 iomodel->FindConstant(&domaintype, DomainTypeEnum);40 iomodel->FindConstant(&num_cost_functions,"md.inversion.num_cost_functions"); 41 iomodel->FindConstant(&domaintype,"md.mesh.domain_type"); 32 42 for(int i=0;i<num_cost_functions;i++){ 33 cost_function= reCast<int,IssmDouble>(iomodel->Data( InversionCostFunctionsEnum)[i]);34 //iomodel->FetchDataToInput(elements, InversionThicknessObsEnum);35 if( cost_function==ThicknessAbsMisfitEnum) iomodel->FetchDataToInput(elements, InversionThicknessObsEnum);36 else if(cost_function==SurfaceAbsMisfitEnum) iomodel->FetchDataToInput(elements, InversionSurfaceObsEnum);43 cost_function= reCast<int,IssmDouble>(iomodel->Data("md.inversion.cost_functions")[i]); 44 //iomodel->FetchDataToInput(elements,"md.inversion.thickness_obs",InversionThicknessObsEnum); 45 if( cost_function==ThicknessAbsMisfitEnum) iomodel->FetchDataToInput(elements,"md.inversion.thickness_obs",InversionThicknessObsEnum); 46 else if(cost_function==SurfaceAbsMisfitEnum) iomodel->FetchDataToInput(elements,"md.inversion.surface_obs",InversionSurfaceObsEnum); 37 47 else if(cost_function==SurfaceAbsVelMisfitEnum 38 48 || cost_function==SurfaceRelVelMisfitEnum … … 40 50 || cost_function==SurfaceLogVxVyMisfitEnum 41 51 || cost_function==SurfaceAverageVelMisfitEnum){ 42 iomodel->FetchDataToInput(elements, InversionVxObsEnum);43 if (domaintype!=Domain2DverticalEnum) iomodel->FetchDataToInput(elements,InversionVyObsEnum);52 iomodel->FetchDataToInput(elements,"md.inversion.vx_obs",InversionVxObsEnum); 53 if(domaintype!=Domain2DverticalEnum) iomodel->FetchDataToInput(elements,"md.inversion.vy_obs",InversionVyObsEnum); 44 54 } 45 55 } 46 56 47 for(int i=0;i<num_control _type;i++){48 control = reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i]);57 for(int i=0;i<num_controls;i++){ 58 control = control_enums[i]; 49 59 switch(control){ 50 60 /*List of supported controls*/ 51 case BalancethicknessThickeningRateEnum: 52 case VxEnum: 53 case VyEnum: 54 case ThicknessEnum: 55 case FrictionCoefficientEnum: 56 case FrictionAsEnum: 57 case BalancethicknessApparentMassbalanceEnum: 58 case BalancethicknessOmegaEnum: 59 case MaterialsRheologyBEnum: 60 iomodel->FetchData(1,control); 61 break; 62 61 case BalancethicknessThickeningRateEnum: iomodel->FetchData(1,"md.balancethickness.thickening_rate"); break; 62 case VxEnum: iomodel->FetchData(1,"md.initialization.vx"); break; 63 case VyEnum: iomodel->FetchData(1,"md.initialization.vy"); break; 64 case ThicknessEnum: iomodel->FetchData(1,"md.geometry.thickness"); break; 65 case FrictionCoefficientEnum: iomodel->FetchData(1,"md.friction.coefficient"); break; 66 case FrictionAsEnum: iomodel->FetchData(1,"md.friction.As"); break; 67 case BalancethicknessApparentMassbalanceEnum: iomodel->FetchData(1,"md.balancethickness.apparent_massbalance"); break; 68 case BalancethicknessOmegaEnum: iomodel->FetchData(1,"md.balancethickness.omega"); break; 69 case MaterialsRheologyBEnum: iomodel->FetchData(1,"md.materials.rheology_B"); break; 63 70 /*Special cases*/ 64 case MaterialsRheologyBbarEnum: iomodel->FetchData(1, MaterialsRheologyBEnum); break;65 case DamageDbarEnum: iomodel->FetchData(1, DamageDEnum); break;71 case MaterialsRheologyBbarEnum: iomodel->FetchData(1,"md.materials.rheology_B"); break; 72 case DamageDbarEnum: iomodel->FetchData(1,"md.damage.D"); break; 66 73 default: 67 74 _error_("Control " << EnumToStringx(control) << " not implemented yet"); … … 80 87 81 88 /*Free data: */ 82 for(int i=0;i<num_control_type;i++){ 83 control = reCast<int,IssmDouble>(iomodel->Data(InversionControlParametersEnum)[i]); 84 switch(control){ 85 case MaterialsRheologyBbarEnum: iomodel->DeleteData(1,MaterialsRheologyBEnum); break; 86 case DamageDbarEnum: iomodel->DeleteData(1,DamageDEnum); break; 87 default: iomodel->DeleteData(1,control); 89 for(int i=0;i<num_controls;i++){ 90 switch(control_enums[i]){ 91 /*List of supported controls*/ 92 case BalancethicknessThickeningRateEnum: iomodel->DeleteData(1,"md.balancethickness.thickening_rate"); break; 93 case VxEnum: iomodel->DeleteData(1,"md.initialization.vx"); break; 94 case VyEnum: iomodel->DeleteData(1,"md.initialization.vy"); break; 95 case ThicknessEnum: iomodel->DeleteData(1,"md.geometry.thickness"); break; 96 case FrictionCoefficientEnum: iomodel->DeleteData(1,"md.friction.coefficient"); break; 97 case FrictionAsEnum: iomodel->DeleteData(1,"md.friction.As"); break; 98 case BalancethicknessApparentMassbalanceEnum: iomodel->DeleteData(1,"md.balancethickness.apparent_massbalance"); break; 99 case BalancethicknessOmegaEnum: iomodel->DeleteData(1,"md.balancethickness.omega"); break; 100 case MaterialsRheologyBEnum: iomodel->DeleteData(1,"md.materials.rheology_B"); break; 101 /*Special cases*/ 102 case MaterialsRheologyBbarEnum: iomodel->DeleteData(1,"md.materials.rheology_B"); break; 103 case DamageDbarEnum: iomodel->DeleteData(1,"md.damage.D"); break; 104 default: 105 _error_("Control " << EnumToStringx(control_enums[i]) << " not implemented yet"); 88 106 } 89 107 } 90 iomodel->DeleteData(5,InversionControlParametersEnum,InversionCostFunctionsCoefficientsEnum,InversionCostFunctionsEnum,InversionMinParametersEnum,InversionMaxParametersEnum); 108 iomodel->DeleteData(4,"md.inversion.cost_functions","md.inversion.cost_functions_coefficients","md.inversion.min_parameters","md.inversion.max_parameters"); 109 xDelete<int>(control_enums); 110 for(int i=0;i<num_controls;i++) xDelete<char>(controls[i]); 111 xDelete<char*>(controls); 112 91 113 92 114 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateElementsVerticesAndMaterials.cpp
r20687 r20690 17 17 18 18 /*Fetch parameters: */ 19 iomodel->FindConstant(&control_analysis, InversionIscontrolEnum);20 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);21 iomodel->FindConstant(&materials_type, MaterialsEnum);19 iomodel->FindConstant(&control_analysis,"md.inversion.iscontrol"); 20 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 21 iomodel->FindConstant(&materials_type,"md.materials.type"); 22 22 23 23 /*Did we already create the elements? : */ … … 25 25 26 26 /*Create elements*/ 27 if(control_analysis)iomodel->FetchData( 3,InversionControlParametersEnum,InversionMinParametersEnum,InversionMaxParametersEnum);27 if(control_analysis)iomodel->FetchData(2,"md.inversion.min_parameters","md.inversion.max_parameters"); 28 28 switch(iomodel->meshelementtype){ 29 29 case TriaEnum: … … 38 38 break; 39 39 case PentaEnum: 40 iomodel->FetchData(2, MeshUpperelementsEnum,MeshLowerelementsEnum);40 iomodel->FetchData(2,"md.mesh.upperelements","md.mesh.lowerelements"); 41 41 for(i=0;i<iomodel->numberofelements;i++){ 42 42 if(iomodel->my_elements[i]) elements->AddObject(new Penta(i+1,i,i,iomodel,nummodels)); … … 50 50 switch(materials_type){ 51 51 case MaticeEnum: 52 iomodel->FetchDataToInput(elements, MaterialsRheologyBEnum);53 iomodel->FetchDataToInput(elements, MaterialsRheologyNEnum);52 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum); 53 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 54 54 for (i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel)); 55 55 switch(iomodel->domaindim){ … … 64 64 break; 65 65 case MatdamageiceEnum: 66 iomodel->FetchDataToInput(elements, MaterialsRheologyBEnum);67 iomodel->FetchDataToInput(elements, MaterialsRheologyNEnum);68 iomodel->FetchDataToInput(elements, DamageDEnum);66 iomodel->FetchDataToInput(elements,"md.materials.rheology_B",MaterialsRheologyBEnum); 67 iomodel->FetchDataToInput(elements,"md.materials.rheology_n",MaterialsRheologyNEnum); 68 iomodel->FetchDataToInput(elements,"md.damage.D",DamageDEnum); 69 69 for (i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matice(i+1,i,iomodel)); 70 70 switch(iomodel->domaindim){ … … 80 80 break; 81 81 case MatestarEnum: 82 iomodel->FetchDataToInput(elements, MaterialsRheologyKoEnum);83 iomodel->FetchDataToInput(elements, MaterialsRheologyEcEnum);84 iomodel->FetchDataToInput(elements, MaterialsRheologyEsEnum);82 iomodel->FetchDataToInput(elements,"md.materials.rheology_ko",MaterialsRheologyKoEnum); 83 iomodel->FetchDataToInput(elements,"md.materials.rheology_Ec",MaterialsRheologyEcEnum); 84 iomodel->FetchDataToInput(elements,"md.materials.rheology_Es",MaterialsRheologyEsEnum); 85 85 for(i=0;i<iomodel->numberofelements;i++) if(iomodel->my_elements[i]) materials->AddObject(new Matestar(i+1,i,iomodel)); 86 86 switch(iomodel->domaindim){ … … 101 101 102 102 /*Free data: */ 103 iomodel->DeleteData(8,MeshUpperelementsEnum,MeshLowerelementsEnum, 104 MaterialsRheologyBEnum,MaterialsRheologyNEnum,DamageDEnum,InversionControlParametersEnum,InversionMinParametersEnum, 105 InversionMaxParametersEnum); 103 iomodel->DeleteData(7,"md.mesh.upperelements","md.mesh.lowerelements","md.material.rheology_B", 104 "md.material.rheology_n","md.damage.D","md.inversion.min_parameters","md.inversion.max_parameters"); 106 105 107 106 /*Add new constant material property to materials, at the end: */ … … 111 110 112 111 /*Fetch data:*/ 113 iomodel->FetchData(6, MeshXEnum,MeshYEnum,MeshZEnum,BaseEnum,ThicknessEnum,MaskIceLevelsetEnum);114 if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->FetchData(3, MeshLatEnum,MeshLongEnum,MeshREnum);112 iomodel->FetchData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset"); 113 if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->FetchData(3,"md.mesh.lat","md.mesh.long","md.mesh.r"); 115 114 116 115 CreateNumberNodeToElementConnectivity(iomodel); … … 121 120 122 121 /*Free data: */ 123 iomodel->DeleteData(6, MeshXEnum,MeshYEnum,MeshZEnum,BaseEnum,ThicknessEnum,MaskIceLevelsetEnum);124 if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->DeleteData(3, MeshLatEnum,MeshLongEnum,MeshREnum);122 iomodel->DeleteData(6,"md.mesh.x","md.mesh.y","md.mesh.z","md.geometry.base","md.geometry.thickness","md.mask.ice_levelset"); 123 if (iomodel->domaintype == Domain3DsurfaceEnum) iomodel->DeleteData(3,"md.mesh.lat","md.mesh.long","md.mesh.r"); 125 124 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
r20596 r20690 19 19 output_definitions=new DataSet(); 20 20 21 iomodel->FetchData(&output_definition_enums,&num_output_definitions,NULL, OutputdefinitionListEnum);21 iomodel->FetchData(&output_definition_enums,&num_output_definitions,NULL,"md.outputdefinition.list"); 22 22 if(num_output_definitions){ 23 23 for (i=0;i<num_output_definitions;i++){ 24 25 24 if (output_definition_enums[i]==MassfluxatgateEnum){ 26 27 25 /*Deal with mass flux gates:{{{ */ 28 26 29 27 /*massfluxatgate variables: */ 30 28 int temp,numgates; 31 char **gatenames = NULL; 32 int *gatedefinitionenums = NULL; 33 IssmDouble **gatesegments = NULL; 34 int *gatesegments_M = NULL; 35 29 char **gatenames = NULL; 30 int *gatedefinitionenums = NULL; 31 IssmDouble **gatesegments = NULL; 32 int *gatesegments_M = NULL; 36 33 37 34 /*Fetch segments and names: */ 38 iomodel->FetchMultipleData(&gatenames,&numgates, MassfluxatgateNameEnum);39 iomodel->FetchMultipleData(&gatedefinitionenums,&temp, MassfluxatgateDefinitionenumEnum); _assert_(temp==numgates);40 iomodel->FetchMultipleData(&gatesegments,&gatesegments_M,NULL,&temp, MassfluxatgateSegmentsEnum);_assert_(temp==numgates);35 iomodel->FetchMultipleData(&gatenames,&numgates, "md.massfluxatgate.name"); 36 iomodel->FetchMultipleData(&gatedefinitionenums,&temp, "md.massfluxatgate.definitionenum"); _assert_(temp==numgates); 37 iomodel->FetchMultipleData(&gatesegments,&gatesegments_M,NULL,&temp, "md.massfluxatgate.segments"); _assert_(temp==numgates); 41 38 42 39 for(j=0;j<numgates;j++){ … … 74 71 75 72 /*Fetch name, model_enum, observation, observation_enum, etc ... (see src/m/classes/misfit.m): */ 76 iomodel->FetchMultipleData(&misfit_name_s,&nummisfits, MisfitNameEnum);77 iomodel->FetchMultipleData(&misfit_definitionenums_s,&nummisfits, MisfitDefinitionenumEnum);78 iomodel->FetchMultipleData(&misfit_model_enum_s,&nummisfits, MisfitModelEnumEnum);79 iomodel->FetchMultipleData(&misfit_observation_s,&misfit_observation_M_s,&misfit_observation_N_s,&nummisfits, MisfitObservationEnum);80 iomodel->FetchMultipleData(&misfit_observation_enum_s,&nummisfits, MisfitObservationEnumEnum);81 iomodel->FetchMultipleData(&misfit_timeinterpolation_s,&nummisfits, MisfitTimeinterpolationEnum);82 iomodel->FetchMultipleData(&misfit_local_s,&nummisfits, MisfitLocalEnum);83 iomodel->FetchMultipleData(&misfit_weights_s,&misfit_weights_M_s,&misfit_weights_N_s,&nummisfits, MisfitWeightsEnum);84 iomodel->FetchMultipleData(&misfit_weights_enum_s,&nummisfits, MisfitWeightsEnumEnum);73 iomodel->FetchMultipleData(&misfit_name_s,&nummisfits, "md.misfit.name"); 74 iomodel->FetchMultipleData(&misfit_definitionenums_s,&nummisfits, "md.misfit.definitionenum"); 75 iomodel->FetchMultipleData(&misfit_model_enum_s,&nummisfits, "md.misfit.model_enum"); 76 iomodel->FetchMultipleData(&misfit_observation_s,&misfit_observation_M_s,&misfit_observation_N_s,&nummisfits, "md.misfit.observation"); 77 iomodel->FetchMultipleData(&misfit_observation_enum_s,&nummisfits, "md.misfit.observation_enum"); 78 iomodel->FetchMultipleData(&misfit_timeinterpolation_s,&nummisfits, "md.misfit.timeinterpolation"); 79 iomodel->FetchMultipleData(&misfit_local_s,&nummisfits, "md.misfit.local"); 80 iomodel->FetchMultipleData(&misfit_weights_s,&misfit_weights_M_s,&misfit_weights_N_s,&nummisfits, "md.misfit.weights"); 81 iomodel->FetchMultipleData(&misfit_weights_enum_s,&nummisfits, "md.misfit.weights_enum"); 85 82 86 83 for(j=0;j<nummisfits;j++){ … … 134 131 135 132 /*Fetch name, model_enum, etc ... (see src/m/classes/nodalvalue.m): */ 136 iomodel->FetchMultipleData(&nodalvalue_name_s,&numnodalvalues, NodalvalueNameEnum);137 iomodel->FetchMultipleData(&nodalvalue_definitionenums_s,&numnodalvalues, NodalvalueDefinitionenumEnum);138 iomodel->FetchMultipleData(&nodalvalue_model_enum_s,&numnodalvalues, NodalvalueModelEnumEnum);139 iomodel->FetchMultipleData(&nodalvalue_node_s,&numnodalvalues, NodalvalueNodeEnum);133 iomodel->FetchMultipleData(&nodalvalue_name_s,&numnodalvalues, "md.nodalvalue.name"); 134 iomodel->FetchMultipleData(&nodalvalue_definitionenums_s,&numnodalvalues, "md.nodalvalue.definitionenum"); 135 iomodel->FetchMultipleData(&nodalvalue_model_enum_s,&numnodalvalues, "md.nodalvalue.model_enum"); 136 iomodel->FetchMultipleData(&nodalvalue_node_s,&numnodalvalues, "md.nodalvalue.node"); 140 137 141 138 for(j=0;j<numnodalvalues;j++){ … … 169 166 170 167 /*Fetch name and levelset, etc ... (see src/m/classes/masscon.m): */ 171 iomodel->FetchMultipleData(&masscon_name_s,&nummasscons, MassconNameEnum);172 iomodel->FetchMultipleData(&masscon_definitionenum_s,&nummasscons, MassconDefinitionenumEnum);173 iomodel->FetchMultipleData(&masscon_levelset_s,&masscon_levelset_M_s,&masscon_levelset_N_s,&nummasscons, MassconLevelsetEnum);168 iomodel->FetchMultipleData(&masscon_name_s,&nummasscons, "md.masscon.name"); 169 iomodel->FetchMultipleData(&masscon_definitionenum_s,&nummasscons, "md.masscon.definitionenum"); 170 iomodel->FetchMultipleData(&masscon_levelset_s,&masscon_levelset_M_s,&masscon_levelset_N_s,&nummasscons,"md.masscon.levelset"); 174 171 for(j=0;j<nummasscons;j++){ 175 172 … … 207 204 208 205 /*Fetch names and multiplicators, etc ... (see src/m/classes/masscon_axpby.m): */ 209 iomodel->FetchMultipleData(&masscon_name_s,&num, MassconaxpbyNameEnum);210 iomodel->FetchMultipleData(&masscon_definitionenum_s,&num, MassconaxpbyDefinitionenumEnum);211 iomodel->FetchMultipleData(&masscon_namex_s,&num, MassconaxpbyNamexEnum);212 iomodel->FetchMultipleData(&masscon_namey_s,&num, MassconaxpbyNameyEnum);213 iomodel->FetchMultipleData(&masscon_alpha_s,&num, MassconaxpbyAlphaEnum);214 iomodel->FetchMultipleData(&masscon_beta_s,&num, MassconaxpbyBetaEnum);206 iomodel->FetchMultipleData(&masscon_name_s,&num, "md.massconaxpby.name"); 207 iomodel->FetchMultipleData(&masscon_definitionenum_s,&num,"md.massconaxpby.definitionenum"); 208 iomodel->FetchMultipleData(&masscon_namex_s,&num, "md.massconaxpby.namex"); 209 iomodel->FetchMultipleData(&masscon_namey_s,&num, "md.massconaxpby.namey"); 210 iomodel->FetchMultipleData(&masscon_alpha_s,&num, "md.massconaxpby.alpha"); 211 iomodel->FetchMultipleData(&masscon_beta_s,&num, "md.massconaxpby.beta"); 215 212 for(j=0;j<num;j++){ 216 213 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp
r20645 r20690 41 41 42 42 /*Copy some constants from iomodel */ 43 parameters->AddObject(iomodel->CopyConstantObject( DomainTypeEnum));44 parameters->AddObject(iomodel->CopyConstantObject( DomainDimensionEnum));45 parameters->AddObject(iomodel->CopyConstantObject( SettingsOutputFrequencyEnum));46 parameters->AddObject(iomodel->CopyConstantObject( SettingsRecordingFrequencyEnum));47 parameters->AddObject(iomodel->CopyConstantObject( ConstantsYtsEnum));48 parameters->AddObject(iomodel->CopyConstantObject( TimesteppingStartTimeEnum));49 parameters->AddObject(iomodel->CopyConstantObject( TimesteppingFinalTimeEnum));50 parameters->AddObject(iomodel->CopyConstantObject( TimesteppingTimeAdaptEnum));51 parameters->AddObject(iomodel->CopyConstantObject( TimesteppingTimeStepEnum));52 parameters->AddObject(iomodel->CopyConstantObject( TimesteppingCflCoefficientEnum));53 parameters->AddObject(iomodel->CopyConstantObject( TimesteppingInterpForcingsEnum));54 parameters->AddObject(iomodel->CopyConstantObject( SettingsLowmemEnum));55 parameters->AddObject(iomodel->CopyConstantObject( DebugProfilingEnum));56 parameters->AddObject(iomodel->CopyConstantObject( MeshAverageVertexConnectivityEnum));57 parameters->AddObject(iomodel->CopyConstantObject( SettingsWaitonlockEnum));58 parameters->AddObject(iomodel->CopyConstantObject( MeshNumberofelementsEnum));59 parameters->AddObject(iomodel->CopyConstantObject( MeshNumberofverticesEnum));60 parameters->AddObject(iomodel->CopyConstantObject( SettingsResultsOnNodesEnum));61 parameters->AddObject(iomodel->CopyConstantObject( SettingsIoGatherEnum));62 parameters->AddObject(iomodel->CopyConstantObject( AutodiffIsautodiffEnum));63 parameters->AddObject(iomodel->CopyConstantObject( QmuIsdakotaEnum));64 parameters->AddObject(iomodel->CopyConstantObject( InversionIscontrolEnum));65 parameters->AddObject(iomodel->CopyConstantObject( InversionTypeEnum));66 parameters->AddObject(iomodel->CopyConstantObject( CalvingLawEnum));43 parameters->AddObject(iomodel->CopyConstantObject("md.mesh.domain_type",DomainTypeEnum)); 44 parameters->AddObject(iomodel->CopyConstantObject("md.mesh.domain_dimension",DomainDimensionEnum)); 45 parameters->AddObject(iomodel->CopyConstantObject("md.settings.output_frequency",SettingsOutputFrequencyEnum)); 46 parameters->AddObject(iomodel->CopyConstantObject("md.settings.recording_frequency",SettingsRecordingFrequencyEnum)); 47 parameters->AddObject(iomodel->CopyConstantObject("md.constants.yts",ConstantsYtsEnum)); 48 parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.start_time",TimesteppingStartTimeEnum)); 49 parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.final_time",TimesteppingFinalTimeEnum)); 50 parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_adapt",TimesteppingTimeAdaptEnum)); 51 parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.time_step",TimesteppingTimeStepEnum)); 52 parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.cfl_coefficient",TimesteppingCflCoefficientEnum)); 53 parameters->AddObject(iomodel->CopyConstantObject("md.timestepping.interp_forcings",TimesteppingInterpForcingsEnum)); 54 parameters->AddObject(iomodel->CopyConstantObject("md.settings.lowmem",SettingsLowmemEnum)); 55 parameters->AddObject(iomodel->CopyConstantObject("md.debug.profiling",DebugProfilingEnum)); 56 parameters->AddObject(iomodel->CopyConstantObject("md.mesh.average_vertex_connectivity",MeshAverageVertexConnectivityEnum)); 57 parameters->AddObject(iomodel->CopyConstantObject("md.settings.waitonlock",SettingsWaitonlockEnum)); 58 parameters->AddObject(iomodel->CopyConstantObject("md.mesh.numberofelements",MeshNumberofelementsEnum)); 59 parameters->AddObject(iomodel->CopyConstantObject("md.mesh.numberofvertices",MeshNumberofverticesEnum)); 60 parameters->AddObject(iomodel->CopyConstantObject("md.settings.results_on_nodes",SettingsResultsOnNodesEnum)); 61 parameters->AddObject(iomodel->CopyConstantObject("md.settings.io_gather",SettingsIoGatherEnum)); 62 parameters->AddObject(iomodel->CopyConstantObject("md.autodiff.isautodiff",AutodiffIsautodiffEnum)); 63 parameters->AddObject(iomodel->CopyConstantObject("md.qmu.isdakota",QmuIsdakotaEnum)); 64 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.iscontrol",InversionIscontrolEnum)); 65 parameters->AddObject(iomodel->CopyConstantObject("md.inversion.type",InversionTypeEnum)); 66 parameters->AddObject(iomodel->CopyConstantObject("md.calving.law",CalvingLawEnum)); 67 67 {/*This is specific to ice...*/ 68 parameters->AddObject(iomodel->CopyConstantObject( MeshElementtypeEnum));69 parameters->AddObject(iomodel->CopyConstantObject( SteadystateReltolEnum));70 parameters->AddObject(iomodel->CopyConstantObject( SteadystateMaxiterEnum));71 parameters->AddObject(iomodel->CopyConstantObject( ConstantsReferencetemperatureEnum));72 parameters->AddObject(iomodel->CopyConstantObject( GroundinglineMigrationEnum));73 parameters->AddObject(iomodel->CopyConstantObject( TransientIsstressbalanceEnum));74 parameters->AddObject(iomodel->CopyConstantObject( TransientIsmasstransportEnum));75 parameters->AddObject(iomodel->CopyConstantObject( TransientIssmbEnum));76 parameters->AddObject(iomodel->CopyConstantObject( TransientIsthermalEnum));77 parameters->AddObject(iomodel->CopyConstantObject( TransientIsgroundinglineEnum));78 parameters->AddObject(iomodel->CopyConstantObject( TransientIsgiaEnum));79 parameters->AddObject(iomodel->CopyConstantObject( TransientIsdamageevolutionEnum));80 parameters->AddObject(iomodel->CopyConstantObject( TransientIshydrologyEnum));81 parameters->AddObject(iomodel->CopyConstantObject( TransientIsmovingfrontEnum));82 parameters->AddObject(iomodel->CopyConstantObject( TransientIsslrEnum));83 parameters->AddObject(iomodel->CopyConstantObject( TransientIscouplerEnum));84 parameters->AddObject(iomodel->CopyConstantObject( MaterialsRheologyLawEnum));85 parameters->AddObject(iomodel->CopyConstantObject( GiaCrossSectionShapeEnum));68 parameters->AddObject(iomodel->CopyConstantObject("md.mesh.elementtype",MeshElementtypeEnum)); 69 parameters->AddObject(iomodel->CopyConstantObject("md.steadystate.reltol",SteadystateReltolEnum)); 70 parameters->AddObject(iomodel->CopyConstantObject("md.steadystate.maxiter",SteadystateMaxiterEnum)); 71 parameters->AddObject(iomodel->CopyConstantObject("md.constants.referencetemperature",ConstantsReferencetemperatureEnum)); 72 parameters->AddObject(iomodel->CopyConstantObject("md.groundingline.migration",GroundinglineMigrationEnum)); 73 parameters->AddObject(iomodel->CopyConstantObject("md.transient.isstressbalance",TransientIsstressbalanceEnum)); 74 parameters->AddObject(iomodel->CopyConstantObject("md.transient.ismasstransport",TransientIsmasstransportEnum)); 75 parameters->AddObject(iomodel->CopyConstantObject("md.transient.issmb",TransientIssmbEnum)); 76 parameters->AddObject(iomodel->CopyConstantObject("md.transient.isthermal",TransientIsthermalEnum)); 77 parameters->AddObject(iomodel->CopyConstantObject("md.transient.isgroundingline",TransientIsgroundinglineEnum)); 78 parameters->AddObject(iomodel->CopyConstantObject("md.transient.isgia",TransientIsgiaEnum)); 79 parameters->AddObject(iomodel->CopyConstantObject("md.transient.isdamageevolution",TransientIsdamageevolutionEnum)); 80 parameters->AddObject(iomodel->CopyConstantObject("md.transient.ishydrology",TransientIshydrologyEnum)); 81 parameters->AddObject(iomodel->CopyConstantObject("md.transient.ismovingfront",TransientIsmovingfrontEnum)); 82 parameters->AddObject(iomodel->CopyConstantObject("md.transient.isslr",TransientIsslrEnum)); 83 parameters->AddObject(iomodel->CopyConstantObject("md.transient.iscoupler",TransientIscouplerEnum)); 84 parameters->AddObject(iomodel->CopyConstantObject("md.materials.rheology_law",MaterialsRheologyLawEnum)); 85 parameters->AddObject(iomodel->CopyConstantObject("md.gia.cross_section_shape",GiaCrossSectionShapeEnum)); 86 86 87 87 /*For stress balance only*/ 88 parameters->AddObject(iomodel->CopyConstantObject( FlowequationIsFSEnum));89 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceRiftPenaltyThresholdEnum));90 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceMaxiterEnum));91 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceRestolEnum));92 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceReltolEnum));93 parameters->AddObject(iomodel->CopyConstantObject( StressbalanceAbstolEnum));88 parameters->AddObject(iomodel->CopyConstantObject("md.flowequation.isFS",FlowequationIsFSEnum)); 89 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.rift_penalty_threshold",StressbalanceRiftPenaltyThresholdEnum)); 90 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.maxiter",StressbalanceMaxiterEnum)); 91 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.restol",StressbalanceRestolEnum)); 92 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.reltol",StressbalanceReltolEnum)); 93 parameters->AddObject(iomodel->CopyConstantObject("md.stressbalance.abstol",StressbalanceAbstolEnum)); 94 94 if(iomodel->domaintype==Domain3DEnum) 95 parameters->AddObject(iomodel->CopyConstantObject( MeshNumberoflayersEnum));95 parameters->AddObject(iomodel->CopyConstantObject("md.mesh.numberoflayers",MeshNumberoflayersEnum)); 96 96 } 97 97 98 98 99 99 /*Basal forcing parameters*/ 100 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsEnum));101 iomodel->FindConstant(&basalforcing_model, BasalforcingsEnum);100 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.model",BasalforcingsEnum)); 101 iomodel->FindConstant(&basalforcing_model,"md.basalforcings.model"); 102 102 switch(basalforcing_model){ 103 103 case FloatingMeltRateEnum: … … 105 105 break; 106 106 case LinearFloatingMeltRateEnum: 107 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsDeepwaterMeltingRateEnum));108 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsDeepwaterElevationEnum));109 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsUpperwaterElevationEnum));107 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.deepwater_melting_rate",BasalforcingsDeepwaterMeltingRateEnum)); 108 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.deepwater_elevation",BasalforcingsDeepwaterElevationEnum)); 109 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.upperwater_elevation",BasalforcingsUpperwaterElevationEnum)); 110 110 break; 111 111 case MismipFloatingMeltRateEnum: 112 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsMeltrateFactorEnum));113 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsThresholdThicknessEnum));114 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsUpperdepthMeltEnum));112 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.meltrate_factor",BasalforcingsMeltrateFactorEnum)); 113 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.threshold_thickness",BasalforcingsThresholdThicknessEnum)); 114 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.upperdepth_melt",BasalforcingsUpperdepthMeltEnum)); 115 115 break; 116 116 case MantlePlumeGeothermalFluxEnum: 117 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsMantleconductivityEnum));118 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsNusseltEnum));119 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsDtbgEnum));120 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsPlumeradiusEnum));121 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsTopplumedepthEnum));122 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsBottomplumedepthEnum));123 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsPlumexEnum));124 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsPlumeyEnum));125 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsCrustthicknessEnum));126 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsUppercrustthicknessEnum));127 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsUppercrustheatEnum));128 parameters->AddObject(iomodel->CopyConstantObject( BasalforcingsLowercrustheatEnum));117 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.mantleconductivity",BasalforcingsMantleconductivityEnum)); 118 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.nusselt",BasalforcingsNusseltEnum)); 119 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.dtbg",BasalforcingsDtbgEnum)); 120 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.plumeradius",BasalforcingsPlumeradiusEnum)); 121 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.topplumedepth",BasalforcingsTopplumedepthEnum)); 122 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.bottomplumedepth",BasalforcingsBottomplumedepthEnum)); 123 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.plumex",BasalforcingsPlumexEnum)); 124 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.plumey",BasalforcingsPlumeyEnum)); 125 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.crustthickness",BasalforcingsCrustthicknessEnum)); 126 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.uppercrustthickness",BasalforcingsUppercrustthicknessEnum)); 127 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.uppercrustheat",BasalforcingsUppercrustheatEnum)); 128 parameters->AddObject(iomodel->CopyConstantObject("md.basalforcings.lowercrustheat",BasalforcingsLowercrustheatEnum)); 129 129 break; 130 130 default: … … 135 135 parameters->AddObject(new IntParam(SolutionTypeEnum,solution_type)); 136 136 137 iomodel->FindConstant(&time, TimesteppingStartTimeEnum);137 iomodel->FindConstant(&time,"md.timestepping.start_time"); 138 138 parameters->AddObject(new DoubleParam(TimeEnum,time)); 139 139 parameters->AddObject(new IntParam(StepEnum,0)); … … 143 143 144 144 /*Requested outputs */ 145 iomodel->F etchData(&requestedoutputs,&numoutputs,TransientRequestedOutputsEnum);145 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.transient.requested_outputs"); 146 146 parameters->AddObject(new IntParam(TransientNumRequestedOutputsEnum,numoutputs)); 147 147 if(numoutputs)parameters->AddObject(new StringArrayParam(TransientRequestedOutputsEnum,requestedoutputs,numoutputs)); 148 iomodel->DeleteData(&requestedoutputs,numoutputs, TransientRequestedOutputsEnum);149 150 iomodel->F etchData(&requestedoutputs,&numoutputs,SteadystateRequestedOutputsEnum);148 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.transient.requested_outputs"); 149 150 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.steadystate.requested_outputs"); 151 151 parameters->AddObject(new IntParam(SteadystateNumRequestedOutputsEnum,numoutputs)); 152 152 if(numoutputs)parameters->AddObject(new StringArrayParam(SteadystateRequestedOutputsEnum,requestedoutputs,numoutputs)); 153 iomodel->DeleteData(&requestedoutputs,numoutputs, SteadystateRequestedOutputsEnum);154 155 iomodel->FindConstant(&materialtype, MaterialsEnum);153 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.steadystate.requested_outputs"); 154 155 iomodel->FindConstant(&materialtype,"md.materials.type"); 156 156 if(materialtype==MatdamageiceEnum){ 157 iomodel->F etchData(&requestedoutputs,&numoutputs,DamageEvolutionRequestedOutputsEnum);157 iomodel->FindConstant(&requestedoutputs,&numoutputs,"md.damage.requested_outputs"); 158 158 parameters->AddObject(new IntParam(DamageEvolutionNumRequestedOutputsEnum,numoutputs)); 159 159 if(numoutputs)parameters->AddObject(new StringArrayParam(DamageEvolutionRequestedOutputsEnum,requestedoutputs,numoutputs)); 160 iomodel->DeleteData(&requestedoutputs,numoutputs, DamageEvolutionRequestedOutputsEnum);160 iomodel->DeleteData(&requestedoutputs,numoutputs,"md.damage.requested_outputs"); 161 161 } 162 162 163 163 /*Deal with mass flux segments: {{{*/ 164 iomodel->FetchData(&qmu_mass_flux_present, QmuMassFluxSegmentsPresentEnum);165 iomodel->FetchData(&autodiff_mass_flux_present, AutodiffMassFluxSegmentsPresentEnum);164 iomodel->FetchData(&qmu_mass_flux_present,"md.qmu.mass_flux_segments_present"); 165 iomodel->FetchData(&autodiff_mass_flux_present,"md.autodiff.mass_flux_segments_present"); 166 166 167 167 if(qmu_mass_flux_present || autodiff_mass_flux_present)mass_flux_present=true; … … 172 172 173 173 /*Fetch the mass flux segments necessary to compute the mass fluxes. Build a DoubleMatArrayParam object out of them: */ 174 iomodel->FetchData(&array,&mdims_array,&ndims_array,&mass_flux_num_profiles, MassFluxSegmentsEnum);174 iomodel->FetchData(&array,&mdims_array,&ndims_array,&mass_flux_num_profiles,"md.qmu.mass_flux_segments"); 175 175 if(mass_flux_num_profiles==0)_error_("mass_flux_num_profiles is 0, when MassFlux computations were requested!"); 176 176 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/CreateParametersDakota.cpp
r20645 r20690 36 36 37 37 /*recover parameters: */ 38 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);38 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 39 39 40 40 if(dakota_analysis){ 41 41 42 iomodel->FindConstant(&name, MiscellaneousNameEnum);43 iomodel->FindConstant(&numberofresponses, QmuNumberofresponsesEnum);42 iomodel->FindConstant(&name,"md.miscellaneous.name"); 43 iomodel->FindConstant(&numberofresponses,"md.qmu.numberofresponses"); 44 44 45 45 /*name of qmu input, error and output files*/ … … 57 57 58 58 /*Fetch variable descriptors*/ 59 iomodel->FetchData(&variabledescriptors,&numvariabledescriptors, QmuVariabledescriptorsEnum);59 iomodel->FetchData(&variabledescriptors,&numvariabledescriptors,"md.qmu.variabledescriptors"); 60 60 61 61 /*Ok, we have all the variable descriptors. Build a parameter with it: */ … … 63 63 64 64 /*Fetch response descriptors*/ 65 iomodel->FetchData(&responsedescriptors,&numresponsedescriptors, QmuResponsedescriptorsEnum);65 iomodel->FetchData(&responsedescriptors,&numresponsedescriptors,"md.qmu.responsedescriptors"); 66 66 67 67 /*Ok, we have all the response descriptors. Build a parameter with it: */ … … 71 71 /*Deal with partitioning*/ 72 72 /*partition vertices in iomodel->qmu_npart parts, unless a partition is already present: */ 73 parameters->AddObject(iomodel->CopyConstantObject( QmuNumberofpartitionsEnum));74 iomodel->FetchData(&dpart,NULL,NULL, QmuPartitionEnum);73 parameters->AddObject(iomodel->CopyConstantObject("md.qmu.numberofpartitions",QmuNumberofpartitionsEnum)); 74 iomodel->FetchData(&dpart,NULL,NULL,"md.qmu.partition"); 75 75 if(!dpart){ 76 76 /*Partition elements and vertices and nodes: */ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Dakota/UpdateElementsAndMaterialsDakota.cpp
r20645 r20690 13 13 /*recover parameters: */ 14 14 bool dakota_analysis; 15 iomodel->FindConstant(&dakota_analysis, QmuIsdakotaEnum);15 iomodel->FindConstant(&dakota_analysis,"md.qmu.isdakota"); 16 16 17 if(dakota_analysis){ 18 iomodel->FetchDataToInput(elements,GeometryHydrostaticRatioEnum,0.); 19 } 17 if(dakota_analysis) iomodel->FetchDataToInput(elements,"md.geometry.hydrostatic_ratio",0.); 20 18 } -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ElementsAndVerticesPartitioning.cpp
r20645 r20690 44 44 45 45 /*Fetch parameters: */ 46 iomodel->FindConstant(&numrifts, RiftsNumriftsEnum);46 iomodel->FindConstant(&numrifts,"md.rifts.numrifts"); 47 47 48 48 /*First, check that partitioning has not yet been carryed out. Just check whether my_elements pointers is not already assigned a value: */ … … 66 66 case PentaEnum: 67 67 elements_width=6; 68 iomodel->FetchData(&elements2d,NULL,NULL, MeshElements2dEnum);69 iomodel->FindConstant(&numberofelements2d, MeshNumberofelements2dEnum);70 iomodel->FindConstant(&numberofvertices2d, MeshNumberofvertices2dEnum);71 iomodel->FindConstant(&numlayers, MeshNumberoflayersEnum);68 iomodel->FetchData(&elements2d,NULL,NULL,"md.mesh.elements2d"); 69 iomodel->FindConstant(&numberofelements2d,"md.mesh.numberofelements2d"); 70 iomodel->FindConstant(&numberofvertices2d,"md.mesh.numberofvertices2d"); 71 iomodel->FindConstant(&numlayers,"md.mesh.numberoflayers"); 72 72 break; 73 73 default: … … 82 82 /*Deal with rifts, they have to be included into one partition only, not several: */ 83 83 if(numrifts){ 84 iomodel->FetchData(&riftinfo,&numrifts,NULL, RiftsRiftstructEnum);84 iomodel->FetchData(&riftinfo,&numrifts,NULL,"md.rifts.riftstruct"); 85 85 for(i=0;i<numrifts;i++){ 86 86 el1=reCast<int>(*(riftinfo+RIFTINFOSIZE*i+2))-1; //matlab indexing to c indexing … … 88 88 epart[el2]=epart[el1]; //ensures that this pair of elements will be in the same partition, as well as the corresponding vertices; 89 89 } 90 iomodel->DeleteData(riftinfo, RiftsRiftstructEnum);90 iomodel->DeleteData(riftinfo,"md.rifts.riftstruct"); 91 91 } 92 92 … … 114 114 * penpair has 2 nodes that are poointing toward 2 vertices. 115 115 * The 2 vertices must be in the same cpu as the penpair*/ 116 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL, StressbalanceVertexPairingEnum);116 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.stressbalance.vertex_pairing"); 117 117 for(i=0;i<numvertex_pairing;i++){ 118 118 if(my_vertices[vertex_pairing[2*i+0]-1] && !my_vertices[vertex_pairing[2*i+1]-1]){ … … 121 121 } 122 122 xDelete<int>(vertex_pairing); 123 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL, MasstransportVertexPairingEnum);123 iomodel->FetchData(&vertex_pairing,&numvertex_pairing,NULL,"md.masstransport.vertex_pairing"); 124 124 for(i=0;i<numvertex_pairing;i++){ 125 125 if(my_vertices[vertex_pairing[2*i+0]-1] && !my_vertices[vertex_pairing[2*i+1]-1]){ -
issm/trunk-jpl/src/c/modules/ModelProcessorx/ModelProcessorx.cpp
r20645 r20690 27 27 28 28 /*Fetch parameters: */ 29 iomodel->FindConstant(&verbose, VerboseEnum);29 iomodel->FindConstant(&verbose,"md.verbose"); 30 30 SetVerbosityLevel(verbose); 31 31 -
issm/trunk-jpl/src/c/modules/ModelProcessorx/Transient/UpdateElementsTransient.cpp
r17555 r20690 15 15 16 16 if(isgroundingline){ 17 iomodel->FetchDataToInput(elements, BedEnum);17 iomodel->FetchDataToInput(elements,"md.geometry.bed",BedEnum); 18 18 } 19 19 } -
issm/trunk-jpl/src/c/modules/SurfaceMassBalancex/SurfaceMassBalancex.cpp
r20645 r20690 203 203 /* Get constants */ 204 204 femmodel->parameters->FindParam(&yts,ConstantsYtsEnum); 205 /*iomodel->FindConstant(&yts, ConstantsYtsEnum);*/205 /*iomodel->FindConstant(&yts,"md.constants.yts");*/ 206 206 /*this->parameters->FindParam(&yts,ConstantsYtsEnum);*/ 207 207 /*Mathieu original*/ -
issm/trunk-jpl/src/m/classes/SMBcomponents.m
r19897 r20690 76 76 fielddisplay(self,'requested_outputs','additional outputs requested'); 77 77 end % }}} 78 function marshall(self, md,fid) % {{{78 function marshall(self,prefix,md,fid) % {{{ 79 79 80 80 yts=365.0*24.0*3600.0; 81 81 82 WriteData(fid, 'enum',SmbEnum(),'data',SMBcomponentsEnum(),'format','Integer');83 WriteData(fid, 'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);84 WriteData(fid, 'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);85 WriteData(fid, 'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);82 WriteData(fid,prefix,'name','md.smb.model','data',SMBcomponentsEnum(),'format','Integer'); 83 WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 84 WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 85 WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 86 86 87 87 %process requested outputs … … 92 92 outputs = [outputs defaultoutputs(self,md)]; %add defaults 93 93 end 94 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');94 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 95 95 96 96 end % }}} -
issm/trunk-jpl/src/m/classes/SMBcomponents.py
r19897 r20690 77 77 return md 78 78 # }}} 79 def marshall(self, md,fid): # {{{79 def marshall(self,prefix,md,fid): # {{{ 80 80 81 81 yts=365.0*24.0*3600.0 82 82 83 WriteData(fid, 'enum',SmbEnum(),'data',SMBcomponentsEnum(),'format','Integer');84 WriteData(fid, 'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)85 WriteData(fid, 'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)86 WriteData(fid, 'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)83 WriteData(fid,prefix,'name','md.smb.model','data',SMBcomponentsEnum(),'format','Integer'); 84 WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 85 WriteData(fid,prefix,'object',self,'class','smb','fieldname','runoff','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 86 WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 87 87 88 88 #process requested outputs … … 92 92 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 93 93 outputs =outputscopy 94 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum(),'format','StringArray')94 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray') 95 95 96 96 # }}} -
issm/trunk-jpl/src/m/classes/SMBd18opdd.m
r19897 r20690 102 102 % PositiveDegreeDay (Tria.cpp) used in that case 103 103 end % }}} 104 function marshall(self, md,fid) % {{{104 function marshall(self,prefix,md,fid) % {{{ 105 105 106 106 yts=365.0*24.0*3600.0; 107 107 108 WriteData(fid, 'enum',SmbEnum(),'data',SMBd18opddEnum(),'format','Integer');108 WriteData(fid,prefix,'name','md.smb.model','data',SMBd18opddEnum(),'format','Integer'); 109 109 110 WriteData(fid, 'object',self,'class','smb','fieldname','ismungsm','format','Boolean');111 WriteData(fid, 'object',self,'class','smb','fieldname','isd18opd','format','Boolean');112 WriteData(fid, 'object',self,'class','smb','fieldname','desfac','format','Double');113 WriteData(fid, 'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);114 WriteData(fid, 'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);115 WriteData(fid, 'object',self,'class','smb','fieldname','rlaps','format','Double');116 WriteData(fid, 'object',self,'class','smb','fieldname','rlapslgm','format','Double');117 WriteData(fid, 'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2);118 WriteData(fid, 'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2);110 WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismungsm','format','Boolean'); 111 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isd18opd','format','Boolean'); 112 WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double'); 113 WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1); 114 WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1); 115 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double'); 116 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double'); 117 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2); 118 WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2); 119 119 120 120 if self.isd18opd 121 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);122 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);123 WriteData(fid, 'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2);124 WriteData(fid, 'object',self,'class','smb','fieldname','dpermil','format','Double');121 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 122 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 123 WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2); 124 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dpermil','format','Double'); 125 125 end 126 126 … … 132 132 outputs = [outputs defaultoutputs(self,md)]; %add defaults 133 133 end 134 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');134 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 135 135 136 136 end % }}} -
issm/trunk-jpl/src/m/classes/SMBd18opdd.py
r19897 r20690 106 106 return md 107 107 # }}} 108 def marshall(self, md,fid): # {{{108 def marshall(self,prefix,md,fid): # {{{ 109 109 110 110 yts=365.0*24.0*3600.0 111 111 112 WriteData(fid, 'enum',SmbEnum(),'data',SMBd18opddEnum(),'format','Integer')112 WriteData(fid,prefix,'name','md.smb.model','data',SMBd18opddEnum(),'format','Integer') 113 113 114 WriteData(fid, 'object',self,'class','smb','fieldname','ismungsm','format','Boolean')115 WriteData(fid, 'object',self,'class','smb','fieldname','isd18opd','format','Boolean')116 WriteData(fid, 'object',self,'class','smb','fieldname','desfac','format','Double')117 WriteData(fid, 'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);118 WriteData(fid, 'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);119 WriteData(fid, 'object',self,'class','smb','fieldname','rlaps','format','Double')120 WriteData(fid, 'object',self,'class','smb','fieldname','rlapslgm','format','Double')121 WriteData(fid, 'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2)122 WriteData(fid, 'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2)114 WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismungsm','format','Boolean') 115 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isd18opd','format','Boolean') 116 WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double') 117 WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1); 118 WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1); 119 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double') 120 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double') 121 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2) 122 WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2) 123 123 124 124 if self.isd18opd: 125 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)126 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)127 WriteData(fid, 'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2)128 WriteData(fid, 'object',self,'class','smb','fieldname','dpermil','format','Double')125 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 126 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 127 WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2) 128 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dpermil','format','Double') 129 129 130 130 #process requested outputs … … 134 134 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 135 135 outputs =outputscopy 136 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum(),'format','StringArray')136 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray') 137 137 138 138 # }}} -
issm/trunk-jpl/src/m/classes/SMBforcing.js
r19901 r20690 22 22 this.initialize = function(md) {// {{{ 23 23 24 if (isNaN( self.mass_balance)){25 self.mass_balance=NewArrayFill(md.mesh.numberofvertices,0);24 if (isNaN(this.mass_balance)){ 25 this.mass_balance=NewArrayFill(md.mesh.numberofvertices,0); 26 26 console.log(' no smb.mass_balance specified: values set as zero'); 27 27 } … … 43 43 var yts=365.0*24.0*3600.0; 44 44 45 WriteData(fid, 'enum',SmbEnum(),'data',SMBforcingEnum(),'format','Integer');46 WriteData(fid, 'object',this,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);45 WriteData(fid,prefix,'name','md.smb.model','data',SMBforcingEnum(),'format','Integer'); 46 WriteData(fid,prefix,'object',this,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 47 47 48 48 //process requested outputs … … 55 55 } 56 56 } 57 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum(),'format','StringArray');57 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 58 58 59 59 }//}}} -
issm/trunk-jpl/src/m/classes/SMBforcing.m
r20137 r20690 63 63 fielddisplay(self,'requested_outputs','additional outputs requested'); 64 64 end % }}} 65 function marshall(self, md,fid) % {{{65 function marshall(self,prefix,md,fid) % {{{ 66 66 67 67 yts=365.0*24.0*3600.0; 68 68 69 WriteData(fid, 'enum',SmbEnum(),'data',SMBforcingEnum(),'format','Integer');70 WriteData(fid, 'object',self,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);69 WriteData(fid,prefix,'name','md.smb.model','data',SMBforcingEnum(),'format','Integer'); 70 WriteData(fid,prefix,'object',self,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 71 71 72 72 %process requested outputs … … 77 77 outputs = [outputs defaultoutputs(self,md)]; %add defaults 78 78 end 79 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');79 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 80 80 81 81 end % }}} -
issm/trunk-jpl/src/m/classes/SMBforcing.py
r19897 r20690 51 51 return md 52 52 # }}} 53 def marshall(self, md,fid): # {{{53 def marshall(self,prefix,md,fid): # {{{ 54 54 55 55 yts=365.0*24.0*3600.0 56 56 57 WriteData(fid, 'enum',SmbEnum(),'data',SMBforcingEnum(),'format','Integer');58 WriteData(fid, 'object',self,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)57 WriteData(fid,prefix,'name','md.smb.model','data',SMBforcingEnum(),'format','Integer'); 58 WriteData(fid,prefix,'object',self,'class','smb','fieldname','mass_balance','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 59 59 60 60 #process requested outputs … … 64 64 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 65 65 outputs =outputscopy 66 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum(),'format','StringArray')66 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray') 67 67 68 68 # }}} -
issm/trunk-jpl/src/m/classes/SMBgemb.m
r20407 r20690 256 256 257 257 end % }}} 258 function marshall(self, md,fid) % {{{258 function marshall(self,prefix,md,fid) % {{{ 259 259 260 260 yts=365.25*24.0*3600.0; 261 261 262 WriteData(fid, 'enum',SmbEnum(),'data',SMBgembEnum(),'format','Integer');263 264 WriteData(fid, 'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean');265 WriteData(fid, 'object',self,'class','smb','fieldname','isalbedo','format','Boolean');266 WriteData(fid, 'object',self,'class','smb','fieldname','isshortwave','format','Boolean');267 WriteData(fid, 'object',self,'class','smb','fieldname','isthermal','format','Boolean');268 WriteData(fid, 'object',self,'class','smb','fieldname','isaccumulation','format','Boolean');269 WriteData(fid, 'object',self,'class','smb','fieldname','ismelt','format','Boolean');270 WriteData(fid, 'object',self,'class','smb','fieldname','isdensification','format','Boolean');271 WriteData(fid, 'object',self,'class','smb','fieldname','isturbulentflux','format','Boolean');272 WriteData(fid, 'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean');273 WriteData(fid, 'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean');274 275 WriteData(fid, 'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1);276 WriteData(fid, 'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1);277 WriteData(fid, 'object',self,'class','smb','fieldname','dswrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1);278 WriteData(fid, 'object',self,'class','smb','fieldname','dlwrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1);279 WriteData(fid, 'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1);280 WriteData(fid, 'object',self,'class','smb','fieldname','eAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1);281 WriteData(fid, 'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1);282 283 WriteData(fid, 'object',self,'class','smb','fieldname','Tmean','format','DoubleMat','mattype',2);284 WriteData(fid, 'object',self,'class','smb','fieldname','C','format','DoubleMat','mattype',2);285 WriteData(fid, 'object',self,'class','smb','fieldname','Tz','format','DoubleMat','mattype',2);286 WriteData(fid, 'object',self,'class','smb','fieldname','Vz','format','DoubleMat','mattype',2);287 WriteData(fid, 'object',self,'class','smb','fieldname','zTop','format','DoubleMat','mattype',2);288 WriteData(fid, 'object',self,'class','smb','fieldname','dzTop','format','DoubleMat','mattype',2);289 WriteData(fid, 'object',self,'class','smb','fieldname','dzMin','format','DoubleMat','mattype',2);290 WriteData(fid, 'object',self,'class','smb','fieldname','zY','format','DoubleMat','mattype',2);291 WriteData(fid, 'object',self,'class','smb','fieldname','zMax','format','DoubleMat','mattype',2);292 WriteData(fid, 'object',self,'class','smb','fieldname','zMin','format','DoubleMat','mattype',2);293 294 WriteData(fid, 'object',self,'class','smb','fieldname','aIdx','format','Integer');295 WriteData(fid, 'object',self,'class','smb','fieldname','swIdx','format','Integer');296 WriteData(fid, 'object',self,'class','smb','fieldname','denIdx','format','Integer');297 WriteData(fid, 'object',self,'class','smb','fieldname','InitDensityScaling','format','Double');298 299 WriteData(fid, 'object',self,'class','smb','fieldname','outputFreq','format','Double');300 WriteData(fid, 'object',self,'class','smb','fieldname','aSnow','format','Double');301 WriteData(fid, 'object',self,'class','smb','fieldname','aIce','format','Double');302 WriteData(fid, 'object',self,'class','smb','fieldname','cldFrac','format','Double');303 WriteData(fid, 'object',self,'class','smb','fieldname','t0wet','format','Double');304 WriteData(fid, 'object',self,'class','smb','fieldname','t0dry','format','Double');305 WriteData(fid, 'object',self,'class','smb','fieldname','K','format','Double');262 WriteData(fid,prefix,'name','md.smb.model','data',SMBgembEnum(),'format','Integer'); 263 264 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean'); 265 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isalbedo','format','Boolean'); 266 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isshortwave','format','Boolean'); 267 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isthermal','format','Boolean'); 268 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isaccumulation','format','Boolean'); 269 WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismelt','format','Boolean'); 270 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdensification','format','Boolean'); 271 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isturbulentflux','format','Boolean'); 272 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean'); 273 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isgraingrowth','format','Boolean'); 274 275 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Ta','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1); 276 WriteData(fid,prefix,'object',self,'class','smb','fieldname','V','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1); 277 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dswrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1); 278 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dlwrf','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1); 279 WriteData(fid,prefix,'object',self,'class','smb','fieldname','P','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1); 280 WriteData(fid,prefix,'object',self,'class','smb','fieldname','eAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1); 281 WriteData(fid,prefix,'object',self,'class','smb','fieldname','pAir','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1); 282 283 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tmean','format','DoubleMat','mattype',2); 284 WriteData(fid,prefix,'object',self,'class','smb','fieldname','C','format','DoubleMat','mattype',2); 285 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tz','format','DoubleMat','mattype',2); 286 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Vz','format','DoubleMat','mattype',2); 287 WriteData(fid,prefix,'object',self,'class','smb','fieldname','zTop','format','DoubleMat','mattype',2); 288 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dzTop','format','DoubleMat','mattype',2); 289 WriteData(fid,prefix,'object',self,'class','smb','fieldname','dzMin','format','DoubleMat','mattype',2); 290 WriteData(fid,prefix,'object',self,'class','smb','fieldname','zY','format','DoubleMat','mattype',2); 291 WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMax','format','DoubleMat','mattype',2); 292 WriteData(fid,prefix,'object',self,'class','smb','fieldname','zMin','format','DoubleMat','mattype',2); 293 294 WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIdx','format','Integer'); 295 WriteData(fid,prefix,'object',self,'class','smb','fieldname','swIdx','format','Integer'); 296 WriteData(fid,prefix,'object',self,'class','smb','fieldname','denIdx','format','Integer'); 297 WriteData(fid,prefix,'object',self,'class','smb','fieldname','InitDensityScaling','format','Double'); 298 299 WriteData(fid,prefix,'object',self,'class','smb','fieldname','outputFreq','format','Double'); 300 WriteData(fid,prefix,'object',self,'class','smb','fieldname','aSnow','format','Double'); 301 WriteData(fid,prefix,'object',self,'class','smb','fieldname','aIce','format','Double'); 302 WriteData(fid,prefix,'object',self,'class','smb','fieldname','cldFrac','format','Double'); 303 WriteData(fid,prefix,'object',self,'class','smb','fieldname','t0wet','format','Double'); 304 WriteData(fid,prefix,'object',self,'class','smb','fieldname','t0dry','format','Double'); 305 WriteData(fid,prefix,'object',self,'class','smb','fieldname','K','format','Double'); 306 306 307 307 %figure out dt from forcings: … … 309 309 dtime=diff(time,1); 310 310 dt=min(dtime); 311 WriteData(fid, 'data',dt,'enum',SmbDtEnum,'format','Double','scale',yts);311 WriteData(fid,prefix,'data',dt,'name','md.smb.dt','format','Double','scale',yts); 312 312 313 313 %process requested outputs … … 318 318 outputs = [outputs defaultoutputs(self,md)]; %add defaults 319 319 end 320 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');320 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 321 321 end % }}} 322 322 end -
issm/trunk-jpl/src/m/classes/SMBgradients.m
r19897 r20690 60 60 61 61 end % }}} 62 function marshall(self, md,fid) % {{{62 function marshall(self,prefix,md,fid) % {{{ 63 63 64 64 yts=365.0*24.0*3600.0; 65 65 66 WriteData(fid, 'enum',SmbEnum(),'data',SMBgradientsEnum(),'format','Integer');67 WriteData(fid, 'object',self,'class','smb','fieldname','href','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);68 WriteData(fid, 'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);69 WriteData(fid, 'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);70 WriteData(fid, 'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);66 WriteData(fid,prefix,'name','md.smb.model','data',SMBgradientsEnum(),'format','Integer'); 67 WriteData(fid,prefix,'object',self,'class','smb','fieldname','href','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 68 WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 69 WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 70 WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 71 71 72 72 %process requested outputs … … 77 77 outputs = [outputs defaultoutputs(self,md)]; %add defaults 78 78 end 79 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');79 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 80 80 81 81 end % }}} -
issm/trunk-jpl/src/m/classes/SMBgradients.py
r19897 r20690 57 57 return md 58 58 # }}} 59 def marshall(self, md,fid): # {{{59 def marshall(self,prefix,md,fid): # {{{ 60 60 61 61 yts=365.0*24.0*3600.0 62 62 63 WriteData(fid, 'enum',SmbEnum(),'data',SMBgradientsEnum(),'format','Integer');64 WriteData(fid, 'object',self,'class','smb','fieldname','href','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)65 WriteData(fid, 'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)66 WriteData(fid, 'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)67 WriteData(fid, 'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)63 WriteData(fid,prefix,'name','md.smb.model','data',SMBgradientsEnum(),'format','Integer'); 64 WriteData(fid,prefix,'object',self,'class','smb','fieldname','href','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 65 WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 66 WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_pos','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 67 WriteData(fid,prefix,'object',self,'class','smb','fieldname','b_neg','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 68 68 69 69 #process requested outputs … … 73 73 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 74 74 outputs =outputscopy 75 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum(),'format','StringArray')75 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray') 76 76 77 77 # }}} -
issm/trunk-jpl/src/m/classes/SMBhenning.m
r19897 r20690 48 48 fielddisplay(self,'requested_outputs','additional outputs requested'); 49 49 end % }}} 50 function marshall(self, md,fid) % {{{50 function marshall(self,prefix,md,fid) % {{{ 51 51 52 52 yts=365.0*24.0*3600.0; 53 53 54 WriteData(fid, 'enum',SmbEnum(),'data',SMBhenningEnum(),'format','Integer');55 WriteData(fid, 'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);54 WriteData(fid,prefix,'name','md.smb.model','data',SMBhenningEnum(),'format','Integer'); 55 WriteData(fid,prefix,'object',self,'class','smb','fieldname','smbref','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 56 56 57 57 %process requested outputs … … 62 62 outputs = [outputs defaultoutputs(self,md)]; %add defaults 63 63 end 64 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');64 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 65 65 66 66 end % }}} -
issm/trunk-jpl/src/m/classes/SMBmeltcomponents.m
r19897 r20690 87 87 fielddisplay(self,'requested_outputs','additional outputs requested'); 88 88 end % }}} 89 function marshall(self, md,fid) % {{{89 function marshall(self,prefix,md,fid) % {{{ 90 90 91 91 yts=365.0*24.0*3600.0; 92 92 93 WriteData(fid, 'enum',SmbEnum(),'data',SMBmeltcomponentsEnum(),'format','Integer');94 WriteData(fid, 'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);95 WriteData(fid, 'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);96 WriteData(fid, 'object',self,'class','smb','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);97 WriteData(fid, 'object',self,'class','smb','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);93 WriteData(fid,prefix,'name','md.smb.model','data',SMBmeltcomponentsEnum(),'format','Integer'); 94 WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 95 WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 96 WriteData(fid,prefix,'object',self,'class','smb','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 97 WriteData(fid,prefix,'object',self,'class','smb','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 98 98 99 99 %process requested outputs … … 104 104 outputs = [outputs defaultoutputs(self,md)]; %add defaults 105 105 end 106 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');106 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 107 107 108 108 end % }}} -
issm/trunk-jpl/src/m/classes/SMBmeltcomponents.py
r19897 r20690 88 88 return md 89 89 # }}} 90 def marshall(self, md,fid): # {{{90 def marshall(self,prefix,md,fid): # {{{ 91 91 92 92 yts=365.0*24.0*3600.0 93 93 94 WriteData(fid, 'enum',SmbEnum(),'data',SMBmeltcomponentsEnum(),'format','Integer');95 WriteData(fid, 'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)96 WriteData(fid, 'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)97 WriteData(fid, 'object',self,'class','smb','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)98 WriteData(fid, 'object',self,'class','smb','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)94 WriteData(fid,prefix,'name','md.smb.model','data',SMBmeltcomponentsEnum(),'format','Integer'); 95 WriteData(fid,prefix,'object',self,'class','smb','fieldname','accumulation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 96 WriteData(fid,prefix,'object',self,'class','smb','fieldname','evaporation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 97 WriteData(fid,prefix,'object',self,'class','smb','fieldname','melt','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 98 WriteData(fid,prefix,'object',self,'class','smb','fieldname','refreeze','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 99 99 100 100 #process requested outputs … … 104 104 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 105 105 outputs =outputscopy 106 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum(),'format','StringArray')106 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray') 107 107 108 108 # }}} -
issm/trunk-jpl/src/m/classes/SMBpdd.m
r19897 r20690 141 141 fielddisplay(self,'requested_outputs','additional outputs requested'); 142 142 end % }}} 143 function marshall(self, md,fid) % {{{143 function marshall(self,prefix,md,fid) % {{{ 144 144 145 145 yts=365.0*24.0*3600.0; 146 146 147 WriteData(fid, 'enum',SmbEnum(),'data',SMBpddEnum(),'format','Integer');147 WriteData(fid,prefix,'name','md.smb.model','data',SMBpddEnum(),'format','Integer'); 148 148 149 WriteData(fid, 'object',self,'class','smb','fieldname','isdelta18o','format','Boolean');150 WriteData(fid, 'object',self,'class','smb','fieldname','ismungsm','format','Boolean');151 WriteData(fid, 'object',self,'class','smb','fieldname','desfac','format','Double');152 WriteData(fid, 'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);153 WriteData(fid, 'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);154 WriteData(fid, 'object',self,'class','smb','fieldname','rlaps','format','Double');155 WriteData(fid, 'object',self,'class','smb','fieldname','rlapslgm','format','Double');149 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdelta18o','format','Boolean'); 150 WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismungsm','format','Boolean'); 151 WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double'); 152 WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1); 153 WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1); 154 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double'); 155 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double'); 156 156 157 157 if(self.isdelta18o==0 & self.ismungsm==0) 158 %WriteData(fid, 'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1);159 WriteData(fid, 'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);160 WriteData(fid, 'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);158 %WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1); 159 WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 160 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 161 161 elseif self.isdelta18o 162 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);163 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);164 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);165 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);166 WriteData(fid, 'object',self,'class','smb','fieldname','delta18o_surface','format','DoubleMat','mattype',1,'timeserieslength',2);167 WriteData(fid, 'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2);168 WriteData(fid, 'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2);169 WriteData(fid, 'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2);162 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 163 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 164 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 165 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 166 WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o_surface','format','DoubleMat','mattype',1,'timeserieslength',2); 167 WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2); 168 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2); 169 WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2); 170 170 elseif self.ismungsm 171 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);172 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);173 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);174 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);175 WriteData(fid, 'object',self,'class','smb','fieldname','Pfac','format','DoubleMat','mattype',1,'timeserieslength',2);176 WriteData(fid, 'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2);177 WriteData(fid, 'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2);171 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 172 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 173 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 174 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 175 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Pfac','format','DoubleMat','mattype',1,'timeserieslength',2); 176 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2); 177 WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2); 178 178 end 179 179 … … 185 185 outputs = [outputs defaultoutputs(self,md)]; %add defaults 186 186 end 187 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum,'format','StringArray');187 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray'); 188 188 189 189 end % }}} -
issm/trunk-jpl/src/m/classes/SMBpdd.py
r19897 r20690 149 149 return md 150 150 #}}} 151 def marshall(self, md,fid): # {{{151 def marshall(self,prefix,md,fid): # {{{ 152 152 153 153 yts=365.0*24.0*3600.0 154 154 155 WriteData(fid, 'enum',SmbEnum(),'data',SMBpddEnum(),'format','Integer')155 WriteData(fid,prefix,'name','md.smb.model','data',SMBpddEnum(),'format','Integer') 156 156 157 WriteData(fid, 'object',self,'class','smb','fieldname','isdelta18o','format','Boolean')158 WriteData(fid, 'object',self,'class','smb','fieldname','ismungsm','format','Boolean')159 WriteData(fid, 'object',self,'class','smb','fieldname','desfac','format','Double')160 WriteData(fid, 'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1);161 WriteData(fid, 'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1);162 WriteData(fid, 'object',self,'class','smb','fieldname','rlaps','format','Double')163 WriteData(fid, 'object',self,'class','smb','fieldname','rlapslgm','format','Double')157 WriteData(fid,prefix,'object',self,'class','smb','fieldname','isdelta18o','format','Boolean') 158 WriteData(fid,prefix,'object',self,'class','smb','fieldname','ismungsm','format','Boolean') 159 WriteData(fid,prefix,'object',self,'class','smb','fieldname','desfac','format','Double') 160 WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0p','format','DoubleMat','mattype',1); 161 WriteData(fid,prefix,'object',self,'class','smb','fieldname','s0t','format','DoubleMat','mattype',1); 162 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlaps','format','Double') 163 WriteData(fid,prefix,'object',self,'class','smb','fieldname','rlapslgm','format','Double') 164 164 165 165 if (self.isdelta18o==0 and self.ismungsm==0): 166 WriteData(fid, 'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)167 WriteData(fid, 'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)166 WriteData(fid,prefix,'object',self,'class','smb','fieldname','monthlytemperatures','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 167 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitation','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 168 168 elif self.isdelta18o: 169 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)170 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)171 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)172 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)173 WriteData(fid, 'object',self,'class','smb','fieldname','delta18o_surface','format','DoubleMat','mattype',1,'timeserieslength',2)174 WriteData(fid, 'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2)175 WriteData(fid, 'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2)176 WriteData(fid, 'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2)169 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 170 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 171 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 172 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 173 WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o_surface','format','DoubleMat','mattype',1,'timeserieslength',2) 174 WriteData(fid,prefix,'object',self,'class','smb','fieldname','delta18o','format','DoubleMat','mattype',1,'timeserieslength',2) 175 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2) 176 WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2) 177 177 elif self.ismungsm: 178 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)179 WriteData(fid, 'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)180 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)181 WriteData(fid, 'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)182 WriteData(fid, 'object',self,'class','smb','fieldname','Pfac','format','DoubleMat','mattype',1,'timeserieslength',2)183 WriteData(fid, 'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2)184 WriteData(fid, 'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2)178 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_presentday','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 179 WriteData(fid,prefix,'object',self,'class','smb','fieldname','temperatures_lgm','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 180 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_presentday','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 181 WriteData(fid,prefix,'object',self,'class','smb','fieldname','precipitations_lgm','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 182 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Pfac','format','DoubleMat','mattype',1,'timeserieslength',2) 183 WriteData(fid,prefix,'object',self,'class','smb','fieldname','Tdiff','format','DoubleMat','mattype',1,'timeserieslength',2) 184 WriteData(fid,prefix,'object',self,'class','smb','fieldname','sealev','format','DoubleMat','mattype',1,'timeserieslength',2) 185 185 186 186 #process requested outputs … … 190 190 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 191 191 outputs =outputscopy 192 WriteData(fid, 'data',outputs,'enum',SmbRequestedOutputsEnum(),'format','StringArray')192 WriteData(fid,prefix,'data',outputs,'name','md.smb.requested_outputs','format','StringArray') 193 193 194 194 # }}} -
issm/trunk-jpl/src/m/classes/adinversion.m
r19897 r20690 125 125 disp(' 503: ThicknessAbsGradient'); 126 126 end % }}} 127 function marshall(self, md,fid) % {{{127 function marshall(self,prefix,md,fid) % {{{ 128 128 129 129 yts=365.0*24.0*3600.0; 130 130 131 WriteData(fid, 'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');132 WriteData(fid, 'enum',InversionTypeEnum(),'data',4,'format','Integer');131 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean'); 132 WriteData(fid,prefix,'name','md.inversion.type','data',4,'format','Integer'); 133 133 if ~self.iscontrol, return; end 134 WriteData(fid, 'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3);135 WriteData(fid, 'object',self,'class','inversion','fieldname','maxsteps','format','Integer');136 WriteData(fid, 'object',self,'class','inversion','fieldname','maxiter','format','Integer');137 WriteData(fid, 'object',self,'class','inversion','fieldname','dxmin','format','Double');138 WriteData(fid, 'object',self,'class','inversion','fieldname','gttol','format','Double');139 WriteData(fid, 'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);140 WriteData(fid, 'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);141 WriteData(fid, 'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);142 WriteData(fid, 'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);143 WriteData(fid, 'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);144 WriteData(fid, 'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);134 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3); 135 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer'); 136 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer'); 137 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dxmin','format','Double'); 138 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double'); 139 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 140 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3); 141 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3); 142 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 143 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 144 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 145 145 if(numel(self.thickness_obs)==md.mesh.numberofelements), 146 146 mattype=2; … … 148 148 mattype=1; 149 149 end 150 WriteData(fid, 'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);151 WriteData(fid, 'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);150 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype); 151 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype); 152 152 153 153 %process control parameters 154 154 num_control_parameters=numel(self.control_parameters); 155 data=zeros(1,num_control_parameters); 156 for i=1:num_control_parameters, 157 data(i)=StringToEnum(self.control_parameters{i}); 158 end 159 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3); 160 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer'); 155 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray'); 156 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer'); 161 157 162 158 %process cost functions … … 186 182 pos=find(self.cost_functions==1009); data(pos)=Outputdefinition8Enum(); 187 183 pos=find(self.cost_functions==1010); data(pos)=Outputdefinition10Enum(); 188 WriteData(fid, 'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);189 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');184 WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3); 185 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer'); 190 186 end % }}} 191 187 end -
issm/trunk-jpl/src/m/classes/adinversion.py
r19379 r20690 142 142 yts=365.0*24.0*3600.0; 143 143 144 WriteData(fid, 'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');145 WriteData(fid, 'enum',InversionTypeEnum(),'data',4,'format','Integer');144 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean'); 145 WriteData(fid,prefix,'name','md.inversion.type','data',4,'format','Integer'); 146 146 if not self.iscontrol: 147 147 return 148 WriteData(fid, 'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3);149 WriteData(fid, 'object',self,'class','inversion','fieldname','maxsteps','format','Integer');150 WriteData(fid, 'object',self,'class','inversion','fieldname','maxiter','format','Integer');151 WriteData(fid, 'object',self,'class','inversion','fieldname','dxmin','format','Double');152 WriteData(fid, 'object',self,'class','inversion','fieldname','gttol','format','Double');153 WriteData(fid, 'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);154 WriteData(fid, 'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);155 WriteData(fid, 'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);156 WriteData(fid, 'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);157 WriteData(fid, 'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);158 WriteData(fid, 'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);148 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3); 149 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer'); 150 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer'); 151 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dxmin','format','Double'); 152 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double'); 153 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 154 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3); 155 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3); 156 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 157 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 158 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 159 159 if(numel(self.thickness_obs)==md.mesh.numberofelements): 160 160 mattype=2; … … 162 162 mattype=1; 163 163 164 WriteData(fid, 'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);165 WriteData(fid, 'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);164 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype); 165 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype); 166 166 167 167 #process control parameters 168 168 num_control_parameters = numpy.numel(self.control_parameters); 169 data = numpy.array([StringToEnum(self.control_parameter[0]) for control_parameter in self.control_parameters]).reshape(1,-1) 170 171 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3); 172 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer'); 169 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray'); 170 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer'); 173 171 174 172 #process cost functions … … 198 196 data[numpy.nonzero(self.cost_functions==1009)]=Outputdefinition8Enum(); 199 197 data[numpy.nonzero(self.cost_functions==1010)]=Outputdefinition10Enum(); 200 WriteData(fid, 'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);201 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');198 WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3); 199 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer'); 202 200 -
issm/trunk-jpl/src/m/classes/autodiff.js
r19860 r20690 62 62 this.marshall=function(md,fid) { //{{{ 63 63 64 WriteData(fid, 'object',this,'fieldname','isautodiff','format','Boolean');65 WriteData(fid, 'object',this,'fieldname','driver','format','String');64 WriteData(fid,prefix,'object',this,'fieldname','isautodiff','format','Boolean'); 65 WriteData(fid,prefix,'object',this,'fieldname','driver','format','String'); 66 66 67 67 //early return 68 68 if (!this.isautodiff){ 69 WriteData(fid, 'data',false,'enum',AutodiffMassFluxSegmentsPresentEnum(),'format','Boolean');70 WriteData(fid, 'data',false,'enum',AutodiffKeepEnum(),'format','Boolean');69 WriteData(fid,prefix,'data',false,'name','md.autodiff.mass_flux_segments_present','format','Boolean'); 70 WriteData(fid,prefix,'data',false,'name','md.autodiff.keep','format','Boolean'); 71 71 return; 72 72 } 73 73 74 74 //buffer sizes {{{ 75 WriteData(fid, 'object',this,'fieldname','obufsize','format','Double');76 WriteData(fid, 'object',this,'fieldname','lbufsize','format','Double');77 WriteData(fid, 'object',this,'fieldname','cbufsize','format','Double');78 WriteData(fid, 'object',this,'fieldname','tbufsize','format','Double');79 WriteData(fid, 'object',this,'fieldname','gcTriggerRatio','format','Double');80 WriteData(fid, 'object',this,'fieldname','gcTriggerMaxSize','format','Double');75 WriteData(fid,prefix,'object',this,'fieldname','obufsize','format','Double'); 76 WriteData(fid,prefix,'object',this,'fieldname','lbufsize','format','Double'); 77 WriteData(fid,prefix,'object',this,'fieldname','cbufsize','format','Double'); 78 WriteData(fid,prefix,'object',this,'fieldname','tbufsize','format','Double'); 79 WriteData(fid,prefix,'object',this,'fieldname','gcTriggerRatio','format','Double'); 80 WriteData(fid,prefix,'object',this,'fieldname','gcTriggerMaxSize','format','Double'); 81 81 //}}} 82 82 //process dependent variables {{{ 83 83 num_dependent_objects=this.dependents.length; 84 WriteData(fid, 'data',num_dependent_objects,'enum',AutodiffNumDependentObjectsEnum(),'format','Integer');84 WriteData(fid,prefix,'data',num_dependent_objects,'name','md.autodiff.num_dependent_objects','format','Integer'); 85 85 86 86 if(num_dependent_objects){ … … 96 96 indices[i]=dep.index; 97 97 } 98 WriteData(fid, 'data',names,'enum',AutodiffDependentObjectNamesEnum(),'format','StringArray');99 WriteData(fid, 'data',types,'enum',AutodiffDependentObjectTypesEnum(),'format','IntMat','mattype',3);100 WriteData(fid, 'data',indices,'enum',AutodiffDependentObjectIndicesEnum(),'format','IntMat','mattype',3);98 WriteData(fid,prefix,'data',names,'name','md.autodiff.dependent_object_names','format','StringArray'); 99 WriteData(fid,prefix,'data',types,'name','md.autodiff.dependent_object_types','format','IntMat','mattype',3); 100 WriteData(fid,prefix,'data',indices,'name','md.autodiff.dependent_object_indices','format','IntMat','mattype',3); 101 101 } 102 102 //}}} 103 103 //process independent variables {{{ 104 104 num_independent_objects=this.independents.length; 105 WriteData(fid, 'data',num_independent_objects,'enum',AutodiffNumIndependentObjectsEnum(),'format','Integer');105 WriteData(fid,prefix,'data',num_independent_objects,'name','md.autodiff.num_independent_objects','format','Integer'); 106 106 107 107 if(num_independent_objects){ … … 115 115 types[i]=indep.typetoscalar(); 116 116 } 117 WriteData(fid, 'data',names,'enum',AutodiffIndependentObjectNamesEnum(),'format','IntMat','mattype',3);118 WriteData(fid, 'data',types,'enum',AutodiffIndependentObjectTypesEnum(),'format','IntMat','mattype',3);117 WriteData(fid,prefix,'data',names,'name','md.autodiff.independent_object_names','format','IntMat','mattype',3); 118 WriteData(fid,prefix,'data',types,'name','md.autodiff.independent_object_types','format','IntMat','mattype',3); 119 119 } 120 120 //}}} … … 135 135 } 136 136 index=index-1; //get c-index numbering going 137 WriteData(fid, 'data',index,'enum',AutodiffFosForwardIndexEnum(),'format','Integer');137 WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_forward_index','format','Integer'); 138 138 } 139 139 //}}} … … 154 154 } 155 155 index=index-1; //get c-index numbering going 156 WriteData(fid, 'data',index,'enum',AutodiffFosReverseIndexEnum(),'format','Integer');156 WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_reverse_index','format','Integer'); 157 157 } 158 158 //}}} … … 173 173 } 174 174 indices=indices-1; //get c-indices numbering going 175 WriteData(fid, 'data',indices,'enum',AutodiffFovForwardIndicesEnum(),'format','IntMat','mattype',3);175 WriteData(fid,prefix,'data',indices,'name','md.autodiff.fov_forward_indices','format','IntMat','mattype',3); 176 176 } 177 177 //}}} … … 185 185 } 186 186 if (mass_flux_segments.length){ 187 WriteData(fid, 'data',mass_flux_segments,'enum',MassFluxSegmentsEnum(),'format','MatArray');187 WriteData(fid,prefix,'data',mass_flux_segments,'name','md.autodiff.mass_flux_segments','format','MatArray'); 188 188 flag=true; 189 189 } 190 190 else flag=false; 191 WriteData(fid, 'data',flag,'enum',AutodiffMassFluxSegmentsPresentEnum(),'format','Boolean');191 WriteData(fid,prefix,'data',flag,'name','md.autodiff.mass_flux_segments_present','format','Boolean'); 192 192 //}}} 193 193 //deal with trace keep on: {{{ … … 206 206 else keep=false; 207 207 } 208 WriteData(fid, 'data',keep,'enum',AutodiffKeepEnum(),'format','Boolean');208 WriteData(fid,prefix,'data',keep,'name','md.autodiff.keep','format','Boolean'); 209 209 //}}} 210 210 }//}}} -
issm/trunk-jpl/src/m/classes/autodiff.m
r19958 r20690 76 76 fielddisplay(self,'gcTriggerMaxSize','free location block sorting/consolidation triggered if the allocated locations exceed gcTriggerMaxSize'); 77 77 end % }}} 78 function marshall(self, md,fid) % {{{79 80 WriteData(fid, 'object',self,'fieldname','isautodiff','format','Boolean');81 WriteData(fid, 'object',self,'fieldname','driver','format','String');78 function marshall(self,prefix,md,fid) % {{{ 79 80 WriteData(fid,prefix,'object',self,'fieldname','isautodiff','format','Boolean'); 81 WriteData(fid,prefix,'object',self,'fieldname','driver','format','String'); 82 82 83 83 %early return 84 84 if ~self.isautodiff, 85 WriteData(fid, 'data',false,'enum',AutodiffMassFluxSegmentsPresentEnum(),'format','Boolean');86 WriteData(fid, 'data',false,'enum',AutodiffKeepEnum(),'format','Boolean');85 WriteData(fid,prefix,'data',false,'name','md.autodiff.mass_flux_segments_present','format','Boolean'); 86 WriteData(fid,prefix,'data',false,'name','md.autodiff.keep','format','Boolean'); 87 87 return; 88 88 end 89 89 90 90 %buffer sizes {{{ 91 WriteData(fid, 'object',self,'fieldname','obufsize','format','Double');92 WriteData(fid, 'object',self,'fieldname','lbufsize','format','Double');93 WriteData(fid, 'object',self,'fieldname','cbufsize','format','Double');94 WriteData(fid, 'object',self,'fieldname','tbufsize','format','Double');95 WriteData(fid, 'object',self,'fieldname','gcTriggerRatio','format','Double');96 WriteData(fid, 'object',self,'fieldname','gcTriggerMaxSize','format','Double');91 WriteData(fid,prefix,'object',self,'fieldname','obufsize','format','Double'); 92 WriteData(fid,prefix,'object',self,'fieldname','lbufsize','format','Double'); 93 WriteData(fid,prefix,'object',self,'fieldname','cbufsize','format','Double'); 94 WriteData(fid,prefix,'object',self,'fieldname','tbufsize','format','Double'); 95 WriteData(fid,prefix,'object',self,'fieldname','gcTriggerRatio','format','Double'); 96 WriteData(fid,prefix,'object',self,'fieldname','gcTriggerMaxSize','format','Double'); 97 97 %}}} 98 98 %process dependent variables {{{ 99 99 num_dependent_objects=numel(self.dependents); 100 WriteData(fid, 'data',num_dependent_objects,'enum',AutodiffNumDependentObjectsEnum(),'format','Integer');100 WriteData(fid,prefix,'data',num_dependent_objects,'naem','md.autodiff.num_dependent_objects','format','Integer'); 101 101 102 102 if(num_dependent_objects), … … 112 112 indices(i)=dep.index; 113 113 end 114 WriteData(fid, 'data',names,'enum',AutodiffDependentObjectNamesEnum(),'format','StringArray');115 WriteData(fid, 'data',types,'enum',AutodiffDependentObjectTypesEnum(),'format','IntMat','mattype',3);116 WriteData(fid, 'data',indices,'enum',AutodiffDependentObjectIndicesEnum(),'format','IntMat','mattype',3);114 WriteData(fid,prefix,'data',names,'name','md.autodiff.dependent_object_names','format','StringArray'); 115 WriteData(fid,prefix,'data',types,'name','md.autodiff.dependent_object_types','format','IntMat','mattype',3); 116 WriteData(fid,prefix,'data',indices,'name','md.autodiff.dependent_object_indicies','format','IntMat','mattype',3); 117 117 end 118 118 %}}} 119 119 %process independent variables {{{ 120 120 num_independent_objects=numel(self.independents); 121 WriteData(fid, 'data',num_independent_objects,'enum',AutodiffNumIndependentObjectsEnum(),'format','Integer');121 WriteData(fid,prefix,'data',num_independent_objects,'name','md.autodiff.num_independent_objects','format','Integer'); 122 122 123 123 if(num_independent_objects), … … 131 131 types(i)=indep.typetoscalar(); 132 132 end 133 WriteData(fid, 'data',names,'enum',AutodiffIndependentObjectNamesEnum(),'format','IntMat','mattype',3);134 WriteData(fid, 'data',types,'enum',AutodiffIndependentObjectTypesEnum(),'format','IntMat','mattype',3);133 WriteData(fid,prefix,'data',names,'name','md.autodiff.independent_object_names','format','IntMat','mattype',3); 134 WriteData(fid,prefix,'data',types,'name','md.autodiff.independent_object_types','format','IntMat','mattype',3); 135 135 end 136 136 %}}} … … 153 153 end 154 154 index=index-1; %get c-index numbering going 155 WriteData(fid, 'data',index,'enum',AutodiffFosForwardIndexEnum(),'format','Integer');155 WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_forward_index','format','Integer'); 156 156 end 157 157 %}}} … … 174 174 end 175 175 index=index-1; %get c-index numbering going 176 WriteData(fid, 'data',index,'enum',AutodiffFosReverseIndexEnum(),'format','Integer');176 WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_reverse_index','format','Integer'); 177 177 end 178 178 %}}} … … 195 195 end 196 196 indices=indices-1; %get c-indices numbering going 197 WriteData(fid, 'data',indices,'enum',AutodiffFovForwardIndicesEnum(),'format','IntMat','mattype',3);197 WriteData(fid,prefix,'data',indices,'name','md.autodiff.fov_forward_indices','format','IntMat','mattype',3); 198 198 end 199 199 %}}} … … 207 207 end 208 208 if ~isempty(mass_flux_segments), 209 WriteData(fid, 'data',mass_flux_segments,'enum',MassFluxSegmentsEnum(),'format','MatArray');209 WriteData(fid,prefix,'data',mass_flux_segments,'name','md.autodiff.mass_flux_segments','format','MatArray'); 210 210 flag=true; 211 211 else 212 212 flag=false; 213 213 end 214 WriteData(fid, 'data',flag,'enum',AutodiffMassFluxSegmentsPresentEnum(),'format','Boolean');214 WriteData(fid,prefix,'data',flag,'name','md.autodiff.mass_flux_segments_present','format','Boolean'); 215 215 %}}} 216 216 %deal with trace keep on: {{{ … … 233 233 end 234 234 end 235 WriteData(fid, 'data',keep,'enum',AutodiffKeepEnum(),'format','Boolean');235 WriteData(fid,prefix,'data',keep,'name','md.autodiff.keep','format','Boolean'); 236 236 %}}} 237 237 -
issm/trunk-jpl/src/m/classes/autodiff.py
r20002 r20690 81 81 return md 82 82 # }}} 83 def marshall(self, md,fid): # {{{84 WriteData(fid, 'object',self,'fieldname','isautodiff','format','Boolean')85 WriteData(fid, 'object',self,'fieldname','driver','format','String')83 def marshall(self,prefix,md,fid): # {{{ 84 WriteData(fid,prefix,'object',self,'fieldname','isautodiff','format','Boolean') 85 WriteData(fid,prefix,'object',self,'fieldname','driver','format','String') 86 86 87 87 #early return 88 88 if not self.isautodiff: 89 WriteData(fid, 'data',False,'enum',AutodiffMassFluxSegmentsPresentEnum(),'format','Boolean')90 WriteData(fid, 'data',False,'enum',AutodiffKeepEnum(),'format','Boolean')89 WriteData(fid,prefix,'data',False,'name','md.autodiff.mass_flux_segments_present','format','Boolean') 90 WriteData(fid,prefix,'data',False,'name','md.autodiff.keep','format','Boolean') 91 91 return 92 92 93 93 #buffer sizes {{{ 94 WriteData(fid, 'object',self,'fieldname','obufsize','format','Double');95 WriteData(fid, 'object',self,'fieldname','lbufsize','format','Double');96 WriteData(fid, 'object',self,'fieldname','cbufsize','format','Double');97 WriteData(fid, 'object',self,'fieldname','tbufsize','format','Double');98 WriteData(fid, 'object',self,'fieldname','gcTriggerRatio','format','Double');99 WriteData(fid, 'object',self,'fieldname','gcTriggerMaxSize','format','Double');94 WriteData(fid,prefix,'object',self,'fieldname','obufsize','format','Double'); 95 WriteData(fid,prefix,'object',self,'fieldname','lbufsize','format','Double'); 96 WriteData(fid,prefix,'object',self,'fieldname','cbufsize','format','Double'); 97 WriteData(fid,prefix,'object',self,'fieldname','tbufsize','format','Double'); 98 WriteData(fid,prefix,'object',self,'fieldname','gcTriggerRatio','format','Double'); 99 WriteData(fid,prefix,'object',self,'fieldname','gcTriggerMaxSize','format','Double'); 100 100 #}}} 101 101 #process dependent variables {{{ 102 102 num_dependent_objects=len(self.dependents) 103 WriteData(fid, 'data',num_dependent_objects,'enum',AutodiffNumDependentObjectsEnum(),'format','Integer')103 WriteData(fid,prefix,'data',num_dependent_objects,'name','md.autodiff.num_dependent_objects','format','Integer') 104 104 105 105 if num_dependent_objects: … … 113 113 indices[i]=dep.index 114 114 115 WriteData(fid, 'data',names,'enum',AutodiffDependentObjectNamesEnum(),'format','StringArray')116 WriteData(fid, 'data',types,'enum',AutodiffDependentObjectTypesEnum(),'format','IntMat','mattype',3)117 WriteData(fid, 'data',indices,'enum',AutodiffDependentObjectIndicesEnum(),'format','IntMat','mattype',3)115 WriteData(fid,prefix,'data',names,'name','md.autodiff.dependent_object_names','format','StringArray') 116 WriteData(fid,prefix,'data',types,'name','md.autodiff.dependent_object_types','format','IntMat','mattype',3) 117 WriteData(fid,prefix,'data',indices,'name','md.autodiff.dependent_object_indices','format','IntMat','mattype',3) 118 118 #}}} 119 119 #process independent variables {{{ 120 120 num_independent_objects=len(self.independents) 121 WriteData(fid, 'data',num_independent_objects,'enum',AutodiffNumIndependentObjectsEnum(),'format','Integer')121 WriteData(fid,prefix,'data',num_independent_objects,'name','md.autodiff.num_independent_objects','format','Integer') 122 122 123 123 if num_independent_objects: … … 129 129 types[i]=indep.typetoscalar() 130 130 131 WriteData(fid, 'data',names,'enum',AutodiffIndependentObjectNamesEnum(),'format','IntMat','mattype',3)132 WriteData(fid, 'data',types,'enum',AutodiffIndependentObjectTypesEnum(),'format','IntMat','mattype',3)131 WriteData(fid,prefix,'data',names,'name','md.autodiff.independent_object_names','format','IntMat','mattype',3) 132 WriteData(fid,prefix,'data',types,'name','md.autodiff.independent_object_types','format','IntMat','mattype',3) 133 133 #}}} 134 134 #if driver is fos_forward, build index: {{{ … … 147 147 148 148 index-=1 #get c-index numbering going 149 WriteData(fid, 'data',index,'enum',AutodiffFosForwardIndexEnum(),'format','Integer')149 WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_forward_index','format','Integer') 150 150 #}}} 151 151 #if driver is fos_reverse, build index: {{{ … … 164 164 165 165 index-=1 #get c-index numbering going 166 WriteData(fid, 'data',index,'enum',AutodiffFosReverseIndexEnum(),'format','Integer')166 WriteData(fid,prefix,'data',index,'name','md.autodiff.fos_reverse_index','format','Integer') 167 167 #}}} 168 168 #if driver is fov_forward, build indices: {{{ … … 181 181 182 182 indices-=1 #get c-indices numbering going 183 WriteData(fid, 'data',indices,'enum',AutodiffFovForwardIndicesEnum(),'format','IntMat','mattype',3)183 WriteData(fid,prefix,'data',indices,'name','md.autodiff.fov_forward_indices','format','IntMat','mattype',3) 184 184 #}}} 185 185 #deal with mass fluxes: {{{ … … 187 187 188 188 if mass_flux_segments: 189 WriteData(fid, 'data',mass_flux_segments,'enum',MassFluxSegmentsEnum(),'format','MatArray')189 WriteData(fid,prefix,'data',mass_flux_segments,'name','md.autodiff.mass_flux_segments','format','MatArray') 190 190 flag=True 191 191 else: 192 192 flag=False 193 WriteData(fid, 'data',flag,'enum',AutodiffMassFluxSegmentsPresentEnum(),'format','Boolean')193 WriteData(fid,prefix,'data',flag,'name','md.autodiff.mass_flux_segments_present','format','Boolean') 194 194 #}}} 195 195 #deal with trace keep on: {{{ … … 210 210 else: 211 211 keep=False 212 WriteData(fid, 'data',keep,'enum',AutodiffKeepEnum(),'format','Boolean')212 WriteData(fid,prefix,'data',keep,'name','md.autodiff.keep','format','Boolean') 213 213 #}}} 214 214 -
issm/trunk-jpl/src/m/classes/balancethickness.js
r19901 r20690 37 37 var yts=365.0*24.0*3600.0; 38 38 39 WriteData(fid, 'object',this,'fieldname','spcthickness','format','DoubleMat','mattype',1);40 WriteData(fid, 'object',this,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1/yts);41 WriteData(fid, 'object',this,'fieldname','stabilization','format','Integer');42 WriteData(fid, 'object',this,'fieldname','omega','format','DoubleMat','mattype',1);39 WriteData(fid,prefix,'object',this,'fieldname','spcthickness','format','DoubleMat','mattype',1); 40 WriteData(fid,prefix,'object',this,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1/yts); 41 WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer'); 42 WriteData(fid,prefix,'object',this,'fieldname','omega','format','DoubleMat','mattype',1); 43 43 44 44 }//}}} -
issm/trunk-jpl/src/m/classes/balancethickness.m
r19897 r20690 45 45 46 46 end % }}} 47 function marshall(self, md,fid) % {{{47 function marshall(self,prefix,md,fid) % {{{ 48 48 49 49 yts=365.0*24.0*3600.0; 50 50 51 WriteData(fid, 'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1);52 WriteData(fid, 'object',self,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1./yts);53 WriteData(fid, 'object',self,'fieldname','stabilization','format','Integer');51 WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1); 52 WriteData(fid,prefix,'object',self,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1./yts); 53 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer'); 54 54 55 WriteData(fid, 'object',self,'fieldname','omega','format','DoubleMat','mattype',1);55 WriteData(fid,prefix,'object',self,'fieldname','omega','format','DoubleMat','mattype',1); 56 56 end % }}} 57 57 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/balancethickness.py
r19897 r20690 48 48 return md 49 49 # }}} 50 def marshall(self, md,fid): # {{{50 def marshall(self,prefix,md,fid): # {{{ 51 51 52 52 yts=365.0*24.0*3600.0 53 53 54 WriteData(fid, 'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1)55 WriteData(fid, 'object',self,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1./yts)56 WriteData(fid, 'object',self,'fieldname','stabilization','format','Integer')54 WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1) 55 WriteData(fid,prefix,'object',self,'fieldname','thickening_rate','format','DoubleMat','mattype',1,'scale',1./yts) 56 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer') 57 57 # }}} -
issm/trunk-jpl/src/m/classes/basalforcings.js
r19901 r20690 58 58 var yts=365.0*24.0*3600.0; 59 59 60 WriteData(fid, 'enum',BasalforcingsEnum(),'data',FloatingMeltRateEnum(),'format','Integer');61 WriteData(fid, 'object',this,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)62 WriteData(fid, 'object',this,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)63 WriteData(fid, 'object',this,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);60 WriteData(fid,prefix,'name','md.basalforcings.model','data',FloatingMeltRateEnum(),'format','Integer'); 61 WriteData(fid,prefix,'object',this,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 62 WriteData(fid,prefix,'object',this,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 63 WriteData(fid,prefix,'object',this,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 64 64 }//}}} 65 65 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/basalforcings.m
r19958 r20690 64 64 65 65 end % }}} 66 function marshall(self, md,fid) % {{{66 function marshall(self,prefix,md,fid) % {{{ 67 67 68 68 yts=365.0*24.0*3600.0; 69 69 70 WriteData(fid, 'enum',BasalforcingsEnum(),'data',FloatingMeltRateEnum(),'format','Integer');71 WriteData(fid, 'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)72 WriteData(fid, 'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)73 WriteData(fid, 'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);70 WriteData(fid,prefix,'name','md.basalforcings.model','data',FloatingMeltRateEnum(),'format','Integer'); 71 WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 72 WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 73 WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 74 74 end % }}} 75 75 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/basalforcings.py
r19897 r20690 69 69 return md 70 70 # }}} 71 def marshall(self, md,fid): # {{{71 def marshall(self,prefix,md,fid): # {{{ 72 72 73 73 yts=365.0*24.0*3600.0 74 74 75 WriteData(fid, 'enum',BasalforcingsEnum(),'data',FloatingMeltRateEnum(),'format','Integer');76 WriteData(fid, 'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)77 WriteData(fid, 'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)78 WriteData(fid, 'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)75 WriteData(fid,prefix,'name','md.basalforcings.model','data',FloatingMeltRateEnum(),'format','Integer'); 76 WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 77 WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 78 WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 79 79 # }}} -
issm/trunk-jpl/src/m/classes/calving.js
r20460 r20690 28 28 this.marshall=function(md,fid) { //{{{ 29 29 var yts=365.0*24.0*3600.0; 30 WriteData(fid, 'enum',CalvingLawEnum(),'data',DefaultCalvingEnum(),'format','Integer');31 WriteData(fid, 'object',this,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts);32 WriteData(fid, 'object',this,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts);30 WriteData(fid,prefix,'name','md.calving.law','data',DefaultCalvingEnum(),'format','Integer'); 31 WriteData(fid,prefix,'object',this,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts); 32 WriteData(fid,prefix,'object',this,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts); 33 33 }//}}} 34 34 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/calving.m
r20518 r20690 47 47 fielddisplay(self,'meltingrate','melting rate at given location [m/a]'); 48 48 end % }}} 49 function marshall(self, md,fid) % {{{49 function marshall(self,prefix,md,fid) % {{{ 50 50 yts=365.0*24.0*3600.0; 51 WriteData(fid, 'enum',CalvingLawEnum(),'data',DefaultCalvingEnum(),'format','Integer');52 WriteData(fid, 'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts);53 WriteData(fid, 'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts);51 WriteData(fid,prefix,'name','md.calving.law','data',DefaultCalvingEnum(),'format','Integer'); 52 WriteData(fid,prefix,'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts); 53 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts); 54 54 end % }}} 55 55 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/calving.py
r20460 r20690 50 50 return md 51 51 # }}} 52 def marshall(self, md,fid): # {{{52 def marshall(self,prefix,md,fid): # {{{ 53 53 54 54 yts=365.*24.*3600. 55 55 56 WriteData(fid, 'enum',CalvingLawEnum(),'data',DefaultCalvingEnum(),'format','Integer');57 WriteData(fid, 'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts)58 WriteData(fid, 'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts)56 WriteData(fid,prefix,'name','md.calving.law','data',DefaultCalvingEnum(),'format','Integer'); 57 WriteData(fid,prefix,'object',self,'fieldname','calvingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts) 58 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts) 59 59 # }}} -
issm/trunk-jpl/src/m/classes/calvingdev.m
r20461 r20690 50 50 51 51 end % }}} 52 function marshall(self, md,fid) % {{{52 function marshall(self,prefix,md,fid) % {{{ 53 53 yts=365.0*24.0*3600.0; 54 WriteData(fid, 'enum',CalvingLawEnum(),'data',CalvingDevEnum(),'format','Integer');55 WriteData(fid, 'enum',CalvingdevCoeffEnum(),'data',self.coeff,'format','DoubleMat','mattype',1);56 WriteData(fid, 'class','calving','object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1,'scale',1./yts);54 WriteData(fid,prefix,'name','md.calving.law','data',CalvingDevEnum(),'format','Integer'); 55 WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1); 56 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'forcinglength',md.mesh.numberofvertices+1,'scale',1./yts); 57 57 end % }}} 58 58 end -
issm/trunk-jpl/src/m/classes/calvinglevermann.m
r20460 r20690 50 50 51 51 end % }}} 52 function marshall(self, md,fid) % {{{52 function marshall(self,prefix,md,fid) % {{{ 53 53 yts=365.0*24.0*3600.0; 54 WriteData(fid, 'enum',CalvingLawEnum(),'data',CalvingLevermannEnum(),'format','Integer');55 WriteData(fid, 'enum',CalvinglevermannCoeffEnum(),'data',self.coeff,'format','DoubleMat','mattype',1);56 WriteData(fid, 'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts);54 WriteData(fid,prefix,'name','md.calving.law','data',CalvingLevermannEnum(),'format','Integer'); 55 WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1); 56 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts); 57 57 end % }}} 58 58 end -
issm/trunk-jpl/src/m/classes/calvinglevermann.py
r20460 r20690 49 49 return md 50 50 # }}} 51 def marshall(self, md,fid): # {{{51 def marshall(self,prefix,md,fid): # {{{ 52 52 yts=365.*24.*3600. 53 WriteData(fid, 'enum',CalvingLawEnum(),'data',CalvingLevermannEnum(),'format','Integer');54 WriteData(fid, 'enum',CalvinglevermannCoeffEnum(),'data',self.coeff,'format','DoubleMat','mattype',1)55 WriteData(fid, 'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts)53 WriteData(fid,prefix,'name','md.calving.law','data',CalvingLevermannEnum(),'format','Integer'); 54 WriteData(fid,prefix,'object',self,'fieldname','coeff','format','DoubleMat','mattype',1) 55 WriteData(fid,prefix,'object',self,'fieldname','meltingrate','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'scale',1./yts) 56 56 # }}} -
issm/trunk-jpl/src/m/classes/constants.js
r19860 r20690 42 42 } // }}} 43 43 this.marshall=function(md,fid) { //{{{ 44 WriteData(fid, 'object',this,'fieldname','g','format','Double');45 WriteData(fid, 'object',this,'fieldname','yts','format','Double');46 WriteData(fid, 'object',this,'fieldname','referencetemperature','format','Double');44 WriteData(fid,prefix,'object',this,'fieldname','g','format','Double'); 45 WriteData(fid,prefix,'object',this,'fieldname','yts','format','Double'); 46 WriteData(fid,prefix,'object',this,'fieldname','referencetemperature','format','Double'); 47 47 }//}}} 48 48 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/constants.m
r19958 r20690 52 52 53 53 end % }}} 54 function marshall(self, md,fid) % {{{55 WriteData(fid, 'object',self,'fieldname','g','format','Double');56 WriteData(fid, 'object',self,'fieldname','yts','format','Double');57 WriteData(fid, 'object',self,'fieldname','referencetemperature','format','Double');54 function marshall(self,prefix,md,fid) % {{{ 55 WriteData(fid,prefix,'object',self,'fieldname','g','format','Double'); 56 WriteData(fid,prefix,'object',self,'fieldname','yts','format','Double'); 57 WriteData(fid,prefix,'object',self,'fieldname','referencetemperature','format','Double'); 58 58 end % }}} 59 59 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/constants.py
r17497 r20690 51 51 return md 52 52 # }}} 53 def marshall(self, md,fid): # {{{54 WriteData(fid, 'object',self,'fieldname','g','format','Double')55 WriteData(fid, 'object',self,'fieldname','yts','format','Double')56 WriteData(fid, 'object',self,'fieldname','referencetemperature','format','Double')53 def marshall(self,prefix,md,fid): # {{{ 54 WriteData(fid,prefix,'object',self,'fieldname','g','format','Double') 55 WriteData(fid,prefix,'object',self,'fieldname','yts','format','Double') 56 WriteData(fid,prefix,'object',self,'fieldname','referencetemperature','format','Double') 57 57 # }}} -
issm/trunk-jpl/src/m/classes/damage.js
r19903 r20690 70 70 if (this.isdamage){ 71 71 checkfield(md,'fieldname','damage.law','numel',[1],'values',[0,1,2]); 72 checkfield(md,'fieldname','damage.D','>=',0,'<=', self.max_damage,'size',[md.mesh.numberofvertices ,1]);72 checkfield(md,'fieldname','damage.D','>=',0,'<=',this.max_damage,'size',[md.mesh.numberofvertices ,1]); 73 73 checkfield(md,'fieldname','damage.spcdamage','Inf',1,'timeseries',1); 74 74 checkfield(md,'fieldname','damage.max_damage','<',1,'>=',0); … … 94 94 this.marshall=function(md,fid) { //{{{ 95 95 96 WriteData(fid, 'object',this,'fieldname','isdamage','format','Boolean');96 WriteData(fid,prefix,'object',this,'fieldname','isdamage','format','Boolean'); 97 97 if (this.isdamage){ 98 WriteData(fid, 'object',this,'fieldname','law','format','Integer');99 WriteData(fid, 'object',this,'fieldname','D','format','DoubleMat','mattype',1);100 WriteData(fid, 'object',this,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);101 WriteData(fid, 'object',this,'fieldname','max_damage','format','Double');98 WriteData(fid,prefix,'object',this,'fieldname','law','format','Integer'); 99 WriteData(fid,prefix,'object',this,'fieldname','D','format','DoubleMat','mattype',1); 100 WriteData(fid,prefix,'object',this,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 101 WriteData(fid,prefix,'object',this,'fieldname','max_damage','format','Double'); 102 102 103 WriteData(fid, 'object',this,'fieldname','stabilization','format','Integer');104 WriteData(fid, 'object',this,'fieldname','maxiter','format','Integer');105 WriteData(fid, 'enum',DamageElementinterpEnum(),'data',StringToEnum(this.elementinterp),'format','Integer');106 WriteData(fid, 'object',this,'fieldname','stress_threshold','format','Double');107 WriteData(fid, 'object',this,'fieldname','kappa','format','Double');108 WriteData(fid, 'object',this,'fieldname','c1','format','Double');109 WriteData(fid, 'object',this,'fieldname','c2','format','Double');110 WriteData(fid, 'object',this,'fieldname','c3','format','Double');111 WriteData(fid, 'object',this,'fieldname','c4','format','Double');112 WriteData(fid, 'object',this,'fieldname','healing','format','Double');113 WriteData(fid, 'object',this,'fieldname','equiv_stress','format','Integer');103 WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer'); 104 WriteData(fid,prefix,'object',this,'fieldname','maxiter','format','Integer'); 105 WriteData(fid,prefix,'name','md.damage.elementinterp','data',StringToEnum(this.elementinterp),'format','Integer'); 106 WriteData(fid,prefix,'object',this,'fieldname','stress_threshold','format','Double'); 107 WriteData(fid,prefix,'object',this,'fieldname','kappa','format','Double'); 108 WriteData(fid,prefix,'object',this,'fieldname','c1','format','Double'); 109 WriteData(fid,prefix,'object',this,'fieldname','c2','format','Double'); 110 WriteData(fid,prefix,'object',this,'fieldname','c3','format','Double'); 111 WriteData(fid,prefix,'object',this,'fieldname','c4','format','Double'); 112 WriteData(fid,prefix,'object',this,'fieldname','healing','format','Double'); 113 WriteData(fid,prefix,'object',this,'fieldname','equiv_stress','format','Integer'); 114 114 } 115 115 … … 123 123 } 124 124 if (this.isdamage){ 125 WriteData(fid, 'data',outputs,'enum',DamageEvolutionRequestedOutputsEnum(),'format','StringArray');125 WriteData(fid,prefix,'data',outputs,'name','md.damage.requested_outputs','format','StringArray'); 126 126 } 127 127 -
issm/trunk-jpl/src/m/classes/damage.m
r19958 r20690 143 143 144 144 end % }}} 145 function marshall(self, md,fid) % {{{145 function marshall(self,prefix,md,fid) % {{{ 146 146 147 WriteData(fid, 'object',self,'fieldname','isdamage','format','Boolean');147 WriteData(fid,prefix,'object',self,'fieldname','isdamage','format','Boolean'); 148 148 if self.isdamage, 149 WriteData(fid, 'object',self,'fieldname','law','format','Integer');150 WriteData(fid, 'object',self,'fieldname','D','format','DoubleMat','mattype',1);151 WriteData(fid, 'object',self,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);152 WriteData(fid, 'object',self,'fieldname','max_damage','format','Double');149 WriteData(fid,prefix,'object',self,'fieldname','law','format','Integer'); 150 WriteData(fid,prefix,'object',self,'fieldname','D','format','DoubleMat','mattype',1); 151 WriteData(fid,prefix,'object',self,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 152 WriteData(fid,prefix,'object',self,'fieldname','max_damage','format','Double'); 153 153 154 WriteData(fid, 'object',self,'fieldname','stabilization','format','Integer');155 WriteData(fid, 'object',self,'fieldname','maxiter','format','Integer');156 WriteData(fid, 'enum',DamageElementinterpEnum(),'data',StringToEnum(self.elementinterp),'format','Integer');157 WriteData(fid, 'object',self,'fieldname','stress_threshold','format','Double');158 WriteData(fid, 'object',self,'fieldname','kappa','format','Double');159 WriteData(fid, 'object',self,'fieldname','c1','format','Double');160 WriteData(fid, 'object',self,'fieldname','c2','format','Double');161 WriteData(fid, 'object',self,'fieldname','c3','format','Double');162 WriteData(fid, 'object',self,'fieldname','c4','format','Double');163 WriteData(fid, 'object',self,'fieldname','healing','format','Double');164 WriteData(fid, 'object',self,'fieldname','equiv_stress','format','Integer');154 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer'); 155 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer'); 156 WriteData(fid,prefix,'name','md.damage.elementinterp','data',StringToEnum(self.elementinterp),'format','Integer'); 157 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold','format','Double'); 158 WriteData(fid,prefix,'object',self,'fieldname','kappa','format','Double'); 159 WriteData(fid,prefix,'object',self,'fieldname','c1','format','Double'); 160 WriteData(fid,prefix,'object',self,'fieldname','c2','format','Double'); 161 WriteData(fid,prefix,'object',self,'fieldname','c3','format','Double'); 162 WriteData(fid,prefix,'object',self,'fieldname','c4','format','Double'); 163 WriteData(fid,prefix,'object',self,'fieldname','healing','format','Double'); 164 WriteData(fid,prefix,'object',self,'fieldname','equiv_stress','format','Integer'); 165 165 end 166 166 … … 173 173 end 174 174 if self.isdamage, 175 WriteData(fid, 'data',outputs,'enum',DamageEvolutionRequestedOutputsEnum,'format','StringArray');175 WriteData(fid,prefix,'data',outputs,'name','md.damage.requested_outputs','format','StringArray'); 176 176 end 177 177 -
issm/trunk-jpl/src/m/classes/damage.py
r19903 r20690 145 145 return md 146 146 # }}} 147 def marshall(self, md,fid): # {{{147 def marshall(self,prefix,md,fid): # {{{ 148 148 149 WriteData(fid, 'object',self,'fieldname','isdamage','format','Boolean')149 WriteData(fid,prefix,'object',self,'fieldname','isdamage','format','Boolean') 150 150 if self.isdamage: 151 WriteData(fid, 'object',self,'fieldname','D','format','DoubleMat','mattype',1)152 WriteData(fid, 'object',self,'fieldname','law','format','Integer')153 WriteData(fid, 'object',self,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)154 WriteData(fid, 'object',self,'fieldname','max_damage','format','Double')155 WriteData(fid, 'object',self,'fieldname','stabilization','format','Integer')156 WriteData(fid, 'object',self,'fieldname','maxiter','format','Integer')157 WriteData(fid, 'enum',DamageElementinterpEnum(),'data',StringToEnum(self.elementinterp)[0],'format','Integer')158 WriteData(fid, 'object',self,'fieldname','stress_threshold','format','Double')159 WriteData(fid, 'object',self,'fieldname','kappa','format','Double')160 WriteData(fid, 'object',self,'fieldname','c1','format','Double')161 WriteData(fid, 'object',self,'fieldname','c2','format','Double')162 WriteData(fid, 'object',self,'fieldname','c3','format','Double')163 WriteData(fid, 'object',self,'fieldname','c4','format','Double')164 WriteData(fid, 'object',self,'fieldname','healing','format','Double')165 WriteData(fid, 'object',self,'fieldname','equiv_stress','format','Integer')151 WriteData(fid,prefix,'object',self,'fieldname','D','format','DoubleMat','mattype',1) 152 WriteData(fid,prefix,'object',self,'fieldname','law','format','Integer') 153 WriteData(fid,prefix,'object',self,'fieldname','spcdamage','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 154 WriteData(fid,prefix,'object',self,'fieldname','max_damage','format','Double') 155 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer') 156 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer') 157 WriteData(fid,prefix,'name','md.damage.elementinterp','data',StringToEnum(self.elementinterp)[0],'format','Integer') 158 WriteData(fid,prefix,'object',self,'fieldname','stress_threshold','format','Double') 159 WriteData(fid,prefix,'object',self,'fieldname','kappa','format','Double') 160 WriteData(fid,prefix,'object',self,'fieldname','c1','format','Double') 161 WriteData(fid,prefix,'object',self,'fieldname','c2','format','Double') 162 WriteData(fid,prefix,'object',self,'fieldname','c3','format','Double') 163 WriteData(fid,prefix,'object',self,'fieldname','c4','format','Double') 164 WriteData(fid,prefix,'object',self,'fieldname','healing','format','Double') 165 WriteData(fid,prefix,'object',self,'fieldname','equiv_stress','format','Integer') 166 166 167 167 #process requested outputs … … 171 171 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 172 172 outputs =outputscopy 173 WriteData(fid, 'data',outputs,'enum',DamageEvolutionRequestedOutputsEnum(),'format','StringArray')173 WriteData(fid,prefix,'data',outputs,'name','md.damage.requested_outputs','format','StringArray') 174 174 # }}} -
issm/trunk-jpl/src/m/classes/debug.js
r19860 r20690 21 21 }// }}} 22 22 this.marshall=function(md,fid) { //{{{ 23 WriteData(fid, 'object',this,'fieldname','profiling','format','Boolean');23 WriteData(fid,prefix,'object',this,'fieldname','profiling','format','Boolean'); 24 24 }//}}} 25 25 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/debug.m
r19958 r20690 30 30 31 31 end % }}} 32 function marshall(self, md,fid) % {{{33 WriteData(fid, 'object',self,'fieldname','profiling','format','Boolean');32 function marshall(self,prefix,md,fid) % {{{ 33 WriteData(fid,prefix,'object',self,'fieldname','profiling','format','Boolean'); 34 34 end % }}} 35 35 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/debug.py
r15131 r20690 30 30 return self 31 31 #}}} 32 def marshall(self, md,fid): # {{{33 WriteData(fid, 'object',self,'fieldname','profiling','format','Boolean')32 def marshall(self,prefix,md,fid): # {{{ 33 WriteData(fid,prefix,'object',self,'fieldname','profiling','format','Boolean') 34 34 # }}} -
issm/trunk-jpl/src/m/classes/flowequation.js
r19860 r20690 91 91 } // }}} 92 92 this.marshall=function(md,fid) { //{{{ 93 WriteData(fid,'object',this,'fieldname','isSIA','format','Boolean'); 94 WriteData(fid,'object',this,'fieldname','isSSA','format','Boolean'); 95 WriteData(fid,'object',this,'fieldname','isL1L2','format','Boolean'); 96 WriteData(fid,'object',this,'fieldname','isHO','format','Boolean'); 97 WriteData(fid,'object',this,'fieldname','isFS','format','Boolean'); 98 WriteData(fid,'enum',FlowequationFeSSAEnum(),'data',StringToEnum(this.fe_SSA),'format','Integer'); 99 WriteData(fid,'enum',FlowequationFeHOEnum() ,'data',StringToEnum(this.fe_HO) ,'format','Integer'); 100 WriteData(fid,'enum',FlowequationFeFSEnum() ,'data',StringToEnum(this.fe_FS) ,'format','Integer'); 101 WriteData(fid,'enum',AugmentedLagrangianREnum(),'data',this.augmented_lagrangian_r ,'format','Double'); 102 WriteData(fid,'enum',AugmentedLagrangianRhopEnum(),'data',this.augmented_lagrangian_rhop ,'format','Double'); 103 WriteData(fid,'enum',AugmentedLagrangianRlambdaEnum(),'data',this.augmented_lagrangian_rlambda ,'format','Double'); 104 WriteData(fid,'enum',AugmentedLagrangianRholambdaEnum(),'data',this.augmented_lagrangian_rholambda ,'format','Double'); 105 WriteData(fid,'enum',AugmentedLagrangianThetaEnum() ,'data',this.XTH_theta ,'format','Double'); 106 WriteData(fid,'object',this,'fieldname','borderSSA','format','DoubleMat','mattype',1); 107 WriteData(fid,'object',this,'fieldname','borderHO','format','DoubleMat','mattype',1); 108 WriteData(fid,'object',this,'fieldname','borderFS','format','DoubleMat','mattype',1); 93 WriteData(fid,prefix,'object',this,'fieldname','isSIA','format','Boolean'); 94 WriteData(fid,prefix,'object',this,'fieldname','isSSA','format','Boolean'); 95 WriteData(fid,prefix,'object',this,'fieldname','isL1L2','format','Boolean'); 96 WriteData(fid,prefix,'object',this,'fieldname','isHO','format','Boolean'); 97 WriteData(fid,prefix,'object',this,'fieldname','isFS','format','Boolean'); 98 WriteData(fid,prefix,'object',this,'fieldname','fe_SSA','data',StringToEnum(this.fe_SSA),'format','Integer'); 99 WriteData(fid,prefix,'object',this,'fieldname','fe_HO','data',StringToEnum(this.fe_HO) ,'format','Integer'); 100 WriteData(fid,prefix,'object',this,'fieldname','fe_FS','data',StringToEnum(this.fe_FS) ,'format','Integer'); 101 102 WriteData(fid,prefix,'object',this,'fieldname','augmented_lagrangian_r','format','Double'); 103 WriteData(fid,prefix,'object',this,'fieldname','augmented_lagrangian_rhop','format','Double'); 104 WriteData(fid,prefix,'object',this,'fieldname','augmented_lagrangian_rlambda','format','Double'); 105 WriteData(fid,prefix,'object',this,'fieldname','augmented_lagrangian_rholambda','format','Double'); 106 WriteData(fid,prefix,'object',this,'fieldname','XTH_theta','data',this.XTH_theta ,'format','Double'); 107 WriteData(fid,prefix,'object',this,'fieldname','borderSSA','format','DoubleMat','mattype',1); 108 WriteData(fid,prefix,'object',this,'fieldname','borderHO','format','DoubleMat','mattype',1); 109 WriteData(fid,prefix,'object',this,'fieldname','borderFS','format','DoubleMat','mattype',1); 109 110 110 111 //convert approximations to enums … … 133 134 if(data[i]==8) data[i]=ssafsap; 134 135 } 135 WriteData(fid, 'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1);136 WriteData(fid,prefix,'data',data,'name','md.flowequation.vertex_equation','format','DoubleMat','mattype',1); 136 137 137 138 data=this.element_equation; … … 147 148 if(data[i]==8) data[i]=hofsaap; 148 149 } 149 WriteData(fid, 'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2);150 WriteData(fid,prefix,'data',data,'name','md.flowequation.element_equation','format','DoubleMat','mattype',2); 150 151 151 152 }//}}} -
issm/trunk-jpl/src/m/classes/flowequation.m
r19958 r20690 154 154 155 155 end % }}} 156 function marshall(self, md,fid) % {{{157 WriteData(fid, 'object',self,'fieldname','isSIA','format','Boolean');158 WriteData(fid, 'object',self,'fieldname','isSSA','format','Boolean');159 WriteData(fid, 'object',self,'fieldname','isL1L2','format','Boolean');160 WriteData(fid, 'object',self,'fieldname','isHO','format','Boolean');161 WriteData(fid, 'object',self,'fieldname','isFS','format','Boolean');162 WriteData(fid, 'enum',FlowequationFeSSAEnum(),'data',StringToEnum(self.fe_SSA),'format','Integer');163 WriteData(fid, 'enum',FlowequationFeHOEnum(),'data',StringToEnum(self.fe_HO) ,'format','Integer');164 WriteData(fid, 'enum',FlowequationFeFSEnum(),'data',StringToEnum(self.fe_FS) ,'format','Integer');165 WriteData(fid, 'enum',AugmentedLagrangianREnum(),'data',self.augmented_lagrangian_r,'format','Double');166 WriteData(fid, 'enum',AugmentedLagrangianRhopEnum(),'data',self.augmented_lagrangian_rhop,'format','Double');167 WriteData(fid, 'enum',AugmentedLagrangianRlambdaEnum(),'data',self.augmented_lagrangian_rlambda,'format','Double');168 WriteData(fid, 'enum',AugmentedLagrangianRholambdaEnum(),'data',self.augmented_lagrangian_rholambda,'format','Double');169 WriteData(fid, 'enum',AugmentedLagrangianThetaEnum(),'data',self.XTH_theta ,'format','Double');170 WriteData(fid, 'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1);171 WriteData(fid, 'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1);172 WriteData(fid, 'object',self,'fieldname','borderFS','format','DoubleMat','mattype',1);156 function marshall(self,prefix,md,fid) % {{{ 157 WriteData(fid,prefix,'object',self,'fieldname','isSIA','format','Boolean'); 158 WriteData(fid,prefix,'object',self,'fieldname','isSSA','format','Boolean'); 159 WriteData(fid,prefix,'object',self,'fieldname','isL1L2','format','Boolean'); 160 WriteData(fid,prefix,'object',self,'fieldname','isHO','format','Boolean'); 161 WriteData(fid,prefix,'object',self,'fieldname','isFS','format','Boolean'); 162 WriteData(fid,prefix,'object',self,'fieldname','fe_SSA','data',StringToEnum(self.fe_SSA),'format','Integer'); 163 WriteData(fid,prefix,'object',self,'fieldname','fe_HO' ,'data',StringToEnum(self.fe_HO) ,'format','Integer'); 164 WriteData(fid,prefix,'object',self,'fieldname','fe_FS' ,'data',StringToEnum(self.fe_FS) ,'format','Integer'); 165 WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_r','format','Double'); 166 WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rhop','format','Double'); 167 WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rlambda','format','Double'); 168 WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rholambda','format','Double'); 169 WriteData(fid,prefix,'object',self,'fieldname','XTH_theta','data',self.XTH_theta ,'format','Double'); 170 WriteData(fid,prefix,'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1); 171 WriteData(fid,prefix,'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1); 172 WriteData(fid,prefix,'object',self,'fieldname','borderFS','format','DoubleMat','mattype',1); 173 173 %convert approximations to enums 174 174 data=self.vertex_equation; … … 183 183 pos=find(data==7); data(pos,end)=HOFSApproximationEnum(); 184 184 pos=find(data==8); data(pos,end)=SSAFSApproximationEnum(); 185 WriteData(fid, 'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1);185 WriteData(fid,prefix,'data',data,'name','md.flowequation.vertex_equation','format','DoubleMat','mattype',1); 186 186 data=self.element_equation; 187 187 pos=find(data==0); data(pos,end)=NoneApproximationEnum(); … … 195 195 pos=find(data==7); data(pos,end)=SSAFSApproximationEnum(); 196 196 pos=find(data==8); data(pos,end)=HOFSApproximationEnum(); 197 WriteData(fid, 'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2);197 WriteData(fid,prefix,'data',data,'name','md.flowequation.element_equation','format','DoubleMat','mattype',2); 198 198 end % }}} 199 199 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/flowequation.py
r20288 r20690 120 120 return md 121 121 # }}} 122 def marshall(self, md,fid): # {{{123 WriteData(fid, 'object',self,'fieldname','isSIA','format','Boolean')124 WriteData(fid, 'object',self,'fieldname','isSSA','format','Boolean')125 WriteData(fid, 'object',self,'fieldname','isL1L2','format','Boolean')126 WriteData(fid, 'object',self,'fieldname','isHO','format','Boolean')127 WriteData(fid, 'object',self,'fieldname','isFS','format','Boolean')128 WriteData(fid, 'enum',FlowequationFeSSAEnum(),'data',StringToEnum(self.fe_SSA)[0],'format','Integer')129 WriteData(fid, 'enum',FlowequationFeHOEnum(),'data',StringToEnum(self.fe_HO)[0] ,'format','Integer')130 WriteData(fid, 'enum',FlowequationFeFSEnum(),'data',StringToEnum(self.fe_FS)[0] ,'format','Integer')131 WriteData(fid, 'enum',AugmentedLagrangianREnum(),'data',self.augmented_lagrangian_r ,'format','Double')132 WriteData(fid, 'enum',AugmentedLagrangianRhopEnum(),'data',self.augmented_lagrangian_rhop ,'format','Double')133 WriteData(fid, 'enum',AugmentedLagrangianRlambdaEnum(),'data',self.augmented_lagrangian_rlambda ,'format','Double')134 WriteData(fid, 'enum',AugmentedLagrangianRholambdaEnum(),'data',self.augmented_lagrangian_rholambda ,'format','Double')135 WriteData(fid, 'enum',AugmentedLagrangianThetaEnum(),'data',self.XTH_theta ,'format','Double')136 WriteData(fid, 'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1)137 WriteData(fid, 'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1)138 WriteData(fid, 'object',self,'fieldname','borderFS','format','DoubleMat','mattype',1)122 def marshall(self,prefix,md,fid): # {{{ 123 WriteData(fid,prefix,'object',self,'fieldname','isSIA','format','Boolean') 124 WriteData(fid,prefix,'object',self,'fieldname','isSSA','format','Boolean') 125 WriteData(fid,prefix,'object',self,'fieldname','isL1L2','format','Boolean') 126 WriteData(fid,prefix,'object',self,'fieldname','isHO','format','Boolean') 127 WriteData(fid,prefix,'object',self,'fieldname','isFS','format','Boolean') 128 WriteData(fid,prefix,'object',self,'fieldname','fe_SSA','data',StringToEnum(self.fe_SSA)[0],'format','Integer') 129 WriteData(fid,prefix,'object',self,'fieldname','fe_HO','data',StringToEnum(self.fe_HO)[0] ,'format','Integer') 130 WriteData(fid,prefix,'object',self,'fieldname','fe_FS','data',StringToEnum(self.fe_FS)[0] ,'format','Integer') 131 WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_r','format','Double'); 132 WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rhop','format','Double'); 133 WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rlambda','format','Double'); 134 WriteData(fid,prefix,'object',self,'fieldname','augmented_lagrangian_rholambda','format','Double'); 135 WriteData(fid,prefix,'object',self,'fieldname','XTH_theta','data',self.XTH_theta ,'format','Double') 136 WriteData(fid,prefix,'object',self,'fieldname','borderSSA','format','DoubleMat','mattype',1) 137 WriteData(fid,prefix,'object',self,'fieldname','borderHO','format','DoubleMat','mattype',1) 138 WriteData(fid,prefix,'object',self,'fieldname','borderFS','format','DoubleMat','mattype',1) 139 139 #convert approximations to enums 140 140 data=copy.deepcopy(self.vertex_equation); … … 150 150 data[numpy.nonzero(data==7)]=HOFSApproximationEnum() 151 151 data[numpy.nonzero(data==8)]=SSAFSApproximationEnum() 152 WriteData(fid, 'data',data,'enum',FlowequationVertexEquationEnum(),'format','DoubleMat','mattype',1)152 WriteData(fid,prefix,'data',data,'name','md.flowequation.vertex_equation','format','DoubleMat','mattype',1) 153 153 data=copy.deepcopy(self.element_equation) 154 154 if isinstance(data, (list, tuple, numpy.ndarray)): … … 162 162 data[numpy.nonzero(data==7)]=SSAFSApproximationEnum() 163 163 data[numpy.nonzero(data==8)]=HOFSApproximationEnum() 164 WriteData(fid, 'data',data,'enum',FlowequationElementEquationEnum(),'format','DoubleMat','mattype',2)164 WriteData(fid,prefix,'data',data,'name','md.flowequation.element_equation','format','DoubleMat','mattype',2) 165 165 # }}} -
issm/trunk-jpl/src/m/classes/friction.js
r19901 r20690 32 32 var yts=365.0*24.0*3600.0; 33 33 34 WriteData(fid, 'enum',FrictionLawEnum(),'data',1,'format','Integer');35 WriteData(fid, 'object',this,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);36 //WriteData(fid, 'object',this,'fieldname','coefficient','format','DoubleMat','mattype',1);37 WriteData(fid, 'object',this,'fieldname','p','format','DoubleMat','mattype',2);38 WriteData(fid, 'object',this,'fieldname','q','format','DoubleMat','mattype',2);34 WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer'); 35 WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 36 //WriteData(fid,prefix,'object',this,'fieldname','coefficient','format','DoubleMat','mattype',1); 37 WriteData(fid,prefix,'object',this,'fieldname','p','format','DoubleMat','mattype',2); 38 WriteData(fid,prefix,'object',this,'fieldname','q','format','DoubleMat','mattype',2); 39 39 40 40 -
issm/trunk-jpl/src/m/classes/friction.m
r20137 r20690 43 43 fielddisplay(self,'q','q exponent'); 44 44 end % }}} 45 function marshall(self, md,fid) % {{{45 function marshall(self,prefix,md,fid) % {{{ 46 46 yts=365.0*24.0*3600.0; 47 47 48 WriteData(fid,'enum',FrictionLawEnum,'data',1,'format','Integer'); 49 WriteData(fid,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 50 %WriteData(fid,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1); 51 WriteData(fid,'object',self,'fieldname','p','format','DoubleMat','mattype',2); 52 WriteData(fid,'object',self,'fieldname','q','format','DoubleMat','mattype',2); 48 WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer'); 49 WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 50 WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2); 51 WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2); 53 52 54 53 -
issm/trunk-jpl/src/m/classes/friction.py
r19897 r20690 51 51 return md 52 52 # }}} 53 def marshall(self, md,fid): # {{{54 WriteData(fid, 'enum',FrictionLawEnum(),'data',1,'format','Integer')55 WriteData(fid, 'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1)56 WriteData(fid, 'object',self,'fieldname','p','format','DoubleMat','mattype',2)57 WriteData(fid, 'object',self,'fieldname','q','format','DoubleMat','mattype',2)53 def marshall(self,prefix,md,fid): # {{{ 54 WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer') 55 WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1) 56 WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2) 57 WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2) 58 58 # }}} -
issm/trunk-jpl/src/m/classes/frictioncoulomb.m
r19958 r20690 45 45 fielddisplay(self,'q','q exponent'); 46 46 end % }}} 47 function marshall(self, md,fid) % {{{47 function marshall(self,prefix,md,fid) % {{{ 48 48 49 WriteData(fid, 'enum',FrictionLawEnum,'data',7,'format','Integer');50 WriteData(fid, 'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'enum',FrictionCoefficientEnum());51 WriteData(fid, 'object',self,'fieldname','coefficientcoulomb','format','DoubleMat','mattype',1,'enum',FrictionCoefficientcoulombEnum());52 WriteData(fid, 'object',self,'fieldname','p','format','DoubleMat','mattype',2,'enum',FrictionPEnum());53 WriteData(fid, 'object',self,'fieldname','q','format','DoubleMat','mattype',2,'enum',FrictionQEnum());49 WriteData(fid,prefix,'name','md.friction.law','data',7,'format','Integer'); 50 WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 51 WriteData(fid,prefix,'object',self,'fieldname','coefficientcoulomb','format','DoubleMat','mattype',1); 52 WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2); 53 WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2); 54 54 55 55 end % }}} -
issm/trunk-jpl/src/m/classes/frictioncoulomb.py
r19897 r20690 55 55 return md 56 56 # }}} 57 def marshall(self, md,fid): # {{{58 WriteData(fid, 'enum',FrictionLawEnum(),'data',1,'format','Integer')59 WriteData(fid, 'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1,'enum',FrictionCoefficientEnum())60 WriteData(fid, 'object',self,'fieldname','coefficientcoulomb','format','DoubleMat','mattype',1,'enum',FrictionCoefficientcoulombEnum())61 WriteData(fid, 'object',self,'fieldname','p','format','DoubleMat','mattype',2,'enum',FrictionPEnum())62 WriteData(fid, 'object',self,'fieldname','q','format','DoubleMat','mattype',2,'enum',FrictionQEnum())57 def marshall(self,prefix,md,fid): # {{{ 58 WriteData(fid,prefix,'name','md.friction.law','data',1,'format','Integer') 59 WriteData(fid,prefix,'object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 60 WriteData(fid,prefix,'object',self,'fieldname','coefficientcoulomb','format','DoubleMat','mattype',1) 61 WriteData(fid,prefix,'object',self,'fieldname','p','format','DoubleMat','mattype',2) 62 WriteData(fid,prefix,'object',self,'fieldname','q','format','DoubleMat','mattype',2) 63 63 # }}} -
issm/trunk-jpl/src/m/classes/frictionhydro.m
r19897 r20690 52 52 fielddisplay(self,'effective_pressure','Effective Pressure for the forcing if not coupled [Pa]'); 53 53 end % }}} 54 function marshall(self, md,fid) % {{{55 WriteData(fid, 'enum',FrictionLawEnum,'data',3,'format','Integer');56 WriteData(fid, 'class','friction','object',self,'fieldname','Coupling','format','Integer');57 WriteData(fid, 'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2);58 WriteData(fid, 'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',2);59 WriteData(fid, 'class','friction','object',self,'fieldname','As','format','DoubleMat','mattype',2);54 function marshall(self,prefix,md,fid) % {{{ 55 WriteData(fid,prefix,'name','md.friction.law','data',3,'format','Integer'); 56 WriteData(fid,prefix,'class','friction','object',self,'fieldname','Coupling','format','Integer'); 57 WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2); 58 WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',2); 59 WriteData(fid,prefix,'class','friction','object',self,'fieldname','As','format','DoubleMat','mattype',2); 60 60 if self.Coupling==0, 61 WriteData(fid, 'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);61 WriteData(fid,prefix,'class','friction','object',self,'fieldname','effective_pressure','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 62 62 end 63 63 end % }}} -
issm/trunk-jpl/src/m/classes/frictionsommers.m
r19897 r20690 35 35 fielddisplay(self,'coefficient','friction coefficient [SI]'); 36 36 end % }}} 37 function marshall(self, md,fid) % {{{37 function marshall(self,prefix,md,fid) % {{{ 38 38 yts=365.0*24.0*3600.0; 39 39 40 WriteData(fid, 'enum',FrictionLawEnum,'data',8,'format','Integer');41 WriteData(fid, 'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);40 WriteData(fid,prefix,'name','md.friction.law','data',8,'format','Integer'); 41 WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 42 42 43 43 end % }}} -
issm/trunk-jpl/src/m/classes/frictiontemp.m
r20306 r20690 54 54 fielddisplay(self,'q','q exponent'); 55 55 end % }}} 56 function marshall(self, md,fid) % {{{56 function marshall(self,prefix,md,fid) % {{{ 57 57 58 WriteData(fid, 'enum',FrictionLawEnum,'data',4,'format','Integer');59 WriteData(fid, 'class','friction','object',self,'fieldname','gamma','format','Double');60 WriteData(fid, 'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);61 WriteData(fid, 'class','friction','object',self,'fieldname','p','format','DoubleMat','mattype',2);62 WriteData(fid, 'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2);58 WriteData(fid,prefix,'name','md.friction.law','data',4,'format','Integer'); 59 WriteData(fid,prefix,'class','friction','object',self,'fieldname','gamma','format','Double'); 60 WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 61 WriteData(fid,prefix,'class','friction','object',self,'fieldname','p','format','DoubleMat','mattype',2); 62 WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2); 63 63 end % }}} 64 64 end -
issm/trunk-jpl/src/m/classes/frictionwaterlayer.m
r19903 r20690 52 52 fielddisplay(self,'water_layer','water thickness at the base of the ice (m)'); 53 53 end % }}} 54 function marshall(self, md,fid) % {{{54 function marshall(self,prefix,md,fid) % {{{ 55 55 56 WriteData(fid, 'enum',FrictionLawEnum,'data',5,'format','Integer');57 WriteData(fid, 'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);58 WriteData(fid, 'class','friction','object',self,'fieldname','f','format','Double');59 WriteData(fid, 'class','friction','object',self,'fieldname','p','format','DoubleMat','mattype',2);60 WriteData(fid, 'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2);61 WriteData(fid, 'class','friction','object',self,'fieldname','water_layer','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);56 WriteData(fid,prefix,'name','md.friction.law','data',5,'format','Integer'); 57 WriteData(fid,prefix,'class','friction','object',self,'fieldname','coefficient','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 58 WriteData(fid,prefix,'class','friction','object',self,'fieldname','f','format','Double'); 59 WriteData(fid,prefix,'class','friction','object',self,'fieldname','p','format','DoubleMat','mattype',2); 60 WriteData(fid,prefix,'class','friction','object',self,'fieldname','q','format','DoubleMat','mattype',2); 61 WriteData(fid,prefix,'class','friction','object',self,'fieldname','water_layer','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 62 62 end % }}} 63 63 end -
issm/trunk-jpl/src/m/classes/frictionweertman.m
r19958 r20690 42 42 fielddisplay(self,'m','m exponent'); 43 43 end % }}} 44 function marshall(self, md,fid) % {{{44 function marshall(self,prefix,md,fid) % {{{ 45 45 yts=365.0*24.0*3600.0; 46 46 47 WriteData(fid, 'enum',FrictionLawEnum,'data',2,'format','Integer');48 WriteData(fid, 'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);49 WriteData(fid, 'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);47 WriteData(fid,prefix,'name','md.friction.law','data',2,'format','Integer'); 48 WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 49 WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2); 50 50 51 51 -
issm/trunk-jpl/src/m/classes/frictionweertman.py
r19897 r20690 42 42 return md 43 43 # }}} 44 def marshall(self, md,fid): # {{{45 WriteData(fid, 'enum',FrictionLawEnum(),'data',2,'format','Integer')46 WriteData(fid, 'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1)47 WriteData(fid, 'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2)44 def marshall(self,prefix,md,fid): # {{{ 45 WriteData(fid,prefix,'name','md.friction.law','data',2,'format','Integer') 46 WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1) 47 WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2) 48 48 # }}} -
issm/trunk-jpl/src/m/classes/frictionweertmantemp.m
r19897 r20690 37 37 fielddisplay(self,'m','m exponent'); 38 38 end % }}} 39 function marshall(self, md,fid) % {{{39 function marshall(self,prefix,md,fid) % {{{ 40 40 yts=365.0*24.0*3600.0; 41 41 42 WriteData(fid, 'enum',FrictionLawEnum,'data',6,'format','Integer');43 WriteData(fid, 'class','friction','object',self,'fieldname','gamma','format','Double');44 WriteData(fid, 'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);45 WriteData(fid, 'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2);42 WriteData(fid,prefix,'name','md.friction.law','data',6,'format','Integer'); 43 WriteData(fid,prefix,'class','friction','object',self,'fieldname','gamma','format','Double'); 44 WriteData(fid,prefix,'class','friction','object',self,'fieldname','C','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 45 WriteData(fid,prefix,'class','friction','object',self,'fieldname','m','format','DoubleMat','mattype',2); 46 46 47 47 -
issm/trunk-jpl/src/m/classes/geometry.js
r19901 r20690 40 40 } // }}} 41 41 this.marshall=function(md,fid) { //{{{ 42 WriteData(fid, 'data',this.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum());43 WriteData(fid, 'data',this.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum(),'timeserieslength',md.mesh.numberofvertices+1);44 WriteData(fid, 'data',this.base,'format','DoubleMat','mattype',1,'enum',BaseEnum());45 WriteData(fid, 'data',this.bed,'format','DoubleMat','mattype',1,'enum',BedEnum());46 WriteData(fid, 'object',this,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);42 WriteData(fid,prefix,'object',this,'fieldname','surface','format','DoubleMat','mattype',1); 43 WriteData(fid,prefix,'object',this,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 44 WriteData(fid,prefix,'object',this,'fieldname','base','format','DoubleMat','mattype',1); 45 WriteData(fid,prefix,'object',this,'fieldname','bed','format','DoubleMat','mattype',1); 46 WriteData(fid,prefix,'object',this,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1); 47 47 }//}}} 48 48 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/geometry.m
r19958 r20690 76 76 77 77 end % }}} 78 function marshall(self, md,fid) % {{{79 WriteData(fid, 'data',self.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum());80 WriteData(fid, 'data',self.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum(),'timeserieslength',md.mesh.numberofvertices+1);81 WriteData(fid, 'data',self.base,'format','DoubleMat','mattype',1,'enum',BaseEnum());82 WriteData(fid, 'data',self.bed,'format','DoubleMat','mattype',1,'enum',BedEnum());83 WriteData(fid, 'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1);78 function marshall(self,prefix,md,fid) % {{{ 79 WriteData(fid,prefix,'object',self,'fieldname','surface','format','DoubleMat','mattype',1); 80 WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1); 81 WriteData(fid,prefix,'object',self,'fieldname','base','format','DoubleMat','mattype',1); 82 WriteData(fid,prefix,'object',self,'fieldname','bed','format','DoubleMat','mattype',1); 83 WriteData(fid,prefix,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1); 84 84 end % }}} 85 85 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/geometry.py
r20447 r20690 59 59 return md 60 60 # }}} 61 def marshall(self, md,fid): # {{{62 WriteData(fid, 'data',self.surface,'format','DoubleMat','mattype',1,'enum',SurfaceEnum())63 WriteData(fid, 'data',self.thickness,'format','DoubleMat','mattype',1,'enum',ThicknessEnum(),'timeserieslength',md.mesh.numberofvertices+1)64 WriteData(fid, 'data',self.base,'format','DoubleMat','mattype',1,'enum',BaseEnum())65 WriteData(fid, 'data',self.bed,'format','DoubleMat','mattype',1,'enum',BedEnum())66 WriteData(fid, 'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1)61 def marshall(self,prefix,md,fid): # {{{ 62 WriteData(fid,prefix,'object',self,'fieldname','surface','format','DoubleMat','mattype',1) 63 WriteData(fid,prefix,'object',self,'fieldname','thickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 64 WriteData(fid,prefix,'object',self,'fieldname','base','format','DoubleMat','mattype',1) 65 WriteData(fid,prefix,'object',self,'fieldname','bed','format','DoubleMat','mattype',1) 66 WriteData(fid,prefix,'object',self,'fieldname','hydrostatic_ratio','format','DoubleMat','mattype',1) 67 67 # }}} -
issm/trunk-jpl/src/m/classes/gia.js
r19901 r20690 45 45 } // }}} 46 46 this.marshall=function(md,fid) { //{{{ 47 WriteData(fid, 'object',this,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);48 WriteData(fid, 'object',this,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',Math.pow(10,3)); //from km to m49 WriteData(fid, 'object',this,'fieldname','cross_section_shape','format','Integer');47 WriteData(fid,prefix,'object',this,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1); 48 WriteData(fid,prefix,'object',this,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',Math.pow(10,3)); //from km to m 49 WriteData(fid,prefix,'object',this,'fieldname','cross_section_shape','format','Integer'); 50 50 }//}}} 51 51 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/gia.m
r19958 r20690 57 57 58 58 end % }}} 59 function marshall(self, md,fid) % {{{60 WriteData(fid, 'object',self,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);61 WriteData(fid, 'object',self,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',10^3); %from km to m62 WriteData(fid, 'object',self,'fieldname','cross_section_shape','format','Integer');59 function marshall(self,prefix,md,fid) % {{{ 60 WriteData(fid,prefix,'object',self,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1); 61 WriteData(fid,prefix,'object',self,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',10^3); %from km to m 62 WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','format','Integer'); 63 63 end % }}} 64 64 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/gia.py
r19897 r20690 57 57 return md 58 58 # }}} 59 def marshall(self, md,fid): # {{{59 def marshall(self,prefix,md,fid): # {{{ 60 60 61 WriteData(fid, 'object',self,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1);62 WriteData(fid, 'object',self,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',10.**3.);63 WriteData(fid, 'object',self,'fieldname','cross_section_shape','format','Integer');61 WriteData(fid,prefix,'object',self,'fieldname','mantle_viscosity','format','DoubleMat','mattype',1); 62 WriteData(fid,prefix,'object',self,'fieldname','lithosphere_thickness','format','DoubleMat','mattype',1,'scale',10.**3.); 63 WriteData(fid,prefix,'object',self,'fieldname','cross_section_shape','format','Integer'); 64 64 # }}} -
issm/trunk-jpl/src/m/classes/groundingline.js
r19860 r20690 41 41 } // }}} 42 42 this.marshall=function(md,fid) { //{{{ 43 WriteData(fid, 'data',StringToEnum(this.migration),'enum',GroundinglineMigrationEnum(),'format','Integer');43 WriteData(fid,prefix,'data',StringToEnum(this.migration),'name','md.groundingline.migration','format','Integer'); 44 44 }//}}} 45 45 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/groundingline.m
r20260 r20690 47 47 48 48 end % }}} 49 function marshall(self, md,fid) % {{{50 WriteData(fid, 'data',StringToEnum(self.migration),'enum',GroundinglineMigrationEnum(),'format','Integer');49 function marshall(self,prefix,md,fid) % {{{ 50 WriteData(fid,prefix,'data',StringToEnum(self.migration),'name','md.groundingline.migration','format','Integer'); 51 51 end % }}} 52 52 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/groundingline.py
r18861 r20690 50 50 return md 51 51 # }}} 52 def marshall(self, md,fid): # {{{53 WriteData(fid, 'data',StringToEnum(self.migration)[0],'enum',GroundinglineMigrationEnum(),'format','Integer')52 def marshall(self,prefix,md,fid): # {{{ 53 WriteData(fid,prefix,'data',StringToEnum(self.migration)[0],'name','md.groundingline.migration','format','Integer') 54 54 # }}} -
issm/trunk-jpl/src/m/classes/hydrologydc.m
r19903 r20690 187 187 end 188 188 % }}} 189 % {{{ function marshall(self, md,fid)190 function marshall(self, md,fid)191 WriteData(fid, 'enum',HydrologyModelEnum(),'data',HydrologydcEnum(),'format','Integer');192 WriteData(fid, 'object',self,'fieldname','water_compressibility','format','Double');193 WriteData(fid, 'object',self,'fieldname','isefficientlayer','format','Boolean');194 WriteData(fid, 'object',self,'fieldname','penalty_factor','format','Double');195 WriteData(fid, 'object',self,'fieldname','penalty_lock','format','Integer');196 WriteData(fid, 'object',self,'fieldname','rel_tol','format','Double');197 WriteData(fid, 'object',self,'fieldname','max_iter','format','Integer');198 WriteData(fid, 'object',self,'fieldname','sedimentlimit_flag','format','Integer');199 WriteData(fid, 'object',self,'fieldname','transfer_flag','format','Integer');189 % {{{ function marshall(self,prefix,md,fid) 190 function marshall(self,prefix,md,fid) 191 WriteData(fid,prefix,'name','md.hydrology.model','data',HydrologydcEnum(),'format','Integer'); 192 WriteData(fid,prefix,'object',self,'fieldname','water_compressibility','format','Double'); 193 WriteData(fid,prefix,'object',self,'fieldname','isefficientlayer','format','Boolean'); 194 WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double'); 195 WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer'); 196 WriteData(fid,prefix,'object',self,'fieldname','rel_tol','format','Double'); 197 WriteData(fid,prefix,'object',self,'fieldname','max_iter','format','Integer'); 198 WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit_flag','format','Integer'); 199 WriteData(fid,prefix,'object',self,'fieldname','transfer_flag','format','Integer'); 200 200 if self.sedimentlimit_flag==1, 201 WriteData(fid, 'object',self,'fieldname','sedimentlimit','format','Double');201 WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit','format','Double'); 202 202 end 203 203 if self.transfer_flag==1, 204 WriteData(fid, 'object',self,'fieldname','leakage_factor','format','Double');205 end 206 WriteData(fid, 'object',self,'fieldname','basal_moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)207 208 WriteData(fid, 'object',self,'fieldname','spcsediment_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);209 WriteData(fid, 'object',self,'fieldname','sediment_compressibility','format','Double');210 WriteData(fid, 'object',self,'fieldname','sediment_porosity','format','Double');211 WriteData(fid, 'object',self,'fieldname','sediment_thickness','format','Double');212 WriteData(fid, 'object',self,'fieldname','sediment_transmitivity','format','DoubleMat','mattype',1');204 WriteData(fid,prefix,'object',self,'fieldname','leakage_factor','format','Double'); 205 end 206 WriteData(fid,prefix,'object',self,'fieldname','basal_moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 207 208 WriteData(fid,prefix,'object',self,'fieldname','spcsediment_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 209 WriteData(fid,prefix,'object',self,'fieldname','sediment_compressibility','format','Double'); 210 WriteData(fid,prefix,'object',self,'fieldname','sediment_porosity','format','Double'); 211 WriteData(fid,prefix,'object',self,'fieldname','sediment_thickness','format','Double'); 212 WriteData(fid,prefix,'object',self,'fieldname','sediment_transmitivity','format','DoubleMat','mattype',1'); 213 213 214 214 if self.isefficientlayer==1, 215 WriteData(fid, 'object',self,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);216 WriteData(fid, 'object',self,'fieldname','mask_eplactive_node','format','DoubleMat','mattype',1);217 WriteData(fid, 'object',self,'fieldname','epl_compressibility','format','Double');218 WriteData(fid, 'object',self,'fieldname','epl_porosity','format','Double');219 WriteData(fid, 'object',self,'fieldname','epl_initial_thickness','format','Double');220 WriteData(fid, 'object',self,'fieldname','epl_colapse_thickness','format','Double');221 WriteData(fid, 'object',self,'fieldname','epl_thick_comp','format','Integer');222 WriteData(fid, 'object',self,'fieldname','epl_max_thickness','format','Double');223 WriteData(fid, 'object',self,'fieldname','epl_conductivity','format','Double');224 WriteData(fid, 'object',self,'fieldname','eplflip_lock','format','Integer');215 WriteData(fid,prefix,'object',self,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 216 WriteData(fid,prefix,'object',self,'fieldname','mask_eplactive_node','format','DoubleMat','mattype',1); 217 WriteData(fid,prefix,'object',self,'fieldname','epl_compressibility','format','Double'); 218 WriteData(fid,prefix,'object',self,'fieldname','epl_porosity','format','Double'); 219 WriteData(fid,prefix,'object',self,'fieldname','epl_initial_thickness','format','Double'); 220 WriteData(fid,prefix,'object',self,'fieldname','epl_colapse_thickness','format','Double'); 221 WriteData(fid,prefix,'object',self,'fieldname','epl_thick_comp','format','Integer'); 222 WriteData(fid,prefix,'object',self,'fieldname','epl_max_thickness','format','Double'); 223 WriteData(fid,prefix,'object',self,'fieldname','epl_conductivity','format','Double'); 224 WriteData(fid,prefix,'object',self,'fieldname','eplflip_lock','format','Integer'); 225 225 end 226 226 end -
issm/trunk-jpl/src/m/classes/hydrologydc.py
r19903 r20690 183 183 md = checkfield(md,'fieldname','hydrology.epl_conductivity','numel',[1],'>',0.) 184 184 # }}} 185 def marshall(self, md,fid): #{{{186 WriteData(fid, 'enum',HydrologyModelEnum(),'data',HydrologydcEnum(),'format','Integer')187 WriteData(fid, 'object',self,'fieldname','water_compressibility','format','Double')188 WriteData(fid, 'object',self,'fieldname','isefficientlayer','format','Boolean')189 WriteData(fid, 'object',self,'fieldname','penalty_factor','format','Double')190 WriteData(fid, 'object',self,'fieldname','penalty_lock','format','Integer')191 WriteData(fid, 'object',self,'fieldname','rel_tol','format','Double')192 WriteData(fid, 'object',self,'fieldname','max_iter','format','Integer')193 WriteData(fid, 'object',self,'fieldname','sedimentlimit_flag','format','Integer')194 WriteData(fid, 'object',self,'fieldname','transfer_flag','format','Integer')185 def marshall(self,prefix,md,fid): #{{{ 186 WriteData(fid,prefix,'name','md.hydrology.model','data',HydrologydcEnum(),'format','Integer') 187 WriteData(fid,prefix,'object',self,'fieldname','water_compressibility','format','Double') 188 WriteData(fid,prefix,'object',self,'fieldname','isefficientlayer','format','Boolean') 189 WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double') 190 WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer') 191 WriteData(fid,prefix,'object',self,'fieldname','rel_tol','format','Double') 192 WriteData(fid,prefix,'object',self,'fieldname','max_iter','format','Integer') 193 WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit_flag','format','Integer') 194 WriteData(fid,prefix,'object',self,'fieldname','transfer_flag','format','Integer') 195 195 if self.sedimentlimit_flag==1: 196 WriteData(fid, 'object',self,'fieldname','sedimentlimit','format','Double')196 WriteData(fid,prefix,'object',self,'fieldname','sedimentlimit','format','Double') 197 197 198 198 if self.transfer_flag==1: 199 WriteData(fid, 'object',self,'fieldname','leakage_factor','format','Double')200 201 WriteData(fid, 'object',self,'fieldname','basal_moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)202 WriteData(fid, 'object',self,'fieldname','spcsediment_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)203 WriteData(fid, 'object',self,'fieldname','sediment_compressibility','format','Double')204 WriteData(fid, 'object',self,'fieldname','sediment_porosity','format','Double')205 WriteData(fid, 'object',self,'fieldname','sediment_thickness','format','Double')206 WriteData(fid, 'object',self,'fieldname','sediment_transmitivity','format','DoubleMat','mattype',1)199 WriteData(fid,prefix,'object',self,'fieldname','leakage_factor','format','Double') 200 201 WriteData(fid,prefix,'object',self,'fieldname','basal_moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 202 WriteData(fid,prefix,'object',self,'fieldname','spcsediment_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 203 WriteData(fid,prefix,'object',self,'fieldname','sediment_compressibility','format','Double') 204 WriteData(fid,prefix,'object',self,'fieldname','sediment_porosity','format','Double') 205 WriteData(fid,prefix,'object',self,'fieldname','sediment_thickness','format','Double') 206 WriteData(fid,prefix,'object',self,'fieldname','sediment_transmitivity','format','DoubleMat','mattype',1) 207 207 208 208 if self.isefficientlayer==1: 209 WriteData(fid, 'object',self,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)210 WriteData(fid, 'object',self,'fieldname','mask_eplactive_node','format','DoubleMat','mattype',1)211 WriteData(fid, 'object',self,'fieldname','epl_compressibility','format','Double')212 WriteData(fid, 'object',self,'fieldname','epl_porosity','format','Double')213 WriteData(fid, 'object',self,'fieldname','epl_max_thickness','format','Double')214 WriteData(fid, 'object',self,'fieldname','epl_initial_thickness','format','Double')215 WriteData(fid, 'object',self,'fieldname','epl_colapse_thickness','format','Double')216 WriteData(fid, 'object',self,'fieldname','epl_thick_comp','format','Integer')217 WriteData(fid, 'object',self,'fieldname','epl_conductivity','format','Double')218 WriteData(fid, 'object',self,'fieldname','eplflip_lock','format','Integer')219 # }}} 209 WriteData(fid,prefix,'object',self,'fieldname','spcepl_head','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 210 WriteData(fid,prefix,'object',self,'fieldname','mask_eplactive_node','format','DoubleMat','mattype',1) 211 WriteData(fid,prefix,'object',self,'fieldname','epl_compressibility','format','Double') 212 WriteData(fid,prefix,'object',self,'fieldname','epl_porosity','format','Double') 213 WriteData(fid,prefix,'object',self,'fieldname','epl_max_thickness','format','Double') 214 WriteData(fid,prefix,'object',self,'fieldname','epl_initial_thickness','format','Double') 215 WriteData(fid,prefix,'object',self,'fieldname','epl_colapse_thickness','format','Double') 216 WriteData(fid,prefix,'object',self,'fieldname','epl_thick_comp','format','Integer') 217 WriteData(fid,prefix,'object',self,'fieldname','epl_conductivity','format','Double') 218 WriteData(fid,prefix,'object',self,'fieldname','eplflip_lock','format','Integer') 219 # }}} -
issm/trunk-jpl/src/m/classes/hydrologyshreve.js
r19903 r20690 9 9 10 10 //Type of stabilization to use 0:nothing 1:artificial_diffusivity 11 self.stabilization=1;11 this.stabilization=1; 12 12 13 13 }// }}} … … 37 37 } // }}} 38 38 this.marshall=function(md,fid) { //{{{ 39 WriteData(fid, 'enum',HydrologyModelEnum(),'data',HydrologyshreveEnum(),'format','Integer');40 WriteData(fid, 'object',this,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);41 WriteData(fid, 'object',this,'fieldname','stabilization','format','Double');39 WriteData(fid,prefix,'name','md.hydrology.model','data',HydrologyshreveEnum(),'format','Integer'); 40 WriteData(fid,prefix,'object',this,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 41 WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Double'); 42 42 }//}}} 43 43 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/hydrologyshreve.m
r19958 r20690 43 43 44 44 end % }}} 45 function marshall(self, md,fid) % {{{46 WriteData(fid, 'enum',HydrologyModelEnum(),'data',HydrologyshreveEnum(),'format','Integer');47 WriteData(fid, 'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);48 WriteData(fid, 'object',self,'fieldname','stabilization','format','Double');45 function marshall(self,prefix,md,fid) % {{{ 46 WriteData(fid,prefix,'name','md.hydrology.model','data',HydrologyshreveEnum(),'format','Integer'); 47 WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 48 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Double'); 49 49 end % }}} 50 50 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/hydrologyshreve.py
r19903 r20690 48 48 return md 49 49 # }}} 50 def marshall(self, md,fid): # {{{51 WriteData(fid, 'enum',HydrologyModelEnum(),'data',HydrologyshreveEnum(),'format','Integer');52 WriteData(fid, 'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)53 WriteData(fid, 'object',self,'fieldname','stabilization','format','Double')50 def marshall(self,prefix,md,fid): # {{{ 51 WriteData(fid,prefix,'name','md.hydrology.model','data',HydrologyshreveEnum(),'format','Integer'); 52 WriteData(fid,prefix,'object',self,'fieldname','spcwatercolumn','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 53 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Double') 54 54 # }}} -
issm/trunk-jpl/src/m/classes/hydrologysommers.m
r19897 r20690 60 60 fielddisplay(self,'spchead','water head constraints (NaN means no constraint) (m)'); 61 61 end % }}} 62 function marshall(self, md,fid) % {{{62 function marshall(self,prefix,md,fid) % {{{ 63 63 64 64 yts=365.0*24.0*3600.0; 65 65 66 WriteData(fid, 'enum',HydrologyModelEnum(),'data',HydrologysommersEnum(),'format','Integer');67 WriteData(fid, 'object',self,'class','hydrology','fieldname','head','format','DoubleMat','mattype',1);68 WriteData(fid, 'object',self,'class','hydrology','fieldname','gap_height','format','DoubleMat','mattype',2);69 WriteData(fid, 'object',self,'class','hydrology','fieldname','bump_spacing','format','DoubleMat','mattype',2);70 WriteData(fid, 'object',self,'class','hydrology','fieldname','bump_height','format','DoubleMat','mattype',2);71 WriteData(fid, 'object',self,'class','hydrology','fieldname','englacial_input','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);72 WriteData(fid, 'object',self,'class','hydrology','fieldname','moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);73 WriteData(fid, 'object',self,'class','hydrology','fieldname','reynolds','format','DoubleMat','mattype',2);74 WriteData(fid, 'object',self,'class','hydrology','fieldname','neumannflux','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1);75 WriteData(fid, 'object',self,'class','hydrology','fieldname','spchead','format','DoubleMat','mattype',1);66 WriteData(fid,prefix,'name','md.hydrology.model','data',HydrologysommersEnum(),'format','Integer'); 67 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','head','format','DoubleMat','mattype',1); 68 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','gap_height','format','DoubleMat','mattype',2); 69 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','bump_spacing','format','DoubleMat','mattype',2); 70 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','bump_height','format','DoubleMat','mattype',2); 71 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','englacial_input','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 72 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','moulin_input','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 73 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','reynolds','format','DoubleMat','mattype',2); 74 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','neumannflux','format','DoubleMat','mattype',2,'timeserieslength',md.mesh.numberofelements+1); 75 WriteData(fid,prefix,'object',self,'class','hydrology','fieldname','spchead','format','DoubleMat','mattype',1); 76 76 end % }}} 77 77 end -
issm/trunk-jpl/src/m/classes/initialization.js
r20265 r20690 85 85 var yts=365.0*24.0*3600.0; 86 86 87 WriteData(fid, 'data',this.vx,'format','DoubleMat','mattype',1,'enum',VxEnum(),'scale',1./yts);88 WriteData(fid, 'data',this.vy,'format','DoubleMat','mattype',1,'enum',VyEnum(),'scale',1./yts);89 WriteData(fid, 'data',this.vz,'format','DoubleMat','mattype',1,'enum',VzEnum(),'scale',1./yts);90 WriteData(fid, 'data',this.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum());91 WriteData(fid, 'data',this.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum());92 WriteData(fid, 'data',this.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum());93 WriteData(fid, 'data',this.sediment_head,'format','DoubleMat','mattype',1,'enum',SedimentHeadEnum());94 WriteData(fid, 'data',this.epl_head,'format','DoubleMat','mattype',1,'enum',EplHeadEnum());95 WriteData(fid, 'data',this.epl_thickness,'format','DoubleMat','mattype',1,'enum',HydrologydcEplThicknessEnum());96 WriteData(fid, 'data',this.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum());87 WriteData(fid,prefix,'object',this,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts); 88 WriteData(fid,prefix,'object',this,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts); 89 WriteData(fid,prefix,'object',this,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts); 90 WriteData(fid,prefix,'object',this,'fieldname','pressure','format','DoubleMat','mattype',1); 91 WriteData(fid,prefix,'object',this,'fieldname','temperature','format','DoubleMat','mattype',1); 92 WriteData(fid,prefix,'object',this,'fieldname','waterfraction','format','DoubleMat','mattype',1); 93 WriteData(fid,prefix,'object',this,'fieldname','sediment_head','format','DoubleMat','mattype',1); 94 WriteData(fid,prefix,'object',this,'fieldname','epl_head','format','DoubleMat','mattype',1); 95 WriteData(fid,prefix,'object',this,'fieldname','epl_thickness','format','DoubleMat','mattype',1); 96 WriteData(fid,prefix,'object',this,'fieldname','watercolumn','format','DoubleMat','mattype',1); 97 97 98 98 if (md.thermal.isenthalpy){ … … 105 105 enthalpy[i] = md.materials.heatcapacity*(tpmp[i] - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction[i]; 106 106 } 107 WriteData(fid, 'data',enthalpy,'format','DoubleMat','mattype',1,'enum',EnthalpyEnum());107 WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy'); 108 108 } 109 109 }//}}} -
issm/trunk-jpl/src/m/classes/initialization.m
r20137 r20690 112 112 113 113 end % }}} 114 function marshall(self, md,fid) % {{{114 function marshall(self,prefix,md,fid) % {{{ 115 115 116 116 yts=365.0*24.0*3600.0; 117 117 118 WriteData(fid, 'data',self.vx,'format','DoubleMat','mattype',1,'enum',VxEnum,'scale',1./yts);119 WriteData(fid, 'data',self.vy,'format','DoubleMat','mattype',1,'enum',VyEnum,'scale',1./yts);120 WriteData(fid, 'data',self.vz,'format','DoubleMat','mattype',1,'enum',VzEnum,'scale',1./yts);121 WriteData(fid, 'data',self.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum);122 WriteData(fid, 'data',self.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum);123 WriteData(fid, 'data',self.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum);124 WriteData(fid, 'data',self.sediment_head,'format','DoubleMat','mattype',1,'enum',SedimentHeadEnum);125 WriteData(fid, 'data',self.epl_head,'format','DoubleMat','mattype',1,'enum',EplHeadEnum);126 WriteData(fid, 'data',self.epl_thickness,'format','DoubleMat','mattype',1,'enum',HydrologydcEplThicknessEnum);127 WriteData(fid, 'data',self.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum);118 WriteData(fid,prefix,'object',self,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts); 119 WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts); 120 WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts); 121 WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1); 122 WriteData(fid,prefix,'object',self,'fieldname','temperature','format','DoubleMat','mattype',1); 123 WriteData(fid,prefix,'object',self,'fieldname','waterfraction','format','DoubleMat','mattype',1); 124 WriteData(fid,prefix,'object',self,'fieldname','sediment_head','format','DoubleMat','mattype',1); 125 WriteData(fid,prefix,'object',self,'fieldname','epl_head','format','DoubleMat','mattype',1); 126 WriteData(fid,prefix,'object',self,'fieldname','epl_thickness','format','DoubleMat','mattype',1); 127 WriteData(fid,prefix,'object',self,'fieldname','watercolumn','format','DoubleMat','mattype',1); 128 128 129 129 if md.thermal.isenthalpy, … … 132 132 enthalpy = md.materials.heatcapacity*(md.initialization.temperature-md.constants.referencetemperature); 133 133 enthalpy(pos) = md.materials.heatcapacity*(tpmp(pos) - md.constants.referencetemperature) + md.materials.latentheat*md.initialization.waterfraction(pos); 134 WriteData(fid, 'data',enthalpy,'format','DoubleMat','mattype',1,'enum',EnthalpyEnum());134 WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy'); 135 135 end 136 136 end % }}} -
issm/trunk-jpl/src/m/classes/initialization.py
r19897 r20690 107 107 return md 108 108 # }}} 109 def marshall(self, md,fid): # {{{109 def marshall(self,prefix,md,fid): # {{{ 110 110 111 111 yts=365.0*24.0*3600.0 112 112 113 WriteData(fid, 'data',self.vx,'format','DoubleMat','mattype',1,'enum',VxEnum(),'scale',1./yts)114 WriteData(fid, 'data',self.vy,'format','DoubleMat','mattype',1,'enum',VyEnum(),'scale',1./yts)115 WriteData(fid, 'data',self.vz,'format','DoubleMat','mattype',1,'enum',VzEnum(),'scale',1./yts)116 WriteData(fid, 'data',self.pressure,'format','DoubleMat','mattype',1,'enum',PressureEnum())117 WriteData(fid, 'data',self.temperature,'format','DoubleMat','mattype',1,'enum',TemperatureEnum())118 WriteData(fid, 'data',self.waterfraction,'format','DoubleMat','mattype',1,'enum',WaterfractionEnum())119 WriteData(fid, 'data',self.watercolumn,'format','DoubleMat','mattype',1,'enum',WatercolumnEnum())120 WriteData(fid, 'data',self.sediment_head,'format','DoubleMat','mattype',1,'enum',SedimentHeadEnum())121 WriteData(fid, 'data',self.epl_head,'format','DoubleMat','mattype',1,'enum',EplHeadEnum())122 WriteData(fid, 'data',self.epl_thickness,'format','DoubleMat','mattype',1,'enum',HydrologydcEplThicknessEnum())113 WriteData(fid,prefix,'object',self,'fieldname','vx','format','DoubleMat','mattype',1,'scale',1./yts) 114 WriteData(fid,prefix,'object',self,'fieldname','vy','format','DoubleMat','mattype',1,'scale',1./yts) 115 WriteData(fid,prefix,'object',self,'fieldname','vz','format','DoubleMat','mattype',1,'scale',1./yts) 116 WriteData(fid,prefix,'object',self,'fieldname','pressure','format','DoubleMat','mattype',1) 117 WriteData(fid,prefix,'object',self,'fieldname','temperature','format','DoubleMat','mattype',1) 118 WriteData(fid,prefix,'object',self,'fieldname','waterfraction','format','DoubleMat','mattype',1) 119 WriteData(fid,prefix,'object',self,'fieldname','watercolumn','format','DoubleMat','mattype',1) 120 WriteData(fid,prefix,'object',self,'fieldname','sediment_head','format','DoubleMat','mattype',1) 121 WriteData(fid,prefix,'object',self,'fieldname','epl_head','format','DoubleMat','mattype',1) 122 WriteData(fid,prefix,'object',self,'fieldname','epl_thickness','format','DoubleMat','mattype',1) 123 123 124 124 … … 128 128 enthalpy = md.materials.heatcapacity*(md.initialization.temperature-md.constants.referencetemperature); 129 129 enthalpy[pos] = md.materials.heatcapacity*tpmp[pos].reshape(-1,1) - md.constants.referencetemperature + md.materials.latentheat*md.initialization.waterfraction[pos].reshape(-1,1) 130 WriteData(fid, 'data',enthalpy,'format','DoubleMat','mattype',1,'enum',EnthalpyEnum());130 WriteData(fid,prefix,'data',enthalpy,'format','DoubleMat','mattype',1,'name','md.initialization.enthalpy'); 131 131 132 132 # }}} -
issm/trunk-jpl/src/m/classes/inversion.js
r19901 r20690 120 120 var yts=365.0*24.0*3600.0; 121 121 122 WriteData(fid, 'enum',InversionTypeEnum(),'data',0,'format','Integer');123 WriteData(fid, 'object',this,'fieldname','iscontrol','format','Boolean');124 WriteData(fid, 'object',this,'fieldname','incomplete_adjoint','format','Boolean');122 WriteData(fid,prefix,'name','md.inversion.type','data',0,'format','Integer'); 123 WriteData(fid,prefix,'object',this,'fieldname','iscontrol','format','Boolean'); 124 WriteData(fid,prefix,'object',this,'fieldname','incomplete_adjoint','format','Boolean'); 125 125 if (!this.iscontrol) return; 126 WriteData(fid, 'object',this,'fieldname','nsteps','format','Integer');127 WriteData(fid, 'object',this,'fieldname','maxiter_per_step','format','IntMat','mattype',3);128 WriteData(fid, 'object',this,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);129 WriteData(fid, 'object',this,'fieldname','gradient_scaling','format','DoubleMat','mattype',3);130 WriteData(fid, 'object',this,'fieldname','cost_function_threshold','format','Double');131 WriteData(fid, 'object',this,'fieldname','min_parameters','format','DoubleMat','mattype',3);132 WriteData(fid, 'object',this,'fieldname','max_parameters','format','DoubleMat','mattype',3);133 WriteData(fid, 'object',this,'fieldname','step_threshold','format','DoubleMat','mattype',3);134 WriteData(fid, 'object',this,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);135 WriteData(fid, 'object',this,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);136 WriteData(fid, 'object',this,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);126 WriteData(fid,prefix,'object',this,'fieldname','nsteps','format','Integer'); 127 WriteData(fid,prefix,'object',this,'fieldname','maxiter_per_step','format','IntMat','mattype',3); 128 WriteData(fid,prefix,'object',this,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 129 WriteData(fid,prefix,'object',this,'fieldname','gradient_scaling','format','DoubleMat','mattype',3); 130 WriteData(fid,prefix,'object',this,'fieldname','cost_function_threshold','format','Double'); 131 WriteData(fid,prefix,'object',this,'fieldname','min_parameters','format','DoubleMat','mattype',3); 132 WriteData(fid,prefix,'object',this,'fieldname','max_parameters','format','DoubleMat','mattype',3); 133 WriteData(fid,prefix,'object',this,'fieldname','step_threshold','format','DoubleMat','mattype',3); 134 WriteData(fid,prefix,'object',this,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 135 WriteData(fid,prefix,'object',this,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 136 WriteData(fid,prefix,'object',this,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 137 137 if(this.thickness_obs.length==md.mesh.numberofelements) mattype=2; 138 138 else mattype=1; 139 WriteData(fid,'object',this,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype); 140 WriteData(fid,'object',this,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype); 141 139 WriteData(fid,prefix,'object',this,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype); 140 WriteData(fid,prefix,'object',this,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype); 142 141 143 142 //process control parameters 144 143 num_control_parameters=this.control_parameters.length; 145 data=NewArrayFill(num_control_parameters,0); 146 for (var i=0;i<num_control_parameters;i++){ 147 data[i]=StringToEnum(this.control_parameters[i]); 148 } 149 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3); 150 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer'); 144 WriteData(fid,prefix,'object',this,'fieldname','control_parameters','format','StringArray'); 145 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer'); 151 146 152 147 //process cost functions 153 148 num_cost_functions=this.cost_functions[0].length; 154 149 data=marshallcostfunctions(this.cost_functions); 155 WriteData(fid, 'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);156 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');150 WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3); 151 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer'); 157 152 }//}}} 158 153 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/inversion.m
r19958 r20690 148 148 disp(' 503: ThicknessAbsGradient'); 149 149 end % }}} 150 function marshall(self, md,fid) % {{{150 function marshall(self,prefix,md,fid) % {{{ 151 151 152 152 yts=365.0*24.0*3600.0; 153 153 154 WriteData(fid, 'enum',InversionTypeEnum(),'data',0,'format','Integer');155 WriteData(fid, 'object',self,'fieldname','iscontrol','format','Boolean');156 WriteData(fid, 'object',self,'fieldname','incomplete_adjoint','format','Boolean');154 WriteData(fid,prefix,'name','md.inversion.type','data',0,'format','Integer'); 155 WriteData(fid,prefix,'object',self,'fieldname','iscontrol','format','Boolean'); 156 WriteData(fid,prefix,'object',self,'fieldname','incomplete_adjoint','format','Boolean'); 157 157 if ~self.iscontrol, return; end 158 WriteData(fid, 'object',self,'fieldname','nsteps','format','Integer');159 WriteData(fid, 'object',self,'fieldname','maxiter_per_step','format','IntMat','mattype',3);160 WriteData(fid, 'object',self,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);161 WriteData(fid, 'object',self,'fieldname','gradient_scaling','format','DoubleMat','mattype',3);162 WriteData(fid, 'object',self,'fieldname','cost_function_threshold','format','Double');163 WriteData(fid, 'object',self,'fieldname','min_parameters','format','DoubleMat','mattype',3);164 WriteData(fid, 'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3);165 WriteData(fid, 'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3);166 WriteData(fid, 'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);167 WriteData(fid, 'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);168 WriteData(fid, 'object',self,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);158 WriteData(fid,prefix,'object',self,'fieldname','nsteps','format','Integer'); 159 WriteData(fid,prefix,'object',self,'fieldname','maxiter_per_step','format','IntMat','mattype',3); 160 WriteData(fid,prefix,'object',self,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 161 WriteData(fid,prefix,'object',self,'fieldname','gradient_scaling','format','DoubleMat','mattype',3); 162 WriteData(fid,prefix,'object',self,'fieldname','cost_function_threshold','format','Double'); 163 WriteData(fid,prefix,'object',self,'fieldname','min_parameters','format','DoubleMat','mattype',3); 164 WriteData(fid,prefix,'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3); 165 WriteData(fid,prefix,'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3); 166 WriteData(fid,prefix,'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 167 WriteData(fid,prefix,'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 168 WriteData(fid,prefix,'object',self,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 169 169 if(numel(self.thickness_obs)==md.mesh.numberofelements), 170 170 mattype=2; … … 172 172 mattype=1; 173 173 end 174 WriteData(fid,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype); 175 WriteData(fid,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype); 176 174 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype); 175 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype); 177 176 178 177 %process control parameters 179 num_control_parameters=numel(self.control_parameters); 180 data=zeros(1,num_control_parameters); 181 for i=1:num_control_parameters, 182 data(i)=StringToEnum(self.control_parameters{i}); 183 end 184 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3); 185 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer'); 178 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray'); 179 WriteData(fid,prefix,'data',numel(self.control_parameters),'name','md.inversion.num_control_parameters','format','Integer'); 186 180 187 181 %process cost functions 188 182 num_cost_functions=size(self.cost_functions,2); 189 183 data=marshallcostfunctions(self.cost_functions); 190 WriteData(fid, 'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);191 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');184 WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3); 185 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer'); 192 186 end % }}} 193 187 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/inversion.py
r19897 r20690 158 158 return md 159 159 # }}} 160 def marshall(self, md,fid): # {{{160 def marshall(self,prefix,md,fid): # {{{ 161 161 162 162 yts=365.0*24.0*3600.0 163 163 164 WriteData(fid, 'enum',InversionTypeEnum(),'data',0,'format','Integer')165 WriteData(fid, 'object',self,'fieldname','iscontrol','format','Boolean')166 WriteData(fid, 'object',self,'fieldname','incomplete_adjoint','format','Boolean')164 WriteData(fid,prefix,'name','md.inversion.type','data',0,'format','Integer') 165 WriteData(fid,prefix,'object',self,'fieldname','iscontrol','format','Boolean') 166 WriteData(fid,prefix,'object',self,'fieldname','incomplete_adjoint','format','Boolean') 167 167 if not self.iscontrol: 168 168 return 169 WriteData(fid, 'object',self,'fieldname','nsteps','format','Integer')170 WriteData(fid, 'object',self,'fieldname','maxiter_per_step','format','DoubleMat','mattype',3)171 WriteData(fid, 'object',self,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1)172 WriteData(fid, 'object',self,'fieldname','gradient_scaling','format','DoubleMat','mattype',3)173 WriteData(fid, 'object',self,'fieldname','cost_function_threshold','format','Double')174 WriteData(fid, 'object',self,'fieldname','min_parameters','format','DoubleMat','mattype',3)175 WriteData(fid, 'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3)176 WriteData(fid, 'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3)177 WriteData(fid, 'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts)178 WriteData(fid, 'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts)179 WriteData(fid, 'object',self,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts)180 WriteData(fid, 'object',self,'fieldname','thickness_obs','format','DoubleMat','mattype',1)181 WriteData(fid, 'object',self,'fieldname','surface_obs','format','DoubleMat','mattype',1)169 WriteData(fid,prefix,'object',self,'fieldname','nsteps','format','Integer') 170 WriteData(fid,prefix,'object',self,'fieldname','maxiter_per_step','format','DoubleMat','mattype',3) 171 WriteData(fid,prefix,'object',self,'fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1) 172 WriteData(fid,prefix,'object',self,'fieldname','gradient_scaling','format','DoubleMat','mattype',3) 173 WriteData(fid,prefix,'object',self,'fieldname','cost_function_threshold','format','Double') 174 WriteData(fid,prefix,'object',self,'fieldname','min_parameters','format','DoubleMat','mattype',3) 175 WriteData(fid,prefix,'object',self,'fieldname','max_parameters','format','DoubleMat','mattype',3) 176 WriteData(fid,prefix,'object',self,'fieldname','step_threshold','format','DoubleMat','mattype',3) 177 WriteData(fid,prefix,'object',self,'fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts) 178 WriteData(fid,prefix,'object',self,'fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts) 179 WriteData(fid,prefix,'object',self,'fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts) 180 WriteData(fid,prefix,'object',self,'fieldname','thickness_obs','format','DoubleMat','mattype',1) 181 WriteData(fid,prefix,'object',self,'fieldname','surface_obs','format','DoubleMat','mattype',1) 182 182 183 183 #process control parameters 184 184 num_control_parameters=len(self.control_parameters) 185 data=numpy.array([StringToEnum(control_parameter)[0] for control_parameter in self.control_parameters]).reshape(1,-1) 186 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3) 187 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer') 185 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray') 186 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer') 188 187 189 188 #process cost functions 190 189 num_cost_functions=numpy.size(self.cost_functions) 191 190 data=marshallcostfunctions(self.cost_functions) 192 WriteData(fid, 'data',numpy.array(data).reshape(1,-1),'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3)193 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer')191 WriteData(fid,prefix,'data',numpy.array(data).reshape(1,-1),'name','md.inversion.cost_functions','format','DoubleMat','mattype',3) 192 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer') 194 193 # }}} -
issm/trunk-jpl/src/m/classes/inversionvalidation.m
r19897 r20690 110 110 disp(' 503: ThicknessAbsGradient'); 111 111 end % }}} 112 function marshall(self, md,fid) % {{{112 function marshall(self,prefix,md,fid) % {{{ 113 113 114 114 yts=365.0*24.0*3600.0; 115 115 116 WriteData(fid, 'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');117 WriteData(fid, 'enum',InversionTypeEnum(),'data',3,'format','Integer');116 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean'); 117 WriteData(fid,prefix,'name','md.inversion.type','data',3,'format','Integer'); 118 118 if ~self.iscontrol, return; end 119 WriteData(fid, 'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');120 WriteData(fid, 'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3);121 WriteData(fid, 'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);122 WriteData(fid, 'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);123 WriteData(fid, 'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);124 WriteData(fid, 'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);125 WriteData(fid, 'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);126 WriteData(fid, 'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);119 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean'); 120 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3); 121 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 122 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3); 123 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3); 124 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 125 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 126 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 127 127 if(numel(self.thickness_obs)==md.mesh.numberofelements), 128 128 mattype=2; … … 130 130 mattype=1; 131 131 end 132 WriteData(fid, 'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);133 WriteData(fid, 'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);132 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype); 133 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype); 134 134 135 135 %process control parameters 136 136 num_control_parameters=numel(self.control_parameters); 137 data=zeros(1,num_control_parameters); 138 for i=1:num_control_parameters, 139 data(i)=StringToEnum(self.control_parameters{i}); 140 end 141 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3); 142 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer'); 137 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray'); 138 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer'); 143 139 144 140 %process cost functions 145 141 num_cost_functions=size(self.cost_functions,2); 146 142 data=marshallcostfunctions(self.cost_functions); 147 WriteData(fid, 'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);148 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');143 WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3); 144 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer'); 149 145 end % }}} 150 146 end -
issm/trunk-jpl/src/m/classes/levelset.js
r20486 r20690 31 31 checkfield(md,'fieldname','levelset.stabilization','values',[0,1,2]); 32 32 } //}}} 33 34 WriteData(fid,'object',this,'class','levelset','fieldname','stabilization','format','Integer');35 WriteData(fid,'enum',SpclevelsetEnum(),'data',this.spclevelset,'format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);36 WriteData(fid,'object',this,'class','levelset','fieldname','reinit_frequency','format','Integer');33 this.marshall=function(md,fid) { //{{{ 34 WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer'); 35 WriteData(fid,prefix,'object',this,'fieldname','.spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 36 WriteData(fid,prefix,'object',this,'fieldname','reinit_frequency','format','Integer'); 37 37 38 38 }//}}} 39 39 this.fix=function() { //{{{ 40 40 this.spclevelset=NullFix(this.spclevelset,NaN); -
issm/trunk-jpl/src/m/classes/levelset.m
r20467 r20690 53 53 fielddisplay(self,'reinit_frequency','Amount of time steps after which the levelset function in re-initialized'); 54 54 end % }}} 55 function marshall(self, md,fid) % {{{56 WriteData(fid, 'object',self,'class','levelset','fieldname','stabilization','format','Integer');57 WriteData(fid, 'enum',SpclevelsetEnum(),'data',self.spclevelset,'format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);58 WriteData(fid, 'object',self,'class','levelset','fieldname','reinit_frequency','format','Integer');55 function marshall(self,prefix,md,fid) % {{{ 56 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer'); 57 WriteData(fid,prefix,'object',self,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 58 WriteData(fid,prefix,'object',self,'fieldname','reinit_frequency','format','Integer'); 59 59 end % }}} 60 60 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/levelset.py
r20467 r20690 55 55 return md 56 56 # }}} 57 def marshall(self, md,fid): # {{{57 def marshall(self,prefix,md,fid): # {{{ 58 58 59 WriteData(fid, 'object',self,'class','levelset','fieldname','stabilization','format','Integer');60 WriteData(fid, 'enum',SpclevelsetEnum(),'data',self.spclevelset,'format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);61 WriteData(fid, 'object',self,'class','levelset','fieldname','reinit_frequency','format','Integer');59 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer'); 60 WriteData(fid,prefix,'object',self,'fieldname','spclevelset','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 61 WriteData(fid,prefix,'object',self,'fieldname','reinit_frequency','format','Integer'); 62 62 # }}} -
issm/trunk-jpl/src/m/classes/linearbasalforcings.m
r19958 r20690 71 71 72 72 end % }}} 73 function marshall(self, md,fid) % {{{73 function marshall(self,prefix,md,fid) % {{{ 74 74 75 75 yts=365.0*24.0*3600.0; … … 79 79 pos=find(md.geometry.base>md.basalforcings.deepwater_elevation & md.geometry.base<md.basalforcings.upperwater_elevation); 80 80 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); 81 WriteData(fid, 'enum',BasalforcingsEnum(),'data',LinearFloatingMeltRateEnum(),'format','Integer');82 WriteData(fid, 'data',floatingice_melting_rate,'format','DoubleMat','enum',BasalforcingsFloatingiceMeltingRateEnum(),'mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)83 WriteData(fid, 'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','enum',BasalforcingsGroundediceMeltingRateEnum(),'mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)84 WriteData(fid, 'object',self,'fieldname','geothermalflux','enum',BasalforcingsGeothermalfluxEnum(),'format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);85 WriteData(fid, 'object',self,'fieldname','deepwater_melting_rate','format','Double','enum',BasalforcingsDeepwaterMeltingRateEnum(),'scale',1./yts)86 WriteData(fid, 'object',self,'fieldname','deepwater_elevation','format','Double','enum',BasalforcingsDeepwaterElevationEnum())87 WriteData(fid, 'object',self,'fieldname','upperwater_elevation','format','Double','enum',BasalforcingsUpperwaterElevationEnum())81 WriteData(fid,prefix,'name','md.basalforcings.model','data',LinearFloatingMeltRateEnum(),'format','Integer'); 82 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) 83 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) 84 WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 85 WriteData(fid,prefix,'object',self,'fieldname','deepwater_melting_rate','format','Double','name','md.basalforcings.deepwater_melting_rate','scale',1./yts) 86 WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','format','Double','name','md.basalforcings.deepwater_elevation') 87 WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','format','Double','name','md.basalforcings.upperwater_elevation') 88 88 end % }}} 89 89 end -
issm/trunk-jpl/src/m/classes/linearbasalforcings.py
r19897 r20690 89 89 return md 90 90 # }}} 91 def marshall(self, md,fid): # {{{91 def marshall(self,prefix,md,fid): # {{{ 92 92 93 93 yts=365.0*24.0*3600.0 … … 99 99 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) 100 100 101 WriteData(fid, 'enum',BasalforcingsEnum(),'data',LinearFloatingMeltRateEnum(),'format','Integer');102 WriteData(fid, 'object',self,'fieldname','groundedice_melting_rate','enum',BasalforcingsGroundediceMeltingRateEnum(),'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)103 WriteData(fid, 'data',floatingice_melting_rate,'enum',BasalforcingsFloatingiceMeltingRateEnum(),'format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)104 WriteData(fid, 'object',self,'fieldname','geothermalflux','enum',BasalforcingsGeothermalfluxEnum(),'format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)105 WriteData(fid, 'object',self,'fieldname','deepwater_melting_rate','enum',BasalforcingsDeepwaterMeltingRateEnum(),'format','Double','scale',1./yts)106 WriteData(fid, 'object',self,'fieldname','deepwater_elevation','enum',BasalforcingsDeepwaterElevationEnum(),'format','Double')107 WriteData(fid, 'object',self,'fieldname','upperwater_elevation','enum',BasalforcingsUpperwaterElevationEnum(),'format','Double')101 WriteData(fid,prefix,'name','md.basalforcings.model','data',LinearFloatingMeltRateEnum(),'format','Integer'); 102 WriteData(fid,prefix,'object',self,'fieldname','groundedice_melting_rate','name','md.basalforcings.groundedice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 103 WriteData(fid,prefix,'data',floatingice_melting_rate,'name','md.basalforcings.floatingice_melting_rate','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 104 WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 105 WriteData(fid,prefix,'object',self,'fieldname','deepwater_melting_rate','name','md.basalforcings.deepwater_melting_rate','format','Double','scale',1./yts) 106 WriteData(fid,prefix,'object',self,'fieldname','deepwater_elevation','name','md.basalforcings.deepwater_elevation','format','Double') 107 WriteData(fid,prefix,'object',self,'fieldname','upperwater_elevation','name','md.basalforcings.upperwater_elevation','format','Double') 108 108 # }}} -
issm/trunk-jpl/src/m/classes/m1qn3inversion.m
r19897 r20690 136 136 disp(' 503: ThicknessAbsGradient'); 137 137 end % }}} 138 function marshall(self, md,fid) % {{{138 function marshall(self,prefix,md,fid) % {{{ 139 139 140 140 yts=365.0*24.0*3600.0; 141 141 142 WriteData(fid, 'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');143 WriteData(fid, 'enum',InversionTypeEnum(),'data',2,'format','Integer');142 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean'); 143 WriteData(fid,prefix,'name','md.inversion.type','data',2,'format','Integer'); 144 144 if ~self.iscontrol, return; end 145 WriteData(fid, 'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');146 WriteData(fid, 'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3);147 WriteData(fid, 'object',self,'class','inversion','fieldname','maxsteps','format','Integer');148 WriteData(fid, 'object',self,'class','inversion','fieldname','maxiter','format','Integer');149 WriteData(fid, 'object',self,'class','inversion','fieldname','dxmin','format','Double');150 WriteData(fid, 'object',self,'class','inversion','fieldname','gttol','format','Double');151 WriteData(fid, 'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);152 WriteData(fid, 'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);153 WriteData(fid, 'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);154 WriteData(fid, 'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);155 WriteData(fid, 'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);156 WriteData(fid, 'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);145 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean'); 146 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3); 147 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer'); 148 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer'); 149 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dxmin','format','Double'); 150 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double'); 151 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 152 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3); 153 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3); 154 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 155 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 156 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 157 157 if(numel(self.thickness_obs)==md.mesh.numberofelements), 158 158 mattype=2; … … 160 160 mattype=1; 161 161 end 162 WriteData(fid, 'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype);163 WriteData(fid, 'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype);162 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',mattype); 163 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',mattype); 164 164 165 165 %process control parameters 166 166 num_control_parameters=numel(self.control_parameters); 167 data=zeros(1,num_control_parameters); 168 for i=1:num_control_parameters, 169 data(i)=StringToEnum(self.control_parameters{i}); 170 end 171 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3); 172 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer'); 167 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray'); 168 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer'); 173 169 174 170 %process cost functions 175 171 num_cost_functions=size(self.cost_functions,2); 176 172 data=marshallcostfunctions(self.cost_functions); 177 WriteData(fid, 'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);178 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');173 WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3); 174 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer'); 179 175 end % }}} 180 176 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/m1qn3inversion.py
r19897 r20690 163 163 return md 164 164 # }}} 165 def marshall(self, md,fid): # {{{165 def marshall(self,prefix,md,fid): # {{{ 166 166 167 167 yts=365.0*24.0*3600.0 168 168 169 WriteData(fid, 'object',self,'class','inversion','fieldname','iscontrol','format','Boolean')170 WriteData(fid, 'enum',InversionTypeEnum(),'data',2,'format','Integer')169 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean') 170 WriteData(fid,prefix,'name','md.inversion.type','data',2,'format','Integer') 171 171 if not self.iscontrol: 172 172 return 173 WriteData(fid, 'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean')174 WriteData(fid, 'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3)175 WriteData(fid, 'object',self,'class','inversion','fieldname','maxsteps','format','Integer')176 WriteData(fid, 'object',self,'class','inversion','fieldname','maxiter','format','Integer')177 WriteData(fid, 'object',self,'class','inversion','fieldname','dxmin','format','Double')178 WriteData(fid, 'object',self,'class','inversion','fieldname','gttol','format','Double')179 WriteData(fid, 'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1)180 WriteData(fid, 'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3)181 WriteData(fid, 'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3)182 WriteData(fid, 'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts)183 WriteData(fid, 'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts)184 WriteData(fid, 'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts)185 WriteData(fid, 'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1)173 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean') 174 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','control_scaling_factors','format','DoubleMat','mattype',3) 175 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer') 176 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer') 177 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','dxmin','format','Double') 178 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double') 179 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1) 180 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3) 181 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3) 182 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts) 183 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts) 184 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts) 185 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1) 186 186 187 187 #process control parameters 188 188 num_control_parameters=len(self.control_parameters) 189 data=numpy.array([StringToEnum(control_parameter)[0] for control_parameter in self.control_parameters]).reshape(1,-1) 190 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3) 191 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer') 189 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray') 190 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer') 192 191 193 192 #process cost functions 194 193 num_cost_functions=numpy.size(self.cost_functions) 195 194 data=marshallcostfunctions(self.cost_functions) 196 WriteData(fid, 'data',numpy.array(data).reshape(1,-1),'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3)197 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer')195 WriteData(fid,prefix,'data',numpy.array(data).reshape(1,-1),'name','md.inversion.cost_functions','format','DoubleMat','mattype',3) 196 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer') 198 197 # }}} -
issm/trunk-jpl/src/m/classes/mask.js
r20453 r20690 52 52 } // }}} 53 53 this.marshall=function(md,fid) { //{{{ 54 WriteData(fid, 'object',this,'fieldname','groundedice_levelset','format','DoubleMat','mattype',1);55 WriteData(fid, 'object',this,'fieldname','ice_levelset','format','DoubleMat','mattype',1);54 WriteData(fid,prefix,'object',this,'fieldname','groundedice_levelset','format','DoubleMat','mattype',1); 55 WriteData(fid,prefix,'object',this,'fieldname','ice_levelset','format','DoubleMat','mattype',1); 56 56 }//}}} 57 57 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/mask.m
r20453 r20690 59 59 fielddisplay(self,'ice_levelset','presence of ice if < 0, icefront position if = 0, no ice if > 0'); 60 60 end % }}} 61 function marshall(self, md,fid) % {{{62 WriteData(fid, 'object',self,'fieldname','groundedice_levelset','format','DoubleMat','mattype',1);63 WriteData(fid, 'object',self,'fieldname','ice_levelset','format','DoubleMat','mattype',1,'NaN',1);61 function marshall(self,prefix,md,fid) % {{{ 62 WriteData(fid,prefix,'object',self,'fieldname','groundedice_levelset','format','DoubleMat','mattype',1); 63 WriteData(fid,prefix,'object',self,'fieldname','ice_levelset','format','DoubleMat','mattype',1,'NaN',1); 64 64 end % }}} 65 65 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/mask.py
r20453 r20690 51 51 return md 52 52 # }}} 53 def marshall(self, md,fid): # {{{54 WriteData(fid, 'object',self,'fieldname','groundedice_levelset','format','DoubleMat','mattype',1)55 WriteData(fid, 'object',self,'fieldname','ice_levelset','format','DoubleMat','mattype',1)53 def marshall(self,prefix,md,fid): # {{{ 54 WriteData(fid,prefix,'object',self,'fieldname','groundedice_levelset','format','DoubleMat','mattype',1) 55 WriteData(fid,prefix,'object',self,'fieldname','ice_levelset','format','DoubleMat','mattype',1) 56 56 # }}} -
issm/trunk-jpl/src/m/classes/maskpsl.js
r20453 r20690 59 59 } // }}} 60 60 this.marshall=function(md,fid) { //{{{ 61 WriteData(fid, 'object',this,'class','mask','fieldname','groundedice_levelset','format','DoubleMat','mattype',1);62 WriteData(fid, 'object',this,'class','mask','fieldname','ice_levelset','format','DoubleMat','mattype',1);63 WriteData(fid, 'object',this,'class','mask','fieldname','ocean_levelset','format','DoubleMat','mattype',1);64 WriteData(fid, 'object',this,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1);61 WriteData(fid,prefix,'object',this,'class','mask','fieldname','groundedice_levelset','format','DoubleMat','mattype',1); 62 WriteData(fid,prefix,'object',this,'class','mask','fieldname','ice_levelset','format','DoubleMat','mattype',1); 63 WriteData(fid,prefix,'object',this,'class','mask','fieldname','ocean_levelset','format','DoubleMat','mattype',1); 64 WriteData(fid,prefix,'object',this,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1); 65 65 }//}}} 66 66 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/maskpsl.m
r20453 r20690 67 67 fielddisplay(self,'land_levelset','is the vertex on the land ? yes if = 1, no if = 0'); 68 68 end % }}} 69 function marshall(self, md,fid) % {{{70 WriteData(fid, 'object',self,'class','mask','fieldname','groundedice_levelset','format','DoubleMat','mattype',1);71 WriteData(fid, 'object',self,'class','mask','fieldname','ice_levelset','format','DoubleMat','mattype',1);72 WriteData(fid, 'object',self,'class','mask','fieldname','ocean_levelset','format','DoubleMat','mattype',1);73 WriteData(fid, 'object',self,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1);69 function marshall(self,prefix,md,fid) % {{{ 70 WriteData(fid,prefix,'object',self,'class','mask','fieldname','groundedice_levelset','format','DoubleMat','mattype',1); 71 WriteData(fid,prefix,'object',self,'class','mask','fieldname','ice_levelset','format','DoubleMat','mattype',1); 72 WriteData(fid,prefix,'object',self,'class','mask','fieldname','ocean_levelset','format','DoubleMat','mattype',1); 73 WriteData(fid,prefix,'object',self,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1); 74 74 end % }}} 75 75 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/maskpsl.py
r20453 r20690 79 79 return self 80 80 # }}} 81 def marshall(self, md,fid): # {{{82 WriteData(fid, 'object',self,'class','mask','fieldname','groundedice_levelset','format','DoubleMat','mattype',1)83 WriteData(fid, 'object',self,'class','mask','fieldname','ice_levelset','format','DoubleMat','mattype',1)84 WriteData(fid, 'object',self,'class','mask','fieldname','ocean_levelset','format','DoubleMat','mattype',1)85 WriteData(fid, 'object',self,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1)81 def marshall(self,prefix,md,fid): # {{{ 82 WriteData(fid,prefix,'object',self,'class','mask','fieldname','groundedice_levelset','format','DoubleMat','mattype',1) 83 WriteData(fid,prefix,'object',self,'class','mask','fieldname','ice_levelset','format','DoubleMat','mattype',1) 84 WriteData(fid,prefix,'object',self,'class','mask','fieldname','ocean_levelset','format','DoubleMat','mattype',1) 85 WriteData(fid,prefix,'object',self,'class','mask','fieldname','land_levelset','format','DoubleMat','mattype',1) 86 86 # }}} 87 87 def savemodeljs(self,fid,modelname): # {{{ -
issm/trunk-jpl/src/m/classes/masscon.m
r19897 r20690 55 55 56 56 end % }}} 57 function md = marshall(self, md,fid) % {{{57 function md = marshall(self,prefix,md,fid) % {{{ 58 58 59 WriteData(fid, 'object',self,'fieldname','name','format','String');60 WriteData(fid, 'object',self,'fieldname','definitionenum','format','Integer');61 WriteData(fid, 'object',self,'fieldname','levelset','format','DoubleMat','mattype',1);59 WriteData(fid,prefix,'object',self,'fieldname','name','format','String'); 60 WriteData(fid,prefix,'object',self,'fieldname','definitionenum','format','Integer'); 61 WriteData(fid,prefix,'object',self,'fieldname','levelset','format','DoubleMat','mattype',1); 62 62 63 63 end % }}} -
issm/trunk-jpl/src/m/classes/massconaxpby.m
r19897 r20690 69 69 70 70 end % }}} 71 function md = marshall(self, md,fid) % {{{71 function md = marshall(self,prefix,md,fid) % {{{ 72 72 73 WriteData(fid, 'object',self,'fieldname','name','format','String');74 WriteData(fid, 'object',self,'fieldname','definitionenum','format','Integer');75 WriteData(fid, 'object',self,'fieldname','namex','format','String');76 WriteData(fid, 'object',self,'fieldname','namey','format','String');77 WriteData(fid, 'object',self,'fieldname','alpha','format','Double');78 WriteData(fid, 'object',self,'fieldname','beta','format','Double');73 WriteData(fid,prefix,'object',self,'fieldname','name','format','String'); 74 WriteData(fid,prefix,'object',self,'fieldname','definitionenum','format','Integer'); 75 WriteData(fid,prefix,'object',self,'fieldname','namex','format','String'); 76 WriteData(fid,prefix,'object',self,'fieldname','namey','format','String'); 77 WriteData(fid,prefix,'object',self,'fieldname','alpha','format','Double'); 78 WriteData(fid,prefix,'object',self,'fieldname','beta','format','Double'); 79 79 80 80 end % }}} -
issm/trunk-jpl/src/m/classes/massfluxatgate.m
r19040 r20690 55 55 56 56 end % }}} 57 function marshall(self, md,fid) % {{{57 function marshall(self,prefix,md,fid) % {{{ 58 58 59 59 %before marshalling, we need to create the segments out of the profilename: … … 61 61 62 62 %ok, marshall name and segments: 63 WriteData(fid, 'object',self,'fieldname','name','format','String');64 WriteData(fid, 'object',self,'fieldname','definitionenum','format','Integer');65 WriteData(fid, 'object',self,'fieldname','segments','format','DoubleMat','mattype',1);63 WriteData(fid,prefix,'data',self.name,'name','md.massfluxatgate.name','format','String'); 64 WriteData(fid,prefix,'data',self.definitionenum,'name','md.massfluxatgate.definitionenum','format','Integer'); 65 WriteData(fid,prefix,'data',self.segments,'name','md.massfluxatgate.segments','format','DoubleMat','mattype',1); 66 66 67 67 end % }}} -
issm/trunk-jpl/src/m/classes/massfluxatgate.py
r18944 r20690 59 59 return md 60 60 # }}} 61 def marshall(self, md,fid): # {{{61 def marshall(self,prefix,md,fid): # {{{ 62 62 63 63 #before marshalling, we need to create the segments out of the profilename: … … 65 65 66 66 #ok, marshall name and segments: 67 WriteData(fid, 'object',self,'fieldname','name','format','String')68 WriteData(fid, 'object',self,'fieldname','definitionenum','format','Integer')69 WriteData(fid, 'object',self,'fieldname','segments','format','DoubleMat','mattype',1)67 WriteData(fid,prefix,'data',self.name,'name','md.massfluxatgate.name','format','String'); 68 WriteData(fid,prefix,'data',self.definitionenum,'name','md.massfluxatgate.definitionenum','format','Integer'); 69 WriteData(fid,prefix,'data',self.segments,'name','md.massfluxatgate.segments','format','DoubleMat','mattype',1); 70 70 71 71 # }}} -
issm/trunk-jpl/src/m/classes/masstransport.js
r19903 r20690 58 58 var yts=365.*24.*3600.; 59 59 60 WriteData(fid, 'object',this,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);61 WriteData(fid, 'object',this,'fieldname','isfreesurface','format','Boolean');62 WriteData(fid, 'object',this,'fieldname','min_thickness','format','Double');63 WriteData(fid, 'data',StringToEnum(this.hydrostatic_adjustment),'format','Integer','enum',MasstransportHydrostaticAdjustmentEnum());64 WriteData(fid, 'object',this,'fieldname','stabilization','format','Integer');65 WriteData(fid, 'object',this,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);66 WriteData(fid, 'object',this,'fieldname','penalty_factor','format','Double');60 WriteData(fid,prefix,'object',this,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 61 WriteData(fid,prefix,'object',this,'fieldname','isfreesurface','format','Boolean'); 62 WriteData(fid,prefix,'object',this,'fieldname','min_thickness','format','Double'); 63 WriteData(fid,prefix,'data',StringToEnum(this.hydrostatic_adjustment),'format','Integer','name','md.masstransport.hydrostatic_adjustment'); 64 WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer'); 65 WriteData(fid,prefix,'object',this,'fieldname','vertex_pairing','format','DoubleMat','mattype',3); 66 WriteData(fid,prefix,'object',this,'fieldname','penalty_factor','format','Double'); 67 67 68 68 //process requested outputs … … 75 75 } 76 76 } 77 WriteData(fid, 'data',outputs,'enum',MasstransportRequestedOutputsEnum(),'format','StringArray');77 WriteData(fid,prefix,'data',outputs,'name','md.masstransport.requested_outputs','format','StringArray'); 78 78 }//}}} 79 79 this.defaultoutputs = function(md) { //{{{ -
issm/trunk-jpl/src/m/classes/masstransport.m
r20263 r20690 111 111 112 112 end % }}} 113 function marshall(self, md,fid) % {{{113 function marshall(self,prefix,md,fid) % {{{ 114 114 115 115 yts=365.*24.*3600.; 116 116 117 WriteData(fid, 'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);118 WriteData(fid, 'object',self,'fieldname','isfreesurface','format','Boolean');119 WriteData(fid, 'object',self,'fieldname','min_thickness','format','Double');120 WriteData(fid, 'data',StringToEnum(self.hydrostatic_adjustment),'format','Integer','enum',MasstransportHydrostaticAdjustmentEnum());121 WriteData(fid, 'object',self,'fieldname','stabilization','format','Integer');122 WriteData(fid, 'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3);123 WriteData(fid, 'object',self,'fieldname','penalty_factor','format','Double');117 WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 118 WriteData(fid,prefix,'object',self,'fieldname','isfreesurface','format','Boolean'); 119 WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double'); 120 WriteData(fid,prefix,'data',StringToEnum(self.hydrostatic_adjustment),'format','Integer','name','md.masstransport.hydrostatic_adjustment'); 121 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer'); 122 WriteData(fid,prefix,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3); 123 WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double'); 124 124 125 125 %process requested outputs … … 130 130 outputs = [outputs defaultoutputs(self,md)]; %add defaults 131 131 end 132 WriteData(fid, 'data',outputs,'enum',MasstransportRequestedOutputsEnum,'format','StringArray');132 WriteData(fid,prefix,'data',outputs,'name','md.masstransport.requested_outputs','format','StringArray'); 133 133 end % }}} 134 134 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/masstransport.py
r19903 r20690 81 81 return md 82 82 # }}} 83 def marshall(self, md,fid): # {{{83 def marshall(self,prefix,md,fid): # {{{ 84 84 85 85 yts=365.*24.*3600. 86 86 87 WriteData(fid, 'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)88 WriteData(fid, 'object',self,'fieldname','isfreesurface','format','Boolean')89 WriteData(fid, 'object',self,'fieldname','min_thickness','format','Double')90 WriteData(fid, 'data',StringToEnum(self.hydrostatic_adjustment)[0],'format','Integer','enum',MasstransportHydrostaticAdjustmentEnum())91 WriteData(fid, 'object',self,'fieldname','stabilization','format','Integer')92 WriteData(fid, 'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3)93 WriteData(fid, 'object',self,'fieldname','penalty_factor','format','Double')87 WriteData(fid,prefix,'object',self,'fieldname','spcthickness','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 88 WriteData(fid,prefix,'object',self,'fieldname','isfreesurface','format','Boolean') 89 WriteData(fid,prefix,'object',self,'fieldname','min_thickness','format','Double') 90 WriteData(fid,prefix,'data',StringToEnum(self.hydrostatic_adjustment)[0],'format','Integer','name','md.masstransport.hydrostatic_adjustment') 91 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer') 92 WriteData(fid,prefix,'object',self,'fieldname','vertex_pairing','format','DoubleMat','mattype',3) 93 WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double') 94 94 95 95 #process requested outputs … … 99 99 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 100 100 outputs =outputscopy 101 WriteData(fid, 'data',outputs,'enum',MasstransportRequestedOutputsEnum(),'format','StringArray')101 WriteData(fid,prefix,'data',outputs,'name','md.masstransport.requested_outputs','format','StringArray') 102 102 # }}} -
issm/trunk-jpl/src/m/classes/matdamageice.m
r20622 r20690 152 152 fielddisplay(self,'earth_density','Mantle density [kg/m^-3]'); 153 153 end % }}} 154 function marshall(self, md,fid) % {{{155 WriteData(fid, 'enum',MaterialsEnum(),'data',MatdamageiceEnum(),'format','Integer');156 WriteData(fid, 'object',self,'class','materials','fieldname','rho_ice','format','Double');157 WriteData(fid, 'object',self,'class','materials','fieldname','rho_water','enum',MaterialsRhoSeawaterEnum(),'format','Double');158 WriteData(fid, 'object',self,'class','materials','fieldname','rho_freshwater','format','Double');159 WriteData(fid, 'object',self,'class','materials','fieldname','mu_water','format','Double');160 WriteData(fid, 'object',self,'class','materials','fieldname','heatcapacity','format','Double');161 WriteData(fid, 'object',self,'class','materials','fieldname','latentheat','format','Double');162 WriteData(fid, 'object',self,'class','materials','fieldname','thermalconductivity','format','Double');163 WriteData(fid, 'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');164 WriteData(fid, 'object',self,'class','materials','fieldname','meltingpoint','format','Double');165 WriteData(fid, 'object',self,'class','materials','fieldname','beta','format','Double');166 WriteData(fid, 'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');167 WriteData(fid, 'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');168 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1);169 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);170 WriteData(fid, 'data',StringToEnum(self.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');154 function marshall(self,prefix,md,fid) % {{{ 155 WriteData(fid,prefix,'name','md.materials.type','data',MatdamageiceEnum(),'format','Integer'); 156 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double'); 157 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double'); 158 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double'); 159 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double'); 160 WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double'); 161 WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double'); 162 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double'); 163 WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double'); 164 WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double'); 165 WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double'); 166 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double'); 167 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double'); 168 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1); 169 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2); 170 WriteData(fid,prefix,'data',StringToEnum(self.rheology_law),'name','md.materials.rheology_law','format','Integer'); 171 171 172 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');173 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);174 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');175 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);176 WriteData(fid, 'object',self,'class','materials','fieldname','earth_density','format','Double');172 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double'); 173 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3); 174 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double'); 175 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3); 176 WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double'); 177 177 178 178 end % }}} -
issm/trunk-jpl/src/m/classes/matdamageice.py
r20622 r20690 144 144 return md 145 145 # }}} 146 def marshall(self, md,fid): # {{{147 WriteData(fid, 'enum',MaterialsEnum(),'data',MatdamageiceEnum(),'format','Integer');148 WriteData(fid, 'object',self,'class','materials','fieldname','rho_ice','format','Double')149 WriteData(fid, 'object',self,'class','materials','fieldname','rho_water','enum',MaterialsRhoSeawaterEnum(),'format','Double')150 WriteData(fid, 'object',self,'class','materials','fieldname','rho_freshwater','format','Double')151 WriteData(fid, 'object',self,'class','materials','fieldname','mu_water','format','Double')152 WriteData(fid, 'object',self,'class','materials','fieldname','heatcapacity','format','Double')153 WriteData(fid, 'object',self,'class','materials','fieldname','latentheat','format','Double')154 WriteData(fid, 'object',self,'class','materials','fieldname','thermalconductivity','format','Double')155 WriteData(fid, 'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')156 WriteData(fid, 'object',self,'class','materials','fieldname','meltingpoint','format','Double')157 WriteData(fid, 'object',self,'class','materials','fieldname','beta','format','Double')158 WriteData(fid, 'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double')159 WriteData(fid, 'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double')160 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1)161 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)162 WriteData(fid, 'data',StringToEnum(self.rheology_law)[0],'enum',MaterialsRheologyLawEnum(),'format','Integer')146 def marshall(self,prefix,md,fid): # {{{ 147 WriteData(fid,prefix,'name','md.materials.type','data',MatdamageiceEnum(),'format','Integer'); 148 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double') 149 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double') 150 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double') 151 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double') 152 WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double') 153 WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double') 154 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double') 155 WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double') 156 WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double') 157 WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double') 158 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double') 159 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double') 160 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1) 161 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2) 162 WriteData(fid,prefix,'data',StringToEnum(self.rheology_law)[0],'name','md.materials.rheology_law','format','Integer') 163 163 164 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');165 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10.**3.);166 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');167 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10.**3.);168 WriteData(fid, 'object',self,'class','materials','fieldname','earth_density','format','Double');164 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double'); 165 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10.**3.); 166 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double'); 167 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10.**3.); 168 WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double'); 169 169 170 170 # }}} -
issm/trunk-jpl/src/m/classes/matestar.m
r20688 r20690 155 155 fielddisplay(self,'earth_density','Mantle density [kg/m^-3]'); 156 156 end % }}} 157 function marshall(self, md,fid) % {{{158 WriteData(fid, 'enum',MaterialsEnum(),'data',MatestarEnum(),'format','Integer');159 WriteData(fid, 'object',self,'class','materials','fieldname','rho_ice','format','Double');160 WriteData(fid, 'object',self,'class','materials','fieldname','rho_water','enum',MaterialsRhoSeawaterEnum(),'format','Double');161 WriteData(fid, 'object',self,'class','materials','fieldname','rho_freshwater','format','Double');162 WriteData(fid, 'object',self,'class','materials','fieldname','mu_water','format','Double');163 WriteData(fid, 'object',self,'class','materials','fieldname','heatcapacity','format','Double');164 WriteData(fid, 'object',self,'class','materials','fieldname','latentheat','format','Double');165 WriteData(fid, 'object',self,'class','materials','fieldname','thermalconductivity','format','Double');166 WriteData(fid, 'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');167 WriteData(fid, 'object',self,'class','materials','fieldname','meltingpoint','format','Double');168 WriteData(fid, 'object',self,'class','materials','fieldname','beta','format','Double');169 WriteData(fid, 'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');170 WriteData(fid, 'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');171 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_ko','format','DoubleMat','mattype',1);172 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_Ec','format','DoubleMat','mattype',1);173 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_Es','format','DoubleMat','mattype',1);174 WriteData(fid, 'data',StringToEnum(self.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');175 176 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');177 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);178 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');179 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);180 WriteData(fid, 'object',self,'class','materials','fieldname','earth_density','format','Double');157 function marshall(self,prefix,md,fid) % {{{ 158 WriteData(fid,prefix,'name','md.materials.type','data',MatestarEnum(),'format','Integer'); 159 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double'); 160 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double'); 161 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double'); 162 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double'); 163 WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double'); 164 WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double'); 165 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double'); 166 WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double'); 167 WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double'); 168 WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double'); 169 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double'); 170 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double'); 171 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_ko','format','DoubleMat','mattype',1); 172 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_Ec','format','DoubleMat','mattype',1); 173 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_Es','format','DoubleMat','mattype',1); 174 WriteData(fid,prefix,'data',StringToEnum(self.rheology_law),'name','md.materials.rheology_law','format','Integer'); 175 176 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double'); 177 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3); 178 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double'); 179 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3); 180 WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double'); 181 181 end % }}} 182 182 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/matice.js
r20622 r20690 109 109 } // }}} 110 110 this.marshall=function(md,fid) { //{{{ 111 WriteData(fid, 'enum',MaterialsEnum(),'data',MaticeEnum(),'format','Integer');112 WriteData(fid, 'object',this,'class','materials','fieldname','rho_ice','format','Double');113 WriteData(fid, 'object',this,'class','materials','fieldname','rho_water','enum',MaterialsRhoSeawaterEnum(),'format','Double');114 WriteData(fid, 'object',this,'class','materials','fieldname','rho_freshwater','format','Double');115 WriteData(fid, 'object',this,'class','materials','fieldname','mu_water','format','Double');116 WriteData(fid, 'object',this,'class','materials','fieldname','heatcapacity','format','Double');117 WriteData(fid, 'object',this,'class','materials','fieldname','latentheat','format','Double');118 WriteData(fid, 'object',this,'class','materials','fieldname','thermalconductivity','format','Double');119 WriteData(fid, 'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double');120 WriteData(fid, 'object',this,'class','materials','fieldname','meltingpoint','format','Double');121 WriteData(fid, 'object',this,'class','materials','fieldname','beta','format','Double');122 WriteData(fid, 'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double');123 WriteData(fid, 'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double');124 WriteData(fid, 'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);125 WriteData(fid, 'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);126 WriteData(fid, 'data',StringToEnum(this.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');127 WriteData(fid, 'object',this,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');128 WriteData(fid, 'object',this,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);129 WriteData(fid, 'object',this,'class','materials','fieldname','mantle_shear_modulus','format','Double');130 WriteData(fid, 'object',this,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);131 WriteData(fid, 'object',this,'class','materials','fieldname','earth_density','format','Double');111 WriteData(fid,prefix,'name','md.materials.type','data',MaticeEnum(),'format','Integer'); 112 WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_ice','format','Double'); 113 WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_water','format','Double'); 114 WriteData(fid,prefix,'object',this,'class','materials','fieldname','rho_freshwater','format','Double'); 115 WriteData(fid,prefix,'object',this,'class','materials','fieldname','mu_water','format','Double'); 116 WriteData(fid,prefix,'object',this,'class','materials','fieldname','heatcapacity','format','Double'); 117 WriteData(fid,prefix,'object',this,'class','materials','fieldname','latentheat','format','Double'); 118 WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermalconductivity','format','Double'); 119 WriteData(fid,prefix,'object',this,'class','materials','fieldname','temperateiceconductivity','format','Double'); 120 WriteData(fid,prefix,'object',this,'class','materials','fieldname','meltingpoint','format','Double'); 121 WriteData(fid,prefix,'object',this,'class','materials','fieldname','beta','format','Double'); 122 WriteData(fid,prefix,'object',this,'class','materials','fieldname','mixed_layer_capacity','format','Double'); 123 WriteData(fid,prefix,'object',this,'class','materials','fieldname','thermal_exchange_velocity','format','Double'); 124 WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 125 WriteData(fid,prefix,'object',this,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2); 126 WriteData(fid,prefix,'data',StringToEnum(this.rheology_law),'name','md.materials.rheology_law','format','Integer'); 127 WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_shear_modulus','format','Double'); 128 WriteData(fid,prefix,'object',this,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3); 129 WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_shear_modulus','format','Double'); 130 WriteData(fid,prefix,'object',this,'class','materials','fieldname','mantle_density','format','Double','scale',10^3); 131 WriteData(fid,prefix,'object',this,'class','materials','fieldname','earth_density','format','Double'); 132 132 133 133 }//}}} -
issm/trunk-jpl/src/m/classes/matice.m
r20622 r20690 151 151 fielddisplay(self,'earth_density','Mantle density [kg/m^-3]'); 152 152 end % }}} 153 function marshall(self, md,fid) % {{{154 WriteData(fid, 'enum',MaterialsEnum(),'data',MaticeEnum(),'format','Integer');155 WriteData(fid, 'object',self,'class','materials','fieldname','rho_ice','format','Double');156 WriteData(fid, 'object',self,'class','materials','fieldname','rho_water','enum',MaterialsRhoSeawaterEnum(),'format','Double');157 WriteData(fid, 'object',self,'class','materials','fieldname','rho_freshwater','format','Double');158 WriteData(fid, 'object',self,'class','materials','fieldname','mu_water','format','Double');159 WriteData(fid, 'object',self,'class','materials','fieldname','heatcapacity','format','Double');160 WriteData(fid, 'object',self,'class','materials','fieldname','latentheat','format','Double');161 WriteData(fid, 'object',self,'class','materials','fieldname','thermalconductivity','format','Double');162 WriteData(fid, 'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double');163 WriteData(fid, 'object',self,'class','materials','fieldname','meltingpoint','format','Double');164 WriteData(fid, 'object',self,'class','materials','fieldname','beta','format','Double');165 WriteData(fid, 'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double');166 WriteData(fid, 'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double');167 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);168 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2);169 WriteData(fid, 'data',StringToEnum(self.rheology_law),'enum',MaterialsRheologyLawEnum(),'format','Integer');170 171 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');172 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3);173 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');174 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3);175 WriteData(fid, 'object',self,'class','materials','fieldname','earth_density','format','Double');153 function marshall(self,prefix,md,fid) % {{{ 154 WriteData(fid,prefix,'name','md.materials.type','data',MaticeEnum(),'format','Integer'); 155 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double'); 156 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double'); 157 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double'); 158 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double'); 159 WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double'); 160 WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double'); 161 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double'); 162 WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double'); 163 WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double'); 164 WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double'); 165 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double'); 166 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double'); 167 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 168 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2); 169 WriteData(fid,prefix,'data',StringToEnum(self.rheology_law),'name','md.materials.rheology_law','format','Integer'); 170 171 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double'); 172 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10^3); 173 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double'); 174 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10^3); 175 WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double'); 176 176 end % }}} 177 177 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/matice.py
r20622 r20690 145 145 return md 146 146 # }}} 147 def marshall(self, md,fid): # {{{148 WriteData(fid, 'enum',MaterialsEnum(),'data',MaticeEnum(),'format','Integer');149 WriteData(fid, 'object',self,'class','materials','fieldname','rho_ice','format','Double')150 WriteData(fid, 'object',self,'class','materials','fieldname','rho_water','enum',MaterialsRhoSeawaterEnum(),'format','Double')151 WriteData(fid, 'object',self,'class','materials','fieldname','rho_freshwater','format','Double')152 WriteData(fid, 'object',self,'class','materials','fieldname','mu_water','format','Double')153 WriteData(fid, 'object',self,'class','materials','fieldname','heatcapacity','format','Double')154 WriteData(fid, 'object',self,'class','materials','fieldname','latentheat','format','Double')155 WriteData(fid, 'object',self,'class','materials','fieldname','thermalconductivity','format','Double')156 WriteData(fid, 'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double')157 WriteData(fid, 'object',self,'class','materials','fieldname','meltingpoint','format','Double')158 WriteData(fid, 'object',self,'class','materials','fieldname','beta','format','Double')159 WriteData(fid, 'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double')160 WriteData(fid, 'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double')161 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)162 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1)163 WriteData(fid, 'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2)164 WriteData(fid, 'data',StringToEnum(self.rheology_law)[0],'enum',MaterialsRheologyLawEnum(),'format','Integer')147 def marshall(self,prefix,md,fid): # {{{ 148 WriteData(fid,prefix,'name','md.materials.type','data',MaticeEnum(),'format','Integer'); 149 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_ice','format','Double') 150 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_water','format','Double') 151 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rho_freshwater','format','Double') 152 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mu_water','format','Double') 153 WriteData(fid,prefix,'object',self,'class','materials','fieldname','heatcapacity','format','Double') 154 WriteData(fid,prefix,'object',self,'class','materials','fieldname','latentheat','format','Double') 155 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermalconductivity','format','Double') 156 WriteData(fid,prefix,'object',self,'class','materials','fieldname','temperateiceconductivity','format','Double') 157 WriteData(fid,prefix,'object',self,'class','materials','fieldname','meltingpoint','format','Double') 158 WriteData(fid,prefix,'object',self,'class','materials','fieldname','beta','format','Double') 159 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mixed_layer_capacity','format','Double') 160 WriteData(fid,prefix,'object',self,'class','materials','fieldname','thermal_exchange_velocity','format','Double') 161 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 162 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_B','format','DoubleMat','mattype',1) 163 WriteData(fid,prefix,'object',self,'class','materials','fieldname','rheology_n','format','DoubleMat','mattype',2) 164 WriteData(fid,prefix,'data',StringToEnum(self.rheology_law)[0],'name','md.materials.rheology_law','format','Integer') 165 165 166 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double');167 WriteData(fid, 'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10.**3.);168 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double');169 WriteData(fid, 'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10.**3.);170 WriteData(fid, 'object',self,'class','materials','fieldname','earth_density','format','Double');166 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_shear_modulus','format','Double'); 167 WriteData(fid,prefix,'object',self,'class','materials','fieldname','lithosphere_density','format','Double','scale',10.**3.); 168 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_shear_modulus','format','Double'); 169 WriteData(fid,prefix,'object',self,'class','materials','fieldname','mantle_density','format','Double','scale',10.**3.); 170 WriteData(fid,prefix,'object',self,'class','materials','fieldname','earth_density','format','Double'); 171 171 172 172 # }}} -
issm/trunk-jpl/src/m/classes/mesh2d.js
r19901 r20690 80 80 } // }}} 81 81 this.marshall=function(md,fid) { //{{{ 82 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum('Domain' + this.domaintype()),'format','Integer');83 WriteData(fid, 'enum',DomainDimensionEnum(),'data',this.dimension(),'format','Integer');84 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(this.elementtype()),'format','Integer');85 WriteData(fid, 'object',this,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);86 WriteData(fid, 'object',this,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);87 WriteData(fid, 'enum',MeshZEnum(),'data',NewArrayFill(this.numberofvertices,0),'format','DoubleMat','mattype',1);88 WriteData(fid, 'object',this,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);89 WriteData(fid, 'object',this,'class','mesh','fieldname','numberofelements','format','Integer');90 WriteData(fid, 'object',this,'class','mesh','fieldname','numberofvertices','format','Integer');91 WriteData(fid, 'object',this,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');92 WriteData(fid, 'object',this,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1);93 WriteData(fid, 'object',this,'class','mesh','fieldname','segments','format','DoubleMat','mattype',3);82 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum('Domain' + this.domaintype()),'format','Integer'); 83 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',this.dimension(),'format','Integer'); 84 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(this.elementtype()),'format','Integer'); 85 WriteData(fid,prefix,'object',this,'class','mesh','fieldname','x','format','DoubleMat','mattype',1); 86 WriteData(fid,prefix,'object',this,'class','mesh','fieldname','y','format','DoubleMat','mattype',1); 87 WriteData(fid,prefix,'name','md.mesh.z','data',NewArrayFill(this.numberofvertices,0),'format','DoubleMat','mattype',1); 88 WriteData(fid,prefix,'object',this,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2); 89 WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberofelements','format','Integer'); 90 WriteData(fid,prefix,'object',this,'class','mesh','fieldname','numberofvertices','format','Integer'); 91 WriteData(fid,prefix,'object',this,'class','mesh','fieldname','average_vertex_connectivity','format','Integer'); 92 WriteData(fid,prefix,'object',this,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1); 93 WriteData(fid,prefix,'object',this,'class','mesh','fieldname','segments','format','DoubleMat','mattype',3); 94 94 }//}}} 95 95 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/mesh2d.m
r19897 r20690 127 127 fielddisplay(self,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)'); 128 128 end % }}} 129 function marshall(self, md,fid) % {{{130 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum(['Domain' domaintype(self)]),'format','Integer');131 WriteData(fid, 'enum',DomainDimensionEnum(),'data',dimension(self),'format','Integer');132 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(elementtype(self)),'format','Integer');133 WriteData(fid, 'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);134 WriteData(fid, 'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);135 WriteData(fid, 'enum',MeshZEnum(),'data',zeros(self.numberofvertices,1),'format','DoubleMat','mattype',1);136 WriteData(fid, 'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);137 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements','format','Integer');138 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');139 WriteData(fid, 'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');140 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1);141 WriteData(fid, 'object',self,'class','mesh','fieldname','segments','format','DoubleMat','mattype',3);129 function marshall(self,prefix,md,fid) % {{{ 130 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum(['Domain' domaintype(self)]),'format','Integer'); 131 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(self),'format','Integer'); 132 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(elementtype(self)),'format','Integer'); 133 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1); 134 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1); 135 WriteData(fid,prefix,'name','md.mesh.z','data',zeros(self.numberofvertices,1),'format','DoubleMat','mattype',1); 136 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2); 137 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer'); 138 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer'); 139 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer'); 140 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1); 141 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','segments','format','DoubleMat','mattype',3); 142 142 end % }}} 143 143 function t = domaintype(self) % {{{ -
issm/trunk-jpl/src/m/classes/mesh2d.py
r19897 r20690 107 107 return "Tria" 108 108 #}}} 109 def marshall(self, md,fid): # {{{110 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum("Domain"+self.domaintype())[0],'format','Integer');111 WriteData(fid, 'enum',DomainDimensionEnum(),'data',self.dimension(),'format','Integer');112 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(self.elementtype())[0],'format','Integer');113 WriteData(fid, 'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1)114 WriteData(fid, 'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1)115 WriteData(fid, 'enum',MeshZEnum(),'data',numpy.zeros(self.numberofvertices),'format','DoubleMat','mattype',1);116 WriteData(fid, 'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2)117 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements','format','Integer')118 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices','format','Integer')119 WriteData(fid, 'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer')109 def marshall(self,prefix,md,fid): # {{{ 110 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum("Domain"+self.domaintype())[0],'format','Integer'); 111 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',self.dimension(),'format','Integer'); 112 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(self.elementtype())[0],'format','Integer'); 113 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1) 114 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1) 115 WriteData(fid,prefix,'name','md.mesh.z','data',numpy.zeros(self.numberofvertices),'format','DoubleMat','mattype',1); 116 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2) 117 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer') 118 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer') 119 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer') 120 120 # }}} -
issm/trunk-jpl/src/m/classes/mesh2dvertical.m
r20671 r20690 125 125 fielddisplay(self,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)'); 126 126 end % }}} 127 function marshall(self, md,fid) % {{{128 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum(['Domain' domaintype(self)]),'format','Integer');129 WriteData(fid, 'enum',DomainDimensionEnum(),'data',dimension(self),'format','Integer');130 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(elementtype(self)),'format','Integer');131 WriteData(fid, 'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);132 WriteData(fid, 'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);133 WriteData(fid, 'enum',MeshZEnum(),'data',zeros(self.numberofvertices,1),'format','DoubleMat','mattype',1);134 WriteData(fid, 'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);135 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements','format','Integer');136 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');137 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1);138 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1);139 WriteData(fid, 'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');127 function marshall(self,prefix,md,fid) % {{{ 128 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum(['Domain' domaintype(self)]),'format','Integer'); 129 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(self),'format','Integer'); 130 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(elementtype(self)),'format','Integer'); 131 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1); 132 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1); 133 WriteData(fid,prefix,'name','md.mesh.z','data',zeros(self.numberofvertices,1),'format','DoubleMat','mattype',1); 134 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2); 135 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer'); 136 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer'); 137 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1); 138 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1); 139 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer'); 140 140 end % }}} 141 141 function t = domaintype(self) % {{{ -
issm/trunk-jpl/src/m/classes/mesh3dprisms.m
r19958 r20690 149 149 fielddisplay(self,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)'); 150 150 end % }}} 151 function marshall(self, md,fid) % {{{152 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum(['Domain' domaintype(self)]),'format','Integer');153 WriteData(fid, 'enum',DomainDimensionEnum(),'data',dimension(self),'format','Integer');154 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(elementtype(self)),'format','Integer');155 WriteData(fid, 'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);156 WriteData(fid, 'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);157 WriteData(fid, 'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1);158 WriteData(fid, 'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);159 WriteData(fid, 'object',self,'class','mesh','fieldname','numberoflayers','format','Integer');160 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements','format','Integer');161 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');162 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1);163 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1);164 WriteData(fid, 'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2);165 WriteData(fid, 'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2);166 WriteData(fid, 'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');167 WriteData(fid, 'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3);168 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer');169 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer');151 function marshall(self,prefix,md,fid) % {{{ 152 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum(['Domain' domaintype(self)]),'format','Integer'); 153 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(self),'format','Integer'); 154 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(elementtype(self)),'format','Integer'); 155 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1); 156 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1); 157 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1); 158 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2); 159 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberoflayers','format','Integer'); 160 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer'); 161 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer'); 162 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1); 163 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1); 164 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2); 165 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2); 166 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer'); 167 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3); 168 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer'); 169 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer'); 170 170 end % }}} 171 171 function type = domaintype(self) % {{{ -
issm/trunk-jpl/src/m/classes/mesh3dprisms.py
r19897 r20690 131 131 return "Penta" 132 132 #}}} 133 def marshall(self, md,fid): # {{{134 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum("Domain"+self.domaintype())[0],'format','Integer');135 WriteData(fid, 'enum',DomainDimensionEnum(),'data',self.dimension(),'format','Integer');136 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(self.elementtype())[0],'format','Integer');137 WriteData(fid, 'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1)138 WriteData(fid, 'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1)139 WriteData(fid, 'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1)140 WriteData(fid, 'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2)141 WriteData(fid, 'object',self,'class','mesh','fieldname','numberoflayers','format','Integer')142 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements','format','Integer')143 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices','format','Integer')144 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1)145 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1)146 WriteData(fid, 'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2)147 WriteData(fid, 'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2)148 WriteData(fid, 'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer')149 WriteData(fid, 'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3)150 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer')151 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer')133 def marshall(self,prefix,md,fid): # {{{ 134 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum("Domain"+self.domaintype())[0],'format','Integer'); 135 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',self.dimension(),'format','Integer'); 136 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(self.elementtype())[0],'format','Integer'); 137 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1) 138 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1) 139 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1) 140 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2) 141 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberoflayers','format','Integer') 142 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer') 143 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer') 144 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1) 145 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1) 146 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2) 147 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2) 148 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer') 149 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3) 150 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer') 151 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer') 152 152 # }}} -
issm/trunk-jpl/src/m/classes/mesh3dsurface.js
r20191 r20690 78 78 } // }}} 79 79 this.marshall=function(md,fid) { //{{{ 80 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum('Domain' + this.domaintype()),'format','Integer');81 WriteData(fid, 'enum',DomainDimensionEnum(),'data',this.dimension(),'format','Integer');82 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(this.elementtype()),'format','Integer');83 WriteData(fid, 'object',this,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);84 WriteData(fid, 'object',this,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);85 WriteData(fid, 'object',this,'class','mesh','fieldname','z','format','DoubleMat','mattype',1);86 WriteData(fid, 'object',this,'class','mesh','fieldname','lat','format','DoubleMat','mattype',1);87 WriteData(fid, 'object',this,'class','mesh','fieldname','long','format','DoubleMat','mattype',1);88 WriteData(fid, 'object',this,'class','mesh','fieldname','r','format','DoubleMat','mattype',1);89 WriteData(fid, 'object',this,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);90 WriteData(fid, 'object',this,'class','mesh','fieldname','numberofelements','format','Integer');91 WriteData(fid, 'object',this,'class','mesh','fieldname','numberofvertices','format','Integer');92 WriteData(fid, 'object',this,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');93 WriteData(fid, 'object',this,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1);94 WriteData(fid, 'object',this,'class','mesh','fieldname','segments','format','DoubleMat','mattype',3);80 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum('Domain' + this.domaintype()),'format','Integer'); 81 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',this.dimension(),'format','Integer'); 82 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(this.elementtype()),'format','Integer'); 83 WriteData(fid,prefix,'object',this,'fieldname','x','format','DoubleMat','mattype',1); 84 WriteData(fid,prefix,'object',this,'fieldname','y','format','DoubleMat','mattype',1); 85 WriteData(fid,prefix,'object',this,'fieldname','z','format','DoubleMat','mattype',1); 86 WriteData(fid,prefix,'object',this,'fieldname','lat','format','DoubleMat','mattype',1); 87 WriteData(fid,prefix,'object',this,'fieldname','long','format','DoubleMat','mattype',1); 88 WriteData(fid,prefix,'object',this,'fieldname','r','format','DoubleMat','mattype',1); 89 WriteData(fid,prefix,'object',this,'fieldname','elements','format','DoubleMat','mattype',2); 90 WriteData(fid,prefix,'object',this,'fieldname','numberofelements','format','Integer'); 91 WriteData(fid,prefix,'object',this,'fieldname','numberofvertices','format','Integer'); 92 WriteData(fid,prefix,'object',this,'fieldname','average_vertex_connectivity','format','Integer'); 93 WriteData(fid,prefix,'object',this,'fieldname','vertexonboundary','format','DoubleMat','mattype',1); 94 WriteData(fid,prefix,'object',this,'fieldname','segments','format','DoubleMat','mattype',3); 95 95 }//}}} 96 96 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/mesh3dsurface.m
r20196 r20690 131 131 end % }}} 132 132 function marshall(obj,md,fid) % {{{ 133 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum(['Domain' domaintype(obj)]),'format','Integer');134 WriteData(fid, 'enum',DomainDimensionEnum(),'data',dimension(obj),'format','Integer');135 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(elementtype(obj)),'format','Integer');136 WriteData(fid, 'object',obj,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);137 WriteData(fid, 'object',obj,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);138 WriteData(fid, 'object',obj,'class','mesh','fieldname','z','format','DoubleMat','mattype',1);139 WriteData(fid, 'enum',MeshLatEnum(),'data',obj.lat,'format','DoubleMat','mattype',1);140 WriteData(fid, 'enum',MeshLongEnum(),'data',obj.long,'format','DoubleMat','mattype',1);141 WriteData(fid, 'object',obj,'class','mesh','fieldname','r','format','DoubleMat','mattype',1);142 WriteData(fid, 'enum',MeshZEnum(),'data',zeros(obj.numberofvertices,1),'format','DoubleMat','mattype',1);143 WriteData(fid, 'object',obj,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);144 WriteData(fid, 'object',obj,'class','mesh','fieldname','numberofelements','format','Integer');145 WriteData(fid, 'object',obj,'class','mesh','fieldname','numberofvertices','format','Integer');146 WriteData(fid, 'object',obj,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');147 WriteData(fid, 'object',obj,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1);133 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum(['Domain' domaintype(obj)]),'format','Integer'); 134 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(obj),'format','Integer'); 135 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(elementtype(obj)),'format','Integer'); 136 WriteData(fid,prefix,'object',obj,'fieldname','x','format','DoubleMat','mattype',1); 137 WriteData(fid,prefix,'object',obj,'fieldname','y','format','DoubleMat','mattype',1); 138 WriteData(fid,prefix,'object',obj,'fieldname','z','format','DoubleMat','mattype',1); 139 WriteData(fid,prefix,'object',obj,'fieldname','lat','data',obj.lat,'format','DoubleMat','mattype',1); 140 WriteData(fid,prefix,'object',obj,'fieldname','long','data',obj.long,'format','DoubleMat','mattype',1); 141 WriteData(fid,prefix,'object',obj,'fieldname','r','format','DoubleMat','mattype',1); 142 WriteData(fid,prefix,'name','md.mesh.z','data',zeros(obj.numberofvertices,1),'format','DoubleMat','mattype',1); 143 WriteData(fid,prefix,'object',obj,'fieldname','elements','format','DoubleMat','mattype',2); 144 WriteData(fid,prefix,'object',obj,'fieldname','numberofelements','format','Integer'); 145 WriteData(fid,prefix,'object',obj,'fieldname','numberofvertices','format','Integer'); 146 WriteData(fid,prefix,'object',obj,'fieldname','average_vertex_connectivity','format','Integer'); 147 WriteData(fid,prefix,'object',obj,'fieldname','vertexonboundary','format','DoubleMat','mattype',1); 148 148 end % }}} 149 149 function t = domaintype(obj) % {{{ -
issm/trunk-jpl/src/m/classes/mesh3dsurface.py
r20278 r20690 130 130 return md 131 131 # }}} 132 def marshall(self, md,fid): # {{{133 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum('Domain' + self.domaintype())[0],'format','Integer')134 WriteData(fid, 'enum',DomainDimensionEnum(),'data',self.dimension(),'format','Integer')135 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(self.elementtype())[0],'format','Integer')136 WriteData(fid, 'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1)137 WriteData(fid, 'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1)138 WriteData(fid, 'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1)139 WriteData(fid, 'enum',MeshLatEnum(),'data',md.mesh.lat,'format','DoubleMat','mattype',1)140 WriteData(fid, 'enum',MeshLongEnum(),'data',md.mesh.long,'format','DoubleMat','mattype',1)141 WriteData(fid, 'object',self,'class','mesh','fieldname','r','format','DoubleMat','mattype',1)142 WriteData(fid, 'enum',MeshZEnum(),'data',zeros(md.mesh.numberofvertices),'format','DoubleMat','mattype',1)143 WriteData(fid, 'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2)144 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements','format','Integer')145 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices','format','Integer')146 WriteData(fid, 'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer')147 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonboundary','format','DoubleMat','mattype',1)132 def marshall(self,prefix,md,fid): # {{{ 133 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum('Domain' + self.domaintype())[0],'format','Integer') 134 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',self.dimension(),'format','Integer') 135 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(self.elementtype())[0],'format','Integer') 136 WriteData(fid,prefix,'object',self,'fieldname','x','format','DoubleMat','mattype',1) 137 WriteData(fid,prefix,'object',self,'fieldname','y','format','DoubleMat','mattype',1) 138 WriteData(fid,prefix,'object',self,'fieldname','z','format','DoubleMat','mattype',1) 139 WriteData(fid,prefix,'object',self,'fieldname','lat','format','DoubleMat','mattype',1) 140 WriteData(fid,prefix,'object',self,'fieldname','long','format','DoubleMat','mattype',1) 141 WriteData(fid,prefix,'object',self,'fieldname','r','format','DoubleMat','mattype',1) 142 WriteData(fid,prefix,'name','md.mesh.z','data',zeros(md.mesh.numberofvertices),'format','DoubleMat','mattype',1) 143 WriteData(fid,prefix,'object',self,'fieldname','elements','format','DoubleMat','mattype',2) 144 WriteData(fid,prefix,'object',self,'fieldname','numberofelements','format','Integer') 145 WriteData(fid,prefix,'object',self,'fieldname','numberofvertices','format','Integer') 146 WriteData(fid,prefix,'object',self,'fieldname','average_vertex_connectivity','format','Integer') 147 WriteData(fid,prefix,'object',self,'fieldname','vertexonboundary','format','DoubleMat','mattype',1) 148 148 # }}} 149 149 def domaintype(self): # {{{ -
issm/trunk-jpl/src/m/classes/mesh3dtetras.m
r19958 r20690 149 149 fielddisplay(self,'epsg','EPSG code (ex: 3413 for UPS Greenland, 3031 for UPS Antarctica)'); 150 150 end % }}} 151 function marshall(self, md,fid) % {{{152 WriteData(fid, 'enum',DomainTypeEnum(),'data',StringToEnum(['Domain' domaintype(self)]),'format','Integer');153 WriteData(fid, 'enum',DomainDimensionEnum(),'data',dimension(self),'format','Integer');154 WriteData(fid, 'enum',MeshElementtypeEnum(),'data',StringToEnum(elementtype(self)),'format','Integer');155 WriteData(fid, 'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1);156 WriteData(fid, 'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1);157 WriteData(fid, 'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1);158 WriteData(fid, 'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2);159 WriteData(fid, 'object',self,'class','mesh','fieldname','numberoflayers','format','Integer');160 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements','format','Integer');161 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices','format','Integer');162 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1);163 WriteData(fid, 'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1);164 WriteData(fid, 'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2);165 WriteData(fid, 'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2);166 WriteData(fid, 'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer');167 WriteData(fid, 'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3);168 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer');169 WriteData(fid, 'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer');151 function marshall(self,prefix,md,fid) % {{{ 152 WriteData(fid,prefix,'name','md.mesh.domain_type','data',StringToEnum(['Domain' domaintype(self)]),'format','Integer'); 153 WriteData(fid,prefix,'name','md.mesh.domain_dimension','data',dimension(self),'format','Integer'); 154 WriteData(fid,prefix,'name','md.mesh.elementtype','data',StringToEnum(elementtype(self)),'format','Integer'); 155 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','x','format','DoubleMat','mattype',1); 156 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','y','format','DoubleMat','mattype',1); 157 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','z','format','DoubleMat','mattype',1); 158 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements','format','DoubleMat','mattype',2); 159 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberoflayers','format','Integer'); 160 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements','format','Integer'); 161 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices','format','Integer'); 162 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonbase','format','BooleanMat','mattype',1); 163 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','vertexonsurface','format','BooleanMat','mattype',1); 164 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','lowerelements','format','DoubleMat','mattype',2); 165 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','upperelements','format','DoubleMat','mattype',2); 166 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','average_vertex_connectivity','format','Integer'); 167 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','elements2d','format','DoubleMat','mattype',3); 168 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofvertices2d','format','Integer'); 169 WriteData(fid,prefix,'object',self,'class','mesh','fieldname','numberofelements2d','format','Integer'); 170 170 end % }}} 171 171 function t = domaintype(self) % {{{ -
issm/trunk-jpl/src/m/classes/miscellaneous.js
r19860 r20690 25 25 }// }}} 26 26 this.marshall=function(md,fid) { //{{{ 27 WriteData(fid, 'object',this,'fieldname','name','format','String');27 WriteData(fid,prefix,'object',this,'fieldname','name','format','String'); 28 28 }//}}} 29 29 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/miscellaneous.m
r20540 r20690 35 35 36 36 end % }}} 37 function marshall(self, md,fid) % {{{38 WriteData(fid, 'object',self,'fieldname','name','format','String');37 function marshall(self,prefix,md,fid) % {{{ 38 WriteData(fid,prefix,'object',self,'fieldname','name','format','String'); 39 39 end % }}} 40 40 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/miscellaneous.py
r17497 r20690 37 37 return md 38 38 # }}} 39 def marshall(self, md,fid): # {{{40 WriteData(fid, 'object',self,'fieldname','name','format','String')39 def marshall(self,prefix,md,fid): # {{{ 40 WriteData(fid,prefix,'object',self,'fieldname','name','format','String'); 41 41 # }}} -
issm/trunk-jpl/src/m/classes/misfit.m
r19897 r20690 84 84 85 85 end % }}} 86 function md = marshall(self, md,fid) % {{{86 function md = marshall(self,prefix,md,fid) % {{{ 87 87 88 WriteData(fid, 'object',self,'fieldname','name','format','String');89 WriteData(fid, 'object',self,'fieldname','definitionenum','format','Integer');90 WriteData(fid, 'object',self,'fieldname','model_enum','format','Integer');91 WriteData(fid, 'object',self,'fieldname','observation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);92 WriteData(fid, 'object',self,'fieldname','observation_enum','format','Integer');93 WriteData(fid, 'object',self,'fieldname','local','format','Integer');94 WriteData(fid, 'object',self,'fieldname','timeinterpolation','format','String');95 WriteData(fid, 'object',self,'fieldname','weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);96 WriteData(fid, 'object',self,'fieldname','weights_enum','format','Integer');88 WriteData(fid,prefix,'data',self.name,'name','md.misfit.name','format','String'); 89 WriteData(fid,prefix,'data',self.definitionenum,'name','md.misfit.definitionenum','format','Integer'); 90 WriteData(fid,prefix,'data',self.model_enum,'name','md.misfit.model_enum','format','Integer'); 91 WriteData(fid,prefix,'data',self.observation,'name','md.misfit.observation','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 92 WriteData(fid,prefix,'data',self.observation_enum,'name','md.misfit.observation_enum','format','Integer'); 93 WriteData(fid,prefix,'data',self.local,'name','md.misfit.local','format','Integer'); 94 WriteData(fid,prefix,'data',self.timeinterpolation,'name','md.misfit.timeinterpolation','format','String'); 95 WriteData(fid,prefix,'data',self.weights,'name','md.misfit.weights','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 96 WriteData(fid,prefix,'data',self.weights_enum,'name','md.misfit.weights_enum','format','Integer'); 97 97 98 98 end % }}} -
issm/trunk-jpl/src/m/classes/mismipbasalforcings.m
r19958 r20690 78 78 79 79 end % }}} 80 function marshall(self, md,fid) % {{{80 function marshall(self,prefix,md,fid) % {{{ 81 81 82 82 yts=365.2422*24.0*3600.0; … … 85 85 floatingice_melting_rate=md.basalforcings.meltrate_factor*tanh((md.geometry.base-md.geometry.bed)./md.basalforcings.threshold_thickness).*max(md.basalforcings.upperdepth_melt-md.geometry.base,0); 86 86 87 WriteData(fid, 'enum',BasalforcingsEnum(),'data',MismipFloatingMeltRateEnum(),'format','Integer');88 WriteData(fid, 'data',floatingice_melting_rate,'format','DoubleMat','enum',BasalforcingsFloatingiceMeltingRateEnum(),'mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)89 WriteData(fid, 'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','enum',BasalforcingsGroundediceMeltingRateEnum(),'mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)90 WriteData(fid, 'object',self,'fieldname','geothermalflux','enum',BasalforcingsGeothermalfluxEnum(),'format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);91 WriteData(fid, 'object',self,'fieldname','meltrate_factor','format','Double','enum',BasalforcingsMeltrateFactorEnum(),'scale',1./yts)92 WriteData(fid, 'object',self,'fieldname','threshold_thickness','format','Double','enum',BasalforcingsThresholdThicknessEnum())93 WriteData(fid, 'object',self,'fieldname','upperdepth_melt','format','Double','enum',BasalforcingsUpperdepthMeltEnum())87 WriteData(fid,prefix,'name','md.basalforcings.model','data',MismipFloatingMeltRateEnum(),'format','Integer'); 88 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) 89 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) 90 WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 91 WriteData(fid,prefix,'object',self,'fieldname','meltrate_factor','format','Double','scale',1./yts) 92 WriteData(fid,prefix,'object',self,'fieldname','threshold_thickness','format','Double') 93 WriteData(fid,prefix,'object',self,'fieldname','upperdepth_melt','format','Double') 94 94 end % }}} 95 95 end -
issm/trunk-jpl/src/m/classes/mismipbasalforcings.py
r19911 r20690 78 78 return md 79 79 # }}} 80 def marshall(self, md,fid): # {{{80 def marshall(self,prefix,md,fid): # {{{ 81 81 82 82 yts=md.constants.yts … … 87 87 floatingice_melting_rate = md.basalforcings.meltrate_factor*numpy.tanh((md.geometry.base-md.geometry.bed)/md.basalforcings.threshold_thickness)*numpy.amax(md.basalforcings.upperdepth_melt-md.geometry.base,0) 88 88 89 WriteData(fid, 'enum',BasalforcingsEnum(),'data',MismipFloatingMeltRateEnum(),'format','Integer')90 WriteData(fid, 'data',floatingice_melting_rate,'format','DoubleMat','enum',BasalforcingsFloatingiceMeltingRateEnum(),'mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)91 WriteData(fid, 'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','enum',BasalforcingsGroundediceMeltingRateEnum(),'mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)92 WriteData(fid, 'object',self,'fieldname','geothermalflux','enum',BasalforcingsGeothermalfluxEnum(),'format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)93 WriteData(fid, 'object',self,'fieldname','meltrate_factor','format','Double','enum',BasalforcingsMeltrateFactorEnum(),'scale',1./yts)94 WriteData(fid, 'object',self,'fieldname','threshold_thickness','format','Double','enum',BasalforcingsThresholdThicknessEnum())95 WriteData(fid, 'object',self,'fieldname','upperdepth_melt','format','Double','enum',BasalforcingsUpperdepthMeltEnum())89 WriteData(fid,prefix,'name','md.basalforcings.model','data',MismipFloatingMeltRateEnum(),'format','Integer') 90 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) 91 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) 92 WriteData(fid,prefix,'object',self,'fieldname','geothermalflux','name','md.basalforcings.geothermalflux','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 93 WriteData(fid,prefix,'object',self,'fieldname','meltrate_factor','format','Double','scale',1./yts) 94 WriteData(fid,prefix,'object',self,'fieldname','threshold_thickness','format','Double') 95 WriteData(fid,prefix,'object',self,'fieldname','upperdepth_melt','format','Double') 96 96 97 97 # }}} -
issm/trunk-jpl/src/m/classes/nodalvalue.m
r20038 r20690 55 55 56 56 end % }}} 57 function md = marshall(self, md,fid) % {{{57 function md = marshall(self,prefix,md,fid) % {{{ 58 58 59 WriteData(fid, 'object',self,'fieldname','name','format','String');60 WriteData(fid, 'object',self,'fieldname','definitionenum','format','Integer');61 WriteData(fid, 'object',self,'fieldname','model_enum','format','Integer');62 WriteData(fid, 'object',self,'fieldname','node','format','Integer');59 WriteData(fid,prefix,'object',self,'fieldname','name','format','String'); 60 WriteData(fid,prefix,'object',self,'fieldname','definitionenum','format','Integer'); 61 WriteData(fid,prefix,'object',self,'fieldname','model_enum','format','Integer'); 62 WriteData(fid,prefix,'object',self,'fieldname','node','format','Integer'); 63 63 64 64 end % }}} -
issm/trunk-jpl/src/m/classes/outputdefinition.js
r20297 r20690 31 31 var enums=NewArrayFill(this.definitions.length,0); 32 32 for (var i=0;i<this.definitions.length;i++){ 33 this.definitions[i].marshall(md,fid );33 this.definitions[i].marshall(md,fid,prefix); 34 34 classdefinition=this.definitions[i].classname(); 35 35 classdefinition=classdefinition.charAt(0).tuUpperCase() + classdefinition.slice(1); //so it matches our enums definitions. … … 38 38 enums=ArrayUnique(enums); 39 39 if (enums.length==0){ enums=NaN; } 40 WriteData(fid, 'data',enums,'enum',OutputdefinitionListEnum(),'format','DoubleMat','mattype',1);40 WriteData(fid,prefix,'data',enums,'name','md.outputdefinition.list','format','DoubleMat','mattype',1); 41 41 }//}}} 42 42 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/outputdefinition.m
r20295 r20690 36 36 37 37 end % }}} 38 function marshall(self, md,fid) % {{{38 function marshall(self,prefix,md,fid) % {{{ 39 39 40 40 enums=zeros(length(self.definitions),1); 41 41 for i=1:length(self.definitions), 42 self.definitions{i}.marshall( md,fid);42 self.definitions{i}.marshall(prefix,md,fid); 43 43 classdefinition=class(self.definitions{i}); 44 44 classdefinition(1)=upper(classdefinition(1)); %so it matches our enums definitions. … … 47 47 enums=unique(enums); 48 48 49 WriteData(fid, 'data',enums,'enum',OutputdefinitionListEnum(),'format','DoubleMat','mattype',1);49 WriteData(fid,prefix,'data',enums,'name','md.outputdefinition.list','format','DoubleMat','mattype',1); 50 50 end % }}} 51 51 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/outputdefinition.py
r17497 r20690 34 34 35 35 # }}} 36 def marshall(self, md,fid): # {{{36 def marshall(self,prefix,md,fid): # {{{ 37 37 38 38 enums=npy.zeros(len(self.definitions),) 39 39 40 40 for i in range(len(self.definitions)): 41 self.definitions[i].marshall( md,fid);41 self.definitions[i].marshall(prefix,md,fid); 42 42 classdefinition=self.definitions[i].__class__.__name__ 43 43 classdefinition=classdefinition[0].upper()+classdefinition[1:] … … 46 46 enums=npy.unique(enums); 47 47 48 WriteData(fid, 'data',enums,'enum',OutputdefinitionListEnum(),'format','DoubleMat','mattype',1);48 WriteData(fid,prefix,'data',enums,'name','md.outputdefinition.list','format','DoubleMat','mattype',1); 49 49 # }}} -
issm/trunk-jpl/src/m/classes/pairoptions.m
r20132 r20690 286 286 function marshall(self,fid,firstindex)% {{{ 287 287 288 error('needs to be revised with new marhsall format...'); 288 289 for i=1:size(self.list,1), 289 290 name = self.list{i,1}; … … 291 292 292 293 %Write option name 293 WriteData(fid, 'enum',(firstindex-1)+2*i-1,'data',name,'format','String');294 WriteData(fid,prefix,'enum',(firstindex-1)+2*i-1,'data',name,'format','String'); 294 295 295 296 %Write option value 296 297 if (isnumeric(value) & numel(value)==1), 297 WriteData(fid, 'enum',(firstindex-1)+2*i,'data',value,'format','Double');298 WriteData(fid,prefix,'enum',(firstindex-1)+2*i,'data',value,'format','Double'); 298 299 elseif ischar(value), 299 WriteData(fid, 'enum',(firstindex-1)+2*i,'data',value,'format','String');300 WriteData(fid,prefix,'enum',(firstindex-1)+2*i,'data',value,'format','String'); 300 301 else 301 302 error(['Cannot marshall option ' name ': format not supported yet']); -
issm/trunk-jpl/src/m/classes/pairoptions.py
r17480 r20690 159 159 160 160 #Write option name 161 WriteData(fid, 'enum',(firstindex-1)+2*i+1,'data',name,'format','String')161 WriteData(fid,prefix,'enum',(firstindex-1)+2*i+1,'data',name,'format','String') 162 162 163 163 #Write option value 164 164 if isinstance(value,(str,unicode)): 165 WriteData(fid, 'enum',(firstindex-1)+2*i+2,'data',value,'format','String')165 WriteData(fid,prefix,'enum',(firstindex-1)+2*i+2,'data',value,'format','String') 166 166 elif isinstance(value,(bool,int,long,float)): 167 WriteData(fid, 'enum',(firstindex-1)+2*i+2,'data',value,'format','Double')167 WriteData(fid,prefix,'enum',(firstindex-1)+2*i+2,'data',value,'format','Double') 168 168 else: 169 169 raise TypeError("Cannot marshall option '%s': format not supported yet." % name) -
issm/trunk-jpl/src/m/classes/plumebasalforcings.m
r20048 r20690 109 109 110 110 end % }}} 111 function marshall(self, md,fid) % {{{111 function marshall(self,prefix,md,fid) % {{{ 112 112 113 113 yts=365.2422*24.0*3600.0; 114 114 115 WriteData(fid, 'enum',BasalforcingsEnum(),'data',MantlePlumeGeothermalFluxEnum(),'format','Integer');116 WriteData(fid, 'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','enum',BasalforcingsFloatingiceMeltingRateEnum(),'mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)117 WriteData(fid, 'object',self,'fieldname','groundedice_melting_rate','format','DoubleMat','enum',BasalforcingsGroundediceMeltingRateEnum(),'mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)118 WriteData(fid, 'object',self,'fieldname','mantleconductivity','format','Double','enum',BasalforcingsMantleconductivityEnum())119 WriteData(fid, 'object',self,'fieldname','nusselt','format','Double','enum',BasalforcingsNusseltEnum())120 WriteData(fid, 'object',self,'fieldname','dtbg','format','Double','enum',BasalforcingsDtbgEnum())121 WriteData(fid, 'object',self,'fieldname','plumeradius','format','Double','enum',BasalforcingsPlumeradiusEnum())122 WriteData(fid, 'object',self,'fieldname','topplumedepth','format','Double','enum',BasalforcingsTopplumedepthEnum())123 WriteData(fid, 'object',self,'fieldname','bottomplumedepth','format','Double','enum',BasalforcingsBottomplumedepthEnum())124 WriteData(fid, 'object',self,'fieldname','plumex','format','Double','enum',BasalforcingsPlumexEnum())125 WriteData(fid, 'object',self,'fieldname','plumey','format','Double','enum',BasalforcingsPlumeyEnum())126 WriteData(fid, 'object',self,'fieldname','crustthickness','format','Double','enum',BasalforcingsCrustthicknessEnum())127 WriteData(fid, 'object',self,'fieldname','uppercrustthickness','format','Double','enum',BasalforcingsUppercrustthicknessEnum())128 WriteData(fid, 'object',self,'fieldname','uppercrustheat','format','Double','enum',BasalforcingsUppercrustheatEnum())129 WriteData(fid, 'object',self,'fieldname','lowercrustheat','format','Double','enum',BasalforcingsLowercrustheatEnum())115 WriteData(fid,prefix,'name','md.basalforcings.model','data',MantlePlumeGeothermalFluxEnum(),'format','Integer'); 116 WriteData(fid,prefix,'object',self,'fieldname','floatingice_melting_rate','format','DoubleMat','name','md.basalforcings.floatingice_melting_rate','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 117 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) 118 WriteData(fid,prefix,'object',self,'fieldname','mantleconductivity','format','Double') 119 WriteData(fid,prefix,'object',self,'fieldname','nusselt','format','Double') 120 WriteData(fid,prefix,'object',self,'fieldname','dtbg','format','Double') 121 WriteData(fid,prefix,'object',self,'fieldname','plumeradius','format','Double') 122 WriteData(fid,prefix,'object',self,'fieldname','topplumedepth','format','Double') 123 WriteData(fid,prefix,'object',self,'fieldname','bottomplumedepth','format','Double') 124 WriteData(fid,prefix,'object',self,'fieldname','plumex','format','Double') 125 WriteData(fid,prefix,'object',self,'fieldname','plumey','format','Double') 126 WriteData(fid,prefix,'object',self,'fieldname','crustthickness','format','Double') 127 WriteData(fid,prefix,'object',self,'fieldname','uppercrustthickness','format','Double') 128 WriteData(fid,prefix,'object',self,'fieldname','uppercrustheat','format','Double') 129 WriteData(fid,prefix,'object',self,'fieldname','lowercrustheat','format','Double') 130 130 end % }}} 131 131 end -
issm/trunk-jpl/src/m/classes/qmu.js
r20297 r20690 101 101 } // }}} 102 102 this.marshall=function(md,fid) { //{{{ 103 WriteData(fid, 'object',this,'fieldname','isdakota','format','Boolean');103 WriteData(fid,prefix,'object',this,'fieldname','isdakota','format','Boolean'); 104 104 if (!this.isdakota){ 105 WriteData(fid, 'data',0,'enum',QmuMassFluxSegmentsPresentEnum(),'format','Boolean');105 WriteData(fid,prefix,'data',0,'name','md.qmu.mass_flux_segments_present','format','Boolean'); 106 106 } 107 107 else{ 108 WriteData(fid, 'object',this,'fieldname','partition','format','DoubleMat','mattype',2);109 WriteData(fid, 'object',this,'fieldname','numberofpartitions','format','Integer');110 WriteData(fid, 'object',this,'fieldname','numberofresponses','format','Integer');111 WriteData(fid, 'object',this,'fieldname','variabledescriptors','format','StringArray');112 WriteData(fid, 'object',this,'fieldname','responsedescriptors','format','StringArray');108 WriteData(fid,prefix,'object',this,'fieldname','partition','format','DoubleMat','mattype',2); 109 WriteData(fid,prefix,'object',this,'fieldname','numberofpartitions','format','Integer'); 110 WriteData(fid,prefix,'object',this,'fieldname','numberofresponses','format','Integer'); 111 WriteData(fid,prefix,'object',this,'fieldname','variabledescriptors','format','StringArray'); 112 WriteData(fid,prefix,'object',this,'fieldname','responsedescriptors','format','StringArray'); 113 113 if (this.mass_flux_segments.length){ 114 WriteData(fid, 'data',this.mass_flux_segments,'enum',MassFluxSegmentsEnum(),'format','MatArray');114 WriteData(fid,prefix,'data',this.mass_flux_segments,'name','md.qmu.mass_flux_segments','format','MatArray'); 115 115 flag=true; 116 116 } 117 117 else flag=false; 118 WriteData(fid, 'data',flag,'enum',QmuMassFluxSegmentsPresentEnum(),'format','Boolean');118 WriteData(fid,prefix,'data',flag,'name','md.qmu.mass_flux_segments_present','format','Boolean'); 119 119 } 120 120 }//}}} -
issm/trunk-jpl/src/m/classes/qmu.m
r19958 r20690 161 161 162 162 end % }}} 163 function marshall(self, md,fid) % {{{164 WriteData(fid, 'object',self,'fieldname','isdakota','format','Boolean');163 function marshall(self,prefix,md,fid) % {{{ 164 WriteData(fid,prefix,'object',self,'fieldname','isdakota','format','Boolean'); 165 165 if ~self.isdakota, 166 WriteData(fid, 'data',false,'enum',QmuMassFluxSegmentsPresentEnum,'format','Boolean');166 WriteData(fid,prefix,'data',false,'name','md.qmu.mass_flux_segments_present','format','Boolean'); 167 167 return; 168 168 end 169 WriteData(fid, 'object',self,'fieldname','partition','format','DoubleMat','mattype',2);170 WriteData(fid, 'object',self,'fieldname','numberofpartitions','format','Integer');171 WriteData(fid, 'object',self,'fieldname','numberofresponses','format','Integer');172 WriteData(fid, 'object',self,'fieldname','variabledescriptors','format','StringArray');173 WriteData(fid, 'object',self,'fieldname','responsedescriptors','format','StringArray');169 WriteData(fid,prefix,'object',self,'fieldname','partition','format','DoubleMat','mattype',2); 170 WriteData(fid,prefix,'object',self,'fieldname','numberofpartitions','format','Integer'); 171 WriteData(fid,prefix,'object',self,'fieldname','numberofresponses','format','Integer'); 172 WriteData(fid,prefix,'object',self,'fieldname','variabledescriptors','format','StringArray'); 173 WriteData(fid,prefix,'object',self,'fieldname','responsedescriptors','format','StringArray'); 174 174 if ~isempty(self.mass_flux_segments), 175 WriteData(fid, 'data',self.mass_flux_segments,'enum',MassFluxSegmentsEnum,'format','MatArray');175 WriteData(fid,prefix,'data',self.mass_flux_segments,'name','md.qmu.mass_flux_segments','format','MatArray'); 176 176 flag=true; 177 177 else 178 178 flag=false; 179 179 end 180 WriteData(fid, 'data',flag,'enum',QmuMassFluxSegmentsPresentEnum,'format','Boolean');180 WriteData(fid,prefix,'data',flag,'name','md.qmu.mass_flux_segments_present','format','Boolean'); 181 181 end % }}} 182 182 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/qmu.py
r19048 r20690 139 139 return md 140 140 # }}} 141 def marshall(self, md,fid): # {{{142 WriteData(fid, 'object',self,'fieldname','isdakota','format','Boolean')141 def marshall(self,prefix,md,fid): # {{{ 142 WriteData(fid,prefix,'object',self,'fieldname','isdakota','format','Boolean') 143 143 if not self.isdakota: 144 WriteData(fid, 'data',False,'enum',QmuMassFluxSegmentsPresentEnum(),'format','Boolean');144 WriteData(fid,prefix,'data',False,'name','md.qmu.mass_flux_segments_present','format','Boolean'); 145 145 return 146 WriteData(fid, 'object',self,'fieldname','partition','format','DoubleMat','mattype',2)147 WriteData(fid, 'object',self,'fieldname','numberofpartitions','format','Integer')148 WriteData(fid, 'object',self,'fieldname','numberofresponses','format','Integer')149 WriteData(fid, 'object',self,'fieldname','variabledescriptors','format','StringArray')150 WriteData(fid, 'object',self,'fieldname','responsedescriptors','format','StringArray')146 WriteData(fid,prefix,'object',self,'fieldname','partition','format','DoubleMat','mattype',2) 147 WriteData(fid,prefix,'object',self,'fieldname','numberofpartitions','format','Integer') 148 WriteData(fid,prefix,'object',self,'fieldname','numberofresponses','format','Integer') 149 WriteData(fid,prefix,'object',self,'fieldname','variabledescriptors','format','StringArray') 150 WriteData(fid,prefix,'object',self,'fieldname','responsedescriptors','format','StringArray') 151 151 if not self.mass_flux_segments: 152 WriteData(fid, 'data',self.mass_flux_segments,'enum',MassFluxSegmentsEnum(),'format','MatArray');152 WriteData(fid,prefix,'data',self.mass_flux_segments,'name','md.qmu.mass_flux_segments','format','MatArray'); 153 153 flag=True; 154 154 else: 155 155 flag=False; 156 WriteData(fid, 'data',flag,'enum',QmuMassFluxSegmentsPresentEnum(),'format','Boolean');156 WriteData(fid,prefix,'data',flag,'name','md.qmu.mass_flux_segments_present','format','Boolean'); 157 157 # }}} -
issm/trunk-jpl/src/m/classes/results.py
r17480 r20690 49 49 return md 50 50 # }}} 51 def marshall(self, md,fid): # {{{51 def marshall(self,prefix,md,fid): # {{{ 52 52 pass 53 53 # }}} -
issm/trunk-jpl/src/m/classes/rifts.js
r19860 r20690 76 76 } 77 77 } 78 WriteData(fid, 'data',numrifts,'enum',RiftsNumriftsEnum(),'format','Integer');79 WriteData(fid, 'data',data,'enum',RiftsRiftstructEnum(),'format','DoubleMat','mattype',3);78 WriteData(fid,prefix,'data',numrifts,'name','md.rifts.numrifts','format','Integer'); 79 WriteData(fid,prefix,'data',data,'name','md.rifts.riftstruct','format','DoubleMat','mattype',3); 80 80 }//}}} 81 81 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/rifts.m
r19958 r20690 54 54 55 55 end % }}} 56 function marshall(self, md,fid) % {{{56 function marshall(self,prefix,md,fid) % {{{ 57 57 58 58 %Process rift info … … 81 81 end 82 82 83 WriteData(fid, 'data',numrifts,'enum',RiftsNumriftsEnum(),'format','Integer');84 WriteData(fid, 'data',data,'enum',RiftsRiftstructEnum(),'format','DoubleMat','mattype',3);83 WriteData(fid,prefix,'data',numrifts,'name','md.rifts.numrifts','format','Integer'); 84 WriteData(fid,prefix,'data',data, 'name','md.rifts.riftstruct','format','DoubleMat','mattype',3); 85 85 end % }}} 86 86 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/rifts.py
r17686 r20690 55 55 return md 56 56 # }}} 57 def marshall(self, md,fid): # {{{57 def marshall(self,prefix,md,fid): # {{{ 58 58 59 59 #Process rift info … … 80 80 count+=numpairsforthisrift 81 81 82 WriteData(fid, 'data',numrifts,'enum',RiftsNumriftsEnum(),'format','Integer')83 WriteData(fid, 'data',data,'enum',RiftsRiftstructEnum(),'format','DoubleMat','mattype',3)82 WriteData(fid,prefix,'data',numrifts,'name','md.rifts.numrifts','format','Integer') 83 WriteData(fid,prefix,'data',data,'name','md.rifts.riftstruct','format','DoubleMat','mattype',3) 84 84 # }}} -
issm/trunk-jpl/src/m/classes/settings.js
r19860 r20690 60 60 } // }}} 61 61 this.marshall=function(md,fid) { //{{{ 62 WriteData(fid, 'object',this,'fieldname','results_on_nodes','format','Boolean');63 WriteData(fid, 'object',this,'fieldname','io_gather','format','Boolean');64 WriteData(fid, 'object',this,'fieldname','lowmem','format','Boolean');65 WriteData(fid, 'object',this,'fieldname','output_frequency','format','Integer');66 WriteData(fid, 'object',this,'fieldname','recording_frequency','format','Integer');67 if (this.waitonlock>0) WriteData(fid, 'enum',SettingsWaitonlockEnum(),'data',true,'format','Boolean');68 else WriteData(fid, 'enum',SettingsWaitonlockEnum(),'data',false,'format','Boolean');62 WriteData(fid,prefix,'object',this,'fieldname','results_on_nodes','format','Boolean'); 63 WriteData(fid,prefix,'object',this,'fieldname','io_gather','format','Boolean'); 64 WriteData(fid,prefix,'object',this,'fieldname','lowmem','format','Boolean'); 65 WriteData(fid,prefix,'object',this,'fieldname','output_frequency','format','Integer'); 66 WriteData(fid,prefix,'object',this,'fieldname','recording_frequency','format','Integer'); 67 if (this.waitonlock>0) WriteData(fid,prefix,'name','md.settings.waitonlock','data',true,'format','Boolean'); 68 else WriteData(fid,prefix,'name','md.settings.waitonlock','data',false,'format','Boolean'); 69 69 }//}}} 70 70 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/settings.m
r19958 r20690 17 17 upload_port = 0; 18 18 upload_filename = ''; 19 20 19 end 21 20 methods … … 78 77 79 78 end % }}} 80 function marshall(self,md,fid) % {{{ 81 WriteData(fid,'object',self,'fieldname','results_on_nodes','format','Boolean'); 82 WriteData(fid,'object',self,'fieldname','io_gather','format','Boolean'); 83 WriteData(fid,'object',self,'fieldname','lowmem','format','Boolean'); 84 WriteData(fid,'object',self,'fieldname','output_frequency','format','Integer'); 85 WriteData(fid,'object',self,'fieldname','recording_frequency','format','Integer'); 86 if self.waitonlock>0, 87 WriteData(fid,'enum',SettingsWaitonlockEnum(),'data',true,'format','Boolean'); 88 else 89 WriteData(fid,'enum',SettingsWaitonlockEnum(),'data',false,'format','Boolean'); 90 end 79 function marshall(self,prefix,md,fid) % {{{ 80 WriteData(fid,prefix,'object',self,'fieldname','results_on_nodes','format','Boolean'); 81 WriteData(fid,prefix,'object',self,'fieldname','io_gather','format','Boolean'); 82 WriteData(fid,prefix,'object',self,'fieldname','lowmem','format','Boolean'); 83 WriteData(fid,prefix,'object',self,'fieldname','output_frequency','format','Integer'); 84 WriteData(fid,prefix,'object',self,'fieldname','recording_frequency','format','Integer'); 85 WriteData(fid,prefix,'object',self,'fieldname','waitonlock','data',self.waitonlock>0,'format','Boolean'); 91 86 end % }}} 92 87 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/settings.py
r19318 r20690 68 68 return md 69 69 # }}} 70 def marshall(self, md,fid): # {{{71 WriteData(fid, 'object',self,'fieldname','results_on_nodes','format','Boolean')72 WriteData(fid, 'object',self,'fieldname','io_gather','format','Boolean')73 WriteData(fid, 'object',self,'fieldname','lowmem','format','Boolean')74 WriteData(fid, 'object',self,'fieldname','output_frequency','format','Integer')75 WriteData(fid, 'object',self,'fieldname','recording_frequency','format','Integer')70 def marshall(self,prefix,md,fid): # {{{ 71 WriteData(fid,prefix,'object',self,'fieldname','results_on_nodes','format','Boolean') 72 WriteData(fid,prefix,'object',self,'fieldname','io_gather','format','Boolean') 73 WriteData(fid,prefix,'object',self,'fieldname','lowmem','format','Boolean') 74 WriteData(fid,prefix,'object',self,'fieldname','output_frequency','format','Integer') 75 WriteData(fid,prefix,'object',self,'fieldname','recording_frequency','format','Integer') 76 76 if self.waitonlock>0: 77 WriteData(fid, 'enum',SettingsWaitonlockEnum(),'data',True,'format','Boolean');77 WriteData(fid,prefix,'name','md.settings.waitonlock','data',True,'format','Boolean'); 78 78 else: 79 WriteData(fid, 'enum',SettingsWaitonlockEnum(),'data',False,'format','Boolean');79 WriteData(fid,prefix,'name','md.settings.waitonlock','data',False,'format','Boolean'); 80 80 # }}} -
issm/trunk-jpl/src/m/classes/slr.js
r20349 r20690 21 21 22 22 //tidal love numbers: 23 self.tide_love_h=0.6149; //degree 224 self.tide_love_k=0.3055; //degree 223 this.tide_love_h=0.6149; //degree 2 24 this.tide_love_k=0.3055; //degree 2 25 25 26 26 //numerical discretization accuracy … … 85 85 this.marshall=function(md,fid) { //{{{ 86 86 87 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','deltathickness','format','DoubleMat','mattype',1);88 WriteData(fid, 'data',this.sealevel,'mattype',1,'format','DoubleMat','enum',SealevelEnum(),'timeserieslength',md.mesh.numberofvertices+1);89 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','reltol','format','Double');90 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','abstol','format','Double');91 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','maxiter','format','Integer');92 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','love_h','format','DoubleMat','mattype',1);93 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','love_k','format','DoubleMat','mattype',1);94 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','tide_love_h','format','Double');95 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','tide_love_k','format','Double');96 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','rigid','format','Boolean');97 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','elastic','format','Boolean');98 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','rotation','format','Boolean');99 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','degacc','format','Double');100 WriteData(fid, 'object',this,'class','sealevelrise','fieldname','transitions','format','MatArray');87 WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',1); 88 WriteData(fid,prefix,'object',self,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1); 89 WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double'); 90 WriteData(fid,prefix,'object',self,'fieldname','abstol','format','Double'); 91 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer'); 92 WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1); 93 WriteData(fid,prefix,'object',self,'fieldname','love_k','format','DoubleMat','mattype',1); 94 WriteData(fid,prefix,'object',self,'fieldname','tide_love_h','format','Double'); 95 WriteData(fid,prefix,'object',self,'fieldname','tide_love_k','format','Double'); 96 WriteData(fid,prefix,'object',self,'fieldname','rigid','format','Boolean'); 97 WriteData(fid,prefix,'object',self,'fieldname','elastic','format','Boolean'); 98 WriteData(fid,prefix,'object',self,'fieldname','rotation','format','Boolean'); 99 WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double'); 100 WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray'); 101 101 102 102 //process requested outputs … … 109 109 } 110 110 } 111 WriteData(fid, 'data',outputs,'enum',SealevelriseRequestedOutputsEnum(),'format','StringArray');111 WriteData(fid,prefix,'data',outputs,'name','md.slr.requested_outputs','format','StringArray'); 112 112 }//}}} 113 113 this.fix=function() { //{{{ -
issm/trunk-jpl/src/m/classes/slr.m
r20349 r20690 113 113 114 114 end % }}} 115 function marshall(self,md,fid) % {{{ 116 WriteData(fid,'object',self,'class','sealevelrise','fieldname','deltathickness','format','DoubleMat','mattype',2); 117 %WriteData(fid,'object',self,'class','sealevelrise','fieldname','deltathickness','format','DoubleMat','mattype',1); 118 WriteData(fid,'data',self.sealevel,'mattype',1,'format','DoubleMat','enum',SealevelEnum(),'timeserieslength',md.mesh.numberofvertices+1); 119 WriteData(fid,'object',self,'class','sealevelrise','fieldname','reltol','format','Double'); 120 WriteData(fid,'object',self,'class','sealevelrise','fieldname','abstol','format','Double'); 121 WriteData(fid,'object',self,'class','sealevelrise','fieldname','maxiter','format','Integer'); 122 WriteData(fid,'object',self,'class','sealevelrise','fieldname','love_h','format','DoubleMat','mattype',1); 123 WriteData(fid,'object',self,'class','sealevelrise','fieldname','love_k','format','DoubleMat','mattype',1); 124 WriteData(fid,'object',self,'class','sealevelrise','fieldname','tide_love_k','format','Double'); 125 WriteData(fid,'object',self,'class','sealevelrise','fieldname','tide_love_h','format','Double'); 126 WriteData(fid,'object',self,'class','sealevelrise','fieldname','rigid','format','Boolean'); 127 WriteData(fid,'object',self,'class','sealevelrise','fieldname','elastic','format','Boolean'); 128 WriteData(fid,'object',self,'class','sealevelrise','fieldname','rotation','format','Boolean'); 129 WriteData(fid,'object',self,'class','sealevelrise','fieldname','degacc','format','Double'); 130 WriteData(fid,'object',self,'class','sealevelrise','fieldname','transitions','format','MatArray'); 115 function marshall(self,prefix,md,fid) % {{{ 116 WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',2); 117 WriteData(fid,prefix,'object',self,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1); 118 WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double'); 119 WriteData(fid,prefix,'object',self,'fieldname','abstol','format','Double'); 120 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer'); 121 WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1); 122 WriteData(fid,prefix,'object',self,'fieldname','love_k','format','DoubleMat','mattype',1); 123 WriteData(fid,prefix,'object',self,'fieldname','tide_love_k','format','Double'); 124 WriteData(fid,prefix,'object',self,'fieldname','tide_love_h','format','Double'); 125 WriteData(fid,prefix,'object',self,'fieldname','rigid','format','Boolean'); 126 WriteData(fid,prefix,'object',self,'fieldname','elastic','format','Boolean'); 127 WriteData(fid,prefix,'object',self,'fieldname','rotation','format','Boolean'); 128 WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double'); 129 WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray'); 131 130 132 131 %process requested outputs … … 137 136 outputs = [outputs defaultoutputs(self,md)]; %add defaults 138 137 end 139 WriteData(fid, 'data',outputs,'enum',SealevelriseRequestedOutputsEnum,'format','StringArray');138 WriteData(fid,prefix,'data',outputs,'name','md.slr.requested_outputs','format','StringArray'); 140 139 141 140 end % }}} -
issm/trunk-jpl/src/m/classes/slr.py
r20349 r20690 112 112 return ['Sealevel'] 113 113 # }}} 114 def marshall(self, md,fid): # {{{115 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','deltathickness','format','DoubleMat','mattype',1)116 WriteData(fid, 'data',self.sealevel,'mattype',1,'format','DoubleMat','enum',SealevelEnum(),'timeserieslength',md.mesh.numberofvertices+1)117 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','reltol','format','Double')118 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','abstol','format','Double')119 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','maxiter','format','Integer')120 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','love_h','format','DoubleMat','mattype',1)121 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','love_k','format','DoubleMat','mattype',1)122 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','tide_love_h','format','Double');123 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','tide_love_k','format','Double');124 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','rigid','format','Boolean')125 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','elastic','format','Boolean')126 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','rotation','format','Boolean')127 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','degacc','format','Double')128 WriteData(fid, 'object',self,'class','sealevelrise','fieldname','transitions','format','MatArray')114 def marshall(self,prefix,md,fid): # {{{ 115 WriteData(fid,prefix,'object',self,'fieldname','deltathickness','format','DoubleMat','mattype',1) 116 WriteData(fid,prefix,'object',self,'fieldname','sealevel','mattype',1,'format','DoubleMat','timeserieslength',md.mesh.numberofvertices+1) 117 WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double') 118 WriteData(fid,prefix,'object',self,'fieldname','abstol','format','Double') 119 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer') 120 WriteData(fid,prefix,'object',self,'fieldname','love_h','format','DoubleMat','mattype',1) 121 WriteData(fid,prefix,'object',self,'fieldname','love_k','format','DoubleMat','mattype',1) 122 WriteData(fid,prefix,'object',self,'fieldname','tide_love_h','format','Double'); 123 WriteData(fid,prefix,'object',self,'fieldname','tide_love_k','format','Double'); 124 WriteData(fid,prefix,'object',self,'fieldname','rigid','format','Boolean') 125 WriteData(fid,prefix,'object',self,'fieldname','elastic','format','Boolean') 126 WriteData(fid,prefix,'object',self,'fieldname','rotation','format','Boolean') 127 WriteData(fid,prefix,'object',self,'fieldname','degacc','format','Double') 128 WriteData(fid,prefix,'object',self,'fieldname','transitions','format','MatArray') 129 129 130 130 #process requested outputs … … 134 134 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 135 135 outputs =outputscopy 136 WriteData(fid, 'data',outputs,'enum',SealevelriseRequestedOutputsEnum(),'format','StringArray')136 WriteData(fid,prefix,'data',outputs,'name','md.slr.requested_outputs','format','StringArray') 137 137 # }}} -
issm/trunk-jpl/src/m/classes/snowpack.m
r19040 r20690 451 451 452 452 end % }}} 453 function marshall(self, md,fid) % {{{453 function marshall(self,prefix,md,fid) % {{{ 454 454 455 455 yts=365.0*24.0*3600.0; 456 456 457 WriteData(fid,'object',self,'class','snowpack','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 458 WriteData(fid,'object',self,'class','snowpack','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 459 WriteData(fid,'object',self,'class','snowpack','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 460 WriteData(fid,'object',self,'class','snowpack','fieldname','restol','format','Double'); 461 WriteData(fid,'object',self,'class','snowpack','fieldname','reltol','format','Double'); 462 WriteData(fid,'object',self,'class','snowpack','fieldname','abstol','format','Double'); 463 WriteData(fid,'object',self,'class','snowpack','fieldname','isnewton','format','Integer'); 464 WriteData(fid,'object',self,'class','snowpack','fieldname','FSreconditioning','format','Double'); 465 WriteData(fid,'object',self,'class','snowpack','fieldname','viscosity_overshoot','format','Double'); 466 WriteData(fid,'object',self,'class','snowpack','fieldname','maxiter','format','Integer'); 467 WriteData(fid,'object',self,'class','snowpack','fieldname','shelf_dampening','format','Integer'); 468 WriteData(fid,'object',self,'class','snowpack','fieldname','vertex_pairing','format','DoubleMat','mattype',3); 469 WriteData(fid,'object',self,'class','snowpack','fieldname','penalty_factor','format','Double'); 470 WriteData(fid,'object',self,'class','snowpack','fieldname','rift_penalty_lock','format','Integer'); 471 WriteData(fid,'object',self,'class','snowpack','fieldname','rift_penalty_threshold','format','Integer'); 472 WriteData(fid,'object',self,'class','snowpack','fieldname','referential','format','DoubleMat','mattype',1); 473 WriteData(fid,'object',self,'class','snowpack','fieldname','requested_outputs','format','StringArray'); 474 WriteData(fid,'data',self.loadingforce(:,1),'format','DoubleMat','mattype',1,'enum',LoadingforceXEnum); 475 WriteData(fid,'data',self.loadingforce(:,2),'format','DoubleMat','mattype',1,'enum',LoadingforceYEnum); 476 WriteData(fid,'data',self.loadingforce(:,3),'format','DoubleMat','mattype',1,'enum',LoadingforceZEnum); 457 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 458 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 459 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 460 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','restol','format','Double'); 461 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','reltol','format','Double'); 462 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','abstol','format','Double'); 463 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','isnewton','format','Integer'); 464 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','FSreconditioning','format','Double'); 465 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','viscosity_overshoot','format','Double'); 466 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','maxiter','format','Integer'); 467 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','shelf_dampening','format','Integer'); 468 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','vertex_pairing','format','DoubleMat','mattype',3); 469 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','penalty_factor','format','Double'); 470 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','rift_penalty_lock','format','Integer'); 471 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','rift_penalty_threshold','format','Integer'); 472 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','referential','format','DoubleMat','mattype',1); 473 WriteData(fid,prefix,'object',self,'class','snowpack','fieldname','requested_outputs','format','StringArray'); 477 474 end % }}} 478 475 end -
issm/trunk-jpl/src/m/classes/spheremesh.m
r19897 r20690 79 79 80 80 end % }}} 81 function marshall(self, md,fid) % {{{82 WriteData(fid, 'object',self,'fieldname','x','format','DoubleMat','mattype',1);83 WriteData(fid, 'object',self,'fieldname','y','format','DoubleMat','mattype',1);84 WriteData(fid, 'object',self,'fieldname','z','format','DoubleMat','mattype',1);85 WriteData(fid, 'object',self,'fieldname','r','format','DoubleMat','mattype',1);86 WriteData(fid, 'object',self,'fieldname','theta','format','DoubleMat','mattype',1);87 WriteData(fid, 'object',self,'fieldname','phi','format','DoubleMat','mattype',1);88 WriteData(fid, 'object',self,'fieldname','elements','format','DoubleMat','mattype',2);89 WriteData(fid, 'object',self,'fieldname','numberoflayers','format','Integer');90 WriteData(fid, 'object',self,'fieldname','numberofelements','format','Integer');91 WriteData(fid, 'object',self,'fieldname','numberofvertices','format','Integer');92 WriteData(fid, 'object',self,'fieldname','elementconnectivity','format','DoubleMat','mattype',3);93 WriteData(fid, 'object',self,'fieldname','average_vertex_connectivity','format','Integer');81 function marshall(self,prefix,md,fid) % {{{ 82 WriteData(fid,prefix,'object',self,'fieldname','x','format','DoubleMat','mattype',1); 83 WriteData(fid,prefix,'object',self,'fieldname','y','format','DoubleMat','mattype',1); 84 WriteData(fid,prefix,'object',self,'fieldname','z','format','DoubleMat','mattype',1); 85 WriteData(fid,prefix,'object',self,'fieldname','r','format','DoubleMat','mattype',1); 86 WriteData(fid,prefix,'object',self,'fieldname','theta','format','DoubleMat','mattype',1); 87 WriteData(fid,prefix,'object',self,'fieldname','phi','format','DoubleMat','mattype',1); 88 WriteData(fid,prefix,'object',self,'fieldname','elements','format','DoubleMat','mattype',2); 89 WriteData(fid,prefix,'object',self,'fieldname','numberoflayers','format','Integer'); 90 WriteData(fid,prefix,'object',self,'fieldname','numberofelements','format','Integer'); 91 WriteData(fid,prefix,'object',self,'fieldname','numberofvertices','format','Integer'); 92 WriteData(fid,prefix,'object',self,'fieldname','elementconnectivity','format','DoubleMat','mattype',3); 93 WriteData(fid,prefix,'object',self,'fieldname','average_vertex_connectivity','format','Integer'); 94 94 end % }}} 95 95 end -
issm/trunk-jpl/src/m/classes/steadystate.js
r19860 r20690 47 47 } // }}} 48 48 this.marshall=function(md,fid) { //{{{ 49 WriteData(fid, 'object',this,'fieldname','reltol','format','Double');50 WriteData(fid, 'object',this,'fieldname','maxiter','format','Integer');49 WriteData(fid,prefix,'object',this,'fieldname','reltol','format','Double'); 50 WriteData(fid,prefix,'object',this,'fieldname','maxiter','format','Integer'); 51 51 52 52 //process requested outputs … … 59 59 } 60 60 } 61 WriteData(fid, 'data',outputs,'enum',SteadystateRequestedOutputsEnum(),'format','StringArray');61 WriteData(fid,prefix,'data',outputs,'name','md.steadystate.requested_outputs','format','StringArray'); 62 62 }//}}} 63 63 this.defaultoutputs = function(md) { //{{{ -
issm/trunk-jpl/src/m/classes/steadystate.m
r19958 r20690 56 56 57 57 end % }}} 58 function marshall(self, md,fid) % {{{59 WriteData(fid, 'object',self,'fieldname','reltol','format','Double');60 WriteData(fid, 'object',self,'fieldname','maxiter','format','Integer');58 function marshall(self,prefix,md,fid) % {{{ 59 WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double'); 60 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer'); 61 61 62 62 %process requested outputs … … 67 67 outputs = [outputs defaultoutputs(self,md)]; %add defaults 68 68 end 69 WriteData(fid, 'data',outputs,'enum',SteadystateRequestedOutputsEnum,'format','StringArray');69 WriteData(fid,prefix,'data',outputs,'name','md.steadystate.requested_outputs','format','StringArray'); 70 70 end % }}} 71 71 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/steadystate.py
r17497 r20690 62 62 return md 63 63 # }}} 64 def marshall(self, md,fid): # {{{65 WriteData(fid, 'object',self,'fieldname','reltol','format','Double')66 WriteData(fid, 'object',self,'fieldname','maxiter','format','Integer')64 def marshall(self,prefix,md,fid): # {{{ 65 WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double') 66 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer') 67 67 68 68 #process requested outputs … … 72 72 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 73 73 outputs =outputscopy 74 WriteData(fid, 'data',outputs,'enum',SteadystateRequestedOutputsEnum(),'format','StringArray')74 WriteData(fid,prefix,'data',outputs,'name','md.steadystate.requested_outputs','format','StringArray') 75 75 # }}} -
issm/trunk-jpl/src/m/classes/stressbalance.js
r19903 r20690 138 138 this.marshall=function(md,fid) { //{{{ 139 139 140 WriteData(fid, 'object',this,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3);140 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3); 141 141 142 142 var yts=365.0*24.0*3600.0; 143 143 144 WriteData(fid, 'object',this,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);145 WriteData(fid, 'object',this,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);146 WriteData(fid, 'object',this,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);147 WriteData(fid, 'object',this,'class','stressbalance','fieldname','restol','format','Double');148 WriteData(fid, 'object',this,'class','stressbalance','fieldname','reltol','format','Double');149 WriteData(fid, 'object',this,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts);150 WriteData(fid, 'object',this,'class','stressbalance','fieldname','isnewton','format','Integer');151 WriteData(fid, 'object',this,'class','stressbalance','fieldname','FSreconditioning','format','Double');152 WriteData(fid, 'object',this,'class','stressbalance','fieldname','viscosity_overshoot','format','Double');153 WriteData(fid, 'object',this,'class','stressbalance','fieldname','maxiter','format','Integer');154 WriteData(fid, 'object',this,'class','stressbalance','fieldname','shelf_dampening','format','Integer');155 WriteData(fid, 'object',this,'class','stressbalance','fieldname','penalty_factor','format','Double');156 WriteData(fid, 'object',this,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer');157 WriteData(fid, 'object',this,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer');158 WriteData(fid, 'object',this,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1);144 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 145 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 146 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 147 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','restol','format','Double'); 148 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','reltol','format','Double'); 149 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts); 150 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','isnewton','format','Integer'); 151 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','FSreconditioning','format','Double'); 152 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','viscosity_overshoot','format','Double'); 153 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','maxiter','format','Integer'); 154 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','shelf_dampening','format','Integer'); 155 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','penalty_factor','format','Double'); 156 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer'); 157 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer'); 158 WriteData(fid,prefix,'object',this,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1); 159 159 160 160 var lx=NewArrayFill(this.loadingforce.length,0); for(var i=0;i<lx.length;i++)lx[i]=this.loadingforce[i][0]; … … 162 162 var lz=NewArrayFill(this.loadingforce.length,0); for(var i=0;i<lx.length;i++)lz[i]=this.loadingforce[i][2]; 163 163 164 WriteData(fid, 'data',lx,'format','DoubleMat','mattype',1,'enum',LoadingforceXEnum());165 WriteData(fid, 'data',ly,'format','DoubleMat','mattype',1,'enum',LoadingforceYEnum());166 WriteData(fid, 'data',lz,'format','DoubleMat','mattype',1,'enum',LoadingforceZEnum());164 WriteData(fid,prefix,'data',lx,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex'); 165 WriteData(fid,prefix,'data',ly,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey'); 166 WriteData(fid,prefix,'data',lz,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez'); 167 167 168 168 //process requested outputs … … 175 175 } 176 176 } 177 WriteData(fid, 'data',outputs,'enum',StressbalanceRequestedOutputsEnum(),'format','StringArray');177 WriteData(fid,prefix,'data',outputs,'name','md.stressbalance.requested_outputs','format','StringArray'); 178 178 }//}}} 179 179 this.defaultoutputs = function(md){ // {{{ -
issm/trunk-jpl/src/m/classes/stressbalance.m
r20407 r20690 1 %STRESSBALANC Eclass definition1 %STRESSBALANCE class definition 2 2 % 3 3 % Usage: … … 173 173 174 174 end % }}} 175 function marshall(self, md,fid) % {{{176 177 WriteData(fid, 'object',self,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3);175 function marshall(self,prefix,md,fid) % {{{ 176 177 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3); 178 178 179 179 yts=365.0*24.0*3600.0; 180 180 181 WriteData(fid, 'object',self,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);182 WriteData(fid, 'object',self,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);183 WriteData(fid, 'object',self,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1);184 WriteData(fid, 'object',self,'class','stressbalance','fieldname','restol','format','Double');185 WriteData(fid, 'object',self,'class','stressbalance','fieldname','reltol','format','Double');186 WriteData(fid, 'object',self,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts);187 WriteData(fid, 'object',self,'class','stressbalance','fieldname','isnewton','format','Integer');188 WriteData(fid, 'object',self,'class','stressbalance','fieldname','FSreconditioning','format','Double');189 WriteData(fid, 'object',self,'class','stressbalance','fieldname','viscosity_overshoot','format','Double');190 WriteData(fid, 'object',self,'class','stressbalance','fieldname','maxiter','format','Integer');191 WriteData(fid, 'object',self,'class','stressbalance','fieldname','shelf_dampening','format','Integer');192 WriteData(fid, 'object',self,'class','stressbalance','fieldname','penalty_factor','format','Double');193 WriteData(fid, 'object',self,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer');194 WriteData(fid, 'object',self,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer');195 WriteData(fid, 'object',self,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1);181 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 182 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 183 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1); 184 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','restol','format','Double'); 185 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','reltol','format','Double'); 186 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts); 187 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','isnewton','format','Integer'); 188 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','FSreconditioning','format','Double'); 189 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','viscosity_overshoot','format','Double'); 190 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','maxiter','format','Integer'); 191 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','shelf_dampening','format','Integer'); 192 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','penalty_factor','format','Double'); 193 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer'); 194 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer'); 195 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1); 196 196 197 197 if size(self.loadingforce,2)==3, 198 WriteData(fid, 'data',self.loadingforce(:,1),'format','DoubleMat','mattype',1,'enum',LoadingforceXEnum);199 WriteData(fid, 'data',self.loadingforce(:,2),'format','DoubleMat','mattype',1,'enum',LoadingforceYEnum);200 WriteData(fid, 'data',self.loadingforce(:,3),'format','DoubleMat','mattype',1,'enum',LoadingforceZEnum);198 WriteData(fid,prefix,'data',self.loadingforce(:,1),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex'); 199 WriteData(fid,prefix,'data',self.loadingforce(:,2),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey'); 200 WriteData(fid,prefix,'data',self.loadingforce(:,3),'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez'); 201 201 end 202 202 … … 208 208 outputs = [outputs defaultoutputs(self,md)]; %add defaults 209 209 end 210 WriteData(fid, 'data',outputs,'enum',StressbalanceRequestedOutputsEnum,'format','StringArray');210 WriteData(fid,prefix,'data',outputs,'name','md.stressbalance.requested_outputs','format','StringArray'); 211 211 end % }}} 212 212 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/stressbalance.py
r20288 r20690 174 174 return md 175 175 # }}} 176 def marshall(self, md,fid): # {{{176 def marshall(self,prefix,md,fid): # {{{ 177 177 178 178 yts=365.0*24.0*3600.0 179 179 180 WriteData(fid, 'object',self,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)181 WriteData(fid, 'object',self,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)182 WriteData(fid, 'object',self,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1)183 WriteData(fid, 'object',self,'class','stressbalance','fieldname','restol','format','Double')184 WriteData(fid, 'object',self,'class','stressbalance','fieldname','reltol','format','Double')185 WriteData(fid, 'object',self,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts)186 WriteData(fid, 'object',self,'class','stressbalance','fieldname','isnewton','format','Integer')187 WriteData(fid, 'object',self,'class','stressbalance','fieldname','FSreconditioning','format','Double')188 WriteData(fid, 'object',self,'class','stressbalance','fieldname','viscosity_overshoot','format','Double')189 WriteData(fid, 'object',self,'class','stressbalance','fieldname','maxiter','format','Integer')190 WriteData(fid, 'object',self,'class','stressbalance','fieldname','shelf_dampening','format','Integer')191 WriteData(fid, 'object',self,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3)192 WriteData(fid, 'object',self,'class','stressbalance','fieldname','penalty_factor','format','Double')193 WriteData(fid, 'object',self,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer')194 WriteData(fid, 'object',self,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer')195 WriteData(fid, 'object',self,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1)180 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvx','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 181 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvy','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 182 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','spcvz','format','DoubleMat','mattype',1,'scale',1./yts,'timeserieslength',md.mesh.numberofvertices+1) 183 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','restol','format','Double') 184 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','reltol','format','Double') 185 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','abstol','format','Double','scale',1./yts) 186 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','isnewton','format','Integer') 187 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','FSreconditioning','format','Double') 188 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','viscosity_overshoot','format','Double') 189 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','maxiter','format','Integer') 190 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','shelf_dampening','format','Integer') 191 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','vertex_pairing','format','DoubleMat','mattype',3) 192 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','penalty_factor','format','Double') 193 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_lock','format','Integer') 194 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','rift_penalty_threshold','format','Integer') 195 WriteData(fid,prefix,'object',self,'class','stressbalance','fieldname','referential','format','DoubleMat','mattype',1) 196 196 197 197 if isinstance(self.loadingforce, (list, tuple, numpy.ndarray)): … … 202 202 lx=float('NaN'); ly=float('NaN'); lz=float('NaN'); 203 203 204 WriteData(fid, 'data',lx,'format','DoubleMat','mattype',1,'enum',LoadingforceXEnum())205 WriteData(fid, 'data',ly,'format','DoubleMat','mattype',1,'enum',LoadingforceYEnum())206 WriteData(fid, 'data',lz,'format','DoubleMat','mattype',1,'enum',LoadingforceZEnum())204 WriteData(fid,prefix,'data',lx,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcex') 205 WriteData(fid,prefix,'data',ly,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcey') 206 WriteData(fid,prefix,'data',lz,'format','DoubleMat','mattype',1,'name','md.stressbalance.loadingforcez') 207 207 208 208 #process requested outputs … … 212 212 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 213 213 outputs =outputscopy 214 WriteData(fid, 'data',outputs,'enum',StressbalanceRequestedOutputsEnum(),'format','StringArray')214 WriteData(fid,prefix,'data',outputs,'name','md.stressbalance.requested_outputs','format','StringArray') 215 215 # }}} -
issm/trunk-jpl/src/m/classes/taoinversion.m
r19897 r20690 159 159 disp(' 503: ThicknessAbsGradient'); 160 160 end % }}} 161 function marshall(self, md,fid) % {{{161 function marshall(self,prefix,md,fid) % {{{ 162 162 163 163 yts=365.0*24.0*3600.0; 164 164 165 WriteData(fid, 'object',self,'class','inversion','fieldname','iscontrol','format','Boolean');166 WriteData(fid, 'enum',InversionTypeEnum(),'data',1,'format','Integer');165 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean'); 166 WriteData(fid,prefix,'name','md.inversion.type','data',1,'format','Integer'); 167 167 if ~self.iscontrol, return; end 168 WriteData(fid, 'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean');169 WriteData(fid, 'object',self,'class','inversion','fieldname','maxsteps','format','Integer');170 WriteData(fid, 'object',self,'class','inversion','fieldname','maxiter','format','Integer');171 WriteData(fid, 'object',self,'class','inversion','fieldname','fatol','format','Double');172 WriteData(fid, 'object',self,'class','inversion','fieldname','frtol','format','Double');173 WriteData(fid, 'object',self,'class','inversion','fieldname','gatol','format','Double');174 WriteData(fid, 'object',self,'class','inversion','fieldname','grtol','format','Double');175 WriteData(fid, 'object',self,'class','inversion','fieldname','gttol','format','Double');176 WriteData(fid, 'object',self,'class','inversion','fieldname','algorithm','format','String');177 WriteData(fid, 'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1);178 WriteData(fid, 'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3);179 WriteData(fid, 'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3);180 WriteData(fid, 'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts);181 WriteData(fid, 'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts);182 WriteData(fid, 'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts);183 WriteData(fid, 'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1);184 WriteData(fid, 'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',1);168 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean'); 169 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer'); 170 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer'); 171 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','fatol','format','Double'); 172 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','frtol','format','Double'); 173 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gatol','format','Double'); 174 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','grtol','format','Double'); 175 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double'); 176 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','algorithm','format','String'); 177 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1); 178 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3); 179 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3); 180 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts); 181 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts); 182 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts); 183 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1); 184 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',1); 185 185 186 186 %process control parameters 187 187 num_control_parameters=numel(self.control_parameters); 188 data=zeros(1,num_control_parameters); 189 for i=1:num_control_parameters, 190 data(i)=StringToEnum(self.control_parameters{i}); 191 end 192 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3); 193 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer'); 188 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray'); 189 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer'); 194 190 195 191 %process cost functions 196 192 num_cost_functions=size(self.cost_functions,2); 197 193 data=marshallcostfunctions(self.cost_functions); 198 WriteData(fid, 'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3);199 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer');194 WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3); 195 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer'); 200 196 end % }}} 201 197 end -
issm/trunk-jpl/src/m/classes/taoinversion.py
r19897 r20690 166 166 167 167 yts=365.0*24.0*3600.0; 168 WriteData(fid, 'object',self,'class','inversion','fieldname','iscontrol','format','Boolean')169 WriteData(fid, 'enum',InversionTypeEnum(),'data',1,'format','Integer')168 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','iscontrol','format','Boolean') 169 WriteData(fid,prefix,'name','md.inversion.type','data',1,'format','Integer') 170 170 if not self.iscontrol: 171 171 return 172 WriteData(fid, 'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean')173 WriteData(fid, 'object',self,'class','inversion','fieldname','maxsteps','format','Integer')174 WriteData(fid, 'object',self,'class','inversion','fieldname','maxiter','format','Integer')175 WriteData(fid, 'object',self,'class','inversion','fieldname','fatol','format','Double')176 WriteData(fid, 'object',self,'class','inversion','fieldname','frtol','format','Double')177 WriteData(fid, 'object',self,'class','inversion','fieldname','gatol','format','Double')178 WriteData(fid, 'object',self,'class','inversion','fieldname','grtol','format','Double')179 WriteData(fid, 'object',self,'class','inversion','fieldname','gttol','format','Double')180 WriteData(fid, 'object',self,'class','inversion','fieldname','algorithm','format','String')181 WriteData(fid, 'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1)182 WriteData(fid, 'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3)183 WriteData(fid, 'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3)184 WriteData(fid, 'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts)185 WriteData(fid, 'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts)186 WriteData(fid, 'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts)187 WriteData(fid, 'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1)188 WriteData(fid, 'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',1)172 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','incomplete_adjoint','format','Boolean') 173 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxsteps','format','Integer') 174 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','maxiter','format','Integer') 175 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','fatol','format','Double') 176 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','frtol','format','Double') 177 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gatol','format','Double') 178 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','grtol','format','Double') 179 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','gttol','format','Double') 180 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','algorithm','format','String') 181 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','cost_functions_coefficients','format','DoubleMat','mattype',1) 182 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','min_parameters','format','DoubleMat','mattype',3) 183 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','max_parameters','format','DoubleMat','mattype',3) 184 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vx_obs','format','DoubleMat','mattype',1,'scale',1./yts) 185 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vy_obs','format','DoubleMat','mattype',1,'scale',1./yts) 186 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','vz_obs','format','DoubleMat','mattype',1,'scale',1./yts) 187 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','thickness_obs','format','DoubleMat','mattype',1) 188 WriteData(fid,prefix,'object',self,'class','inversion','fieldname','surface_obs','format','DoubleMat','mattype',1) 189 189 190 190 #process control parameters 191 191 num_control_parameters = numpy.numel(self.control_parameters) 192 data = numpy.array([StringToEnum(self.control_parameter[0]) for control_parameter in self.control_parameters]).reshape(1,-1) 193 WriteData(fid,'data',data,'enum',InversionControlParametersEnum(),'format','DoubleMat','mattype',3) 194 WriteData(fid,'data',num_control_parameters,'enum',InversionNumControlParametersEnum(),'format','Integer') 192 WriteData(fid,prefix,'object',self,'fieldname','control_parameters','format','StringArray') 193 WriteData(fid,prefix,'data',num_control_parameters,'name','md.inversion.num_control_parameters','format','Integer') 195 194 196 195 #process cost functions 197 196 num_cost_functions = numpy.size(self.cost_functions,2) 198 197 data= marshallcostfunctions(self.cost_functions) 199 WriteData(fid, 'data',data,'enum',InversionCostFunctionsEnum(),'format','DoubleMat','mattype',3)200 WriteData(fid, 'data',num_cost_functions,'enum',InversionNumCostFunctionsEnum(),'format','Integer')198 WriteData(fid,prefix,'data',data,'name','md.inversion.cost_functions','format','DoubleMat','mattype',3) 199 WriteData(fid,prefix,'data',num_cost_functions,'name','md.inversion.num_cost_functions','format','Integer') -
issm/trunk-jpl/src/m/classes/thermal.js
r19903 r20690 85 85 } // }}} 86 86 this.marshall=function(md,fid) { //{{{ 87 WriteData(fid, 'object',this,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);88 WriteData(fid, 'object',this,'fieldname','penalty_threshold','format','Integer');89 WriteData(fid, 'object',this,'fieldname','stabilization','format','Integer');90 WriteData(fid, 'object',this,'fieldname','reltol','format','Double');91 WriteData(fid, 'object',this,'fieldname','maxiter','format','Integer');92 WriteData(fid, 'object',this,'fieldname','penalty_lock','format','Integer');93 WriteData(fid, 'object',this,'fieldname','penalty_factor','format','Double');94 WriteData(fid, 'object',this,'fieldname','isenthalpy','format','Boolean');95 WriteData(fid, 'object',this,'fieldname','isdynamicbasalspc','format','Boolean');87 WriteData(fid,prefix,'object',this,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 88 WriteData(fid,prefix,'object',this,'fieldname','penalty_threshold','format','Integer'); 89 WriteData(fid,prefix,'object',this,'fieldname','stabilization','format','Integer'); 90 WriteData(fid,prefix,'object',this,'fieldname','reltol','format','Double'); 91 WriteData(fid,prefix,'object',this,'fieldname','maxiter','format','Integer'); 92 WriteData(fid,prefix,'object',this,'fieldname','penalty_lock','format','Integer'); 93 WriteData(fid,prefix,'object',this,'fieldname','penalty_factor','format','Double'); 94 WriteData(fid,prefix,'object',this,'fieldname','isenthalpy','format','Boolean'); 95 WriteData(fid,prefix,'object',this,'fieldname','isdynamicbasalspc','format','Boolean'); 96 96 97 97 //process requested outputs … … 104 104 } 105 105 } 106 WriteData(fid, 'data',outputs,'enum',ThermalRequestedOutputsEnum(),'format','StringArray');106 WriteData(fid,prefix,'data',outputs,'name','md.thermal.requested_outputs','format','StringArray'); 107 107 }//}}} 108 108 this.defaultoutputs = function(md) { //{{{ -
issm/trunk-jpl/src/m/classes/thermal.m
r20407 r20690 113 113 114 114 end % }}} 115 function marshall(self, md,fid) % {{{116 WriteData(fid, 'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1);117 WriteData(fid, 'object',self,'fieldname','penalty_threshold','format','Integer');118 WriteData(fid, 'object',self,'fieldname','stabilization','format','Integer');119 WriteData(fid, 'object',self,'fieldname','reltol','format','Double');120 WriteData(fid, 'object',self,'fieldname','maxiter','format','Integer');121 WriteData(fid, 'object',self,'fieldname','penalty_lock','format','Integer');122 WriteData(fid, 'object',self,'fieldname','penalty_factor','format','Double');123 WriteData(fid, 'object',self,'fieldname','isenthalpy','format','Boolean');124 WriteData(fid, 'object',self,'fieldname','isdynamicbasalspc','format','Boolean');115 function marshall(self,prefix,md,fid) % {{{ 116 WriteData(fid,prefix,'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1); 117 WriteData(fid,prefix,'object',self,'fieldname','penalty_threshold','format','Integer'); 118 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer'); 119 WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double'); 120 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer'); 121 WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer'); 122 WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double'); 123 WriteData(fid,prefix,'object',self,'fieldname','isenthalpy','format','Boolean'); 124 WriteData(fid,prefix,'object',self,'fieldname','isdynamicbasalspc','format','Boolean'); 125 125 126 126 %process requested outputs … … 131 131 outputs = [outputs defaultoutputs(self,md)]; %add defaults 132 132 end 133 WriteData(fid, 'data',outputs,'enum',ThermalRequestedOutputsEnum(),'format','StringArray');133 WriteData(fid,prefix,'data',outputs,'name','md.thermal.requested_outputs','format','StringArray'); 134 134 end % }}} 135 135 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/thermal.py
r19903 r20690 110 110 return md 111 111 # }}} 112 def marshall(self, md,fid): # {{{113 WriteData(fid, 'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1)114 WriteData(fid, 'object',self,'fieldname','penalty_threshold','format','Integer')115 WriteData(fid, 'object',self,'fieldname','stabilization','format','Integer')116 WriteData(fid, 'object',self,'fieldname','reltol','format','Double');117 WriteData(fid, 'object',self,'fieldname','maxiter','format','Integer')118 WriteData(fid, 'object',self,'fieldname','penalty_lock','format','Integer')119 WriteData(fid, 'object',self,'fieldname','penalty_factor','format','Double')120 WriteData(fid, 'object',self,'fieldname','isenthalpy','format','Boolean')121 WriteData(fid, 'object',self,'fieldname','isdynamicbasalspc','format','Boolean');112 def marshall(self,prefix,md,fid): # {{{ 113 WriteData(fid,prefix,'object',self,'fieldname','spctemperature','format','DoubleMat','mattype',1,'timeserieslength',md.mesh.numberofvertices+1) 114 WriteData(fid,prefix,'object',self,'fieldname','penalty_threshold','format','Integer') 115 WriteData(fid,prefix,'object',self,'fieldname','stabilization','format','Integer') 116 WriteData(fid,prefix,'object',self,'fieldname','reltol','format','Double'); 117 WriteData(fid,prefix,'object',self,'fieldname','maxiter','format','Integer') 118 WriteData(fid,prefix,'object',self,'fieldname','penalty_lock','format','Integer') 119 WriteData(fid,prefix,'object',self,'fieldname','penalty_factor','format','Double') 120 WriteData(fid,prefix,'object',self,'fieldname','isenthalpy','format','Boolean') 121 WriteData(fid,prefix,'object',self,'fieldname','isdynamicbasalspc','format','Boolean'); 122 122 123 123 #process requested outputs … … 127 127 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 128 128 outputs =outputscopy 129 WriteData(fid, 'data',outputs,'enum',ThermalRequestedOutputsEnum(),'format','StringArray')129 WriteData(fid,prefix,'data',outputs,'name','md.thermal.requested_outputs','format','StringArray') 130 130 # }}} -
issm/trunk-jpl/src/m/classes/timestepping.js
r19901 r20690 54 54 scale = 365.0*24.0*3600.0; 55 55 56 WriteData(fid, 'object',this,'fieldname','start_time','format','Double','scale',scale);57 WriteData(fid, 'object',this,'fieldname','final_time','format','Double','scale',scale);58 WriteData(fid, 'object',this,'fieldname','time_step','format','Double','scale',scale);59 WriteData(fid, 'object',this,'fieldname','time_adapt','format','Boolean');60 WriteData(fid, 'object',this,'fieldname','cfl_coefficient','format','Double');61 WriteData(fid, 'object',this,'fieldname','interp_forcings','format','Boolean');56 WriteData(fid,prefix,'object',this,'fieldname','start_time','format','Double','scale',scale); 57 WriteData(fid,prefix,'object',this,'fieldname','final_time','format','Double','scale',scale); 58 WriteData(fid,prefix,'object',this,'fieldname','time_step','format','Double','scale',scale); 59 WriteData(fid,prefix,'object',this,'fieldname','time_adapt','format','Boolean'); 60 WriteData(fid,prefix,'object',this,'fieldname','cfl_coefficient','format','Double'); 61 WriteData(fid,prefix,'object',this,'fieldname','interp_forcings','format','Boolean'); 62 62 63 63 }//}}} -
issm/trunk-jpl/src/m/classes/timestepping.m
r19958 r20690 61 61 62 62 end % }}} 63 function marshall(self, md,fid) % {{{63 function marshall(self,prefix,md,fid) % {{{ 64 64 65 65 scale = 365.0*24.0*3600.0; 66 WriteData(fid, 'object',self,'fieldname','start_time','format','Double','scale',scale);67 WriteData(fid, 'object',self,'fieldname','final_time','format','Double','scale',scale);68 WriteData(fid, 'object',self,'fieldname','time_step','format','Double','scale',scale);69 WriteData(fid, 'object',self,'fieldname','time_adapt','format','Boolean');70 WriteData(fid, 'object',self,'fieldname','cfl_coefficient','format','Double');71 WriteData(fid, 'object',self,'fieldname','interp_forcings','format','Boolean');66 WriteData(fid,prefix,'object',self,'fieldname','start_time','format','Double','scale',scale); 67 WriteData(fid,prefix,'object',self,'fieldname','final_time','format','Double','scale',scale); 68 WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',scale); 69 WriteData(fid,prefix,'object',self,'fieldname','time_adapt','format','Boolean'); 70 WriteData(fid,prefix,'object',self,'fieldname','cfl_coefficient','format','Double'); 71 WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean'); 72 72 end % }}} 73 73 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/timestepping.py
r19897 r20690 64 64 return md 65 65 # }}} 66 def marshall(self, md,fid): # {{{66 def marshall(self,prefix,md,fid): # {{{ 67 67 68 68 yts=md.constants.yts 69 69 70 WriteData(fid, 'object',self,'fieldname','start_time','format','Double','scale',yts)71 WriteData(fid, 'object',self,'fieldname','final_time','format','Double','scale',yts)72 WriteData(fid, 'object',self,'fieldname','time_step','format','Double','scale',yts)73 WriteData(fid, 'object',self,'fieldname','time_adapt','format','Boolean')74 WriteData(fid, 'object',self,'fieldname','cfl_coefficient','format','Double')75 WriteData(fid, 'object',self,'fieldname','interp_forcings','format','Boolean')70 WriteData(fid,prefix,'object',self,'fieldname','start_time','format','Double','scale',yts) 71 WriteData(fid,prefix,'object',self,'fieldname','final_time','format','Double','scale',yts) 72 WriteData(fid,prefix,'object',self,'fieldname','time_step','format','Double','scale',yts) 73 WriteData(fid,prefix,'object',self,'fieldname','time_adapt','format','Boolean') 74 WriteData(fid,prefix,'object',self,'fieldname','cfl_coefficient','format','Double') 75 WriteData(fid,prefix,'object',self,'fieldname','interp_forcings','format','Boolean') 76 76 # }}} -
issm/trunk-jpl/src/m/classes/trans.js
r20459 r20690 66 66 } // }}} 67 67 this.marshall=function(md,fid) { //{{{ 68 WriteData(fid, 'object',this,'fieldname','issmb','format','Boolean');69 WriteData(fid, 'object',this,'fieldname','ismasstransport','format','Boolean');70 WriteData(fid, 'object',this,'fieldname','isstressbalance','format','Boolean');71 WriteData(fid, 'object',this,'fieldname','isthermal','format','Boolean');72 WriteData(fid, 'object',this,'fieldname','isgroundingline','format','Boolean');73 WriteData(fid, 'object',this,'fieldname','isgia','format','Boolean');74 WriteData(fid, 'object',this,'fieldname','isdamageevolution','format','Boolean');75 WriteData(fid, 'object',this,'fieldname','ishydrology','format','Boolean');76 WriteData(fid, 'object',this,'fieldname','ismovingfront','format','Boolean');77 WriteData(fid, 'object',this,'fieldname','isslr','format','Boolean');78 WriteData(fid, 'object',this,'fieldname','iscoupler','format','Boolean');68 WriteData(fid,prefix,'object',this,'fieldname','issmb','format','Boolean'); 69 WriteData(fid,prefix,'object',this,'fieldname','ismasstransport','format','Boolean'); 70 WriteData(fid,prefix,'object',this,'fieldname','isstressbalance','format','Boolean'); 71 WriteData(fid,prefix,'object',this,'fieldname','isthermal','format','Boolean'); 72 WriteData(fid,prefix,'object',this,'fieldname','isgroundingline','format','Boolean'); 73 WriteData(fid,prefix,'object',this,'fieldname','isgia','format','Boolean'); 74 WriteData(fid,prefix,'object',this,'fieldname','isdamageevolution','format','Boolean'); 75 WriteData(fid,prefix,'object',this,'fieldname','ishydrology','format','Boolean'); 76 WriteData(fid,prefix,'object',this,'fieldname','ismovingfront','format','Boolean'); 77 WriteData(fid,prefix,'object',this,'fieldname','isslr','format','Boolean'); 78 WriteData(fid,prefix,'object',this,'fieldname','iscoupler','format','Boolean'); 79 79 80 80 //process requested outputs … … 87 87 } 88 88 } 89 WriteData(fid, 'data',outputs,'enum',TransientRequestedOutputsEnum(),'format','StringArray');89 WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray'); 90 90 }//}}} 91 91 this.defaultoutputs = function(md) { //{{{ -
issm/trunk-jpl/src/m/classes/transient.m
r20459 r20690 107 107 108 108 end % }}} 109 function marshall(self, md,fid) % {{{110 WriteData(fid, 'object',self,'fieldname','issmb','format','Boolean');111 WriteData(fid, 'object',self,'fieldname','ismasstransport','format','Boolean');112 WriteData(fid, 'object',self,'fieldname','isstressbalance','format','Boolean');113 WriteData(fid, 'object',self,'fieldname','isthermal','format','Boolean');114 WriteData(fid, 'object',self,'fieldname','isgroundingline','format','Boolean');115 WriteData(fid, 'object',self,'fieldname','isgia','format','Boolean');116 WriteData(fid, 'object',self,'fieldname','isdamageevolution','format','Boolean');117 WriteData(fid, 'object',self,'fieldname','ishydrology','format','Boolean');118 WriteData(fid, 'object',self,'fieldname','ismovingfront','format','Boolean');119 WriteData(fid, 'object',self,'fieldname','isslr','format','Boolean');120 WriteData(fid, 'object',self,'fieldname','iscoupler','format','Boolean');109 function marshall(self,prefix,md,fid) % {{{ 110 WriteData(fid,prefix,'object',self,'fieldname','issmb','format','Boolean'); 111 WriteData(fid,prefix,'object',self,'fieldname','ismasstransport','format','Boolean'); 112 WriteData(fid,prefix,'object',self,'fieldname','isstressbalance','format','Boolean'); 113 WriteData(fid,prefix,'object',self,'fieldname','isthermal','format','Boolean'); 114 WriteData(fid,prefix,'object',self,'fieldname','isgroundingline','format','Boolean'); 115 WriteData(fid,prefix,'object',self,'fieldname','isgia','format','Boolean'); 116 WriteData(fid,prefix,'object',self,'fieldname','isdamageevolution','format','Boolean'); 117 WriteData(fid,prefix,'object',self,'fieldname','ishydrology','format','Boolean'); 118 WriteData(fid,prefix,'object',self,'fieldname','ismovingfront','format','Boolean'); 119 WriteData(fid,prefix,'object',self,'fieldname','isslr','format','Boolean'); 120 WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean'); 121 121 122 122 %process requested outputs … … 127 127 outputs = [outputs defaultoutputs(self,md)]; %add defaults 128 128 end 129 WriteData(fid, 'data',outputs,'enum',TransientRequestedOutputsEnum,'format','StringArray');129 WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray'); 130 130 end % }}} 131 131 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/transient.py
r20459 r20690 113 113 return md 114 114 # }}} 115 def marshall(self, md,fid): # {{{116 WriteData(fid, 'object',self,'fieldname','issmb','format','Boolean')117 WriteData(fid, 'object',self,'fieldname','ismasstransport','format','Boolean')118 WriteData(fid, 'object',self,'fieldname','isstressbalance','format','Boolean')119 WriteData(fid, 'object',self,'fieldname','isthermal','format','Boolean')120 WriteData(fid, 'object',self,'fieldname','isgroundingline','format','Boolean')121 WriteData(fid, 'object',self,'fieldname','isgia','format','Boolean')122 WriteData(fid, 'object',self,'fieldname','isdamageevolution','format','Boolean')123 WriteData(fid, 'object',self,'fieldname','ishydrology','format','Boolean')124 WriteData(fid, 'object',self,'fieldname','ismovingfront','format','Boolean')125 WriteData(fid, 'object',self,'fieldname','isslr','format','Boolean')126 WriteData(fid, 'object',self,'fieldname','iscoupler','format','Boolean')115 def marshall(self,prefix,md,fid): # {{{ 116 WriteData(fid,prefix,'object',self,'fieldname','issmb','format','Boolean') 117 WriteData(fid,prefix,'object',self,'fieldname','ismasstransport','format','Boolean') 118 WriteData(fid,prefix,'object',self,'fieldname','isstressbalance','format','Boolean') 119 WriteData(fid,prefix,'object',self,'fieldname','isthermal','format','Boolean') 120 WriteData(fid,prefix,'object',self,'fieldname','isgroundingline','format','Boolean') 121 WriteData(fid,prefix,'object',self,'fieldname','isgia','format','Boolean') 122 WriteData(fid,prefix,'object',self,'fieldname','isdamageevolution','format','Boolean') 123 WriteData(fid,prefix,'object',self,'fieldname','ishydrology','format','Boolean') 124 WriteData(fid,prefix,'object',self,'fieldname','ismovingfront','format','Boolean') 125 WriteData(fid,prefix,'object',self,'fieldname','isslr','format','Boolean') 126 WriteData(fid,prefix,'object',self,'fieldname','iscoupler','format','Boolean') 127 127 128 128 #process requested outputs … … 132 132 outputscopy=outputs[0:max(0,indices[0]-1)]+self.defaultoutputs(md)+outputs[indices[0]+1:] 133 133 outputs =outputscopy 134 WriteData(fid, 'data',outputs,'enum',TransientRequestedOutputsEnum(),'format','StringArray')134 WriteData(fid,prefix,'data',outputs,'name','md.transient.requested_outputs','format','StringArray') 135 135 # }}} -
issm/trunk-jpl/src/m/classes/verbose.js
r19860 r20690 44 44 } // }}} 45 45 this.marshall=function(md,fid) { //{{{ 46 WriteData(fid, 'data',this.VerboseToBinary(),'enum',VerboseEnum(),'format','Integer');46 WriteData(fid,prefix,'data',this.VerboseToBinary(),'name','md.verbose','format','Integer'); 47 47 }//}}} 48 48 this.VerboseToBinary = function () { //{{{ -
issm/trunk-jpl/src/m/classes/verbose.m
r19958 r20690 132 132 end 133 133 %}}} 134 function marshall(self, md,fid) % {{{135 WriteData(fid, 'data',VerboseToBinary(self),'enum',VerboseEnum(),'format','Integer');134 function marshall(self,prefix,md,fid) % {{{ 135 WriteData(fid,prefix,'data',VerboseToBinary(self),'name','md.verbose','format','Integer'); 136 136 end % }}} 137 137 function savemodeljs(self,fid,modelname) % {{{ -
issm/trunk-jpl/src/m/classes/verbose.py
r19559 r20690 134 134 return md 135 135 # }}} 136 def marshall(self, md,fid): # {{{137 WriteData(fid, 'data',self.VerboseToBinary(),'enum',VerboseEnum(),'format','Integer')136 def marshall(self,prefix,md,fid): # {{{ 137 WriteData(fid,prefix,'data',self.VerboseToBinary(),'name','md.verbose','format','Integer') 138 138 # }}} -
issm/trunk-jpl/src/m/solve/WriteData.js
r20361 r20690 1 function WriteData(fid ){1 function WriteData(fid,prefix){ 2 2 //WRITEDATA - write model field into binary buffer 3 3 // … … 17 17 obj = options.getfieldvalue('object'); 18 18 fieldname = options.getfieldvalue('fieldname'); 19 if (options.exist('enum')){ 20 enumm = options.getfieldvalue('enum'); 19 name = options.getfieldvalue('name',[prefix+'.'+fieldname ]); 20 if (options.exist('data')){ 21 data = options.getfieldvalue('data'); 21 22 } 22 23 else{ 23 classname = options.getfieldvalue('class',obj.classname()); 24 enumm = BuildEnum(classname + '_' + fieldname); 25 } 26 dataini = obj[fieldname]; 24 dataini = obj[fieldname]; 25 } 27 26 } 28 27 else{ 29 28 //No processing required 30 29 dataini = options.getfieldvalue('data'); 31 enumm = options.getfieldvalue('enum');30 namem = options.getfieldvalue('name'); 32 31 } 33 32 if (IsArray(dataini)){ … … 73 72 } 74 73 75 //Step 1: write the enum to identify this record uniquely 76 fid.fwrite(enumm,'int'); 74 //Step 1: write the name to identify this record uniquely 75 fid.fwrite(name.length,'int'); 76 fid.fwrite(name,'char'); 77 77 78 78 //Step 2: write the data itself. … … 278 278 } 279 279 280 function BuildEnum(string){ // {{{281 //BUILDENUM - build enum out of string282 //283 // Usage:284 // enumm=BuildEnum(string)285 286 var index;287 while( string.indexOf('_') !=-1){288 index=string.indexOf('_');289 string=string.slice(0,index)+string[index+1].toUpperCase() + string.slice(index+2);290 }291 292 //take first letter of string and make it uppercase:293 string = string.charAt(0).toUpperCase() + string.slice(1);294 295 //Get Enum296 enumm=StringToEnum(string);297 298 return enumm;299 } // }}}300 280 function FormatToCode(format){ // {{{ 301 281 //This routine takes the format string, and hardcodes it into an integer, which -
issm/trunk-jpl/src/m/solve/WriteData.m
r19027 r20690 1 function WriteData(fid, varargin)1 function WriteData(fid,prefix,varargin) 2 2 %WRITEDATA - write model field in binary file 3 3 % … … 10 10 %Get data properties 11 11 if exist(options,'object'); 12 %This is a object field, construct enum and data13 12 obj = getfieldvalue(options,'object'); 14 13 fieldname = getfieldvalue(options,'fieldname'); 15 14 classname = getfieldvalue(options,'class',class(obj)); 16 if exist(options,'enum'), 17 enum = getfieldvalue(options,'enum'); 15 name = getfieldvalue(options,'name',[prefix '.' fieldname ]); 16 if exist(options,'data'), 17 data = getfieldvalue(options,'data'); 18 18 else 19 enum = BuildEnum([classname '_' fieldname]); 20 end 21 data = obj.(fieldname); 19 data = obj.(fieldname); 20 end 22 21 else 23 %No processing required24 22 data = getfieldvalue(options,'data'); 25 enum = getfieldvalue(options,'enum');23 name = getfieldvalue(options,'name'); 26 24 end 27 25 format = getfieldvalue(options,'format'); … … 48 46 end 49 47 50 %Step 1: write the enum to identify this record uniquely 51 fwrite(fid,enum,'int'); 48 %Step 1: write the name to identify this record uniquely 49 fwrite(fid,numel(name),'int'); 50 fwrite(fid,name,'char'); 52 51 53 52 %Step 2: write the data itself. … … 237 236 end 238 237 239 function enum=BuildEnum(string) % {{{240 %BUILDENUM - build enum out of string241 %242 % Usage:243 % enum=BuildEnum(string)244 245 if findstr(string,'_'),246 indices=findstr(string,'_');247 for i=1:length(indices),248 string(indices(i)+1)=upper(string(indices(i)+1));249 end250 string(indices)=[];251 end252 253 %take first letter of string and make it uppercase:254 string(1)=upper(string(1));255 256 %Get Enum257 enum=StringToEnum(string);258 end % }}}259 238 function code=FormatToCode(format) % {{{ 260 239 %This routine takes the format string, and hardcodes it into an integer, which -
issm/trunk-jpl/src/m/solve/WriteData.py
r19027 r20690 7 7 from EnumToString import EnumToString 8 8 9 def WriteData(fid, *args):9 def WriteData(fid,prefix,*args): 10 10 """ 11 11 WRITEDATA - write model field in binary file … … 24 24 fieldname = options.getfieldvalue('fieldname') 25 25 classname = options.getfieldvalue('class',str(type(obj)).rsplit('.')[-1].split("'")[0]) 26 if options.exist('enum'): 27 enum = options.getfieldvalue('enum') 26 name = options.getfieldvalue('name',prefix+'.'+fieldname); 27 if options.exist('data'): 28 data = options.getfieldvalue('data') 28 29 else: 29 enum = BuildEnum(classname+'_'+fieldname) 30 data = getattr(obj,fieldname) 30 data = getattr(obj,fieldname) 31 31 else: 32 32 #No processing required 33 33 data = options.getfieldvalue('data') 34 enum = options.getfieldvalue('enum')34 name = options.getfieldvalue('name') 35 35 format = options.getfieldvalue('format') 36 36 mattype = options.getfieldvalue('mattype',0) #only required for matrices … … 59 59 60 60 #Step 1: write the enum to identify this record uniquely 61 fid.write(struct.pack('i',enum)) 61 fid.write(struct.pack('i',len(name))) 62 fid.write(struct.pack('%ds' % len(name),name)) 62 63 63 64 #Step 2: write the data itself. … … 288 289 raise TypeError('WriteData error message: data type: %d not supported yet! (%s)' % (format,EnumToString(enum)[0])) 289 290 # }}} 290 291 def BuildEnum(string): # {{{292 """293 BUILDENUM - build enum out of string294 295 Usage:296 enum=BuildEnum(string)297 """298 299 if '_' in string:300 substrs=string.split('_')301 string=''302 for substr in substrs:303 string+=substr[0].upper()+substr[1:]304 else:305 #take first letter of string and make it uppercase:306 string=string[0].upper()+string[1:]307 308 #Get Enum309 enum=StringToEnum(string)[0]310 311 return enum312 # }}}313 291 314 292 def FormatToCode(format): # {{{ … … 342 320 return code 343 321 # }}} 344 -
issm/trunk-jpl/src/m/solve/marshall.js
r20268 r20690 15 15 var fid=new fileptr('mode','w'); 16 16 17 //First, write MaximumNumberOfEnum to make sure that the Enums are synchronized18 WriteData(fid,'enum',MaximumNumberOfDefinitionsEnum(),'data',true,'format','Boolean');19 20 17 //Go through all model fields: check that it is a class and call checkconsistency 21 18 for (field in md){ … … 30 27 31 28 //Marshall current object 32 md[field].marshall( md,fid);29 md[field].marshall(['md.'+field],md,fid); 33 30 } 34 31 35 //Last, write MaximumNumberOfEnum+1to make sure that the binary file is not corrupt36 WriteData(fid,' enum',MaximumNumberOfDefinitionsEnum()+1,'data',true,'format','Boolean');32 //Last, write "md.EOF" to make sure that the binary file is not corrupt 33 WriteData(fid,'XXX','name','md.EOF','data',true,'format','Boolean'); 37 34 return fid; 38 35 } -
issm/trunk-jpl/src/m/solve/marshall.m
r17050 r20690 18 18 end 19 19 20 %First, write MaximumNumberOfEnum to make sure that the Enums are synchronized21 WriteData(fid,'enum',MaximumNumberOfDefinitionsEnum(),'data',true,'format','Boolean');22 23 20 %Go through all model fields: check that it is a class and call checkconsistency 24 21 fields=properties('model'); … … 38 35 %Marshall current object 39 36 %disp(['marshalling ' field '...']); 40 marshall(md.(field), md,fid);37 marshall(md.(field),['md.' field],md,fid); 41 38 end 42 39 43 %Last, write MaximumNumberOfEnum+1to make sure that the binary file is not corrupt44 WriteData(fid,' enum',MaximumNumberOfDefinitionsEnum()+1,'data',true,'format','Boolean');40 %Last, write "md.EOF" to make sure that the binary file is not corrupt 41 WriteData(fid,'XXX','name','md.EOF','data',true,'format','Boolean'); 45 42 46 43 %close file -
issm/trunk-jpl/src/m/solve/marshall.py
r17497 r20690 21 21 raise IOError("marshall error message: could not open '%s.bin' file for binary writing." % md.miscellaneous.name) 22 22 23 #First, write MaximumNumberOfEnum to make sure that the Enums are synchronized24 WriteData(fid,'enum',MaximumNumberOfDefinitionsEnum(),'data',True,'format','Boolean')25 26 23 #Go through all model fields: check that it is a class and call checkconsistency 27 24 fields=vars(md) … … 40 37 #Marshall current object 41 38 #print "marshalling %s ..." % field 42 exec("md.%s.marshall( md,fid)" % field)39 exec("md.%s.marshall('md.%s',md,fid)" %(field,field)) 43 40 44 #Last, write MaximumNumberOfEnum+1to make sure that the binary file is not corrupt45 WriteData(fid,' enum',MaximumNumberOfDefinitionsEnum()+1,'data',True,'format','Boolean');41 #Last, write "md.EOF" to make sure that the binary file is not corrupt 42 WriteData(fid,'XXX','name','md.EOF','data',True,'format','Boolean'); 46 43 47 44 #close file
Note:
See TracChangeset
for help on using the changeset viewer.