source: issm/oecreview/Archive/24684-25833/ISSM-24971-24972.diff

Last change on this file was 25834, checked in by Mathieu Morlighem, 4 years ago

CHG: added 24684-25833

File size: 3.6 KB
  • ../trunk-jpl/src/c/classes/Elements/Tria.cpp

     
    59305930
    59315931        /*diverse:*/
    59325932        int gsize,dummy;
    5933         IssmDouble S;  //change in water water level(Farrel and Clarke, Equ. 4)
     5933        IssmDouble S,BP, Stotal;  //change in water water level(Farrel and Clarke, Equ. 4)
    59345934        IssmDouble constant=0;
    59355935        IssmDouble rho_water;
    59365936        IssmDouble* G=NULL;
     5937        int  bp_compute_fingerprints= 0;
    59375938
    5938         /*optimization:*/
    5939         bool store_green_functions=false;
    5940        
     5939        /*retrieve parameters:*/
     5940        this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
    59415941        rho_water=FindParam(MaterialsRhoSeawaterEnum);
    59425942
    59435943        /*early return if we are not on the ocean:*/
     
    59625962        /*From Sg_old, recover water sea level rise:*/
    59635963        S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg_old[this->vertices[i]->Sid()]/NUMVERTICES;
    59645964
     5965        /*If we have bottom pressure fingerprinting requested, retrieve BP: */
     5966        if(bp_compute_fingerprints){
     5967                Input2* bottompressure_change_input=this->GetInput2(DslSeaWaterPressureChangeAtSeaFloor);
     5968                if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level rise fingerprint!");
     5969                bottompressure_change_input->GetInputAverage(&BP);
     5970
     5971        } else BP=0;
     5972
    59655973        /*convert to kg/m^2: */
    59665974        S=S*rho_water;
     5975        BP=BP*rho_water;
    59675976
    5968         for(int i=0;i<gsize;i++) Sgo[i]+=G[i]*S;
    5969         //cblas_daxpy(gsize,S,&G[0],1,&Sgo[0],1); //for later.
     5977        Stotal=S+BP;
    59705978
     5979        for(int i=0;i<gsize;i++) Sgo[i]+=G[i]*Stotal;
     5980
    59715981        return;
    59725982}
    59735983/*}}}*/
     
    59755985
    59765986        /*diverse:*/
    59775987        int gsize;
    5978         IssmDouble I, S;                //change in relative ice thickness and sea level
     5988        IssmDouble I, S, BP, Stotal;            //change in relative ice thickness and sea level
    59795989        IssmDouble rho_ice,rho_water;
    59805990        int horiz;
     5991        int  bp_compute_fingerprints= 0;
    59815992
    59825993        /*precomputed elastic green functions:*/
    59835994        IssmDouble* GU=NULL;
     
    59966007        /*recover parameters:*/
    59976008        this->parameters->FindParam(&computeelastic,SealevelriseElasticEnum);
    59986009        this->parameters->FindParam(&horiz,SealevelriseHorizEnum);
     6010        this->parameters->FindParam(&bp_compute_fingerprints,DslComputeFingerprintsEnum);
    59996011
    60006012        /*early return if elastic not requested:*/
    60016013        if(!computeelastic) return;
     
    60186030                if (!deltathickness_input)_error_("delta thickness input needed to compute sea level rise!");
    60196031                deltathickness_input->GetInputAverage(&I);
    60206032
     6033                /*convert to kg/m^2*/
     6034                I=I*rho_ice;
     6035
    60216036                for(int i=0;i<gsize;i++){
    6022                         Up[i]+=rho_ice*I*GU[i];
     6037                        Up[i]+=I*GU[i];
    60236038                        if(horiz){
    6024                                 North[i]+=rho_ice*I*GN[i];
    6025                                 East[i]+=rho_ice*I*GE[i];
     6039                                North[i]+=I*GN[i];
     6040                                East[i]+=I*GE[i];
    60266041                        }
    60276042                }
    60286043        }
     
    60306045                /*From Sg, recover water sea level rise:*/
    60316046                S=0; for(int i=0;i<NUMVERTICES;i++) S+=Sg[this->vertices[i]->Sid()]/NUMVERTICES;
    60326047
     6048                /*If we have bottom pressure fingerprinting requested, retrieve BP: */
     6049                if(bp_compute_fingerprints){
     6050                        Input2* bottompressure_change_input=this->GetInput2(DslSeaWaterPressureChangeAtSeaFloor);
     6051                        if (!bottompressure_change_input)_error_("bottom pressure input needed to compute sea level rise fingerprint!");
     6052                        bottompressure_change_input->GetInputAverage(&BP);
     6053                } else BP=0;
     6054
     6055                /*convert to kg/m^2:*/
     6056                S=rho_water*S;
     6057                BP=rho_water*BP;
     6058                Stotal=S+BP;
     6059
    60336060                for(int i=0;i<gsize;i++){
    6034                         Up[i]+=rho_water*S*GU[i];
     6061                        Up[i]+=Stotal*GU[i];
    60356062                        if(horiz){
    6036                                 North[i]+=rho_water*S*GN[i];
    6037                                 East[i]+=rho_water*S*GE[i];
     6063                                North[i]+=Stotal*GN[i];
     6064                                East[i]+=Stotal*GE[i];
    60386065                        }
    60396066                }
    60406067        }
Note: See TracBrowser for help on using the repository browser.