Changeset 17015


Ignore:
Timestamp:
12/09/13 12:41:31 (11 years ago)
Author:
Mathieu Morlighem
Message:

BUG: fixed compilation error (Johannes, make sure you have --enable-debugging in your configure.sh)

File:
1 edited

Legend:

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

    r17014 r17015  
    873873        IssmDouble latentheat = element->GetMaterialParameter(MaterialsLatentheatEnum);
    874874        IssmDouble rho_ice    = element->GetMaterialParameter(MaterialsRhoIceEnum);
    875         //Input* watercolumn_input      = inputs->GetInput(WatercolumnEnum);                 _assert_(watercolumn_input);
    876875        Input* enthalpy_input         = element->GetInput(EnthalpyEnum);                    _assert_(enthalpy_input);
    877         //  Input* pressure_input         = inputs->GetInput(PressureEnum);                    _assert_(pressure_input);
    878         //      Input* basalmeltingrate_input = inputs->GetInput(BasalforcingsMeltingRateEnum);    _assert_(basalmeltingrate_input);
    879876        Input* geothermalflux_input   = element->GetInput(BasalforcingsGeothermalfluxEnum); _assert_(geothermalflux_input);
    880877        Input* vx_input               = element->GetInput(VxEnum);                          _assert_(vx_input);
     
    909906               
    910907                bool checkpositivethickness=true;
    911                 _assert_(watercolumn>=0.);
     908                _assert_(watercolumn[vertexdown]>=0.);
    912909
    913910                /*Calculate basal meltingrate after Fig.5 of A.Aschwanden 2012*/
     
    947944                        element->EnthalpyToThermal(&temperature,&waterfraction,enthalpy[vertexdown],pressure[vertexdown]);
    948945                        geothermalflux_input->GetInputValue(&geothermalflux,gauss);
    949                         // -Mb= Fb-(q-q_geo)/((1-w)*L), cf Aschwanden 2012, eq.66
     946                        /* -Mb= Fb-(q-q_geo)/((1-w)*L), cf Aschwanden 2012, eq.66*/
    950947                        heating[is]=(heatflux+basalfriction+geothermalflux);
    951948                        meltingrate_enthalpy[is]=heating[is]/((1-waterfraction)*latentheat*rho_ice); // m/s water equivalent //????
    952949                }
    953950        }
    954         // enthalpy might have been changed, update
     951        /* enthalpy might have been changed, update */
    955952        //element->AddInput(EnthalpyEnum,enthalpy,P1Enum);
    956953
    957954        /******** DRAINAGE *****************************************/
    958         IssmDouble* drainrate_column = xNew<IssmDouble>(numsegments); //TODO: xDelete?
     955        IssmDouble* drainrate_column  = xNew<IssmDouble>(numsegments); //TODO: xDelete?
    959956        IssmDouble* drainrate_element = xNew<IssmDouble>(numsegments);
    960957        for(is=0;is<numsegments;is++)   drainrate_column[is]=0.;
     
    968965                elementi=elementi->GetUpperElement();                   
    969966        }
    970         // add drained water to melting rate
     967        /* add drained water to melting rate*/
    971968        for(is=0;is<numsegments;is++) meltingrate_enthalpy[is]+=drainrate_column[is];
    972969
     
    976973                vertexdown = pairindices[is*2+0];
    977974                vertexup   = pairindices[is*2+1];
    978                 if(reCast<bool,IssmDouble>(dt)){
     975                if(dt!=0.){
    979976                        if(watercolumn[vertexdown]+meltingrate_enthalpy[is]*dt<0.){     // prevent too much freeze on                   
    980977                                melting_overshoot=watercolumn[vertexdown]+meltingrate_enthalpy[is]*dt;
     
    982979                                basalmeltingrate[vertexdown]=(1.-lambda)*meltingrate_enthalpy[is];
    983980                                watercolumn[vertexdown]=0.;
    984                                 yts=365*24*60*60;
     981                                yts=365.*24.*60.*60.;
    985982                                enthalpy[vertexdown]+=dt/yts*lambda*heating[is];
    986983                        }
Note: See TracChangeset for help on using the changeset viewer.