Changeset 26075


Ignore:
Timestamp:
03/11/21 10:27:18 (4 years ago)
Author:
Eric.Larour
Message:

CHG: removed GIA rates from the test2001 archives.
Transferred new SolidEarthUpdates logic to tws mass transport.

Location:
issm/trunk-jpl
Files:
4 edited

Legend:

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

    r26047 r26075  
    3838
    3939        /*Initialize sea level cumulated sea level loads :*/
    40         InputUpdateFromConstantx(inputs,elements,0.,AccumulatedDeltaTwsEnum);
    41         InputUpdateFromConstantx(inputs,elements,0.,OldAccumulatedDeltaTwsEnum);
     40        iomodel->ConstantToInput(inputs,elements,0.,AccumulatedDeltaTwsEnum,P1Enum);
     41        iomodel->ConstantToInput(inputs,elements,0.,OldAccumulatedDeltaTwsEnum,P1Enum);
    4242        iomodel->FetchDataToInput(inputs,elements,"md.initialization.watercolumn",WatercolumnEnum);
    4343
     
    7979        if(!element->IsOnBase()) return;
    8080
    81         /*deal with logic of accumulating thickness if we are coupled to a
    82          * sea level core:*/
    83         int frequency,count,isgrd;
    84         element->FindParam(&isgrd,SolidearthSettingsGRDEnum);
    85         if(isgrd){
    86                 element->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
    87                 element->FindParam(&count,SealevelchangeRunCountEnum);
    88         }       
    8981        /*Fetch dof list and allocate solution vector*/
    9082        int *doflist = NULL;
     
    10698        xDelete<IssmDouble>(watercolumn);
    10799
    108         /*Get basal element*/
    109         int domaintype; element->FindParam(&domaintype,DomainTypeEnum);
    110         Element* basalelement=element;
    111         if(domaintype!=Domain2DhorizontalEnum) basalelement = element->SpawnBasalElement();
    112 
    113         /*Fetch number of nodes and dof for this finite element*/
    114         int numvertices = basalelement->GetNumberOfVertices();
    115 
    116         /*Now, we need to do some "processing"*/
    117         watercolumn  = xNew<IssmDouble>(numvertices);
    118         IssmDouble* oldwatercolumn      = xNew<IssmDouble>(numvertices);
    119         IssmDouble* cumdeltawatercolumn = xNew<IssmDouble>(numvertices);
    120         IssmDouble* oldcumdeltawatercolumn = xNew<IssmDouble>(numvertices);
    121         IssmDouble* deltawatercolumn = xNew<IssmDouble>(numvertices);
    122 
    123         /*Get previous base, tws, surfac and current sealevel and bed:*/
    124         basalelement->GetInputListOnVertices(&watercolumn[0],WatercolumnEnum);
    125         basalelement->GetInputListOnVertices(&oldwatercolumn[0],WaterColumnOldEnum);
    126         basalelement->GetInputListOnVertices(&cumdeltawatercolumn[0],AccumulatedDeltaTwsEnum);
    127 
    128         /*What is the delta tws forcing the sea-level change core: cumulated over time, hence the +=:*/
    129         if(isgrd){
    130                 for(int i=0;i<numvertices;i++){
    131                         cumdeltawatercolumn[i] += watercolumn[i]-oldwatercolumn[i];
    132                 }
    133         }
    134 
    135         /*Add input to the element: */
    136         if(isgrd){
    137                 element->AddBasalInput(AccumulatedDeltaTwsEnum,cumdeltawatercolumn,P1Enum);
    138                 if(count==frequency){
    139                         basalelement->GetInputListOnVertices(&oldcumdeltawatercolumn[0],OldAccumulatedDeltaTwsEnum);
    140                         element->AddBasalInput(OldAccumulatedDeltaTwsEnum,cumdeltawatercolumn,P1Enum);
    141                         for(int i=0;i<numvertices;i++)deltawatercolumn[i]=cumdeltawatercolumn[i]-oldcumdeltawatercolumn[i];
    142                         element->AddBasalInput(DeltaTwsEnum,deltawatercolumn,P1Enum);
    143                 }
    144         }
    145 
    146         /*Free ressources:*/
    147         xDelete<IssmDouble>(watercolumn);
    148         xDelete<IssmDouble>(deltawatercolumn);
    149         xDelete<IssmDouble>(cumdeltawatercolumn);
    150         xDelete<IssmDouble>(oldcumdeltawatercolumn);
    151         xDelete<IssmDouble>(oldwatercolumn);
    152         xDelete<int>(doflist);
    153         if(domaintype!=Domain2DhorizontalEnum){basalelement->DeleteMaterials(); delete basalelement;};
    154100}/*}}}*/
    155101void           HydrologyTwsAnalysis::UpdateConstraints(FemModel* femmodel){/*{{{*/
  • issm/trunk-jpl/src/c/cores/hydrology_core.cpp

    r26047 r26075  
    99#include "../modules/modules.h"
    1010#include "../solutionsequences/solutionsequences.h"
    11 
    12 void hydrology_core(FemModel* femmodel){
     11void SolidEarthWaterUpdates(FemModel* femmodel);
     12
     13void hydrology_core(FemModel* femmodel){ /*{{{*/
    1314
    1415        /*Start profiler*/
     
    4344                /*transfer water column thickness to old water column thickness: */
    4445                InputDuplicatex(femmodel,WatercolumnEnum,WaterColumnOldEnum);
     46                /*solid earth considerations:*/
     47                SolidEarthWaterUpdates(femmodel);
     48
    4549
    4650        }
     
    5963                GetVectorFromInputsx(&ug,femmodel,HydrologyTwsSpcEnum,VertexPIdEnum);
    6064                InputUpdateFromSolutionx(femmodel,ug);
     65
     66                /*solid earth considerations:*/
     67                SolidEarthWaterUpdates(femmodel);
     68
    6169                delete ug;
    6270       
     
    219227        /*End profiler*/
    220228        femmodel->profiler->Stop(HYDROLOGYCORE);
    221 }
     229} /*}}}*/
     230void SolidEarthWaterUpdates(FemModel* femmodel){ /*{{{*/
     231
     232        int isgrd;
     233        int grdmodel;
     234        IssmDouble time;
     235        int frequency,count;
     236
     237        /*retrieve parameters:*/
     238        femmodel->parameters->FindParam(&isgrd,SolidearthSettingsGRDEnum);
     239        femmodel->parameters->FindParam(&grdmodel,GrdModelEnum);
     240        femmodel->parameters->FindParam(&time,TimeEnum);
     241        femmodel->parameters->FindParam(&frequency,SolidearthSettingsRunFrequencyEnum);
     242        femmodel->parameters->FindParam(&count,SealevelchangeRunCountEnum);
     243       
     244        /*early return?:*/
     245        if(!isgrd)return;
     246
     247        /*From old and new thickness, create delta thickness  and accumulate:*/
     248        femmodel->inputs->AXPY(-1, WaterColumnOldEnum,WatercolumnEnum,DeltaTwsEnum);
     249        femmodel->inputs->AXPY(+1, DeltaTwsEnum,AccumulatedDeltaTwsEnum,DummyEnum);
     250        femmodel->inputs->DuplicateInput(DummyEnum,AccumulatedDeltaTwsEnum);
     251
     252        /*compute total water column change between two sea-level solver time steps, ie. every frequency*dt:*/
     253        if(count==frequency){
     254                femmodel->inputs->AXPY(-1, OldAccumulatedDeltaTwsEnum,AccumulatedDeltaTwsEnum,DeltaTwsEnum);
     255                femmodel->inputs->DuplicateInput(AccumulatedDeltaTwsEnum,OldAccumulatedDeltaTwsEnum);
     256        }
     257        return;
     258}/*}}}*/
  • issm/trunk-jpl/src/c/cores/masstransport_core.cpp

    r26073 r26075  
    1010#include "../solutionsequences/solutionsequences.h"
    1111#include "../classes/Inputs/TransientInput.h"
    12 void SolidEarthUpdates(FemModel* femmodel);
    13 
     12void SolidEarthIceUpdates(FemModel* femmodel);
    1413void masstransport_core(FemModel* femmodel){ /*{{{*/
    1514
     
    7776                        //}
    7877                }
    79                 SolidEarthUpdates(femmodel);
     78                SolidEarthIceUpdates(femmodel);
    8079               
    8180                femmodel->parameters->SetParam(ThicknessEnum,InputToExtrudeEnum);
     
    10099        femmodel->profiler->Stop(MASSTRANSPORTCORE);
    101100} /*}}}*/
    102 void SolidEarthUpdates(FemModel* femmodel){ /*{{{*/
     101void SolidEarthIceUpdates(FemModel* femmodel){ /*{{{*/
    103102
    104103        int isgrd;
  • issm/trunk-jpl/test/NightlyRun/test2001.m

    r26073 r26075  
    5050
    5151%Fields and tolerances to track changes
    52 field_names     ={'UGia','UGiaRate'};
    53 field_tolerances={1e-13,1e-13};
    54 field_values={...
    55         (md.results.TransientSolution(2).SealevelUGrd),
    56         (md.results.TransientSolution(2).SealevelUGrd)
    57         };
     52field_names     ={'UGrd'};
     53field_tolerances={1e-13};
     54field_values={md.results.TransientSolution(2).SealevelUGrd};
Note: See TracChangeset for help on using the changeset viewer.