Changeset 27537


Ignore:
Timestamp:
01/23/23 14:25:41 (2 years ago)
Author:
sehrenfe
Message:

BUG: fixed problem with GlaDS meltflag options

File:
1 edited

Legend:

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

    r27535 r27537  
    113113        int    hydrology_model;
    114114        iomodel->FindConstant(&hydrology_model,"md.hydrology.model");
    115 
     115        int    meltflag;       
     116        iomodel->FindConstant(&meltflag,"md.hydrology.melt_flag");
     117       
    116118        /*Now, do we really want GlaDS?*/
    117119        if(hydrology_model!=HydrologyGlaDSEnum) return;
     
    133135        iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.geothermalflux",BasalforcingsGeothermalfluxEnum);
    134136        iomodel->FetchDataToInput(inputs,elements,"md.basalforcings.groundedice_melting_rate",BasalforcingsGroundediceMeltingRateEnum);
    135         iomodel->FetchDataToInput(inputs,elements,"md.smb.runoff",SmbRunoffEnum);
     137        if(meltflag==2){
     138                iomodel->FetchDataToInput(inputs,elements,"md.smb.runoff",SmbRunoffEnum);
     139        }
    136140        if(iomodel->domaintype!=Domain2DhorizontalEnum){
    137141                iomodel->FetchDataToInput(inputs,elements,"md.mesh.vertexonbase",MeshVertexonbaseEnum);
     
    344348        Input* G_input      = element->GetInput(BasalforcingsGeothermalfluxEnum);_assert_(G_input);
    345349        Input* melt_input   = element->GetInput(BasalforcingsGroundediceMeltingRateEnum);_assert_(melt_input);
    346         Input* RO_input     = element->GetInput(SmbRunoffEnum);_assert_(RO_input);
     350        Input* RO_input     = NULL;
    347351        Input* B_input      = element->GetInput(MaterialsRheologyBEnum);         _assert_(B_input);
    348352        Input* n_input      = element->GetInput(MaterialsRheologyNEnum);         _assert_(n_input);
     
    370374                H_input->GetInputValue(&H,gauss);
    371375                melt_input->GetInputValue(&melt,gauss);
    372                 RO_input->GetInputValue(&RO,gauss);
    373376
    374377                /*Hard code B*/
     
    388391
    389392                /*Compute melt (if necessary)*/
    390                 if(meltflag = 0){
     393                if(meltflag == 0){
    391394                        m = (G + frictionheat)/(rho_ice*L);
    392395                }
    393                 if(meltflag = 1){
     396                else if(meltflag == 1){
    394397                        m = melt;
    395398                }
    396399                else{
    397                         m = RO;
     400                        Input* RO_input = element->GetInput(SmbRunoffEnum);_assert_(RO_input);
     401                        RO_input->GetInputValue(&melt,gauss);
     402                        m = melt + RO;
    398403                }
    399404
Note: See TracChangeset for help on using the changeset viewer.