A.2. Roles of the Different
Routines
159
A.2. Roles of the Different Routines
Program DAMBLD includes all the steps needed to obtain a first feasible
solution to the capital investment problem. The major steps of the program
are summarized in Fig. 3.14.
Subroutine BAKTRAK covers all the operations in the backtracking
sequence of the algorithm; its principal operations are summarized in
Fig. 3.15.
Subroutine BOUND is used to calculate the bound associated with any
project at any point in time and at any stage of a construction schedule.
A description of the mathematical equations used in calculating the bounds
is given in Section 3.2.4. (b).
Subroutine KNOKIN(KX) is used to modify the matrix PVBAR(I,J)
according to whether projects are accepted or rejected. For example, if a
project S is scheduled for construction in year T, KNOKIN(KX = S)
erases all values of PVBAR(I,J) for I = S, S + 1, S + 2, . . . , J = Τ +
1,. . . , TMAX, where S, S + 1, S + 2,. . . are all the projects that may be
built at the same site as S. Alternatively, if a project S is provisionally
accepted and later rejected, the subroutine KNOKIN(KX) restores the
matrix PVBAR(I,J) to its state before project S was considered.
Subroutines OLERSEN and NETFLO, taken together, are a codification of the out-of-kilter algorithm (OKA), which has been described in
Chapter 3, Section 3.
Subroutine READIN is used to enter data about the existing network
configuration and includes (1) the number and location of arcs and nodes
and also (2) the upper bound, the lower bound, and the cost of passing
unit flow for each arc.
Subroutine EXTDAT enters data about miscellaneous items and also
includes data on existing and possible new reservoirs such as (1) their
"active" storage, their location in the water resources network, their annual operating cost, and also (2) the cost and the maximum annual return
(for new reservoirs only).
Subroutine SPEDAT(KX) is used to modify the network configuration
according to whether projects are accepted or rejected. For example, if
project S is scheduled for construction, SPEDAT(KX = S) changes the
network configuration to accommodate the new reservoir and the new
initial conditions. On the other hand, if a project S is provisionally accepted and later rejected, the subroutine SPEDAT(KX) restores the network configuration to its status before project S was considered.
Subroutine PRINTEX prints out the results from running the OKA
(subroutines OLERSEN and NETFLO). The remaining output is directed
by routines DAMBLD and BAKTRAK.
Routines
159
A.2. Roles of the Different Routines
Program DAMBLD includes all the steps needed to obtain a first feasible
solution to the capital investment problem. The major steps of the program
are summarized in Fig. 3.14.
Subroutine BAKTRAK covers all the operations in the backtracking
sequence of the algorithm; its principal operations are summarized in
Fig. 3.15.
Subroutine BOUND is used to calculate the bound associated with any
project at any point in time and at any stage of a construction schedule.
A description of the mathematical equations used in calculating the bounds
is given in Section 3.2.4. (b).
Subroutine KNOKIN(KX) is used to modify the matrix PVBAR(I,J)
according to whether projects are accepted or rejected. For example, if a
project S is scheduled for construction in year T, KNOKIN(KX = S)
erases all values of PVBAR(I,J) for I = S, S + 1, S + 2, . . . , J = Τ +
1,. . . , TMAX, where S, S + 1, S + 2,. . . are all the projects that may be
built at the same site as S. Alternatively, if a project S is provisionally
accepted and later rejected, the subroutine KNOKIN(KX) restores the
matrix PVBAR(I,J) to its state before project S was considered.
Subroutines OLERSEN and NETFLO, taken together, are a codification of the out-of-kilter algorithm (OKA), which has been described in
Chapter 3, Section 3.
Subroutine READIN is used to enter data about the existing network
configuration and includes (1) the number and location of arcs and nodes
and also (2) the upper bound, the lower bound, and the cost of passing
unit flow for each arc.
Subroutine EXTDAT enters data about miscellaneous items and also
includes data on existing and possible new reservoirs such as (1) their
"active" storage, their location in the water resources network, their annual operating cost, and also (2) the cost and the maximum annual return
(for new reservoirs only).
Subroutine SPEDAT(KX) is used to modify the network configuration
according to whether projects are accepted or rejected. For example, if
project S is scheduled for construction, SPEDAT(KX = S) changes the
network configuration to accommodate the new reservoir and the new
initial conditions. On the other hand, if a project S is provisionally accepted and later rejected, the subroutine SPEDAT(KX) restores the network configuration to its status before project S was considered.
Subroutine PRINTEX prints out the results from running the OKA
(subroutines OLERSEN and NETFLO). The remaining output is directed
by routines DAMBLD and BAKTRAK.
