src/simpleNbox.cpp
//------------------------------------------------------------------------------
/*! \brief      Sanity checks
 *  \exception  If any of the sanity checks fails
 *
 *  This is called internally throughout the model run and performs sanity checks.
 *  For example, the main carbon pools (except earth) should always be positive;
 *  partitioning coefficients should not exceed 1; etc.
 */
\brief      Sanity checks
\exception  If any of the sanity checks fails

This is called internally throughout the model run and performs sanity checks.
For example, the main carbon pools (except earth) should always be positive;
partitioning coefficients should not exceed 1; etc.
\ brief Sanity checks \ exception If any of the sanity checks fails This is called internally throughout the model run and performs sanity checks . For example the main carbon pools ( except earth ) should always be positive ; partitioning coefficients should not exceed 1 ; etc .
void SimpleNbox::sanitychecks() throw( h_exception )
{
    unitval_stringmap::const_iterator it;
    double_stringmap::const_iterator itd;
    H_ASSERT( atmos_c.value( U_PGC ) > 0.0, "atmos_c pool <=0" );
    for( it = veg_c.begin(); it != veg_c.end(); it++ )
        H_ASSERT( it->second.value( U_PGC ) > 0.0, "veg_c pool <=0" );
    for( it = detritus_c.begin(); it != detritus_c.end(); it++ )
        H_ASSERT( it->second.value( U_PGC ) > 0.0, "detritus_c pool <=0" );
    for( it = soil_c.begin(); it != soil_c.end(); it++ )
        H_ASSERT( it->second.value( U_PGC ) > 0.0, "soil_c pool <=0" );
    H_ASSERT( f_nppv >= 0.0, "f_nppv <0" );
    H_ASSERT( f_nppd >= 0.0, "f_nppd <0" );
    H_ASSERT( f_nppv + f_nppd <= 1.0, "f_nppv + f_nppd >1" );
    H_ASSERT( f_litterd >= 0.0 && f_litterd <= 1.0, "f_litterd <0 or >1" );
    H_ASSERT( f_lucv >= 0.0, "f_lucv <0" );
    H_ASSERT( f_lucd >= 0.0, "f_lucd <0" );
    H_ASSERT( f_lucv + f_lucd <= 1.0, "f_lucv + f_lucd >1" );
    for( it = npp_flux0.begin(); it != npp_flux0.end(); it++ )
        H_ASSERT( it->second.value( U_PGC_YR ) > 0.0, "npp_flux0 <=0" );
    H_ASSERT( C0.value( U_PPMV_CO2 ) > 0.0, "C0 <= 0" );
    H_ASSERT( Ca.value( U_PPMV_CO2 ) > 0.0, "Ca <= 0" );
}
void SimpleNbox :: sanitychecks ( ) throw ( h_exception ) { unitval_stringmap :: const_iterator it ; double_stringmap :: const_iterator itd ; H_ASSERT ( atmos_c . value ( U_PGC ) > 0.0 , " " ) ; for ( it = veg_c . begin ( ) ; it != veg_c . end ( ) ; it ++ ) H_ASSERT ( it -> second . value ( U_PGC ) > 0.0 , " " ) ; for ( it = detritus_c . begin ( ) ; it != detritus_c . end ( ) ; it ++ ) H_ASSERT ( it -> second . value ( U_PGC ) > 0.0 , " " ) ; for ( it = soil_c . begin ( ) ; it != soil_c . end ( ) ; it ++ ) H_ASSERT ( it -> second . value ( U_PGC ) > 0.0 , " " ) ; H_ASSERT ( f_nppv >= 0.0 , " " ) ; H_ASSERT ( f_nppd >= 0.0 , " " ) ; H_ASSERT ( f_nppv + f_nppd <= 1.0 , " " ) ; H_ASSERT ( f_litterd >= 0.0 && f_litterd <= 1.0 , " " ) ; H_ASSERT ( f_lucv >= 0.0 , " " ) ; H_ASSERT ( f_lucd >= 0.0 , " " ) ; H_ASSERT ( f_lucv + f_lucd <= 1.0 , " " ) ; for ( it = npp_flux0 . begin ( ) ; it != npp_flux0 . end ( ) ; it ++ ) H_ASSERT ( it -> second . value ( U_PGC_YR ) > 0.0 , " " ) ; H_ASSERT ( C0 . value ( U_PPMV_CO2 ) > 0.0 , " " ) ; H_ASSERT ( Ca . value ( U_PPMV_CO2 ) > 0.0 , " " ) ; }
\brief      Sanity checks
  \exception  If any of the sanity checks fails
\ brief Sanity checks \ exception If any of the sanity checks fails
// Make a few sanity checks here, and then return.