Changeset 27798


Ignore:
Timestamp:
06/22/23 12:29:24 (21 months ago)
Author:
Cheng Gong
Message:

CHG: calving law for CalvingMIP can run the whole EXP4 in one simulation, both retreat and advance. Set no calving for grounded ice as required in EXP4

File:
1 edited

Legend:

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

    r27797 r27798  
    11281128        int         dim, domaintype;
    11291129        IssmDouble      vx, vy, vel, c, wrate;
     1130        IssmDouble  time, groundedice;
    11301131
    11311132        /*Get problem dimension and whether there is moving front or not*/
    11321133        this->FindParam(&domaintype,DomainTypeEnum);
     1134        this->FindParam(&time,TimeEnum);
    11331135
    11341136        switch(domaintype){
     
    11441146        Input *vy_input      = this->GetInput(VyEnum);                                _assert_(vy_input);
    11451147        Input *wrate_input   = this->GetInput(CalvingAblationrateEnum);               _assert_(wrate_input);
     1148        Input* gr_input      = this->GetInput(MaskOceanLevelsetEnum);                                           _assert_(gr_input);
    11461149
    11471150        /* Use which experiment: use existing Enum */
     
    11491152
    11501153        /* Start looping on the number of vertices: */
    1151         GaussTria* gauss=new GaussTria();
     1154        GaussTria gauss;
    11521155        for(int iv=0;iv<NUMVERTICES;iv++){
    1153                 gauss->GaussVertex(iv);
     1156                gauss.GaussVertex(iv);
    11541157
    11551158                /*Get velocity components */
    1156                 vx_input->GetInputValue(&vx,gauss);
    1157                 vy_input->GetInputValue(&vy,gauss);
     1159                vx_input->GetInputValue(&vx,&gauss);
     1160                vy_input->GetInputValue(&vy,&gauss);
    11581161                vel=sqrt(vx*vx+vy*vy)+1.e-14;
    11591162
     1163                /* no calving for grounded ice in EXP4 */
     1164                gr_input->GetInputValue(&groundedice,&gauss);
    11601165
    11611166                switch (experiment) {
     
    11661171                                break;
    11671172                        case 2:
     1173                                /* Exp 2: set c=v-wrate(given)*/
     1174                                wrate_input->GetInputValue(&wrate,&gauss);
     1175                                break;
    11681176                        case 4:
    1169                                 /* Exp 2 and 4: set c=v-wrate(given)*/
    1170                                 /*Get wrate*/
    1171                                 wrate_input->GetInputValue(&wrate,gauss);
    1172                                 break;
    1173                         case 0:
    1174                                 /* This is for second half of Exp 2 and 4: to set c=0*/
    1175                                 wrate = vel;
     1177                                /* Exp 4: set c=v-wrate(given), for the first 500 years, then c=0 for the second 500 years*/
     1178                                if((groundedice<0) && (time<=500.0)) {
     1179                                        wrate_input->GetInputValue(&wrate,&gauss);
     1180                                }
     1181                                else {
     1182                                        /* no calving on the grounded ice*/
     1183                                        wrate = vel;
     1184                                }
    11761185                                break;
    11771186                        default:
     
    11871196        this->AddInput(CalvingratexEnum,&calvingratex[0],P1DGEnum);
    11881197        this->AddInput(CalvingrateyEnum,&calvingratey[0],P1DGEnum);
    1189 
    1190         /*Clean up and return*/
    1191         delete gauss;
    11921198}
    11931199/*}}}*/
Note: See TracChangeset for help on using the changeset viewer.