Changeset 25304


Ignore:
Timestamp:
07/28/20 19:47:54 (5 years ago)
Author:
Eric.Larour
Message:

CHG: fixed an issue with BP not being updated when running in MME mode.

Location:
issm/trunk-jpl/src/c/cores
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/cores/cores.h

    r24984 r25304  
    6666void GetStericRate(Vector<IssmDouble> ** psteric_rate_g, FemModel* femmodel);
    6767void GetDynamicRate(Vector<IssmDouble> ** pdynamic_rate_g, FemModel* femmodel);
     68void SetBottomPressure(FemModel* femmodel);
    6869
    6970//optimization
  • issm/trunk-jpl/src/c/cores/sealevelchange_core.cpp

    r25294 r25304  
    169169                masks=sealevelrise_core_masks(femmodel);
    170170
     171                /*set bottom pressures:*/
     172                SetBottomPressure(femmodel);
     173
     174
    171175                /*call eustatic core  (generalized eustatic - Farrel and Clark, Eq 4, 1st, 3rd and 4rd terms on the RHS) */
    172176                RSLg_eustatic=sealevelrise_core_eustatic(femmodel,masks,&oceanarea);
     
    736740}
    737741/*}}}*/
     742void SetBottomPressure(FemModel* femmodel){ /*{{{*/
     743
     744        int dslmodel=-1;
     745        int type;
     746
     747        /*If we are running a dsl mme model, we need to update the bottom pressure first: */
     748        femmodel->parameters->FindParam(&dslmodel,DslModelEnum);
     749        if(dslmodel==2){
     750       
     751                IssmDouble modelid;
     752                /*figure out the type of DslSeaWaterPressureChangeAtSeaFloor input:*/
     753                type=femmodel->inputs2->GetInputObjectEnum(DslSeaWaterPressureChangeAtSeaFloor);
     754
     755                if(type==DatasetInput2Enum){
     756               
     757                        /*find the DslSeaWaterPressureChangeAtSeaFloor dataset of transient inputs:*/
     758                        DatasetInput2* dataset_input=femmodel->inputs2->GetDatasetInput2(DslSeaWaterPressureChangeAtSeaFloor);
     759               
     760                        /*Recover modelid:*/
     761                        femmodel->parameters->FindParam(&modelid,DslModelidEnum);
     762                        modelid--; //from matlab.
     763               
     764                        /*Go find the modelid'th transient input:*/
     765                        TriaInput2* tria_input=dataset_input->GetTriaInputByOffset(reCast<int, IssmDouble>(modelid));
     766                        /*Plug back into DslSeaWaterPressureChangeAtSeaFloor*/
     767                        tria_input->ChangeEnum(DslSeaWaterPressureChangeAtSeaFloor);
     768                }
     769        }
     770}
     771/*}}}*/
    738772
    739773/*support routines:*/
Note: See TracChangeset for help on using the changeset viewer.