#include #include #include #include "GATS_Utilities.hpp" using namespace GATS_Utilities; /** * Routine checks to be sure temperature pressure is the last product listed in the * igdo array. It also checks that two products are not listed more than once and * that the gases listed in igdo are infact included in the idg or the gas id array. * */ extern "C" void check_products(int *igdo, int *ngdo, int *idg, int *ng) { std::vector mm; if( igdo[*ngdo-1] < 0) { if( *ngdo == 1) return; mm = std::vector( igdo, igdo+ *ngdo-1); } else { mm = std::vector( igdo, igdo+ *ngdo) ; } sort(mm.begin(), mm.end() ); assert(mm.front() > 0); assert( monotonic_if( mm.begin(), mm.end(), std::less() ) ); for(unsigned i = 0; i< mm.size() ; ++i) { assert( std::find( idg, idg+ *ng, mm[i] ) != idg+ *ng); } }