28 #define _CRT_SECURE_NO_DEPRECATE
44 int a_phase,
int a_type )
52 unsigned int oldindex=0, newindex=0;
54 if (
m_growth[ index ]->m_dds[ a_phase ][ 0 ] == 99999 ) {
62 if (
m_growth[ index ]->m_dds[ a_phase ][ i+1 ] > a_ddegs ) {
70 if (
m_growth[ index ]->m_dds[ a_phase ][ i+1 ] > a_yddegs ) {
79 if ( newindex > oldindex ) {
84 m_growth[ index ]->m_dds[ a_phase ][ newindex ] - a_yddegs;
86 m_growth[ index ]->m_slopes[ a_phase ][ a_type ][oldindex]*
91 m_growth[ index ]->m_dds[ a_phase ][ newindex ];
93 m_growth[ index ]->m_slopes[ a_phase ][ a_type ][ newindex ]*
97 diff =
m_growth[ index ]->m_slopes[ a_phase ][ a_type ][ newindex ] *
108 for (
unsigned int i=0; i<201; i++) {
140 if ( ThisPlant < 0 || ThisPlant > 200 ) {
142 " specified in", a_cropcurvefile );
149 if ( ThisPlant > 100 ) {
160 ifstream ist(a_vegcurvefile, ios::in);
163 for (
unsigned int i=0; i<NoPlants; i++) {
177 for (
unsigned int j=0; j<5; j++) {
185 float f1=0,f2=0,f0=0;
188 m_growth[ i ]->m_start_valid[j] =
true;
190 ist >> f1 >> f0 >> f2;
196 m_growth[ i ]->m_dds[j][lk] = (double)entry;
198 ist >> f1 >> f0 >> f2;
212 for (
unsigned int i=0; i<
m_growth.size(); i++ )
218 for (
unsigned int j=0; j<5; j++) {
220 for (
unsigned int k=0; k<3; k++) {
230 switch (VegReference)
400 sprintf( error_num,
"%d", VegReference );
402 "PlantGrowthData::VegTypeToCurveNum(): Unknown vegetation type:",
413 return p-> m_start_valid[ a_phase ];
424 vector<double> empty;
426 for (
int i = 0; i < 366; i++) {
427 empty.push_back(0.0);
449 ifstream infile(a_tovinputfile.c_str(), ios::in);
451 if (!infile.is_open()) {
452 g_msg->
Warn(
"PollenNectarDevelopmentData::PollenNectarDevelopmentData Cannot open the file", a_toleinputfile.c_str());
458 for (
int i = 0; i < no_curves-1; i++)
460 infile >> tov >> curvenum;
470 vector<double> slopes(366, 0);
475 for (
int i = 0; i < no_curves; i++)
479 infile >> slopes[365];
481 for (
int d = 0; d < 365; d++) infile >> slopes[d];
485 infile >> slopes[365];
486 for (
int d = 0; d < 365; d++) infile >> slopes[d];
500 infile.open(a_tovinputfile.c_str(), ios::in);
502 if (!infile.is_open()) {
503 g_msg->
Warn(
"PollenNectarDevelopmentData::PollenNectarDevelopmentData Cannot open the file", a_toleinputfile.c_str());
507 int tole, tolecurvenum;
508 for (
int i = 0; i < no_curves-1; i++)
510 infile >> tole >> tolecurvenum;
522 for (
int i = 1; i <= no_curves; i++)
525 infile >> tolecurvenum;
527 infile >> slopes[366];
528 for (
int d = 0; d < 365; d++) infile >> slopes[d];
532 infile >> slopes[365];
533 for (
int d = 0; d < 365; d++) infile >> slopes[d];