Skip to content
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

Implemented a new snow interception module and fixed segfault issue when running crhm-cli #462

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.user
*.userosscache
*.sln.docstates
settings.json

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
Expand Down
4 changes: 2 additions & 2 deletions crhmcode/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ ClassalbedoBaker.o Classalbedoobs.o Classalbedoobs2.o Classalbedoparam.o \
ClassalbedoRichard.o ClassalbedoWinstral.o ClassAnnan.o ClassAyers.o \
ClassBasin.o Classbrushintcp.o Classcalcsun.o Classcontribution.o \
Classcrack.o ClassCRHMCanopy.o ClassCRHMCanopyClearing.o \
ClassCRHMCanopyClearingGap.o Classebsm.o Classevap.o Classevap_Resist.o \
ClassevapD.o ClassevapD_Resist.o ClassevapX.o ClassFlowInSnow.o \
ClassCRHMCanopyClearingGap.o ClassCRHMCanopyVectorBased.o Classebsm.o Classevap.o \
Classevap_Resist.o ClassevapD.o ClassevapD_Resist.o ClassevapX.o ClassFlowInSnow.o \
Classfrostdepth.o Classfrozen.o ClassfrozenAyers.o Classglacier.o \
Classglacier_debris.o ClassGlobal.o ClassGreenAmpt.o ClassGreencrack.o \
ClassGrow_Crop.o ClassHMSA.o ClassHtobs.o ClassIceBulb.o ClassICEflow.o \
Expand Down
2 changes: 1 addition & 1 deletion crhmcode/prj/badlake.prj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Macros:
######
Observations:
######
C:\Users\jhs507\repos\crhmcode\crhmcode\obs\Badlake73_76.obs
/home/alex/Documents/code/crhmcode/crhmcode/obs/Badlake73_76.obs
######
Dates:
######
Expand Down
2 changes: 2 additions & 0 deletions crhmcode/src/core/CRHM_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ namespace CRHM_constants {
const double emiss = 0.985; // emissivity of the atmosphere and snowpack
const double emiss_c = 0.96; // emissivity of the canopy
const double em = 0.622; //
const double ci = 2.102e-3; // heat capacity of ice (MJ/kg/K)

}

#endif // !CRHM_CONSTANTS
12 changes: 9 additions & 3 deletions crhmcode/src/core/CRHMmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2308,7 +2308,7 @@ MMSData * CRHMmain::RunClick2Start()
}
}


Global::DTmin = (int)((DTstartR - Global::DTstart)* Global::Freq);
Global::DTindx = Global::DTmin;
Global::DTnow = Global::DTstart + Global::Interval*((long long)Global::DTindx + 1ll);
Expand Down Expand Up @@ -2351,13 +2351,19 @@ MMSData * CRHMmain::RunClick2Start()
GoodRun = false;
}


ClassData * FileData = NULL;
if (ObsFilesList->size() > 0)
{
FileData = ObsFilesList->begin()->second;
const double tolerance = 1e-9; // to handle floating point precision when DTstartR and FileData->Dt1 are effectively equal but have slightly different precision and then entered the first if statement below.

if (fabs(DTstartR - FileData->Dt1) < tolerance) { // check if effectively equal

LogMessageX("DTstartR and FileData->Dt1 are effectively equal but there still may be a small difference due to floating point precision");

} else if (DTstartR < FileData->Dt1 - tolerance) {

if (DTstartR < FileData->Dt1) {
LogMessageX("Start Time before first Observation");
GoodRun = false;
}
Expand Down
1 change: 1 addition & 0 deletions crhmcode/src/modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ add_library(modules OBJECT
ClassCRHMCanopy.cpp
ClassCRHMCanopyClearing.cpp
ClassCRHMCanopyClearingGap.cpp
ClassCRHMCanopyVectorBased.cpp
Classebsm.cpp
Classevap_Resist.cpp
Classevap.cpp
Expand Down
Loading