Changeset 1911


Ignore:
Timestamp:
08/26/09 09:26:57 (16 years ago)
Author:
seroussi
Message:

moved control solution in diagnostic for paralle

Location:
issm/trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/c/parallel/diagnostic.cpp

    r1890 r1911  
    2323        char* outputfilename=NULL;
    2424        char* lockname=NULL;
    25         int   waitonlock=0;
    2625        int   qmu_analysis=0;
     26        int   control_analysis=0;
     27        char* control_type=NULL;
    2728
    2829        /*Model: */
     
    3435       
    3536        ParameterInputs* inputs=NULL;
     37        int waitonlock=0;
    3638        int   numberofnodes;
    3739       
    3840        double* u_g_initial=NULL;
     41        double* u_g_obs=NULL;
    3942        Param*  param=NULL;
     43        int      count;
     44        DataSet* parameters=NULL;
    4045
    4146        MODULEBOOT();
     
    8085        /*get parameters: */
    8186        model->FindParam(&qmu_analysis,"qmu_analysis");
     87        model->FindParam(&control_analysis,"control_analysis");
    8288        model->FindParam(&waitonlock,"waitonlock");
    8389
     
    8591        model->FindParam(&u_g_initial,"u_g",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
    8692        model->FindParam(&numberofnodes,"numberofnodes");
     93        if(control_analysis){
     94                model->FindParam(&u_g_obs,"u_g_obs",DiagnosticAnalysisEnum(),HorizAnalysisEnum());
     95        }
    8796
    8897        inputs=new ParameterInputs;
    8998        inputs->Add("velocity",u_g_initial,3,numberofnodes);
     99        if(control_analysis){
     100                inputs->Add("velocity_obs",u_g_obs,2,numberofnodes);
     101        }
    90102       
    91103        _printf_("initialize results:\n");
     
    94106        /*are we running the solution sequence, or a qmu wrapper around it? : */
    95107        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                }
    101118        }
    102119        else{
     
    111128        }
    112129
    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);
    116146
    117         _printf_("process results:\n");
    118         ProcessResults(&results,model,DiagnosticAnalysisEnum());
    119        
     147                _printf_("process results:\n");
     148                ProcessResults(&results,model,ControlAnalysisEnum());
     149        }
     150
    120151        _printf_("write results to disk:\n");
    121152        OutputResults(results,outputfilename);
     
    132163        MODULEEND();
    133164       
     165        /*Free ressources */
     166        xfree((void**)&u_g_initial);
     167        xfree((void**)&u_g_obs);
     168
    134169        return 0; //unix success return;
    135170}
  • issm/trunk/src/m/classes/public/loadresultsfromdisk.m

    r1808 r1911  
    2121%Check result is consistent, only if it exists
    2222disp(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 end
     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%end
    2727
    2828%convert analysis type to string
  • issm/trunk/src/m/classes/public/marshall.m

    r1862 r1911  
    9696
    9797%Control methods
     98WriteData(fid,md.control_analysis,'Integer','control_analysis');
    9899WriteData(fid,md.control_type,'String','control_type');
    99100
Note: See TracChangeset for help on using the changeset viewer.