Changeset 772
- Timestamp:
- 06/04/09 14:18:38 (15 years ago)
- Location:
- issm/trunk/src/c/ModelProcessorx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/ModelProcessorx/Control/CreateParametersControl.cpp
r766 r772 27 27 double* maxiter=NULL; 28 28 double* control_parameter=NULL; 29 double* param_g=NULL; 30 29 31 double* vx_obs=NULL; 30 32 double* vy_obs=NULL; 31 33 double* u_g_obs=NULL; 32 double* p_g=NULL; 34 35 double* vx=NULL; 36 double* vy=NULL; 37 double* vz=NULL; 38 double* u_g=NULL; 33 39 34 40 /*Get parameters: */ … … 41 47 param->SetString(model->control_type); 42 48 parameters->AddObject(param); 43 44 49 45 50 /*nsteps: */ … … 103 108 xfree((void**)&model->maxiter); 104 109 105 /*Get vx_obs, vy_obs, and the parameter value: */ 110 /*Get vx, vx_obs, vy, vy_obs, and the parameter value: */ 111 ModelFetchData((void**)&vx,NULL,NULL,model_handle,"vx","Matrix","Mat"); 112 ModelFetchData((void**)&vy,NULL,NULL,model_handle,"vy","Matrix","Mat"); 113 ModelFetchData((void**)&vz,NULL,NULL,model_handle,"vz","Matrix","Mat"); 106 114 ModelFetchData((void**)&vx_obs,NULL,NULL,model_handle,"vx_obs","Matrix","Mat"); 107 115 ModelFetchData((void**)&vy_obs,NULL,NULL,model_handle,"vy_obs","Matrix","Mat"); 108 116 ModelFetchData((void**)&control_parameter,NULL,NULL,model_handle,model->control_type,"Matrix","Mat"); 117 118 u_g=(double*)xcalloc(model->numberofnodes*2,sizeof(double)); 119 if(vx)for(i=0;i<model->numberofnodes;i++)u_g[3*i+0]=vx[i]/model->yts; 120 if(vy)for(i=0;i<model->numberofnodes;i++)u_g[3*i+1]=vy[i]/model->yts; 121 if(vz)for(i=0;i<model->numberofnodes;i++)u_g[3*i+2]=vz[i]/model->yts; 122 123 count++; 124 param= new Param(count,"u_g",DOUBLEVEC); 125 param->SetDoubleVec(u_g,3*model->numberofnodes,3); 126 parameters->AddObject(param); 109 127 110 128 u_g_obs=(double*)xcalloc(model->numberofnodes*2,sizeof(double)); … … 117 135 parameters->AddObject(param); 118 136 119 p _g=(double*)xcalloc(model->numberofnodes*2,sizeof(double));120 for(i=0;i<model->numberofnodes;i++)p _g[2*i+0]=control_parameter[i];137 param_g=(double*)xcalloc(model->numberofnodes*2,sizeof(double)); 138 for(i=0;i<model->numberofnodes;i++)param_g[2*i+0]=control_parameter[i]; 121 139 122 140 count++; 123 141 param= new Param(count,"param_g",DOUBLEVEC); 124 param->SetDoubleVec(p _g,model->numberofnodes,1);142 param->SetDoubleVec(param_g,2*model->numberofnodes,2); 125 143 parameters->AddObject(param); 126 144 145 xfree((void**)&vx); 146 xfree((void**)&vy); 147 xfree((void**)&vz); 148 xfree((void**)&u_g); 127 149 xfree((void**)&vx_obs); 128 150 xfree((void**)&vy_obs); 129 151 xfree((void**)&u_g_obs); 130 xfree((void**)&p _g);152 xfree((void**)¶m_g); 131 153 xfree((void**)&control_parameter); 132 133 154 134 155 /*Assign output pointer: */ 135 156 *pparameters=parameters; 136 157 } 137 138 -
issm/trunk/src/c/ModelProcessorx/DiagnosticHoriz/CreateParametersDiagnosticHoriz.cpp
r765 r772 57 57 *pparameters=parameters; 58 58 } 59 60
Note:
See TracChangeset
for help on using the changeset viewer.