Changeset 1911
- Timestamp:
- 08/26/09 09:26:57 (16 years ago)
- Location:
- issm/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/c/parallel/diagnostic.cpp
r1890 r1911 23 23 char* outputfilename=NULL; 24 24 char* lockname=NULL; 25 int waitonlock=0;26 25 int qmu_analysis=0; 26 int control_analysis=0; 27 char* control_type=NULL; 27 28 28 29 /*Model: */ … … 34 35 35 36 ParameterInputs* inputs=NULL; 37 int waitonlock=0; 36 38 int numberofnodes; 37 39 38 40 double* u_g_initial=NULL; 41 double* u_g_obs=NULL; 39 42 Param* param=NULL; 43 int count; 44 DataSet* parameters=NULL; 40 45 41 46 MODULEBOOT(); … … 80 85 /*get parameters: */ 81 86 model->FindParam(&qmu_analysis,"qmu_analysis"); 87 model->FindParam(&control_analysis,"control_analysis"); 82 88 model->FindParam(&waitonlock,"waitonlock"); 83 89 … … 85 91 model->FindParam(&u_g_initial,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 86 92 model->FindParam(&numberofnodes,"numberofnodes"); 93 if(control_analysis){ 94 model->FindParam(&u_g_obs,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum()); 95 } 87 96 88 97 inputs=new ParameterInputs; 89 98 inputs->Add("velocity",u_g_initial,3,numberofnodes); 99 if(control_analysis){ 100 inputs->Add("velocity_obs",u_g_obs,2,numberofnodes); 101 } 90 102 91 103 _printf_("initialize results:\n"); … … 94 106 /*are we running the solution sequence, or a qmu wrapper around it? : */ 95 107 if(!qmu_analysis){ 96 97 /*run diagnostic analysis: */ 98 _printf_("call computational core:\n"); 99 diagnostic_core(results,model,inputs); 100 108 if(!control_analysis){ 109 /*run diagnostic analysis: */ 110 _printf_("call computational core:\n"); 111 diagnostic_core(results,model,inputs); 112 } 113 else{ 114 /*run control analysis: */ 115 _printf_("call computational core:\n"); 116 control_core(results,model,inputs); 117 } 101 118 } 102 119 else{ … … 111 128 } 112 129 113 /*Add analysis_type to results: */ 114 result=new Result(results->Size()+1,0,1,"analysis_type","diagnostic"); 115 results->AddObject(result); 130 if(!control_analysis){ 131 /*Add analysis_type to results: */ 132 result=new Result(results->Size()+1,0,1,"analysis_type","diagnostic"); 133 results->AddObject(result); 134 135 _printf_("process results:\n"); 136 ProcessResults(&results,model,DiagnosticAnalysisEnum()); 137 } 138 else{ 139 /*Add analysis_type and control_type to results: */ 140 result=new Result(results->Size()+1,0,1,"analysis_type","control"); 141 results->AddObject(result); 142 143 model->FindParam(&control_type,"control_type"); 144 result=new Result(results->Size()+1,0,1,"control_type",control_type); 145 results->AddObject(result); 116 146 117 _printf_("process results:\n"); 118 ProcessResults(&results,model,DiagnosticAnalysisEnum()); 119 147 _printf_("process results:\n"); 148 ProcessResults(&results,model,ControlAnalysisEnum()); 149 } 150 120 151 _printf_("write results to disk:\n"); 121 152 OutputResults(results,outputfilename); … … 132 163 MODULEEND(); 133 164 165 /*Free ressources */ 166 xfree((void**)&u_g_initial); 167 xfree((void**)&u_g_obs); 168 134 169 return 0; //unix success return; 135 170 } -
issm/trunk/src/m/classes/public/loadresultsfromdisk.m
r1808 r1911 21 21 %Check result is consistent, only if it exists 22 22 disp(sprintf('%s\n','checking result consistency')); 23 if ~isresultconsistent(md,md.analysis_type),24 %it would be very cruel to put an error, it would kill the computed results (even if not consistent...)25 disp('!! results not consistent correct the model !!')26 end23 %if ~isresultconsistent(md,md.analysis_type), 24 % %it would be very cruel to put an error, it would kill the computed results (even if not consistent...) 25 % disp('!! results not consistent correct the model !!') 26 %end 27 27 28 28 %convert analysis type to string -
issm/trunk/src/m/classes/public/marshall.m
r1862 r1911 96 96 97 97 %Control methods 98 WriteData(fid,md.control_analysis,'Integer','control_analysis'); 98 99 WriteData(fid,md.control_type,'String','control_type'); 99 100
Note:
See TracChangeset
for help on using the changeset viewer.