Ignore:
Timestamp:
01/27/21 17:49:18 (4 years ago)
Author:
Eric.Larour
Message:

CHG: switched to rates on solidearth surafce loads.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/Elements/Tria.cpp

    r25956 r25958  
    55235523/*}}}*/
    55245524void    Tria::SealevelchangeMomentOfInertia(IssmDouble* dI_list,IssmDouble* Sg_old, SealevelMasks* masks){/*{{{*/
     5525
     5526
    55255527        /*early return if we are not on an ice cap OR ocean:*/
    55265528        if(!masks->isiceonly[this->lid] && !masks->isoceanin[this->lid]){
     
    55995601        }
    56005602        else if(masks->isiceonly[this->lid]){
    5601                 IssmDouble rho_ice, I;
    5602 
    5603                 /*recover material parameters: */
     5603                IssmDouble rho_ice, dIdt, dt;
     5604               
     5605
     5606                /*recover parameters: */
    56045607                rho_ice=FindParam(MaterialsRhoIceEnum);
     5608                dt=FindParam(TimesteppingTimeStepEnum);
    56055609
    56065610                /*Compute ice thickness change: */
    5607                 Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
     5611                Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
    56085612                if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
    5609                 deltathickness_input->GetInputAverage(&I);
    5610 
    5611                 dI_list[0] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
    5612                 dI_list[1] = -4*PI*(rho_ice*I*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
    5613                 dI_list[2] = +4*PI*(rho_ice*I*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
     5613                deltathickness_input->GetInputAverage(&dIdt);
     5614
     5615
     5616                dI_list[0] = -4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(sin(late)*cos(late)*cos(longe))/planetarea;
     5617                dI_list[1] = -4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(sin(late)*cos(late)*sin(longe))/planetarea;
     5618                dI_list[2] = +4*PI*(rho_ice*dIdt*dt*area)*pow(re,4)*(1-pow(sin(late),2))/planetarea;
    56145619        }
    56155620
     
    58195824        IssmDouble area;
    58205825        IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
    5821         IssmDouble I;  //change in ice thickness or water level(Farrel and Clarke, Equ. 4)
     5826        IssmDouble Idot;  //ice thickness rate (Farrel and Clarke, Equ. 4)
    58225827        bool notfullygrounded=false;
    58235828        bool scaleoceanarea= false;
    58245829        bool computerigid= false;
    58255830        int  glfraction=1;
     5831        IssmDouble dt=0;
    58265832
    58275833        /*output: */
     
    58685874        rho_ice=FindParam(MaterialsRhoIceEnum);
    58695875        rho_water=FindParam(MaterialsRhoSeawaterEnum);
     5876        dt=FindParam(TimesteppingTimeStepEnum);
    58705877        this->parameters->FindParam(&computerigid,SolidearthSettingsRigidEnum);
    58715878        this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
     
    58925899
    58935900        /*Retrieve ice thickness at vertices: */
    5894         Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
     5901        Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
    58955902        if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
    58965903
    58975904        /*/Average ice thickness over grounded area of the element only: {{{*/
    5898         if(!notfullygrounded)deltathickness_input->GetInputAverage(&I);
     5905        if(!notfullygrounded)deltathickness_input->GetInputAverage(&Idot);
    58995906        else{
    59005907                IssmDouble total_weight=0;
     
    59095916                /* Start  looping on the number of gaussian points and average over these gaussian points: */
    59105917                total_weight=0;
    5911                 I=0;
     5918                Idot=0;
    59125919                while(gauss->next()){
    5913                         IssmDouble Ig=0;
    5914                         deltathickness_input->GetInputValue(&Ig,gauss);
    5915                         I+=Ig*gauss->weight;
     5920                        IssmDouble Idotg=0;
     5921                        deltathickness_input->GetInputValue(&Idotg,gauss);
     5922                        Idot+=Idotg*gauss->weight;
    59165923                        total_weight+=gauss->weight;
    59175924                }
    5918                 I=I/total_weight;
     5925                Idot=Idot/total_weight;
    59195926                delete gauss;
    59205927        }
     
    59245931        _assert_(oceanarea>0.);
    59255932        if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
    5926         bslcice = rho_ice*area*phi*I/(oceanarea*rho_water);
     5933        bslcice = rho_ice*area*phi*Idot*dt/(oceanarea*rho_water);
    59275934        _assert_(!xIsNan<IssmDouble>(bslcice));
    59285935
    59295936        if(computerigid){
    59305937                /*convert from m to kg/m^2:*/
    5931                 I=I*rho_ice*phi;
     5938                Idot=Idot*rho_ice*phi;
    59325939
    59335940                /*convolve:*/
    5934                 for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*I;
     5941                for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*Idot*dt;
    59355942        }
    59365943
     
    59505957        IssmDouble area;
    59515958        IssmDouble phi=1.0; //WARNING: do not touch this, default is entire elemnt contributes barystatic
    5952         IssmDouble W;  //change in water height thickness (Farrel and Clarke, Equ. 4)
     5959        IssmDouble Wdot;  //change in water height thickness (Farrel and Clarke, Equ. 4)
     5960        IssmDouble dt=0;
    59535961        bool notfullygrounded=false;
    59545962        bool scaleoceanarea= false;
     
    59835991        rho_water=FindParam(MaterialsRhoSeawaterEnum);
    59845992        rho_freshwater=FindParam(MaterialsRhoFreshwaterEnum);
     5993        dt=FindParam(TimesteppingTimeStepEnum);
    59855994        this->parameters->FindParam(&computeelastic,SolidearthSettingsElasticEnum);
    59865995        this->parameters->FindParam(&scaleoceanarea,SolidearthSettingsOceanAreaScalingEnum);
     
    59936002
    59946003        /*Retrieve water height at vertices: */
    5995         Input* deltathickness_input=this->GetInput(SurfaceloadWaterHeightChangeEnum);
    5996         if (!deltathickness_input)_error_("SurfaceloadWaterHeightChangeEnum input needed to compute sea level change!");
    5997         deltathickness_input->GetInputAverage(&W);
     6004        Input* deltathickness_input=this->GetInput(SurfaceloadWaterHeightRateEnum);
     6005        if (!deltathickness_input)_error_("SurfaceloadWaterHeightRateEnum input needed to compute sea level change!");
     6006        deltathickness_input->GetInputAverage(&Wdot);
    59986007
    59996008        /*Compute barystatic component:*/
    60006009        _assert_(oceanarea>0.);
    60016010        if(scaleoceanarea) oceanarea=3.619e+14; // use true ocean area, m^2
    6002         bslchydro = rho_freshwater*area*phi*W/(oceanarea*rho_water);
     6011        bslchydro = rho_freshwater*area*phi*Wdot*dt/(oceanarea*rho_water);
    60036012        _assert_(!xIsNan<IssmDouble>(bslchydro));
    60046013
    60056014        if(computeelastic){
    60066015                /*convert from m to kg/m^2:*/
    6007                 W=W*rho_freshwater*phi;
     6016                Wdot=Wdot*rho_freshwater*phi;
    60086017
    60096018                /*convolve:*/
    6010                 for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*W;
     6019                for(int i=0;i<gsize;i++) Sgi[i]+=G[i]*Wdot*dt;
    60116020        }
    60126021
     
    61186127        /*diverse:*/
    61196128        int gsize;
    6120         IssmDouble I, S, BP;            //change in relative ice thickness and sea level
     6129        IssmDouble Idot, S, BP;         //change in relative ice thickness and sea level
    61216130        IssmDouble rho_ice,rho_water;
    61226131        int horiz;
     
    61826191        }
    61836192        else if (masks->isiceonly[this->lid]){
     6193                IssmDouble dt=0;
     6194                dt=FindParam(TimesteppingTimeStepEnum);
    61846195
    61856196                /*Compute ice thickness change: */
    6186                 Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessChangeEnum);
     6197                Input* deltathickness_input=this->GetInput(SurfaceloadIceThicknessRateEnum);
    61876198                if (!deltathickness_input)_error_("delta thickness input needed to compute sea level change!");
    6188                 deltathickness_input->GetInputAverage(&I);
     6199                deltathickness_input->GetInputAverage(&Idot);
    61896200
    61906201                /*convert to kg/m^2*/
    6191                 I=I*rho_ice;
     6202                Idot=Idot*rho_ice;
    61926203
    61936204                for(int i=0;i<gsize;i++){
    6194                         Up[i]+=I*GU[i];
     6205                        Up[i]+=Idot*dt*GU[i];
    61956206                        if(horiz){
    6196                                 North[i]+=I*GN[i];
    6197                                 East[i]+=I*GE[i];
     6207                                North[i]+=Idot*dt*GN[i];
     6208                                East[i]+=Idot*dt*GE[i];
    61986209                        }
    61996210                }
Note: See TracChangeset for help on using the changeset viewer.