Changeset 19594


Ignore:
Timestamp:
09/25/15 18:41:17 (10 years ago)
Author:
Eric.Larour
Message:

CHG: fixed huge bug with reportina of SmbMassBalance and also
added condensation output.

Location:
issm/trunk-jpl/src
Files:
1 added
6 edited

Legend:

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

    r19583 r19594  
    21292129        IssmDouble C;
    21302130        IssmDouble Tz,Vz;
    2131         IssmDouble rho_ice, aSnow,aIce;
     2131        IssmDouble rho_ice, rho_water,aSnow,aIce;
    21322132        IssmDouble time,dt;
    21332133        IssmDouble t,smb_dt;
     2134        IssmDouble yts;
    21342135        IssmDouble Ta,V,dlw,dsw,P,eAir,pAir;
    21352136        int        aIdx=0;
     
    21632164        IssmDouble  mAdd;
    21642165        int         m;
    2165         IssmDouble  SmbMassBalance=0;
    21662166        int         count=0;
    21672167        /*}}}*/
     
    21732173        /*Retrieve material properties and parameters:{{{ */
    21742174        rho_ice = matpar->GetMaterialParameter(MaterialsRhoIceEnum);
     2175        rho_water = matpar->GetMaterialParameter(MaterialsRhoFreshwaterEnum);
    21752176        parameters->FindParam(&aSnow,SmbASnowEnum);
    21762177        parameters->FindParam(&aIce,SmbAIceEnum);
     
    23832384        if (T[m-1]!=T_bottom) _printf_("T(end)~=T_bottom" << "\n");
    23842385               
    2385                 SmbMassBalance += sumP + sumEC - sumR; //increment SMB for the entire time span of ice-flow dynamics.
    2386 
    23872386                count++;
    23882387
    23892388        } //for (t=time;t<=time+dt;t=t+smb_dt)
     2389
    23902390
    23912391        /*Save generated inputs: */
     
    24002400        this->AddInput(new DoubleArrayInput(SmbAEnum,a,m));
    24012401        this->AddInput(new DoubleArrayInput(SmbSwfEnum,swf,m));
    2402         this->AddInput(new DoubleInput(SmbMassBalanceEnum,time));
     2402        this->AddInput(new DoubleInput(SmbMassBalanceEnum,(sumP + sumEC -sumR)/rho_water/dt));
     2403        this->AddInput(new DoubleInput(SmbRunoffEnum,sumR/rho_water/dt));
     2404        this->AddInput(new DoubleInput(SmbPrecipitationEnum,sumP/rho_water/dt));
     2405        this->AddInput(new DoubleInput(SmbCondensationEnum,sumEC/rho_water/dt));
     2406
    24032407
    24042408
  • issm/trunk-jpl/src/c/shared/Enum/EnumDefinitions.h

    r19561 r19594  
    396396        SmbGspEnum,
    397397        SmbECEnum,
     398        SmbCondensationEnum,
    398399        SmbWEnum,
    399400        SmbAEnum,
  • issm/trunk-jpl/src/c/shared/Enum/EnumToStringx.cpp

    r19561 r19594  
    398398                case SmbGspEnum : return "SmbGsp";
    399399                case SmbECEnum : return "SmbEC";
     400                case SmbCondensationEnum : return "SmbCondensation";
    400401                case SmbWEnum : return "SmbW";
    401402                case SmbAEnum : return "SmbA";
  • issm/trunk-jpl/src/c/shared/Enum/StringToEnumx.cpp

    r19561 r19594  
    407407              else if (strcmp(name,"SmbGsp")==0) return SmbGspEnum;
    408408              else if (strcmp(name,"SmbEC")==0) return SmbECEnum;
     409              else if (strcmp(name,"SmbCondensation")==0) return SmbCondensationEnum;
    409410              else if (strcmp(name,"SmbW")==0) return SmbWEnum;
    410411              else if (strcmp(name,"SmbA")==0) return SmbAEnum;
     
    505506              else if (strcmp(name,"UzawaPressureAnalysis")==0) return UzawaPressureAnalysisEnum;
    506507              else if (strcmp(name,"GiaSolution")==0) return GiaSolutionEnum;
    507               else if (strcmp(name,"GiaAnalysis")==0) return GiaAnalysisEnum;
    508508         else stage=5;
    509509   }
    510510   if(stage==5){
    511               if (strcmp(name,"MeshdeformationSolution")==0) return MeshdeformationSolutionEnum;
     511              if (strcmp(name,"GiaAnalysis")==0) return GiaAnalysisEnum;
     512              else if (strcmp(name,"MeshdeformationSolution")==0) return MeshdeformationSolutionEnum;
    512513              else if (strcmp(name,"MeshdeformationAnalysis")==0) return MeshdeformationAnalysisEnum;
    513514              else if (strcmp(name,"LevelsetAnalysis")==0) return LevelsetAnalysisEnum;
     
    628629              else if (strcmp(name,"FractionIncrement")==0) return FractionIncrementEnum;
    629630              else if (strcmp(name,"Friction")==0) return FrictionEnum;
    630               else if (strcmp(name,"Internal")==0) return InternalEnum;
    631631         else stage=6;
    632632   }
    633633   if(stage==6){
    634               if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
     634              if (strcmp(name,"Internal")==0) return InternalEnum;
     635              else if (strcmp(name,"MassFlux")==0) return MassFluxEnum;
    635636              else if (strcmp(name,"MeltingOffset")==0) return MeltingOffsetEnum;
    636637              else if (strcmp(name,"Misfit")==0) return MisfitEnum;
     
    751752              else if (strcmp(name,"Outputdefinition1")==0) return Outputdefinition1Enum;
    752753              else if (strcmp(name,"Outputdefinition2")==0) return Outputdefinition2Enum;
    753               else if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
    754754         else stage=7;
    755755   }
    756756   if(stage==7){
    757               if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
     757              if (strcmp(name,"Outputdefinition3")==0) return Outputdefinition3Enum;
     758              else if (strcmp(name,"Outputdefinition4")==0) return Outputdefinition4Enum;
    758759              else if (strcmp(name,"Outputdefinition5")==0) return Outputdefinition5Enum;
    759760              else if (strcmp(name,"Outputdefinition6")==0) return Outputdefinition6Enum;
     
    874875              else if (strcmp(name,"MinVel")==0) return MinVelEnum;
    875876              else if (strcmp(name,"MaxVel")==0) return MaxVelEnum;
    876               else if (strcmp(name,"MinVx")==0) return MinVxEnum;
    877877         else stage=8;
    878878   }
    879879   if(stage==8){
    880               if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
     880              if (strcmp(name,"MinVx")==0) return MinVxEnum;
     881              else if (strcmp(name,"MaxVx")==0) return MaxVxEnum;
    881882              else if (strcmp(name,"MaxAbsVx")==0) return MaxAbsVxEnum;
    882883              else if (strcmp(name,"MinVy")==0) return MinVyEnum;
  • issm/trunk-jpl/src/m/enum/EnumDefinitions.py

    r19561 r19594  
    390390def SmbGspEnum(): return StringToEnum("SmbGsp")[0]
    391391def SmbECEnum(): return StringToEnum("SmbEC")[0]
     392def SmbCondensationEnum(): return StringToEnum("SmbCondensation")[0]
    392393def SmbWEnum(): return StringToEnum("SmbW")[0]
    393394def SmbAEnum(): return StringToEnum("SmbA")[0]
  • issm/trunk-jpl/src/m/solve/parseresultsfromdisk.m

    r19527 r19594  
    200200        elseif strcmp(fieldname,'SmbMassBalance'),
    201201                field = field*yts;
     202        elseif strcmp(fieldname,'SmbPrecipitation'),
     203                field = field*yts;
     204        elseif strcmp(fieldname,'SmbRunoff'),
     205                field = field*yts;
     206        elseif strcmp(fieldname,'SmbCondensation'),
     207                field = field*yts;
    202208        elseif strcmp(fieldname,'SmbAccumulation'),
    203209                field = field*yts;
Note: See TracChangeset for help on using the changeset viewer.