Summary of Fixes for Branch 4.3, TDDS6.0, and Libutl6.0 Programs

By Janice M. Fulford 06.02.2000

 

 

Overview

Software fixes for three software packages, Branch 4.3 (1-D unsteady flow model), TDDS6.0 (time-series database system), and Libutl6.0 (utility library) are summarized in this paper.  The software fixes made to the packages include correction of a data-retrieval error and Y2K problems.  The corrections are summarized in two separate sections, Summary of Data-Retrieval Fix and Summary of Y2K Fixes.

 

SUMMARY OF DATA-RETRIEVAL FIX

The retrieval error resulted in data being incorrectly retrieved from the TDDS database.  This error was insidious because it did not produce an obvious error in output.  The error was located in the Libutl utility package. It affects the execution of  TDDS and Branch programs because it is linked with both packages during compilation.

 

The error occurred when data were retrieved across dataset boundaries and the first dataset contained data for a different number of calendar years than did the second dataset.  For example, when data was fetched from 1999/02/28 01:00 to 1999/03/01 24:00 from the datasets listed in the following table an error occurred.

Dataset Number

Begin Date

End Date

1

1998/12/01 24:00

1999/02/28 24:00

2

1999/02/29 00:15

1999/04/01 24:00

 

The older version of Branch incorrectly fetched the data entirely from dataset 1, from a location near the beginning of the dataset.  However, dates would be listed for the requested time interval, erroneously leading users to believe that the data was retrieved correctly.  This error has been corrected in the DADIO subroutine.

 

 

SUMMARY OF Y2K FIXES

Three software packages, Branch 4.3 (1-D unsteady flow model), TDDS6.0 (time-series database system), and Libutl6.0 (utility library), used two digit years that made computations over the millennium change impossible.  Approximately 5 districts use Branch and TDDS to work daily streamflow records.  Because Branch and TDDS rely on Libutl routines, it was necessary to correct all three software packages to handle four digit years and the millennium change.  None of the corrections address any graphical output. All graphical output is disabled for the revised versions of Branch and TDDS.  The following sections summarize the Y2K revisions made to the three software packages.

 

Libutl6.0

The Library Utility software package, Libutl6.0, is documented in an unpublished subroutine reference guide that is available from the HASS web site, http://water.usgs.gov/software/libutl.html.   Some of the routines are described in greater detail in WRIR 96-4143. The utility routines available are grouped into two libraries, libutils.lib which supplies time and date functions, and libdadio.lib, which provides routines that write and retrieve data from TDDS databases.  Several routines were corrected to handle four digit years.  The subroutines or functions corrected in libutils.lib include: DATCOD, DTCODE, DECODE, JDCODE, RECODE, TIMER, INCELT, DAYFEB.  Subroutine files corrected for libdadio.lib were dadio.f, dadiosub.f and dadini.f

 

TDDS

The Time Dependent Data System program is documented in WRIR 96-4143.  The various functions of the TDDS menu were either corrected or deactivated.  Table 1 is a list of the actions taken for each TDDS menu function.  The use of WDM files or WDM features with the TDDS were not addressed.

 

Table 1.  Level of  correction of TDDS menu functions.

Corrected & Checked

Corrected

Deactivated

Dafile

Backup

Daplot

Daget

Allocate

Xyplot

Dafix

Daopen

 

Exit

Summary

 

 

Older TDDS database files built with the previous version will function with the revised TDDS program because the new date encoding scheme is backward compatible.  User input formats that are documented in WRIR 96-4143 have been changed slightly.  In the interest of reducing this report, only the variables affected by program revisions are listed in table 2.  Refer to the WRIR for the entire input formats. 

 

Table 2.  Old and new formats for revised input records.

Functions-record

Variable

 

Old

New

position

format

position

format

Dafile-

Data-definition

Btime

25-38

5(I2,1X)

23-38

I4,1X,4(I2,1X)

Etime

45-58

5(I2,1X)

43-58

I4,1X,4(I2,1X)

Daget-

Data-definition

Btime

25-38

5(I2,1X)

23-38

I4,1X,4(I2,1X)

Etime

45-58

5(I2,1X)

43-58

I4,1X,4(I2,1X)

Daplot-

Data-definition

Btime

25-38

5(I2,1X)

25-39

A16  [year/mo/dy 00:00]

Etime

45-58

5(I2,1X)

43-58

A4,1X,4(I2,1X)

Dafix-

Data-correction

Btime

25-38

5(I2,1X)

23-38

I4,1X,4(I2,1X)

Etime

45-58

5(I2,1X)

43-58

I4,1X,4(I2,1X)

Backup-

Process-control

Lptime

29-42

5(I2,1X)

27-42

I4,1X,4(I2,1X)

 

Older TDDS control files may work with the new version.  Efforts were made to make the control file format changes backward compatible.  However, some older control files will not be compatible if users have inserted characters into some record locations that were previously ignored when read by the TDDS.  Note that some preliminary fixes have been made to daplot.  No testing has been attempted, only compilation of the subroutines.  It is likely that four digit years will result in overflow of the plotting print fields in some cases and years will be printed as asterisks.  It is not expected that the use of four digit years will crash the plotting routines. 

 

Branch

Branch is documented in TWRI book 7 Chapter C3.  The latest version is documented in notes distributed on the HASS site and titled “Summary of Enhancements and Additions to the Branch-Network (Branch) Dynamic Flow Model”.  As with TDDS, not every feature was tested in Branch.  Branch was successfully tested by: 1) creating a TDDS from Watstore B records 2) running a simulation over the millennium change and 3) writing Watstore B records of discharge from the TDDS.  Additionally, Branch was successfully run with an old database file. 

 

Efforts were made to address all the issues related to using four digit years.  Efforts also were made to make the Branch control file format changes backward compatible.  However, some older control files will not be compatible if users have inserted characters into some record locations that were previously ignored when read by Branch.  Data input for time-varying nodes, wind, and measured data were not tested, but input formats were changed to permit four digit years.  As with TDDS, graphics were disabled and the use of WDM files or features were not addressed.   User input formats that are documented in the notes have been changed slightly.  In the interest of reducing this report, only the variables affected are listed in the table 3.  The entire format is listed in the notes distributed on the HASS web site.

 

 

 

 

Table 3.  Format revisions made to Branch input records.

Record Type

Variables

Old

New

Position

Format

Position

format

Boundary-Value Date

Itime

25-39

5(I2,1X)

25-40

I4,1X,3(I2,1X),I2

Ntime

45-59

5(I2,1X)

43-59

I4,1X,4(I2,1X)

Time-varying nodes

Nftime

25-39

5(I2,1X)

25-40

I4,1X,3(I2,1X),I2

Mtime

45-59

5(I2,1X)

43-59

I4,1X,4(I2,1X)

Wind data

Iwtime

25-39

5(I2,1X)

25-40

I4,1X,3(I2,1X),I2

Nwtime

45-59

5(I2,1X)

43-59

I4,1X,4(I2,1X)

Measured data

Meitime

25-39

5(I2,1X)

25-40

I4,1X,3(I2,1X),I2

Mektime

45-59

5(I2,1X)

43-59

I4,1X,4(I2,1X)

 

Version numbers

New version numbers for the revised programs are listed below and are all marked with the date 2000/03/30.  The updated version of Branch lists version 4.4 to the user’s screen.  Most of the version numbers are internal to the various programs and are listed in table 4.

 

 

Table 4.  Revised version numbers.

Routine Name

Old version number

New version number

Backup.f

5.1

5.2

Dafile.f

6.0

6.1

Dafix.f

5.5

5.6

Daget.f

5.1

5.2

Daplot.f

6.1

6.3

Branch.f

4.0

4.1

Brinit.f

4.3

4.4

Tdds.f

6.0

6.1

Dadio.f

6.0

6.1

Getsubs.f

6.0

6.1