Skip to content

Commit

Permalink
v486 - added KGE_PRIME diagnostic
Browse files Browse the repository at this point in the history
  • Loading branch information
James Craig authored and James Craig committed Oct 29, 2024
1 parent 4677309 commit 42fa44e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ string CDiagnostic::GetName() const
case(DIAG_RSR): {return "DIAG_RSR";}
case(DIAG_R2): {return "DIAG_R2";}
case(DIAG_LOG_NASH): {return "DIAG_LOG_NASH";}
case(DIAG_KLING_GUPTA): {return "DIAG_KLING_GUPTA";}
case(DIAG_KLING_GUPTA): {return "DIAG_KLING_GUPTA";}
case(DIAG_KGE_PRIME): {return "DIAG_KGE_PRIME";}
case(DIAG_DAILY_KGE): {return "DIAG_DAILY_KGE";}
case(DIAG_NASH_SUTCLIFFE_DER):{return "DIAG_NASH_SUTCLIFFE_DER"; }
case(DIAG_RMSE_DER): {return "DIAG_RMSE_DER"; }
Expand Down Expand Up @@ -999,6 +1000,7 @@ double CDiagnostic::CalculateDiagnostic(CTimeSeriesABC *pTSMod,
}
}
case(DIAG_KLING_GUPTA)://-----------------------------------------
case(DIAG_KGE_PRIME)://-------------------------------------------
case(DIAG_KLING_GUPTA_DEVIATION)://-------------------------------
{
double ObsAvg = 0;
Expand Down Expand Up @@ -1043,6 +1045,8 @@ double CDiagnostic::CalculateDiagnostic(CTimeSeriesABC *pTSMod,

if (_type==DIAG_KLING_GUPTA_DEVIATION){Beta=1.0;} //remove penalty for difference in means

if (_type==DIAG_KGE_PRIME){Alpha/=Beta;}// Uses C.O.V. instead of std dev. from Kling et al. (2012) Runoff conditions in the upper Danube basin under an ensemble of climate change scenarios, Journal of Hydrology

if ((N>0) && ((ObsAvg!=0.0) || (Beta==1.0)) && (ObsStd!=0.0) && (ModStd!=0.0))
{
return 1.0 - sqrt(pow((r - 1), 2) + pow((Alpha - 1), 2) + pow((Beta - 1), 2));
Expand Down Expand Up @@ -1495,6 +1499,7 @@ diag_type StringToDiagnostic(string distring)
else if (!distring.compare("R2" )){return DIAG_R2;}
else if (!distring.compare("LOG_NASH" )){return DIAG_LOG_NASH;}
else if (!distring.compare("KLING_GUPTA" )){return DIAG_KLING_GUPTA;}
else if (!distring.compare("KGE_PRIME" )){return DIAG_KGE_PRIME;}
else if (!distring.compare("DAILY_KGE" )){return DIAG_DAILY_KGE;}
else if (!distring.compare("NASH_SUTCLIFFE_DER" )){return DIAG_NASH_SUTCLIFFE_DER;}
else if (!distring.compare("RMSE_DER" )){return DIAG_RMSE_DER;}
Expand Down
1 change: 1 addition & 0 deletions src/Diagnostics.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ enum diag_type {
DIAG_RMSE,
DIAG_RMSE_DER,
DIAG_KLING_GUPTA,
DIAG_KGE_PRIME,
DIAG_DAILY_KGE,
DIAG_KLING_GUPTA_DER,
DIAG_KLING_GUPTA_DEVIATION,
Expand Down

0 comments on commit 42fa44e

Please sign in to comment.