Upgrades to a Fortran program for estimating stream transit losses of reusable water, El Paso and Pueblo Counties, Colorado.
In 2016, the U.S. Geological Survey, in cooperation with Pikes Peak Regional Water Authority and the Colorado Water Conservation Board, began a study to modernize a Fortran transit-loss accounting program developed by the U.S. Geological Survey to estimate net reusable flows in Fountain and Monument Creeks in El Paso and Pueblo Counties, Colorado. More than 6,000 lines of this FORTRAN77 transit-loss accounting program were revised to comply with the newer Fortran 2003 standard. The upgrade to the newer standard involved making changes in formatting and syntax on each line and, when available, adding new programming constructs that comply with the new standard. These upgrades produced a more readable Fortran program that includes safeguards to prevent accidental mistyping of variables and unintentional changes in named constants during program execution. Program revisions also introduced dynamic array allocation, whole array processing, and handling of input errors to the upgraded transit-loss accounting program. During the upgrade from FORTRAN77 to the Fortran 2003 standard, revisions were made incrementally to the original transit-loss Fortran program. Because FORTRAN77 is a subset of Fortran 2003, the legacy FORTRAN77 statements and the upgraded Fortran 2003 statements can be compiled within the same program, permitting program revisions to be gradually phased in on a line-by-line basis. This incremental approach helped mitigate risks of introducing logic errors into the Fortran program that could produce incorrect transit-loss estimates. Verification of the upgraded transit-loss accounting program focused on reproducing archived reusable return flows (RRF) for historical daily runs from January 5, 2015, to October 31, 2018. Because interim files storing daily streambank losses were not historically archived, no record of antecedent streambank storage losses to hydraulically connected alluvial deposits were available to provide initial conditions for each daily run. To overcome the problem of missing historical bank storage and recovery files that contain important information relating to antecedent streambank storage conditions, a 104-day "spin-up" period was required before RRFs calculated by the upgraded program and the original program matched. Estimated daily reusable return flows from archived output generated by the original program and output generated by the upgraded program were compared after this initial "spin-up" period. Daily reusable return flow estimates at delivery nodes and at the bottoms of subreaches from the upgraded Fortran program matched those output by the original program to within 0.01 and 0.0001 cubic feet per second, respectively.