Skip to content

Simplify ParentLayer.cpp and SnowLayer.cpp #715

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions src/ParentLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,25 @@ void ParentLayer::updateProperty() {

// get frozen layer specific heat capcity
double ParentLayer::getFrzVolHeatCapa() {
double vhc = vhcsolid ;
return vhc;
return vhcsolid;
};

double ParentLayer::getUnfVolHeatCapa() {
double vhc= vhcsolid ;
return vhc;
return vhcsolid;
};

double ParentLayer::getMixVolHeatCapa() {
double vhc= vhcsolid ;
return vhc;
return vhcsolid;
};

// get frozen layer thermal conductivity
double ParentLayer::getFrzThermCond() {
double tc=tcsolid;
return tc;
return tcsolid;
};

// get unfrozen layer thermal conductivity
double ParentLayer::getUnfThermCond() {
double tc=tcsolid;
return tc;
return tcsolid;
};

// get albedo of visible radiation
Expand Down
25 changes: 3 additions & 22 deletions src/SnowLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,34 +102,15 @@ double SnowLayer::getThermCond() {
return tc;
}

// FIX THIS: THESE 3 functions see to be identical???
double SnowLayer::getFrzVolHeatCapa() {
if (dz != 0) {
// FIX THIS: divide by zero error when there is no thickness!
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this line because a check for division by zero is implemented.

double vhc = SHCICE * ice/dz;
return vhc;
} else {
return 0;
}
return (dz != 0) ? (SHCICE * ice/dz) : 0;
};

double SnowLayer::getUnfVolHeatCapa() {
if (dz != 0) {
// FIX THIS: divide by zero error when there is no thickness!
double vhc = SHCICE * ice/dz;
return vhc;
} else {
return 0;
}
return (dz != 0) ? (SHCICE * ice/dz) : 0;
};

double SnowLayer::getMixVolHeatCapa() {
if (dz != 0) {
// FIX THIS: divide by zero error when there is no thickness!
double vhc = SHCICE * ice/dz;
return vhc;
} else {
return 0;
}
return (dz != 0) ? (SHCICE * ice/dz) : 0;
};

Loading