Laserfiche WebLink
<br />OJOH 1 <br /> <br />Program Modularization <br /> <br />The original accounting program consisted of a <br />main program and fi ve subroutines. In analyzing the <br />program code (0 determine (I) what changes would be <br />needed to account for the TRF diversions and the addi- <br />tional TRF source and (2) where the program code <br />would need to be changed, it became obvious that the <br />changes could be made more easily if the program <br />were modularized. Thus, many aspects of the data <br />input, computational procedures, and data output, <br />especially the repetitive processes, were recoded into <br />individual subroutines. Descriptions of this recoding <br />or of the resulting s\lbroutines is not necessary for the <br />purposes of this report; however, the modularization <br />process and the program changes resulted in an <br />accounting program having 26 subroutines. During <br />this process, a complete list of all the program vari- <br />ables was created and some variable names were <br />changed to mal\.e them more descriptive. Modularizing <br />the program code and creating the variable list <br />provided a better understanding of the program code, <br />especially for persons just beginning to learn the <br />program, and made the task of changing the program <br />much simpler. <br /> <br />Changes to Account for Diversion of <br />Transmountaln Return Flows <br /> <br />To account for the diversion of TRF's, the <br />primary change needed in the accounting program was <br />to provide a mechanism to specify a TRF diversion al <br />a specific location. A diversion ofTRF could be easily <br />specified at any of the noMs, using a method similar to <br />how the NSF diversions are specified. However, the <br />purchaser of a TRF for diversion must incur the transit <br />loss for the diverted TRF, from the point of discharge <br />(at the CCS WWTF) to the point of diversion. Also, <br />the quantity of TRF to be diverted needs to be known . <br />prior to the actual diversion, which makes the needed <br />program changes more difficult. Consider this <br />example: <br />On Monday, the water commissioner is noti- <br />fied by a ditch owner along Fountain Creek <br />of an intent 10 purchase and divert <br />5 ft3/s of TRF for 5 days beginning on <br />Tuesday. Because of transit losses from the <br />CCS WWTF downstream to the ditch <br />diversion point, there. are two possibilities: <br />(I) The dilch owner can purchase and <br /> <br />,.' <br /> <br />divert the equivalent of 5 ft3/s per day at the <br />CCS WWTF, in which case the quantity of <br />TRF available at the diversion point is not <br />known until after the diversion has been <br />made; or (2) the ditch owner can purchase <br />and divert the equivalent of 5 ft3/s at the <br />ditch diversion point, in which case the <br />TRF purchase quantity needed at the CCS <br />WWTF is not known until after the diver- <br />sion has been made. <br />For purposes of water administration and for a <br />capability that could be added easily to the accounting <br />program, the second possibility just described was the <br />best option. Therefore, the program was changed to <br />account for diversion of a specific quantity ofTRF at a <br />given node (an NSF or a TRF diversion point) by <br />calculating the quantity of TRF that would need to be <br />purchased at the CCS WWTF for the specified TRF <br />diversion. The TRF purchase quantity is derived by <br />the following additional computation steps in the <br />subreach computations: <br /> <br />I. Transit-loss computations for the total quantity of <br />TRF are identical to the computations in the orig- <br />inal accounting program (fig. 5). <br /> <br />2. If a s\lbreach has a specified TRF diversion, the <br />program computes the ratio of the TRF diversion <br />quantity to the total TRF quantity at the upstream <br />node of the subreach. <br /> <br />3. The program assigns a proportion of the total transit <br />loss in the previous (upstream) subreach to the <br />TRF diversion quantity on the basis of the ratio <br />computed in step 2. <br /> <br />4. The program adds the transit-loss proportion <br />computed in step 3 to the specified TRF diver- <br />sion quantity, resulting in an estimate of the TRF <br />purchase quantity at the upstream node of the <br />previous subreach. <br /> <br />5. The program computes a new ratio between the <br />TRF purchase quantity just estimated and the <br />total TRF at the upstream node of the current <br />subreach and then returns to computation step 3. <br /> <br />6. The program repeats computation steps 3-5 for <br />each upstream subreach, but the ratio from step 5 <br />rather than the ratio from step 2 is used in the <br />subsequent step 3 computations. The TRF <br />purchase quantity changes in each subreach as <br />the comp\ltations proceed back through subreach <br />I, at which point the TRF purchase quantity <br /> <br />\::" <br /> <br />CIIANGES 'TO 'TilE 'TRANSIT -LOSS ACCOUMllMG PROGRAM OURIMG 1991-92 15 <br /> <br />.. , <br />,.. <br />,:, <br />