Changeset 17924


Ignore:
Timestamp:
05/04/14 14:18:34 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: some CPPcheck errors

Location:
issm/trunk-jpl/src/c
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified issm/trunk-jpl/src/c/analyses/LsfReinitializationAnalysis.cpp

    r17700 r17924  
    112112        /*Intermediaries */
    113113        const int dim = 2;
    114         int        i,row,col,stabilization;
     114        int        row,col,stabilization;
    115115        IssmDouble Jdet,D_scalar;
    116116        IssmDouble dtau = 1.;
     
    399399
    400400        /* Intermediaries */
    401         int i,k;
     401        int i;
    402402        IssmDouble dmaxp,dmaxm,val;
    403403        Element* element;
  • TabularUnified issm/trunk-jpl/src/c/analyses/MasstransportAnalysis.cpp

    r17889 r17924  
    3232        int    stabilization,finiteelement,smb_model;
    3333        bool   dakota_analysis;
    34         bool   issmbgradients;
    35         bool   ispdd;
    3634        bool   isdelta18o;
    3735        bool   isgroundingline;
  • TabularUnified issm/trunk-jpl/src/c/analyses/SmoothedSurfaceSlopeYAnalysis.cpp

    r17886 r17924  
    119119
    120120        /*Intermediaries */
    121         int         input_enum;
    122121        IssmDouble  Jdet,thickness,slope[2];
    123122        IssmDouble  taud_y,norms,normv,vx,vy;
  • TabularUnified issm/trunk-jpl/src/c/analyses/StressbalanceAnalysis.cpp

    r17886 r17924  
    31983198        /*Intermediaries*/
    31993199        bool        mainlyfloating;
    3200         int         i,dim,domaintype,epssize;
     3200        int         dim,domaintype;
    32013201        int         migration_style,point1;
    32023202        IssmDouble  alpha2,Jdet,fraction1,fraction2;
     
    52605260
    52615261        /*Intermediaries*/
    5262         int         i,j,approximation;
     5262        int         i,approximation;
    52635263        int         dim=3;
    52645264        IssmDouble  Jdet,Jdet2d,FSreconditioning;
  • TabularUnified issm/trunk-jpl/src/c/classes/Elements/Element.cpp

    r17862 r17924  
    593593
    594594        /*Intermediaries*/
    595         int        i,t,row;
     595        int        i,t;
    596596        IssmDouble time;
    597597
  • TabularUnified issm/trunk-jpl/src/c/classes/IoModel.cpp

    r17842 r17924  
    286286void IoModel::StartTrace(void){
    287287
    288         int  i;
    289288        bool autodiff = false;
    290289        bool keep=false;
  • TabularUnified issm/trunk-jpl/src/c/classes/Loads/Riftfront.cpp

    r17555 r17924  
    3939        int    riftfront_elem_ids[2];
    4040        int    riftfront_matpar_id;
    41         int    riftfront_type;
    42         int    riftfront_fill;
    4341        IssmDouble riftfront_friction;
    4442        IssmDouble riftfront_fractionincrement;
    45         bool   riftfront_shelf;
    4643        int    penalty_lock;
    4744
  • TabularUnified issm/trunk-jpl/src/c/classes/Massfluxatgate.h

    r16499 r17924  
    3131                /*FUNCTION Massfluxatgate() {{{*/
    3232                Massfluxatgate(){
    33                         this->name     = 0;
    34                         this->numsegments     = 0;
    35                         this->segments   = 0;
     33                        this->name        = 0;
     34                        this->numsegments = 0;
     35                        this->segments    = 0;
    3636                }
    3737                /*}}}*/
  • TabularUnified issm/trunk-jpl/src/c/classes/Materials/Matpar.cpp

    r17884 r17924  
    2121Matpar::Matpar(int matpar_mid, IoModel* iomodel){
    2222
    23         bool ispdd;
    2423        bool isefficientlayer;
    2524        int  hydrology_model,smb_model;
  • TabularUnified issm/trunk-jpl/src/c/classes/kriging/Observations.cpp

    r17342 r17924  
    353353        int           i,j,n_obs;
    354354        IssmPDouble   prediction,error;
    355         IssmPDouble   numerator,denominator,ratio;
    356355        IssmPDouble  *x      = NULL;
    357356        IssmPDouble  *y      = NULL;
  • TabularUnified issm/trunk-jpl/src/c/cores/controlm1qn3_core.cpp

    r17918 r17924  
    128128
    129129        /*Recover Femmodel*/
    130         double      f;
    131         int         intn,solution_type;
     130        int         solution_type;
    132131        FemModel   *femmodel  = (FemModel*)dzs;
    133132
  • TabularUnified issm/trunk-jpl/src/c/cores/masstransport_core.cpp

    r17887 r17924  
    1313
    1414        /*parameters: */
    15         int    i;
    1615        int    numoutputs,domaintype;
    1716        bool   save_results;
    18         bool   issmbgradients,ispdd,isdelta18o,isFS,isfreesurface,dakota_analysis;
     17        bool   isFS,isfreesurface,dakota_analysis;
    1918        int    solution_type;
    2019        char** requested_outputs = NULL;
  • TabularUnified issm/trunk-jpl/src/c/cores/steadystate_core.cpp

    r17236 r17924  
    2121
    2222        /*intermediary: */
    23         int i;
    2423        int step;
    2524        Vector<IssmDouble>* ug     = NULL;
  • TabularUnified issm/trunk-jpl/src/c/cores/transient_core.cpp

    r17760 r17924  
    2020
    2121        /*parameters: */
    22         int    i;
    2322        IssmDouble starttime,finaltime,dt,yts;
    24         bool   isstressbalance,ismasstransport,isFS,isthermal,isgroundingline,isgia,islevelset,isdamageevolution,ishydrology;
    25         bool   save_results,dakota_analysis;
    26         bool   time_adapt=false;
    27         int    output_frequency;
    28         int    domaintype,groundingline_migration,smb_model;
    29         int    numoutputs         = 0;
    30   Analysis *analysis = NULL;
    31         char** requested_outputs = NULL;
     23        bool       isstressbalance,ismasstransport,isFS,isthermal,isgroundingline,isgia,islevelset,isdamageevolution,ishydrology;
     24        bool       save_results,dakota_analysis;
     25        bool       time_adapt=false;
     26        int        output_frequency;
     27        int        domaintype,groundingline_migration;
     28        int        numoutputs         = 0;
     29        Analysis *analysis = NULL;
     30        char**     requested_outputs = NULL;
    3231
    3332
  • TabularUnified issm/trunk-jpl/src/c/modules/IoModelToConstraintsx/IoModelToConstraintsx.cpp

    r17844 r17924  
    3333
    3434        /*intermediary: */
    35         bool        isnan;
    3635        int         i,j,count,elementnbv,numfacevertices;
    3736        IssmDouble  value;
     
    4140
    4241        /*Higher-order finite elements*/
    43         int   v1,v2,v3,v4;
     42        int   v1,v2;
    4443        bool *my_edges = NULL;
    4544        bool *my_faces = NULL;
  • TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateEdges.cpp

    r17853 r17924  
    149149        bool isv1,isv2;
    150150        int  facenbv,v1,v2;
    151         int  id_edge,id_element,id_face;
     151        int  id_edge,id_element;
    152152        int  elementnbe;
    153153
  • TabularUnified issm/trunk-jpl/src/c/modules/ModelProcessorx/CreateParameters.cpp

    r17895 r17924  
    1919
    2020        int         i,j,m,k;
    21         int         numoutputs,domaintype,materialtype,smb_model;
     21        int         numoutputs,materialtype,smb_model;
    2222        char**      requestedoutputs = NULL;
    2323        IssmDouble  time;
    24         bool        ispdd,isdelta18o;
     24        bool        isdelta18o;
    2525
    2626        /*parameters for mass flux:*/
  • TabularUnified issm/trunk-jpl/src/c/toolkits/issm/IssmMpiSparseMat.h

    r16451 r17924  
    141141                void Echo(void){
    142142
    143                         int my_rank;
    144                         int i,j,k;
    145 
    146143                        /*Do a synchronized dump across all the rows: */
    147                         my_rank=IssmComm::GetRank();
    148                         for(i=0;i<IssmComm::GetSize();i++){
    149                                 if (my_rank==i){
     144                        int my_rank=IssmComm::GetRank();
     145                        for(int i=0;i<IssmComm::GetSize();i++){
     146                                if(my_rank==i){
    150147                                        _printf_("cpu " << i << " #rows: " << this->m << "\n");
    151                                         for (j=0;j<this->m;j++){
     148                                        for(int j=0;j<this->m;j++){
    152149                                                _printf_("row " << j << ":");
    153150                                                this->matrix[j]->Echo();
     
    190187                        int*          this_row_cols       = NULL;
    191188                        int*          this_row_mods       = NULL;
    192                         doubletype*   this_row_values     = NULL;
    193189                        int*          numvalues_perrow    = NULL;
    194190                        int           row;
     
    378374                        doubletype norm,local_norm;
    379375                        doubletype absolute;
    380                         int i,j;
     376                        int i;
    381377
    382378                        switch(mode){
     
    421417                void MatMult(IssmAbsVec<doubletype>* Xin,IssmAbsVec<doubletype>* AXin){
    422418
    423                         int         i,j;
    424                         doubletype *X_serial  = NULL;
    425 
    426419                        /*A check on the types: */
    427420                        if(IssmVecTypeFromToolkitOptions()!=MpiEnum)_error_("MatMult operation only possible with 'mpi' vectors");
     
    432425
    433426                        /*Serialize input Xin: */
    434                         X_serial=X->ToMPISerial();
     427                        doubletype* X_serial=X->ToMPISerial();
    435428
    436429                        /*Every cpu has a serial version of the input vector. Use it to do the Matrix-Vector multiply
    437430                         *locally and plug it into AXin: */
    438                         for(i=0;i<this->m;i++){
     431                        for(int i=0;i<this->m;i++){
    439432                                AX->vector[i]=this->matrix[i]->Mult(X_serial);
    440433                        }
  • TabularUnified issm/trunk-jpl/src/c/toolkits/mumps/MumpsSolve.cpp

    r16415 r17924  
    200200        ISSM_MPI_Comm  comm;
    201201        int            num_procs;
    202         int            i,j;
     202        int            i;
    203203        int            nnz,local_nnz;
    204204        int           *irn_loc    = NULL;
     
    217217
    218218        /*First, some checks*/
    219         if (Kff_M!=Kff_N)_error_("stiffness matrix Kff should be square");
    220         if (uf_M!=Kff_M || uf_M!=pf_M)_error_("solution vector should be the same size as stiffness matrix Kff and load vector pf");
    221         if (uf_m!=Kff_m || uf_m!=pf_m)_error_("solution vector should be locally the same size as stiffness matrix Kff and load vector pf");
     219        if(Kff_M!=Kff_N)_error_("stiffness matrix Kff should be square");
     220        if(uf_M!=Kff_M || uf_M!=pf_M)_error_("solution vector should be the same size as stiffness matrix Kff and load vector pf");
     221        if(uf_m!=Kff_m || uf_m!=pf_m)_error_("solution vector should be locally the same size as stiffness matrix Kff and load vector pf");
    222222
    223223        /*Initialize matrix */
Note: See TracChangeset for help on using the changeset viewer.