int routing_open() // // Input: none // Output: returns an error code // Purpose: initializes the routing analyzer. // { // --- open treatment system if ( !treatmnt_open() ) return ErrorCode; // --- topologically sort the links SortedLinks = NULL; if ( Nobjects[LINK] > 0 ) { SortedLinks = (int *) calloc(Nobjects[LINK], sizeof(int)); if ( !SortedLinks ) { report_writeErrorMsg(ERR_MEMORY, ""); return ErrorCode; } toposort_sortLinks(SortedLinks); if ( ErrorCode ) return ErrorCode; } // --- open any routing interface files iface_openRoutingFiles(); return ErrorCode; }
int routing_open() // // Input: none // Output: returns an error code // Purpose: initializes the routing analyzer. // { // --- open treatment system if ( !treatmnt_open() ) return ErrorCode; // --- topologically sort the links SortedLinks = NULL; if ( Nobjects[LINK] > 0 ) { SortedLinks = (int *) calloc(Nobjects[LINK], sizeof(int)); if ( !SortedLinks ) { report_writeErrorMsg(ERR_MEMORY, ""); return ErrorCode; } toposort_sortLinks(SortedLinks); if ( ErrorCode ) return ErrorCode; } // --- open any routing interface files iface_openRoutingFiles(); // --- initialize flow and quality routing systems //(5.1.008) flowrout_init(RouteModel); //(5.1.008) if ( Fhotstart1.mode == NO_FILE ) qualrout_init(); //(5.1.008) return ErrorCode; }
int routing_open(int routingModel) // // Input: routingModel = routing method code // Output: returns an error code // Purpose: initializes the routing analyzer. // { // --- initialize steady state indicator InSteadyState = FALSE; // --- open treatment system if ( !treatmnt_open() ) return ErrorCode; // --- topologically sort the links SortedLinks = NULL; if ( Nobjects[LINK] > 0 ) { SortedLinks = (int *) calloc(Nobjects[LINK], sizeof(int)); if ( !SortedLinks ) { report_writeErrorMsg(ERR_MEMORY, ""); return ErrorCode; } toposort_sortLinks(SortedLinks); if ( ErrorCode ) return ErrorCode; } // --- open any routing interface files iface_openRoutingFiles(); if ( ErrorCode ) return ErrorCode; // --- open hot start files if ( !openHotstartFile1() ) return ErrorCode; if ( !openHotstartFile2() ) return ErrorCode; // --- initialize the flow routing model flowrout_init(routingModel); return ErrorCode; }