Changeset 22507
- Timestamp:
- 03/09/18 08:44:31 (7 years ago)
- Location:
- issm/trunk-jpl/src/c
- Files:
-
- 4 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/Makefile.am
r22498 r22507 76 76 ./classes/Numberedcostfunction.cpp\ 77 77 ./classes/Misfit.cpp\ 78 ./classes/Cfsurfacesquare.cpp\ 79 ./classes/Cfsurfacelogvel.cpp\ 78 80 ./classes/Regionaloutput.cpp\ 79 81 ./classes/Nodalvalue.cpp\ -
issm/trunk-jpl/src/c/classes/Elements/Element.cpp
r22495 r22507 1489 1489 1490 1490 /*Intermediaries*/ 1491 int i,t; 1492 IssmDouble time; 1491 int i,t; 1493 1492 1494 1493 /*Branch on type of vector: nodal or elementary: */ … … 1598 1597 DoubleArrayInput* arrayinput=new DoubleArrayInput(vector_enum,layers,N); 1599 1598 this->inputs->AddInput(arrayinput); 1599 xDelete<IssmDouble>(layers); 1600 } 1601 else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long"); 1602 } 1603 else _error_("Cannot add input for vector type " << vector_type << " (not supported)"); 1604 } 1605 /*}}}*/ 1606 void Element::DatasetInputAdd(int enum_type,IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code,int input_enum){/*{{{*/ 1607 /*enum_type: the name of the DatasetInput (eg Outputdefinition1) 1608 * vector: information being stored (eg observations) 1609 * vector_type: is if by element or by vertex 1610 * vector_enum: is the name of the vector being stored 1611 * code: what type of data is in the vector (booleans, ints, doubles) 1612 */ 1613 1614 /*Intermediaries*/ 1615 int i,t; 1616 DatasetInput* datasetinput = NULL; 1617 1618 /*Get input if it already exists*/ 1619 Input* tempinput = GetInput(enum_type); 1620 if(tempinput){ 1621 /*Cast it to a Datasetinput*/ 1622 if(tempinput->ObjectEnum()!=DatasetInputEnum) _error_("don't know what to do"); 1623 datasetinput = (DatasetInput*)tempinput; 1624 } 1625 else{ 1626 datasetinput=new DatasetInput(enum_type); 1627 this->inputs->AddInput(datasetinput); 1628 } 1629 1630 1631 /*Branch on type of vector: nodal or elementary: */ 1632 if(vector_type==1){ //nodal vector 1633 1634 int numvertices = this->GetNumberOfVertices(); 1635 int *vertexids = xNew<int>(numvertices); 1636 IssmDouble *values = xNew<IssmDouble>(numvertices); 1637 1638 /*Recover vertices ids needed to initialize inputs*/ 1639 _assert_(iomodel->elements); 1640 for(i=0;i<numvertices;i++){ 1641 vertexids[i]=reCast<int>(iomodel->elements[numvertices*this->Sid()+i]); //ids for vertices are in the elements array from Matlab 1642 } 1643 1644 /*Are we in transient or static? */ 1645 if(M==1){ 1646 values[0]=vector[0]; 1647 switch(this->ObjectEnum()){ 1648 case TriaEnum: datasetinput->AddInput(new TriaInput(vector_enum,values,P0Enum),input_enum); break; 1649 case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P0Enum),input_enum); break; 1650 case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P0Enum),input_enum); break; 1651 default: _error_("Not implemented yet"); 1652 } 1653 } 1654 else if(M==iomodel->numberofvertices){ 1655 for(i=0;i<numvertices;i++) values[i]=vector[vertexids[i]-1]; 1656 switch(this->ObjectEnum()){ 1657 case TriaEnum: datasetinput->AddInput(new TriaInput(vector_enum,values,P1Enum),input_enum); break; 1658 case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P1Enum),input_enum); break; 1659 case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P1Enum),input_enum); break; 1660 default: _error_("Not implemented yet"); 1661 } } 1662 else if(M==iomodel->numberofvertices+1){ 1663 /*create transient input: */ 1664 IssmDouble* times = xNew<IssmDouble>(N); 1665 for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t]; 1666 TransientInput* transientinput=new TransientInput(vector_enum,times,N); 1667 for(t=0;t<N;t++){ 1668 for(i=0;i<numvertices;i++) values[i]=vector[N*(vertexids[i]-1)+t]; 1669 switch(this->ObjectEnum()){ 1670 case TriaEnum: transientinput->AddTimeInput(new TriaInput( vector_enum,values,P1Enum)); break; 1671 case PentaEnum: transientinput->AddTimeInput(new PentaInput(vector_enum,values,P1Enum)); break; 1672 case TetraEnum: transientinput->AddTimeInput(new TetraInput(vector_enum,values,P1Enum)); break; 1673 default: _error_("Not implemented yet"); 1674 } 1675 } 1676 datasetinput->AddInput(transientinput,input_enum); 1677 xDelete<IssmDouble>(times); 1678 } 1679 else if(M==iomodel->numberofelements){ 1680 1681 /*This is a Patch!*/ 1682 xDelete<IssmDouble>(values); 1683 values = xNew<IssmDouble>(N); 1684 for(int j=0;j<N;j++) values[j]=vector[this->Sid()*N+j]; 1685 1686 if (N==this->GetNumberOfNodes(P1Enum) ){ 1687 switch(this->ObjectEnum()){ 1688 case TriaEnum: datasetinput->AddInput(new TriaInput(vector_enum,values,P1Enum),input_enum); break; 1689 case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P1Enum),input_enum); break; 1690 case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P1Enum),input_enum); break; 1691 default: _error_("Not implemented yet"); 1692 } 1693 } 1694 else if(N==this->GetNumberOfNodes(P0Enum) ){ 1695 switch(this->ObjectEnum()){ 1696 case TriaEnum: datasetinput->AddInput(new TriaInput(vector_enum,values,P0Enum),input_enum); break; 1697 case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P0Enum),input_enum); break; 1698 case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P0Enum),input_enum); break; 1699 default: _error_("Not implemented yet"); 1700 } 1701 } 1702 else if(N==this->GetNumberOfNodes(P1xP2Enum)){ 1703 switch(this->ObjectEnum()){ 1704 case TriaEnum: datasetinput->AddInput(new TriaInput(vector_enum,values,P1xP2Enum),input_enum); break; 1705 case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P1xP2Enum),input_enum); break; 1706 case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P1xP2Enum),input_enum); break; 1707 default: _error_("Not implemented yet"); 1708 } 1709 } 1710 else if(N==this->GetNumberOfNodes(P1xP3Enum)) { 1711 switch(this->ObjectEnum()){ 1712 case TriaEnum: datasetinput->AddInput(new TriaInput(vector_enum,values,P1xP3Enum),input_enum); break; 1713 case PentaEnum: datasetinput->AddInput(new PentaInput(vector_enum,values,P1xP3Enum),input_enum); break; 1714 case TetraEnum: datasetinput->AddInput(new TetraInput(vector_enum,values,P1xP3Enum),input_enum); break; 1715 default: _error_("Not implemented yet"); 1716 } 1717 } 1718 else _error_("Patch interpolation not supported yet"); 1719 1720 } 1721 else{ 1722 _error_("nodal vector is either numberofvertices or numberofvertices+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long"); 1723 } 1724 1725 xDelete<IssmDouble>(values); 1726 xDelete<int>(vertexids); 1727 } 1728 else if(vector_type==2){ //element vector 1729 1730 IssmDouble value; 1731 1732 /*Are we in transient or static? */ 1733 if(M==iomodel->numberofelements){ 1734 if (code==5){ //boolean 1735 datasetinput->AddInput(new BoolInput(vector_enum,reCast<bool>(vector[this->Sid()])),input_enum); 1736 } 1737 else if (code==6){ //integer 1738 datasetinput->AddInput(new IntInput(vector_enum,reCast<int>(vector[this->Sid()])),input_enum); 1739 } 1740 else if (code==7){ //IssmDouble 1741 datasetinput->AddInput(new DoubleInput(vector_enum,vector[this->Sid()]),input_enum); 1742 } 1743 else _error_("could not recognize nature of vector from code " << code); 1744 } 1745 else if(M==iomodel->numberofelements+1){ 1746 /*create transient input: */ 1747 IssmDouble* times = xNew<IssmDouble>(N); 1748 for(t=0;t<N;t++) times[t] = vector[(M-1)*N+t]; 1749 TransientInput* transientinput=new TransientInput(vector_enum,times,N); 1750 TriaInput* bof=NULL; 1751 for(t=0;t<N;t++){ 1752 value=vector[N*this->Sid()+t]; 1753 switch(this->ObjectEnum()){ 1754 case TriaEnum: transientinput->AddTimeInput(new TriaInput( vector_enum,&value,P0Enum)); break; 1755 case PentaEnum: transientinput->AddTimeInput(new PentaInput(vector_enum,&value,P0Enum)); break; 1756 case TetraEnum: transientinput->AddTimeInput(new TetraInput(vector_enum,&value,P0Enum)); break; 1757 default: _error_("Not implemented yet"); 1758 } 1759 } 1760 datasetinput->AddInput(transientinput,input_enum); 1761 xDelete<IssmDouble>(times); 1762 } 1763 else _error_("element vector is either numberofelements or numberofelements+1 long. Field provided (" << EnumToStringx(vector_enum) << ") is " << M << " long"); 1764 } 1765 else if(vector_type==3){ //element vector 1766 1767 /*For right now we are static */ 1768 if(M==iomodel->numberofelements){ 1769 /*create transient input: */ 1770 IssmDouble* layers = xNewZeroInit<IssmDouble>(N);; 1771 for(t=0;t<N;t++) layers[t] = vector[N*this->Sid()+t]; 1772 DoubleArrayInput* arrayinput=new DoubleArrayInput(vector_enum,layers,N); 1773 datasetinput->AddInput(arrayinput,input_enum); 1600 1774 xDelete<IssmDouble>(layers); 1601 1775 } -
issm/trunk-jpl/src/c/classes/Elements/Element.h
r22473 r22507 122 122 void InputChangeName(int enum_type,int enum_type_old); 123 123 void InputCreate(IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code); 124 void DatasetInputAdd(int enum_type,IssmDouble* vector,IoModel* iomodel,int M,int N,int vector_type,int vector_enum,int code,int input_enum); 124 125 void InputDuplicate(int original_enum,int new_enum); 125 126 void InputUpdateFromConstant(IssmDouble constant, int name); -
issm/trunk-jpl/src/c/classes/classes.h
r22471 r22507 20 20 #include "./Nodalvalue.h" 21 21 #include "./Numberedcostfunction.h" 22 #include "./Cfsurfacesquare.h" 23 #include "./Cfsurfacelogvel.h" 22 24 #include "./Masscon.h" 23 25 #include "./Massconaxpby.h" -
issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateOutputDefinitions.cpp
r22410 r22507 65 65 else if (output_definition_enums[i]==MisfitEnum){ 66 66 /*Deal with misfits: {{{*/ 67 67 68 68 /*misfit variables: */ 69 69 int nummisfits; … … 157 157 /*}}}*/ 158 158 } 159 else if (output_definition_enums[i]==CfsurfacesquareEnum){ 160 /*Deal with cfsurfacesquare: {{{*/ 161 162 /*cfsurfacesquare variables: */ 163 int num_cfsurfacesquares; 164 char** cfsurfacesquare_name_s = NULL; 165 char** cfsurfacesquare_definitionstring_s = NULL; 166 char** cfsurfacesquare_model_string_s = NULL; 167 IssmDouble** cfsurfacesquare_observation_s = NULL; 168 char** cfsurfacesquare_observation_string_s = NULL; 169 int* cfsurfacesquare_observation_M_s = NULL; 170 int* cfsurfacesquare_observation_N_s = NULL; 171 IssmDouble** cfsurfacesquare_weights_s = NULL; 172 int* cfsurfacesquare_weights_M_s = NULL; 173 int* cfsurfacesquare_weights_N_s = NULL; 174 char** cfsurfacesquare_weights_string_s = NULL; 175 int* cfsurfacesquare_datatime_s = NULL; 176 177 /*Fetch name, model_string, observation, observation_string, etc ... (see src/m/classes/cfsurfacesquare.m): */ 178 iomodel->FetchMultipleData(&cfsurfacesquare_name_s,&num_cfsurfacesquares, "md.cfsurfacesquare.name"); 179 iomodel->FetchMultipleData(&cfsurfacesquare_definitionstring_s,&num_cfsurfacesquares, "md.cfsurfacesquare.definitionstring"); 180 iomodel->FetchMultipleData(&cfsurfacesquare_model_string_s,&num_cfsurfacesquares, "md.cfsurfacesquare.model_string"); 181 iomodel->FetchMultipleData(&cfsurfacesquare_observation_s,&cfsurfacesquare_observation_M_s,&cfsurfacesquare_observation_N_s,&num_cfsurfacesquares, "md.cfsurfacesquare.observation"); 182 iomodel->FetchMultipleData(&cfsurfacesquare_observation_string_s,&num_cfsurfacesquares, "md.cfsurfacesquare.observation_string"); 183 iomodel->FetchMultipleData(&cfsurfacesquare_weights_s,&cfsurfacesquare_weights_M_s,&cfsurfacesquare_weights_N_s,&num_cfsurfacesquares, "md.cfsurfacesquare.weights"); 184 iomodel->FetchMultipleData(&cfsurfacesquare_weights_string_s,&num_cfsurfacesquares, "md.cfsurfacesquare.weights_string"); 185 iomodel->FetchMultipleData(&cfsurfacesquare_datatime_s,&num_cfsurfacesquares, "md.cfsurfacesquare.datatime"); 186 187 for(j=0;j<num_cfsurfacesquares;j++){ 188 189 int obs_vector_type=0; 190 if ((cfsurfacesquare_observation_M_s[j]==iomodel->numberofvertices) || (cfsurfacesquare_observation_M_s[j]==iomodel->numberofvertices+1)){ 191 obs_vector_type=1; 192 } 193 else if ((cfsurfacesquare_observation_M_s[j]==iomodel->numberofelements) || (cfsurfacesquare_observation_M_s[j]==iomodel->numberofelements+1)){ 194 obs_vector_type=2; 195 } 196 else 197 _error_("cfsurfacesquare observation size not supported yet"); 198 199 int weight_vector_type=0; 200 if ((cfsurfacesquare_weights_M_s[j]==iomodel->numberofvertices) || (cfsurfacesquare_weights_M_s[j]==iomodel->numberofvertices+1)){ 201 weight_vector_type=1; 202 } 203 else if ((cfsurfacesquare_weights_M_s[j]==iomodel->numberofelements) || (cfsurfacesquare_weights_M_s[j]==iomodel->numberofelements+1)){ 204 weight_vector_type=2; 205 } 206 else 207 _error_("cfsurfacesquare weight size not supported yet"); 208 209 /*First create a cfsurfacesquare object for that specific string (cfsurfacesquare_model_string_s[j]):*/ 210 output_definitions->AddObject(new Cfsurfacesquare(cfsurfacesquare_name_s[j],StringToEnumx(cfsurfacesquare_definitionstring_s[j]),StringToEnumx(cfsurfacesquare_model_string_s[j]),StringToEnumx(cfsurfacesquare_observation_string_s[j]),StringToEnumx(cfsurfacesquare_weights_string_s[j]),cfsurfacesquare_datatime_s[j],false)); 211 212 /*Now, for this particular cfsurfacesquare object, make sure we plug into the elements: the observation, and the weights.*/ 213 for(int k=0;k<elements->Size();k++){ 214 215 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(k)); 216 217 element->DatasetInputAdd(StringToEnumx(cfsurfacesquare_definitionstring_s[j]),cfsurfacesquare_observation_s[j], iomodel,cfsurfacesquare_observation_M_s[j],cfsurfacesquare_observation_N_s[j],obs_vector_type,StringToEnumx(cfsurfacesquare_observation_string_s[j]),7,SurfaceObservationEnum); 218 element->DatasetInputAdd(StringToEnumx(cfsurfacesquare_definitionstring_s[j]),cfsurfacesquare_weights_s[j], iomodel,cfsurfacesquare_weights_M_s[j],cfsurfacesquare_weights_N_s[j],weight_vector_type,StringToEnumx(cfsurfacesquare_weights_string_s[j]),7,WeightsSurfaceObservationEnum); 219 220 } 221 222 } 223 224 /*Free ressources:*/ 225 for(j=0;j<num_cfsurfacesquares;j++){ 226 char* string=NULL; 227 IssmDouble* matrix = NULL; 228 229 string = cfsurfacesquare_definitionstring_s[j]; xDelete<char>(string); 230 string = cfsurfacesquare_observation_string_s[j]; xDelete<char>(string); 231 string = cfsurfacesquare_model_string_s[j]; xDelete<char>(string); 232 string = cfsurfacesquare_weights_string_s[j]; xDelete<char>(string); 233 string = cfsurfacesquare_name_s[j]; xDelete<char>(string); 234 matrix = cfsurfacesquare_observation_s[j]; xDelete<IssmDouble>(matrix); 235 matrix = cfsurfacesquare_weights_s[j]; xDelete<IssmDouble>(matrix); 236 } 237 xDelete<char*>(cfsurfacesquare_name_s); 238 xDelete<char*>(cfsurfacesquare_model_string_s); 239 xDelete<char*>(cfsurfacesquare_definitionstring_s); 240 xDelete<IssmDouble*>(cfsurfacesquare_observation_s); 241 xDelete<char*>(cfsurfacesquare_observation_string_s); 242 xDelete<int>(cfsurfacesquare_observation_M_s); 243 xDelete<int>(cfsurfacesquare_observation_N_s); 244 xDelete<IssmDouble*>(cfsurfacesquare_weights_s); 245 xDelete<int>(cfsurfacesquare_weights_M_s); 246 xDelete<int>(cfsurfacesquare_weights_N_s); 247 xDelete<char*>(cfsurfacesquare_weights_string_s); 248 xDelete<int>(cfsurfacesquare_datatime_s); 249 /*}}}*/ 250 } 251 else if (output_definition_enums[i]==CfsurfacelogvelEnum){ 252 /*Deal with cfsurfacelogvel: {{{*/ 253 254 /*cfsurfacelogvel variables: */ 255 int num_cfsurfacelogvels; 256 char** cfsurfacelogvel_name = NULL; 257 char** cfsurfacelogvel_definitionstring = NULL; 258 IssmDouble** cfsurfacelogvel_vxobs = NULL; 259 IssmDouble** cfsurfacelogvel_vyobs = NULL; 260 char** cfsurfacelogvel_vxobs_string = NULL; 261 char** cfsurfacelogvel_vyobs_string = NULL; 262 int* cfsurfacelogvel_observation_M = NULL; 263 int* cfsurfacelogvel_observation_N = NULL; 264 IssmDouble** cfsurfacelogvel_weights = NULL; 265 int* cfsurfacelogvel_weights_M = NULL; 266 int* cfsurfacelogvel_weights_N = NULL; 267 char** cfsurfacelogvel_weightstring = NULL; 268 int* cfsurfacelogvel_datatime = NULL; 269 270 /*Fetch name, modeltring, observation, observationtring, etc ... (see src/m/classes/cfsurfacelogvel.m): */ 271 iomodel->FetchMultipleData(&cfsurfacelogvel_name,&num_cfsurfacelogvels, "md.cfsurfacelogvel.name"); 272 iomodel->FetchMultipleData(&cfsurfacelogvel_definitionstring,&num_cfsurfacelogvels, "md.cfsurfacelogvel.definitionstring"); 273 iomodel->FetchMultipleData(&cfsurfacelogvel_vxobs,&cfsurfacelogvel_observation_M,&cfsurfacelogvel_observation_N,&num_cfsurfacelogvels, "md.cfsurfacelogvel.vxobs"); 274 iomodel->FetchMultipleData(&cfsurfacelogvel_vxobs_string,&num_cfsurfacelogvels, "md.cfsurfacelogvel.vxobs_string"); 275 iomodel->FetchMultipleData(&cfsurfacelogvel_vyobs,&cfsurfacelogvel_observation_M,&cfsurfacelogvel_observation_N,&num_cfsurfacelogvels, "md.cfsurfacelogvel.vyobs"); 276 iomodel->FetchMultipleData(&cfsurfacelogvel_vyobs_string,&num_cfsurfacelogvels, "md.cfsurfacelogvel.vyobs_string"); iomodel->FetchMultipleData(&cfsurfacelogvel_weights,&cfsurfacelogvel_weights_M,&cfsurfacelogvel_weights_N,&num_cfsurfacelogvels, "md.cfsurfacelogvel.weights"); 277 iomodel->FetchMultipleData(&cfsurfacelogvel_weightstring,&num_cfsurfacelogvels, "md.cfsurfacelogvel.weights_string"); 278 _printf_("Num with weight string: "<<num_cfsurfacelogvels<<"\n"); 279 iomodel->FetchMultipleData(&cfsurfacelogvel_datatime,&num_cfsurfacelogvels, "md.cfsurfacelogvel.datatime"); 280 281 for(j=0;j<num_cfsurfacelogvels;j++){ 282 283 int obs_vector_type=0; 284 if ((cfsurfacelogvel_observation_M[j]==iomodel->numberofvertices) || (cfsurfacelogvel_observation_M[j]==iomodel->numberofvertices+1)){ 285 obs_vector_type=1; 286 } 287 else if ((cfsurfacelogvel_observation_M[j]==iomodel->numberofelements) || (cfsurfacelogvel_observation_M[j]==iomodel->numberofelements+1)){ 288 obs_vector_type=2; 289 } 290 else 291 _error_("cfsurfacelogvel observation size not supported yet"); 292 293 int weight_vector_type=0; 294 if ((cfsurfacelogvel_weights_M[j]==iomodel->numberofvertices) || (cfsurfacelogvel_weights_M[j]==iomodel->numberofvertices+1)){ 295 weight_vector_type=1; 296 } 297 else if ((cfsurfacelogvel_weights_M[j]==iomodel->numberofelements) || (cfsurfacelogvel_weights_M[j]==iomodel->numberofelements+1)){ 298 weight_vector_type=2; 299 } 300 else 301 _error_("cfsurfacelogvel weight size not supported yet"); 302 303 /*First create a cfsurfacelogvel object for that specific string (cfsurfacelogvel_modeltring[j]):*/ 304 output_definitions->AddObject(new Cfsurfacelogvel(cfsurfacelogvel_name[j],StringToEnumx(cfsurfacelogvel_definitionstring[j]),cfsurfacelogvel_datatime[j],false)); 305 306 /*Now, for this particular cfsurfacelogvel object, make sure we plug into the elements: the observation, and the weights.*/ 307 for(int k=0;k<elements->Size();k++){ 308 309 Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(k)); 310 311 element->DatasetInputAdd(StringToEnumx(cfsurfacelogvel_definitionstring[j]),cfsurfacelogvel_vxobs[j], iomodel,cfsurfacelogvel_observation_M[j],cfsurfacelogvel_observation_N[j],obs_vector_type,StringToEnumx(cfsurfacelogvel_vxobs_string[j]),7,VxObsEnum); 312 element->DatasetInputAdd(StringToEnumx(cfsurfacelogvel_definitionstring[j]),cfsurfacelogvel_vyobs[j], iomodel,cfsurfacelogvel_observation_M[j],cfsurfacelogvel_observation_N[j],obs_vector_type,StringToEnumx(cfsurfacelogvel_vyobs_string[j]),7,VyObsEnum); 313 element->DatasetInputAdd(StringToEnumx(cfsurfacelogvel_definitionstring[j]),cfsurfacelogvel_weights[j], iomodel,cfsurfacelogvel_weights_M[j],cfsurfacelogvel_weights_N[j],weight_vector_type,StringToEnumx(cfsurfacelogvel_weightstring[j]),7,WeightsSurfaceObservationEnum); 314 315 } 316 317 } 318 319 /*Free ressources:*/ 320 for(j=0;j<num_cfsurfacelogvels;j++){ 321 char* string=NULL; 322 IssmDouble* matrix = NULL; 323 324 string = cfsurfacelogvel_definitionstring[j]; xDelete<char>(string); 325 string = cfsurfacelogvel_vxobs_string[j]; xDelete<char>(string); 326 string = cfsurfacelogvel_vyobs_string[j]; xDelete<char>(string); 327 string = cfsurfacelogvel_weightstring[j]; xDelete<char>(string); 328 string = cfsurfacelogvel_name[j]; xDelete<char>(string); 329 matrix = cfsurfacelogvel_weights[j]; xDelete<IssmDouble>(matrix); 330 matrix = cfsurfacelogvel_vxobs[j]; xDelete<IssmDouble>(matrix); 331 matrix = cfsurfacelogvel_vyobs[j]; xDelete<IssmDouble>(matrix); 332 } 333 xDelete<char*>(cfsurfacelogvel_name); 334 xDelete<char*>(cfsurfacelogvel_definitionstring); 335 xDelete<int>(cfsurfacelogvel_observation_M); 336 xDelete<IssmDouble*>(cfsurfacelogvel_vxobs); 337 xDelete<IssmDouble*>(cfsurfacelogvel_vyobs); 338 xDelete<char*>(cfsurfacelogvel_vxobs_string); 339 xDelete<char*>(cfsurfacelogvel_vyobs_string); 340 xDelete<int>(cfsurfacelogvel_observation_N); 341 xDelete<IssmDouble*>(cfsurfacelogvel_weights); 342 xDelete<int>(cfsurfacelogvel_weights_M); 343 xDelete<int>(cfsurfacelogvel_weights_N); 344 xDelete<char*>(cfsurfacelogvel_weightstring); 345 xDelete<int>(cfsurfacelogvel_datatime); 346 /*}}}*/ 347 } 159 348 else if (output_definition_enums[i]==NodalvalueEnum){ 160 349 /*Deal with nodal values: {{{*/ -
issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h
r22495 r22507 759 759 VyObsEnum, 760 760 NumberedcostfunctionEnum, 761 CfsurfacesquareEnum, 762 CfsurfacelogvelEnum, 761 763 /*}}}*/ 762 764 /*Relaxation{{{*/ -
issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp
r22495 r22507 753 753 case VyObsEnum : return "VyObs"; 754 754 case NumberedcostfunctionEnum : return "Numberedcostfunction"; 755 case CfsurfacesquareEnum : return "Cfsurfacesquare"; 756 case CfsurfacelogvelEnum : return "Cfsurfacelogvel"; 755 757 case AbsoluteEnum : return "Absolute"; 756 758 case IncrementalEnum : return "Incremental"; -
issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp
r22495 r22507 771 771 else if (strcmp(name,"VyObs")==0) return VyObsEnum; 772 772 else if (strcmp(name,"Numberedcostfunction")==0) return NumberedcostfunctionEnum; 773 else if (strcmp(name,"Cfsurfacesquare")==0) return CfsurfacesquareEnum; 774 else if (strcmp(name,"Cfsurfacelogvel")==0) return CfsurfacelogvelEnum; 773 775 else if (strcmp(name,"Absolute")==0) return AbsoluteEnum; 774 776 else if (strcmp(name,"Incremental")==0) return IncrementalEnum; … … 873 875 else if (strcmp(name,"SealevelriseNumRequestedOutputs")==0) return SealevelriseNumRequestedOutputsEnum; 874 876 else if (strcmp(name,"LoveNfreq")==0) return LoveNfreqEnum; 875 else if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum;876 else if (strcmp(name,"LoveShNmax")==0) return LoveShNmaxEnum;877 877 else stage=8; 878 878 } 879 879 if(stage==8){ 880 if (strcmp(name,"LoveShNmin")==0) return LoveShNminEnum; 880 if (strcmp(name,"LoveFrequencies")==0) return LoveFrequenciesEnum; 881 else if (strcmp(name,"LoveShNmax")==0) return LoveShNmaxEnum; 882 else if (strcmp(name,"LoveShNmin")==0) return LoveShNminEnum; 881 883 else if (strcmp(name,"LoveG0")==0) return LoveG0Enum; 882 884 else if (strcmp(name,"LoveR0")==0) return LoveR0Enum; … … 996 998 else if (strcmp(name,"TriaInput")==0) return TriaInputEnum; 997 999 else if (strcmp(name,"Tetra")==0) return TetraEnum; 998 else if (strcmp(name,"TetraInput")==0) return TetraInputEnum;999 else if (strcmp(name,"Penta")==0) return PentaEnum;1000 1000 else stage=9; 1001 1001 } 1002 1002 if(stage==9){ 1003 if (strcmp(name,"PentaInput")==0) return PentaInputEnum; 1003 if (strcmp(name,"TetraInput")==0) return TetraInputEnum; 1004 else if (strcmp(name,"Penta")==0) return PentaEnum; 1005 else if (strcmp(name,"PentaInput")==0) return PentaInputEnum; 1004 1006 else if (strcmp(name,"Vertex")==0) return VertexEnum; 1005 1007 else if (strcmp(name,"VertexPId")==0) return VertexPIdEnum; … … 1119 1121 else if (strcmp(name,"P1xP4")==0) return P1xP4Enum; 1120 1122 else if (strcmp(name,"P2xP4")==0) return P2xP4Enum; 1121 else if (strcmp(name,"P1P1")==0) return P1P1Enum;1122 else if (strcmp(name,"P1P1GLS")==0) return P1P1GLSEnum;1123 1123 else stage=10; 1124 1124 } 1125 1125 if(stage==10){ 1126 if (strcmp(name,"MINI")==0) return MINIEnum; 1126 if (strcmp(name,"P1P1")==0) return P1P1Enum; 1127 else if (strcmp(name,"P1P1GLS")==0) return P1P1GLSEnum; 1128 else if (strcmp(name,"MINI")==0) return MINIEnum; 1127 1129 else if (strcmp(name,"MINIcondensed")==0) return MINIcondensedEnum; 1128 1130 else if (strcmp(name,"TaylorHood")==0) return TaylorHoodEnum;
Note:
See TracChangeset
for help on using the changeset viewer.