Skip to content

Commit

Permalink
update 1D
Browse files Browse the repository at this point in the history
  • Loading branch information
ftomei committed Jun 17, 2024
1 parent da2b3a8 commit 9f49bfe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
1 change: 1 addition & 0 deletions DATA/PROJECT/kiwifruit/kiwifruit.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ db_soil="./data/soil_ER_2002.db"
db_crop="./data/crop.db"
db_comp_units="./data/units.db"
db_output="./output/kiwifruit.db"
save_state = true

[forecast]
isSeasonalForecast=false
Expand Down
4 changes: 2 additions & 2 deletions agrolib/criteriaModel/criteria1DProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1095,7 +1095,7 @@ int Crit1DProject::computeAllUnits()
}
}

int infoStep = compUnitList.size();
int infoStep = int(compUnitList.size());
if (compUnitList.size() >= 20)
{
infoStep = int(compUnitList.size() / 20);
Expand Down Expand Up @@ -1170,7 +1170,7 @@ int Crit1DProject::computeAllUnits()
}
}

if ((i+1) % infoStep == 0 && nrUnitsComputed > 0)
if ((i+1) % infoStep == 0 && nrUnitsComputed > 20)
{
double percentage = (i+1) * 100.0 / compUnitList.size();
logger.writeInfo("..." + QString::number(round(percentage)) + "%");
Expand Down
26 changes: 15 additions & 11 deletions bin/CRITERIA1D/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void usage()
int main(int argc, char *argv[])
{
QCoreApplication myApp(argc, argv);
std::cout << "CRITERIA-1D agro-hydrological model v1.8.4\n" << std::endl;
std::cout << "CRITERIA-1D agro-hydrological model v1.8.5\n" << std::endl;

Crit1DProject myProject;

Expand All @@ -54,25 +54,29 @@ int main(int argc, char *argv[])

#ifdef TEST
projectFileName = projectPath + "test/test.ini";
#else
#ifdef TEST_GEO
//projectFileName = projectPath + "INCOLTO/incolto.ini";
//projectFileName = "//moses-arpae/CRITERIA1D/PROJECTS/CLARA/iCOLT_2023/seasonalIrriClimate_RO.ini";
#else
usage();
return 1;
#endif
#endif

#ifdef TEST_GEO
projectFileName = projectPath + "INCOLTO/incolto.ini";
#endif

#ifdef TEST_FIRSTRUN
projectFileName = projectPath + "kiwifruit/kiwifruit.ini";
myProject.firstSimulationDate = QDate::fromString("1995-01-01", "yyyy-MM-dd");
myProject.lastSimulationDate = QDate::fromString("2008-05-31", "yyyy-MM-dd");
myProject.lastSimulationDate = QDate::fromString("2001-05-31", "yyyy-MM-dd");
#endif

#ifdef TEST_RESTART
myProject.firstSimulationDate = QDate::fromString("2008-06-01", "yyyy-MM-dd");
projectFileName = projectPath + "kiwifruit/kiwifruit_restart.ini";
myProject.firstSimulationDate = QDate::fromString("2001-06-01", "yyyy-MM-dd");
myProject.lastSimulationDate = QDate::fromString("2008-12-31", "yyyy-MM-dd");
#endif

if (projectFileName.isEmpty())
{
usage();
return 1;
}
}


Expand Down

0 comments on commit 9f49bfe

Please sign in to comment.