Changeset 24921


Ignore:
Timestamp:
05/29/20 16:03:44 (5 years ago)
Author:
Eric.Larour
Message:

CHG: 10% increase in sea level solver speed, using a G_rigid kernel pre computed
in the SealevelriseAnalysis section, before G_elastic kernels.

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

Legend:

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

    r24889 r24921  
    282282        int         dslmodel=0;
    283283
    284         bool elastic=false;
     284        IssmDouble* G_rigid = NULL;
     285        IssmDouble* G_rigid_local = NULL;
    285286        IssmDouble* G_elastic = NULL;
    286287        IssmDouble* G_elastic_local = NULL;
     
    338339        } /*}}}*/
    339340        /*Deal with elasticity {{{*/
    340         iomodel->FetchData(&elastic,"md.slr.elastic");
    341         if(elastic){
    342 
    343                 /*love numbers: */
    344                 iomodel->FetchData(&love_h,&nl,NULL,"md.slr.love_h");
    345                 iomodel->FetchData(&love_k,&nl,NULL,"md.slr.love_k");
    346                 iomodel->FetchData(&love_l,&nl,NULL,"md.slr.love_l");
    347 
    348                 /*compute elastic green function for a range of angles*/
    349                 iomodel->FetchData(&degacc,"md.slr.degacc");
    350                 M=reCast<int,IssmDouble>(180./degacc+1.);
    351 
    352                 // AD performance is sensitive to calls to ensurecontiguous.
    353                 // // Providing "t" will cause ensurecontiguous to be called.
    354                 #ifdef _HAVE_AD_
    355                 G_elastic=xNew<IssmDouble>(M,"t");
    356                 U_elastic=xNew<IssmDouble>(M,"t");
    357                 H_elastic=xNew<IssmDouble>(M,"t");
    358                 #else
    359                 G_elastic=xNew<IssmDouble>(M);
    360                 U_elastic=xNew<IssmDouble>(M);
    361                 H_elastic=xNew<IssmDouble>(M);
    362                 #endif
    363 
    364                 /*compute combined legendre + love number (elastic green function:*/
    365                 m=DetermineLocalSize(M,IssmComm::GetComm());
    366                 GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
    367                 // AD performance is sensitive to calls to ensurecontiguous.
    368                 // // Providing "t" will cause ensurecontiguous to be called.
    369                 #ifdef _HAVE_AD_
    370                 G_elastic_local=xNew<IssmDouble>(m,"t");
    371                 U_elastic_local=xNew<IssmDouble>(m,"t");
    372                 H_elastic_local=xNew<IssmDouble>(m,"t");
    373                 #else
    374                 G_elastic_local=xNew<IssmDouble>(m);
    375                 U_elastic_local=xNew<IssmDouble>(m);
    376                 H_elastic_local=xNew<IssmDouble>(m);
    377                 #endif
    378 
    379                 for(int i=lower_row;i<upper_row;i++){
    380                         IssmDouble alpha,x;
    381                         alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
    382 
    383                         G_elastic_local[i-lower_row]= (love_k[nl-1]-love_h[nl-1])/2.0/sin(alpha/2.0);
    384                         U_elastic_local[i-lower_row]= (love_h[nl-1])/2.0/sin(alpha/2.0);
    385                         H_elastic_local[i-lower_row]= 0;
    386                         IssmDouble Pn = 0.;
    387                         IssmDouble Pn1 = 0.;
    388                         IssmDouble Pn2 = 0.;
    389                         IssmDouble Pn_p = 0.;
    390                         IssmDouble Pn_p1 = 0.;
    391                         IssmDouble Pn_p2 = 0.;
    392 
    393                         for (int n=0;n<nl;n++) {
    394                                 IssmDouble deltalove_G;
    395                                 IssmDouble deltalove_U;
    396 
    397                                 deltalove_G = (love_k[n]-love_k[nl-1]-love_h[n]+love_h[nl-1]);
    398                                 deltalove_U = (love_h[n]-love_h[nl-1]);
    399 
    400                                 /*compute legendre polynomials: P_n(cos\theta) & d P_n(cos\theta)/ d\theta: */
    401                                 if(n==0){
    402                                         Pn=1;
    403                                         Pn_p=0;
    404                                 }
    405                                 else if(n==1){
    406                                         Pn = cos(alpha);
    407                                         Pn_p = 1;
    408                                 }
    409                                 else{
    410                                         Pn = ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;
    411                                         Pn_p = ( (2*n-1)*(Pn1+cos(alpha)*Pn_p1) - (n-1)*Pn_p2 ) /n;
    412                                 }
    413                                 Pn2=Pn1; Pn1=Pn;
    414                                 Pn_p2=Pn_p1; Pn_p1=Pn_p;
    415 
    416                                 G_elastic_local[i-lower_row] += deltalove_G*Pn;         // gravitational potential
    417                                 U_elastic_local[i-lower_row] += deltalove_U*Pn;         // vertical (up) displacement
    418                                 H_elastic_local[i-lower_row] += sin(alpha)*love_l[n]*Pn_p;              // horizontal displacements
    419                         }
    420                 }
    421 
    422                 /*merge G_elastic_local into G_elastic; U_elastic_local into U_elastic; H_elastic_local to H_elastic:{{{*/
    423                 int* recvcounts=xNew<int>(IssmComm::GetSize());
    424                 int* displs=xNew<int>(IssmComm::GetSize());
    425 
    426                 //recvcounts:
    427                 ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
    428 
    429                 /*displs: */
    430                 ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
    431 
    432                 /*All gather:*/
    433                 ISSM_MPI_Allgatherv(G_elastic_local, m, ISSM_MPI_DOUBLE, G_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
    434                 ISSM_MPI_Allgatherv(U_elastic_local, m, ISSM_MPI_DOUBLE, U_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
    435                 ISSM_MPI_Allgatherv(H_elastic_local, m, ISSM_MPI_DOUBLE, H_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
    436                 /*free ressources: */
    437                 xDelete<int>(recvcounts);
    438                 xDelete<int>(displs);
    439 
    440                 /*}}}*/
    441 
    442                 /*Avoid singularity at 0: */
    443                 G_elastic[0]=G_elastic[1];
    444                 parameters->AddObject(new DoubleVecParam(SealevelriseGElasticEnum,G_elastic,M));
    445                 U_elastic[0]=U_elastic[1];
    446                 parameters->AddObject(new DoubleVecParam(SealevelriseUElasticEnum,U_elastic,M));
    447                 H_elastic[0]=H_elastic[1];
    448                 parameters->AddObject(new DoubleVecParam(SealevelriseHElasticEnum,H_elastic,M));
    449 
    450                 /*free ressources: */
    451                 xDelete<IssmDouble>(love_h);
    452                 xDelete<IssmDouble>(love_k);
    453                 xDelete<IssmDouble>(love_l);
    454                 xDelete<IssmDouble>(G_elastic);
    455                 xDelete<IssmDouble>(G_elastic_local);
    456                 xDelete<IssmDouble>(U_elastic);
    457                 xDelete<IssmDouble>(U_elastic_local);
    458                 xDelete<IssmDouble>(H_elastic);
    459                 xDelete<IssmDouble>(H_elastic_local);
    460         } /*}}}*/
     341        /*love numbers: */
     342        iomodel->FetchData(&love_h,&nl,NULL,"md.slr.love_h");
     343        iomodel->FetchData(&love_k,&nl,NULL,"md.slr.love_k");
     344        iomodel->FetchData(&love_l,&nl,NULL,"md.slr.love_l");
     345
     346        /*compute elastic green function for a range of angles*/
     347        iomodel->FetchData(&degacc,"md.slr.degacc");
     348        M=reCast<int,IssmDouble>(180./degacc+1.);
     349
     350        // AD performance is sensitive to calls to ensurecontiguous.
     351        // // Providing "t" will cause ensurecontiguous to be called.
     352        #ifdef _HAVE_AD_
     353        G_rigid=xNew<IssmDouble>(M,"t");
     354        G_elastic=xNew<IssmDouble>(M,"t");
     355        U_elastic=xNew<IssmDouble>(M,"t");
     356        H_elastic=xNew<IssmDouble>(M,"t");
     357        #else
     358        G_rigid=xNew<IssmDouble>(M);
     359        G_elastic=xNew<IssmDouble>(M);
     360        U_elastic=xNew<IssmDouble>(M);
     361        H_elastic=xNew<IssmDouble>(M);
     362        #endif
     363
     364        /*compute combined legendre + love number (elastic green function:*/
     365        m=DetermineLocalSize(M,IssmComm::GetComm());
     366        GetOwnershipBoundariesFromRange(&lower_row,&upper_row,m,IssmComm::GetComm());
     367        // AD performance is sensitive to calls to ensurecontiguous.
     368        // // Providing "t" will cause ensurecontiguous to be called.
     369        #ifdef _HAVE_AD_
     370        G_elastic_local=xNew<IssmDouble>(m,"t");
     371        G_rigid_local=xNew<IssmDouble>(m,"t");
     372        U_elastic_local=xNew<IssmDouble>(m,"t");
     373        H_elastic_local=xNew<IssmDouble>(m,"t");
     374        #else
     375        G_elastic_local=xNew<IssmDouble>(m);
     376        G_rigid_local=xNew<IssmDouble>(m);
     377        U_elastic_local=xNew<IssmDouble>(m);
     378        H_elastic_local=xNew<IssmDouble>(m);
     379        #endif
     380
     381        for(int i=lower_row;i<upper_row;i++){
     382                IssmDouble alpha,x;
     383                alpha= reCast<IssmDouble>(i)*degacc * PI / 180.0;
     384
     385                G_rigid_local[i-lower_row]= .5/sin(alpha/2.0);
     386                G_elastic_local[i-lower_row]= (love_k[nl-1]-love_h[nl-1])*G_rigid_local[i-lower_row];
     387                U_elastic_local[i-lower_row]= (love_h[nl-1])*G_rigid_local[i-lower_row];
     388                H_elastic_local[i-lower_row]= 0;
     389                IssmDouble Pn = 0.;
     390                IssmDouble Pn1 = 0.;
     391                IssmDouble Pn2 = 0.;
     392                IssmDouble Pn_p = 0.;
     393                IssmDouble Pn_p1 = 0.;
     394                IssmDouble Pn_p2 = 0.;
     395
     396                for (int n=0;n<nl;n++) {
     397                        IssmDouble deltalove_G;
     398                        IssmDouble deltalove_U;
     399
     400                        deltalove_G = (love_k[n]-love_k[nl-1]-love_h[n]+love_h[nl-1]);
     401                        deltalove_U = (love_h[n]-love_h[nl-1]);
     402
     403                        /*compute legendre polynomials: P_n(cos\theta) & d P_n(cos\theta)/ d\theta: */
     404                        if(n==0){
     405                                Pn=1;
     406                                Pn_p=0;
     407                        }
     408                        else if(n==1){
     409                                Pn = cos(alpha);
     410                                Pn_p = 1;
     411                        }
     412                        else{
     413                                Pn = ( (2*n-1)*cos(alpha)*Pn1 - (n-1)*Pn2 ) /n;
     414                                Pn_p = ( (2*n-1)*(Pn1+cos(alpha)*Pn_p1) - (n-1)*Pn_p2 ) /n;
     415                        }
     416                        Pn2=Pn1; Pn1=Pn;
     417                        Pn_p2=Pn_p1; Pn_p1=Pn_p;
     418
     419                        G_elastic_local[i-lower_row] += deltalove_G*Pn;         // gravitational potential
     420                        U_elastic_local[i-lower_row] += deltalove_U*Pn;         // vertical (up) displacement
     421                        H_elastic_local[i-lower_row] += sin(alpha)*love_l[n]*Pn_p;              // horizontal displacements
     422                }
     423        }
     424
     425        /*merge G_elastic_local into G_elastic; U_elastic_local into U_elastic; H_elastic_local to H_elastic:{{{*/
     426        int* recvcounts=xNew<int>(IssmComm::GetSize());
     427        int* displs=xNew<int>(IssmComm::GetSize());
     428
     429        //recvcounts:
     430        ISSM_MPI_Allgather(&m,1,ISSM_MPI_INT,recvcounts,1,ISSM_MPI_INT,IssmComm::GetComm());
     431
     432        /*displs: */
     433        ISSM_MPI_Allgather(&lower_row,1,ISSM_MPI_INT,displs,1,ISSM_MPI_INT,IssmComm::GetComm());
     434
     435        /*All gather:*/
     436        ISSM_MPI_Allgatherv(G_rigid_local, m, ISSM_MPI_DOUBLE, G_rigid, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
     437        ISSM_MPI_Allgatherv(G_elastic_local, m, ISSM_MPI_DOUBLE, G_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
     438        ISSM_MPI_Allgatherv(U_elastic_local, m, ISSM_MPI_DOUBLE, U_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
     439        ISSM_MPI_Allgatherv(H_elastic_local, m, ISSM_MPI_DOUBLE, H_elastic, recvcounts, displs, ISSM_MPI_DOUBLE,IssmComm::GetComm());
     440        /*free ressources: */
     441        xDelete<int>(recvcounts);
     442        xDelete<int>(displs);
     443
     444        /*}}}*/
     445
     446        /*Avoid singularity at 0: */
     447        G_rigid[0]=G_rigid[1];
     448        parameters->AddObject(new DoubleVecParam(SealevelriseGRigidEnum,G_rigid,M));
     449        G_elastic[0]=G_elastic[1];
     450        parameters->AddObject(new DoubleVecParam(SealevelriseGElasticEnum,G_elastic,M));
     451        U_elastic[0]=U_elastic[1];
     452        parameters->AddObject(new DoubleVecParam(SealevelriseUElasticEnum,U_elastic,M));
     453        H_elastic[0]=H_elastic[1];
     454        parameters->AddObject(new DoubleVecParam(SealevelriseHElasticEnum,H_elastic,M));
     455
     456        /*free ressources: */
     457        xDelete<IssmDouble>(love_h);
     458        xDelete<IssmDouble>(love_k);
     459        xDelete<IssmDouble>(love_l);
     460        xDelete<IssmDouble>(G_rigid);
     461        xDelete<IssmDouble>(G_rigid_local);
     462        xDelete<IssmDouble>(G_elastic);
     463        xDelete<IssmDouble>(G_elastic_local);
     464        xDelete<IssmDouble>(U_elastic);
     465        xDelete<IssmDouble>(U_elastic_local);
     466        xDelete<IssmDouble>(H_elastic);
     467        xDelete<IssmDouble>(H_elastic_local);
     468/*}}}*/
    461469        /*Transitions:{{{ */
    462470        iomodel->FetchData(&transitions,&transitions_M,&transitions_N,&ntransitions,"md.slr.transitions");
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r24915 r24921  
    55985598
    55995599        /*elastic green function:*/
     5600        int         index;
    56005601        IssmDouble* G_elastic_precomputed=NULL;
     5602        IssmDouble* G_rigid_precomputed=NULL;
    56015603        int         M;
    56025604
     
    56495651
    56505652        /*recover elastic green function:*/
     5653        DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGRigidEnum)); _assert_(parameter);
     5654        parameter->GetParameterValueByPointer(&G_rigid_precomputed,&M);
     5655
    56515656        if(computeelastic){
    5652                 DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum));
    5653                 _assert_(parameter);
     5657                parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); _assert_(parameter);
    56545658                parameter->GetParameterValueByPointer(&G_elastic_precomputed,&M);
    56555659        }
     
    57485752                for(int i=0;i<gsize;i++){
    57495753
    5750                         IssmDouble G_rigid=0;  //do not remove =0!
    57515754                        IssmDouble G_elastic=0;  //do not remove =0!
    57525755
    5753                         /*Compute alpha angle between centroid and current vertex : */
     5756                        /*Compute alpha angle between centroid and current vertex and index into precomputed tables: */
    57545757                        lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
    5755 
    57565758                        delPhi=fabs(lati-late); delLambda=fabs(longi-longe);
    57575759                        alpha=2.*asin(sqrt(pow(sin(delPhi/2),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
    5758 
    5759                         //Rigid earth gravitational perturbation:
    5760                         if(computerigid)G_rigid=1.0/2.0/sin(alpha/2.0);
     5760                        index=reCast<int,IssmDouble>(alpha/PI*reCast<IssmDouble,int>(M-1));
    57615761
    57625762                        //Elastic component  (from Eq 17 in Adhikari et al, GMD 2015)
    5763                         if(computeelastic){
    5764                                 int index=reCast<int,IssmDouble>(alpha/PI*reCast<IssmDouble,int>(M-1));
    5765                                 G_elastic += G_elastic_precomputed[index];
    5766                         }
     5763                        if(computeelastic) G_elastic += G_elastic_precomputed[index];
    57675764
    57685765                        /*Add all components to the Sgi or Sgo solution vectors:*/
    5769                         Sgi[i]+=3*rho_ice/rho_earth*area/eartharea*I*(G_rigid+G_elastic);
    5770 
     5766                        Sgi[i]+=3*rho_ice/rho_earth*area/eartharea*I*(G_rigid_precomputed[index]+G_elastic);
    57715767                }
    57725768        }
     
    59405936
    59415937        /*precomputed elastic green functions:*/
     5938        IssmDouble* G_rigid_precomputed = NULL;
    59425939        IssmDouble* G_elastic_precomputed = NULL;
    59435940        int         M;
    5944 
    5945         /*computation of Green functions:*/
    5946         IssmDouble* G_elastic= NULL;
    5947         IssmDouble* G_rigid= NULL;
     5941        int         index;
     5942        IssmDouble alpha;
     5943        IssmDouble delPhi,delLambda;
    59485944
    59495945        /*optimization:*/
     
    60206016        /*}}}*/
    60216017
     6018        /*recover rigid and elastic green functions:*/
     6019        DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGRigidEnum)); _assert_(parameter);
     6020        parameter->GetParameterValueByPointer(&G_rigid_precomputed,&M);
     6021
    60226022        if(computeelastic){
    6023 
    60246023                /*recover elastic green function:*/
    6025                 DoubleVecParam* parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); _assert_(parameter);
     6024                parameter = static_cast<DoubleVecParam*>(this->parameters->FindParamObject(SealevelriseGElasticEnum)); _assert_(parameter);
    60266025                parameter->GetParameterValueByPointer(&G_elastic_precomputed,&M);
    6027 
    6028                 /*initialize G_elastic:*/
    6029                 G_elastic=xNewZeroInit<IssmDouble>(gsize);
    6030         }
    6031         if(computerigid) G_rigid=xNewZeroInit<IssmDouble>(gsize);
    6032 
    6033         IssmDouble alpha;
    6034         IssmDouble delPhi,delLambda;
    6035 
     6026        }
     6027
     6028       
    60366029        for(int i=0;i<gsize;i++){
    60376030
    60386031                /*Compute alpha angle between centroid and current vertex : */
    60396032                lati=latitude[i]/180*PI; longi=longitude[i]/180*PI;
    6040 
    60416033                delPhi=fabs(lati-late); delLambda=fabs(longi-longe);
    60426034                alpha=2.*asin(sqrt(pow(sin(delPhi/2),2.0)+cos(lati)*cos(late)*pow(sin(delLambda/2),2)));
     6035                index=reCast<int,IssmDouble>(alpha/PI*(M-1));
    60436036
    60446037                /*Rigid earth gravitational perturbation: */
    60456038                if(computerigid){
    6046                         G_rigid[i]=1.0/2.0/sin(alpha/2.0);
    6047                         //values[i]+=3*rho_water/rho_earth*area/eartharea*S*G_rigid[i];
    6048                         Sgo[i]+=3*rho_water/rho_earth*area/eartharea*S*G_rigid[i];
     6039                        Sgo[i]+=3*rho_water/rho_earth*area/eartharea*S*G_rigid_precomputed[index];
    60496040                }
    60506041
    60516042                /*Elastic component  (from Eq 17 in Adhikari et al, GMD 2015): */
    60526043                if(computeelastic){
    6053                         int index=reCast<int,IssmDouble>(alpha/PI*(M-1));
    6054                         G_elastic[i] += G_elastic_precomputed[index];
    6055                         //values[i]+=3*rho_water/rho_earth*area/eartharea*S*G_elastic[i];
    6056                         Sgo[i]+=3*rho_water/rho_earth*area/eartharea*S*G_elastic[i];
    6057                 }
    6058         }
    6059 
    6060 
    6061         /*Free ressources:*/
    6062         if(computeelastic) xDelete<IssmDouble>(G_elastic);
    6063         if(computerigid) xDelete<IssmDouble>(G_rigid);
     6044                        Sgo[i]+=3*rho_water/rho_earth*area/eartharea*S*G_elastic_precomputed[index];
     6045                }
     6046        }
     6047
    60646048
    60656049        return;
  • issm/trunk-jpl/src/c/shared/Enum/Enum.vim

    r24889 r24921  
    308308syn keyword cConstant SealevelriseEquatorialMoiEnum
    309309syn keyword cConstant SealevelriseFluidLoveEnum
     310syn keyword cConstant SealevelriseGRigidEnum
    310311syn keyword cConstant SealevelriseGElasticEnum
    311312syn keyword cConstant SealevelriseGeodeticEnum
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r24889 r24921  
    302302        SealevelriseEquatorialMoiEnum,
    303303        SealevelriseFluidLoveEnum,
     304        SealevelriseGRigidEnum,
    304305        SealevelriseGElasticEnum,
    305306        SealevelriseGeodeticEnum,
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r24889 r24921  
    310310                case SealevelriseEquatorialMoiEnum : return "SealevelriseEquatorialMoi";
    311311                case SealevelriseFluidLoveEnum : return "SealevelriseFluidLove";
     312                case SealevelriseGRigidEnum : return "SealevelriseGRigid";
    312313                case SealevelriseGElasticEnum : return "SealevelriseGElastic";
    313314                case SealevelriseGeodeticEnum : return "SealevelriseGeodetic";
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r24889 r24921  
    316316              else if (strcmp(name,"SealevelriseEquatorialMoi")==0) return SealevelriseEquatorialMoiEnum;
    317317              else if (strcmp(name,"SealevelriseFluidLove")==0) return SealevelriseFluidLoveEnum;
     318              else if (strcmp(name,"SealevelriseGRigid")==0) return SealevelriseGRigidEnum;
    318319              else if (strcmp(name,"SealevelriseGElastic")==0) return SealevelriseGElasticEnum;
    319320              else if (strcmp(name,"SealevelriseGeodetic")==0) return SealevelriseGeodeticEnum;
     
    382383              else if (strcmp(name,"SmbPfac")==0) return SmbPfacEnum;
    383384              else if (strcmp(name,"SmbRdl")==0) return SmbRdlEnum;
    384               else if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
    385385         else stage=4;
    386386   }
    387387   if(stage==4){
    388               if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
     388              if (strcmp(name,"SmbRequestedOutputs")==0) return SmbRequestedOutputsEnum;
     389              else if (strcmp(name,"SmbRlaps")==0) return SmbRlapsEnum;
    389390              else if (strcmp(name,"SmbRlapslgm")==0) return SmbRlapslgmEnum;
    390391              else if (strcmp(name,"SmbRunoffalti")==0) return SmbRunoffaltiEnum;
     
    505506              else if (strcmp(name,"CalvingCalvingrate")==0) return CalvingCalvingrateEnum;
    506507              else if (strcmp(name,"CalvingHabFraction")==0) return CalvingHabFractionEnum;
    507               else if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
    508508         else stage=5;
    509509   }
    510510   if(stage==5){
    511               if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum;
     511              if (strcmp(name,"CalvingMeltingrate")==0) return CalvingMeltingrateEnum;
     512              else if (strcmp(name,"CalvingStressThresholdFloatingice")==0) return CalvingStressThresholdFloatingiceEnum;
    512513              else if (strcmp(name,"CalvingStressThresholdGroundedice")==0) return CalvingStressThresholdGroundediceEnum;
    513514              else if (strcmp(name,"CalvinglevermannCoeff")==0) return CalvinglevermannCoeffEnum;
     
    628629              else if (strcmp(name,"IceMaskNodeActivation")==0) return IceMaskNodeActivationEnum;
    629630              else if (strcmp(name,"Input")==0) return InputEnum;
    630               else if (strcmp(name,"InversionCostFunctionsCoefficients")==0) return InversionCostFunctionsCoefficientsEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"InversionSurfaceObs")==0) return InversionSurfaceObsEnum;
     634              if (strcmp(name,"InversionCostFunctionsCoefficients")==0) return InversionCostFunctionsCoefficientsEnum;
     635              else if (strcmp(name,"InversionSurfaceObs")==0) return InversionSurfaceObsEnum;
    635636              else if (strcmp(name,"InversionThicknessObs")==0) return InversionThicknessObsEnum;
    636637              else if (strcmp(name,"InversionVelObs")==0) return InversionVelObsEnum;
     
    751752              else if (strcmp(name,"SmbMassBalance")==0) return SmbMassBalanceEnum;
    752753              else if (strcmp(name,"SmbMassBalanceSubstep")==0) return SmbMassBalanceSubstepEnum;
    753               else if (strcmp(name,"SmbMassBalanceTransient")==0) return SmbMassBalanceTransientEnum;
    754754         else stage=7;
    755755   }
    756756   if(stage==7){
    757               if (strcmp(name,"SmbMeanLHF")==0) return SmbMeanLHFEnum;
     757              if (strcmp(name,"SmbMassBalanceTransient")==0) return SmbMassBalanceTransientEnum;
     758              else if (strcmp(name,"SmbMeanLHF")==0) return SmbMeanLHFEnum;
    758759              else if (strcmp(name,"SmbMeanSHF")==0) return SmbMeanSHFEnum;
    759760              else if (strcmp(name,"SmbMeanULW")==0) return SmbMeanULWEnum;
     
    874875              else if (strcmp(name,"Outputdefinition14")==0) return Outputdefinition14Enum;
    875876              else if (strcmp(name,"Outputdefinition15")==0) return Outputdefinition15Enum;
    876               else if (strcmp(name,"Outputdefinition16")==0) return Outputdefinition16Enum;
    877877         else stage=8;
    878878   }
    879879   if(stage==8){
    880               if (strcmp(name,"Outputdefinition17")==0) return Outputdefinition17Enum;
     880              if (strcmp(name,"Outputdefinition16")==0) return Outputdefinition16Enum;
     881              else if (strcmp(name,"Outputdefinition17")==0) return Outputdefinition17Enum;
    881882              else if (strcmp(name,"Outputdefinition18")==0) return Outputdefinition18Enum;
    882883              else if (strcmp(name,"Outputdefinition19")==0) return Outputdefinition19Enum;
     
    997998              else if (strcmp(name,"BedSlopeSolution")==0) return BedSlopeSolutionEnum;
    998999              else if (strcmp(name,"BoolExternalResult")==0) return BoolExternalResultEnum;
    999               else if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
    10001000         else stage=9;
    10011001   }
    10021002   if(stage==9){
    1003               if (strcmp(name,"BoolInput2")==0) return BoolInput2Enum;
     1003              if (strcmp(name,"BoolInput")==0) return BoolInputEnum;
     1004              else if (strcmp(name,"BoolInput2")==0) return BoolInput2Enum;
    10041005              else if (strcmp(name,"IntInput2")==0) return IntInput2Enum;
    10051006              else if (strcmp(name,"BoolParam")==0) return BoolParamEnum;
     
    11201121              else if (strcmp(name,"IceVolumeAboveFloatationScaled")==0) return IceVolumeAboveFloatationScaledEnum;
    11211122              else if (strcmp(name,"IceVolume")==0) return IceVolumeEnum;
    1122               else if (strcmp(name,"IceVolumeScaled")==0) return IceVolumeScaledEnum;
    11231123         else stage=10;
    11241124   }
    11251125   if(stage==10){
    1126               if (strcmp(name,"IcefrontMassFlux")==0) return IcefrontMassFluxEnum;
     1126              if (strcmp(name,"IceVolumeScaled")==0) return IceVolumeScaledEnum;
     1127              else if (strcmp(name,"IcefrontMassFlux")==0) return IcefrontMassFluxEnum;
    11271128              else if (strcmp(name,"IcefrontMassFluxLevelset")==0) return IcefrontMassFluxLevelsetEnum;
    11281129              else if (strcmp(name,"Incremental")==0) return IncrementalEnum;
     
    12431244              else if (strcmp(name,"Profiler")==0) return ProfilerEnum;
    12441245              else if (strcmp(name,"ProfilingCurrentFlops")==0) return ProfilingCurrentFlopsEnum;
    1245               else if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum;
    12461246         else stage=11;
    12471247   }
    12481248   if(stage==11){
    1249               if (strcmp(name,"ProfilingSolutionTime")==0) return ProfilingSolutionTimeEnum;
     1249              if (strcmp(name,"ProfilingCurrentMem")==0) return ProfilingCurrentMemEnum;
     1250              else if (strcmp(name,"ProfilingSolutionTime")==0) return ProfilingSolutionTimeEnum;
    12501251              else if (strcmp(name,"Regionaloutput")==0) return RegionaloutputEnum;
    12511252              else if (strcmp(name,"Regular")==0) return RegularEnum;
Note: See TracChangeset for help on using the changeset viewer.