@@ -603,6 +603,23 @@ void CModel::WriteOutputFileHeaders(const optStruct &Options)
603603 }
604604 }
605605
606+ // Assimilation adjustments
607+ // --------------------------------------------------------------
608+ if (Options.assimilate_flow ){
609+ ofstream ASSIM;
610+ tmpFilename=FilenamePrepare (" AssimilationAdjustments.csv" ,Options);
611+ ASSIM.open (tmpFilename.c_str ());
612+ if (ASSIM.fail ()){
613+ ExitGracefully ((" CModel::WriteOutputFileHeaders: Unable to open output file " +tmpFilename+" for writing." ).c_str (),FILE_OPEN_ERR);
614+ }
615+ ASSIM<<" time,date,hour" ;
616+ for (int p = 0 ; p < _nSubBasins; p++) {
617+ if ((_pSubBasins[p]->IsGauged ()) && (_pSubBasins[p]->IsEnabled ())){
618+ ASSIM<<" ," <<_pSubBasins[p]->GetName ()<<" " ;
619+ }
620+ }
621+ }
622+
606623 // Custom output files
607624 // --------------------------------------------------------------
608625 for (int c=0 ;c<_nCustomOutputs;c++)
@@ -1076,9 +1093,7 @@ void CModel::WriteMinorOutput(const optStruct &Options,const time_struct &tt)
10761093 pSB=_pSubBasins[p];
10771094 if ((pSB->IsGauged ()) && (pSB->IsEnabled ()) && (pSB->GetReservoir ()!=NULL ))
10781095 {
1079- string name,constraint_str;
1080- if (pSB->GetName ()==" " ){ name=to_string (pSB->GetID ()); }
1081- else { name=pSB->GetName (); }
1096+ string constraint_str;
10821097
10831098 stage =pSB->GetReservoir ()->GetResStage ();// m
10841099 area =pSB->GetReservoir ()->GetSurfaceArea ();// m2
@@ -1290,6 +1305,24 @@ void CModel::WriteMinorOutput(const optStruct &Options,const time_struct &tt)
12901305 HRUSTOR.close ();
12911306 }
12921307 }
1308+
1309+ // Assimilation adjustments
1310+ // --------------------------------------------------------------
1311+ if (Options.assimilate_flow ){
1312+ ofstream ASSIM;
1313+ tmpFilename=FilenamePrepare (" AssimilationAdjustments.csv" ,Options);
1314+ ASSIM.open (tmpFilename.c_str (),ios::app);
1315+
1316+ ASSIM<<usetime<<" ," <<usedate<<" ," <<usehour<<" ," ;
1317+ for (int p = 0 ; p < _nSubBasins; p++) {
1318+ if ((_pSubBasins[p]->IsGauged ()) && (_pSubBasins[p]->IsEnabled ())){
1319+ if (Options.assim_method ==DA_ECCC){ASSIM<<" ," <<_aDAQadjust[p]<<" " ;}
1320+ else {ASSIM<<" ," <<_aDAscale [p]<<" " ;}
1321+ }
1322+ }
1323+ ASSIM<<endl;
1324+ ASSIM.close ();
1325+ }
12931326 } // end of write output interval if statement
12941327
12951328 // Custom output files
0 commit comments