Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Assimilate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void CModel::PrepareAssimilation(const optStruct &Options,const time_struct &tt)
{
Qobs = _pObservedTS[i]->GetSampledValue(nn); //mean timestep flow
Qobs2 = _pObservedTS[i]->GetSampledValue(nn+1); //mean timestep flow

//override initial conditions directly
if ((nn==1) && (Qobs!=RAV_BLANK_DATA)){
_pSubBasins[p]->SetQout(Qobs);
Expand Down
2 changes: 1 addition & 1 deletion src/ChannelXSect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ double CChannelXSect::GetDiffusivity(const double &Q, const double &SB_slope, co
{
ExitGracefullyIf(Q<=0,"CChannelXSect::GetDiffusivity: Invalid channel flowrate",BAD_DATA);

///< diffusivity from Roberson et al. 1995, Hydraulic Engineering
///< diffusivity from Roberson et al. 1995, Hydraulic Engineering
double slope_mult=1.0;
double Q_mult =1.0;
GetFlowCorrections(SB_slope,SB_n,slope_mult,Q_mult);
Expand Down
18 changes: 9 additions & 9 deletions src/ParsePropertyFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ void AddNewSoilClass (CSoilClass **&pSoilClasses, soil_struct **&parsed_s
string *&soiltags, int &num_parsed_soils, int nConstits,
const string name, bool isdefault, CModel *pModel);
void AddNewLULTClass (CLandUseClass **&pLandUseClasses, surface_struct **&parsed_lults,
string *&lulttags, int &num_parsed_lults,
string *&lulttags, int &num_parsed_lults,
const string name, bool isdefault, CModel *pModel);
void AddNewVegClass (CVegetationClass **&pVegClasses, veg_struct **&parsed_vegs,
string *&vegtags, int &num_parsed_vegs,
string *&vegtags, int &num_parsed_vegs,
const string name, bool isdefault, CModel *pModel);
//////////////////////////////////////////////////////////////////
/// \brief This method parses the class properties .rvp file
Expand Down Expand Up @@ -86,7 +86,7 @@ bool ParseClassPropertiesFile(CModel *&pModel,
CSoilProfile **pProfiles=NULL;

int num_parsed_aqstacks=0;

bool invalid_index;
int num_read;
int *indices=NULL;
Expand Down Expand Up @@ -518,7 +518,7 @@ bool ParseClassPropertiesFile(CModel *&pModel,
invalid_index=ParsePropArray(p,indices,properties,num_read,soiltags,nParamStrings,num_parsed_soils,aAliases,nAliases);
ExitGracefullyIf(invalid_index,
"ParseClassPropertiesFile: Invalid soiltype code in SoilParameterList command",BAD_DATA);

if (Options.noisy){
for (int j=0;j<nParamStrings-1;j++){cout<<" "<<aParamStrings[j+1]<<endl;}
}
Expand Down Expand Up @@ -1520,7 +1520,7 @@ bool ParseClassPropertiesFile(CModel *&pModel,
pSoilClasses[c]->AutoCalculateSoilProps (*parsed_soils[c],*parsed_soils[0],pModel->GetTransportModel()->GetNumConstituents());
}
for (int c=1;c<num_parsed_lult;c++) {
pLUClasses [c]->AutoCalculateLandUseProps (*parsed_surf[c], *parsed_surf[0]);
pLUClasses [c]->AutoCalculateLandUseProps (*parsed_surf[c], *parsed_surf[0]);
}
for (int c=1;c<num_parsed_terrs;c++){
pTerrClasses[c-1]->AutoCalculateTerrainProps ( parsed_terrs[c], parsed_terrs[0]);
Expand Down Expand Up @@ -1577,7 +1577,7 @@ bool ParseClassPropertiesFile(CModel *&pModel,

pModel->CheckForChannelXSectsDuplicates(Options);


delete p;

return true;
Expand Down Expand Up @@ -1648,7 +1648,7 @@ bool ParsePropArray(CParser *p, //parser
tmpproperties[num_read][j-1]=AutoOrDoubleOrAlias(s[j],pAliases,nAliases);
}
DeletePropArray(indices,properties,num_read);

properties=tmpproperties;
indices=tmpind;
num_read++;
Expand Down Expand Up @@ -1808,7 +1808,7 @@ void AddNewSoilClass(CSoilClass **&pSoilClasses,
/// \brief dynamically adds a new LULT class to the array of parsed LULT classes.
//
void AddNewLULTClass (CLandUseClass **&pLandUseClasses, surface_struct **&parsed_lults,
string *&lulttags, int &num_parsed_lults,
string *&lulttags, int &num_parsed_lults,
const string name, bool isdefault, CModel *pModel){
CLandUseClass *pLC;
pLC = new CLandUseClass(name, pModel);
Expand Down Expand Up @@ -1838,7 +1838,7 @@ void AddNewLULTClass (CLandUseClass **&pLandUseClasses, surface_struct **
/// \brief dynamically adds a new veg class to the array of parsed vegetation classes.
//
void AddNewVegClass (CVegetationClass **&pVegClasses, veg_struct **&parsed_vegs,
string *&vegtags, int &num_parsed_vegs,
string *&vegtags, int &num_parsed_vegs,
const string name, bool isdefault, CModel *pModel){
CVegetationClass *pVC;
pVC = new CVegetationClass(name, pModel);
Expand Down
15 changes: 10 additions & 5 deletions src/RavenMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ int main(int argc, char* argv[])
clock_t t0, t1; //computational time markers
time_struct tt;
int nEnsembleMembers;
int retval;
optStruct Options;

Options.version=__RAVEN_VERSION__;
Expand All @@ -51,7 +52,9 @@ int main(int argc, char* argv[])
Options.version+=" w/ lp_solve";
#endif

ProcessExecutableArguments(argc,argv,Options);
retval = ProcessExecutableArguments(argc,argv,Options);
if (!retval) { return 0; }

PrepareOutputdirectory(Options);

for (int i=0;i<10;i++){g_debug_vars[i]=0;}
Expand Down Expand Up @@ -199,7 +202,7 @@ int main(int argc, char* argv[])
/// \details filebase has no extension, all others require .rv* extension
/// \param Options [in] Global model options
//
void ProcessExecutableArguments(int argc, char* argv[], optStruct &Options)
int ProcessExecutableArguments(int argc, char* argv[], optStruct &Options)
{
int i=1;
string word,argument;
Expand Down Expand Up @@ -236,7 +239,7 @@ void ProcessExecutableArguments(int argc, char* argv[], optStruct &Options)
}
if ((word=="-p") || (word=="-h") || (word=="-t") || (word=="-e") || (word=="-c") || (word=="-o") ||
(word=="-s") || (word=="-r") || (word=="-n") || (word=="-l") || (word=="-m") || (word=="-v") ||
(word=="-we")|| (word=="-tt")|| (word=="-template") || (word=="-b") || (i==argc))
(word=="-we")|| (word=="-tt")|| (word=="-template") || (word=="--version") || (word=="-b") || (i==argc))
{
if (mode==0){
Options.rvi_filename=argument+".rvi";
Expand Down Expand Up @@ -282,7 +285,7 @@ void ProcessExecutableArguments(int argc, char* argv[], optStruct &Options)
else if (word=="-we"){mode=13; }
else if (word=="-template"){mode=14;}
else if (word=="-b"){mode=15;}
else if (word=="-v"){Options.pause=false; version_announce=true; mode=10;} //For PAVICS
else if (word=="-v" || word=="--version"){Options.pause=false; version_announce=true; mode=10;} //For PAVICS
}
else{
if (argument==""){argument+=word;}
Expand Down Expand Up @@ -317,8 +320,10 @@ void ProcessExecutableArguments(int argc, char* argv[], optStruct &Options)

if(version_announce) {
cout<<Options.version<<endl;
ExitGracefully("Version check",SIMULATION_DONE);
return 0;
// ExitGracefully("Version check",SIMULATION_DONE);
}
return 1;
}


Expand Down
2 changes: 1 addition & 1 deletion src/RavenMain.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void MassEnergyBalance (CModel *pModel,const optStruct &Options, const tim
void ParseLiveFile (CModel*&pModel,const optStruct &Options, const time_struct &tt);

//Local functions defined below main() in RavenMain.cpp
void ProcessExecutableArguments(int argc, char* argv[], optStruct &Options);
int ProcessExecutableArguments(int argc, char* argv[], optStruct &Options);
void CheckForErrorWarnings (bool quiet, CModel *pModel);
bool CheckForStopfile (const int step, const time_struct &tt, CModel *pModel);
void CallExternalScript (const optStruct &Options, const time_struct &tt);
Expand Down
8 changes: 4 additions & 4 deletions src/Reservoir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,17 +511,17 @@ double CReservoir::GetLakeConvectionCoeff() const { return _lake_convcoeff; }
//////////////////////////////////////////////////////////////////
/// \returns current outflow rate [m3/s]
//
double CReservoir::GetOutflowRate (const bool adjusted) const {
double CReservoir::GetOutflowRate (const bool adjusted) const {
if (adjusted){return max(_Qout+_DAadjust,0.0);}
else {return _Qout;}
else {return _Qout;}
}

//////////////////////////////////////////////////////////////////
/// \returns previous outflow rate [m3/s]
//
double CReservoir::GetOldOutflowRate (const bool adjusted) const {
double CReservoir::GetOldOutflowRate (const bool adjusted) const {
if (adjusted){return max(_Qout_last+_DAadjust_last,0.0);}
else {return _Qout_last;}
else {return _Qout_last;}
}

//////////////////////////////////////////////////////////////////
Expand Down
2 changes: 1 addition & 1 deletion src/Reservoir.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CReservoir

double _DAadjust; //< outflow adjustment - used for reporting overriden flows [m3/s]
double _DAadjust_last; //< outflow adjustment [m3/s] from previous time step

int _dry_timesteps; //< number of time steps this reservoir dried out during simulation

//state variables :
Expand Down
Loading