Monthly Binary Direct Diversion File (*.b43)
StateMod prints a monthly direct access binary diversion binary file (*.b43) that describes water use at each river node. The record length is 160 bytes. A typical read statement is as follows:
Read(43,rec=irecs) (dat(i), i=1,ndiv)
Where:
\(Irecs\) = the binary record to read
\(iy\) = the year of interest
\(iystr0\) = the starting year
\(im\) = the month of interest
\(numsta\) = the total number of stream nodes
\(is\) = the stream node of interest
\(numtop\) = the total number of header cards \((numsta+numdiv+numifr+numres+numrun+numdivw+5+3*maxparm+2)\)
\(dat(i)\) = the data read
\(ndiv\) = the number of diversion data elements (maxparm)
Row-data | Variable | Description |
---|---|---|
1-1 | CodeName | Program Name |
1-2 | ver | Program version |
1-3 | Vdate | Program version date |
2-1 | iystr0 | Beginning year of simulation |
2-2 | iyend0 | Ending year of simulation |
3-1 | numsta | number of river nodes |
3-2 | numdiv | number of diversions |
3-3 | numifr | number of instream flows |
3-4 | numres | number of reservoirs |
3-5 | numown | number of reservoir owners (active and inactive) |
3-6 | nrsact | number of active reservoirs |
3-7 | numrun | number of base flows |
3-8 | numdivw | number of well structures (D&W and Well only) |
3-9 | numdxw | number of well only structures |
3-10 | maxparm | number of parameters for a diversion, reservoir and well |
3-11 | ndivO | number of data elements in the *.b43 output file |
3-12 | nres0 | number of data elements in the *.b44 output file |
3-13 | nwelO | number of data elements in the *.b45 output file |
4-1 | xmonam(1-14) | Month corresponding to the year type. E.g. xmonam(1) = Jan for a calendar yr. xmonam(1) = 10 for a water year, etc. |
5-1 | mthday(1-12) | Days per month (e.g. if xmonam(6) = June then mthday(6)=30 if xmonam(6) = March then mthday(6) = 31 |
6-1 | j | Counter |
6-2 | cstaid(j) | Station ID |
6-3 | stanam(I,j), I=1,6) | Station Name |
Repeat for j=1, numsta (number of river nodes) |
||
7-1 | j | Counter |
7-2 | cdivid(j) | Diversion ID |
7-3 | divnam(I,j), I=1,6) | Diversion Name |
7-4 | idvsta(i) | River Node |
Repeat for j=1, numdiv (number of diversions) |
||
8-1 | j | Counter |
8-2 | cifrid(j) | Instream flow ID |
8-3 | xfrnam(I,j), I=1,6) | Instream flow Name |
8-4 | ifrsta(i) | River Node |
Repeat for j=1, numifr (number of instream flows) |
||
9-1 | j | Counter |
9-2 | cresid(j) | Reservoir ID |
9-3 | resnam(I,j), I=1,6) | Reservoir Name |
9-4 | irssta(i) | River Node |
9-5 | iressw(i) | On (1) / Off(0) Code |
9-6 | nowner(i) | # of owners |
Repeat for j=1, numres+1 (number of reservoirs) |
||
10-1 | j | Counter |
10-2 | crunid(j) | Base Flow ID |
10-3 | runnam(I,j), I=1,6) | Base Flow Name |
10-4 | irusta(i) | River Node |
Repeat for j=1, numrun (number of base flows) |
||
11-1 | j | Counter |
11-2 | cdividw(j) | Well ID |
11-3 | divnamw(I,j), I=1,6) | Well Name |
11-4 | idvstw(i) | River Node |
Repeat for j=1, numdivw (number of wells) |
||
12-1 | j | Counter |
12-2 | paramD(j) | Diversion Parameter |
Repeat for j=1, maxparm (number of parameters) |
||
13-1 | j | Counter |
13-2 | paramR(j) | Reservoir Parameter |
Repeat for j=1, maxparm (number of parameters) |
||
14-1 | j | Counter |
14-2 | paramW(j) | Well Parameter |
Repeat for j=1, maxparm (number of parameters) |
||
15-1 | unit(1-nx) | Units for each data type in a file where nx is ndivO for .b43, ndivR for .b44, and ndivW for *.b42 |
16-1 | dat(1) | Total Demand (Total_Demand) |
16-2 | dat(2) | CU Demand (CU_Demand) |
16-3 | dat(3) | Priority Diversion (From_River_By_Priority) |
16-4 | dat(4) | Storage Diversion (From_River_By_Storage) |
16-5 | dat(5) | Exchange Diversion (From_River_By_Exchange) |
16-6 | dat(6) | River Loss (From_River_Loss) |
16-7 | dat(7) | From Well (From_River_By_Well) |
16-8 | dat(8) | Carrier by Priority (From_Carrier_By_Priority) |
16-9 | dat(9) | Carrier by Exchange (From_Carrier_By_Storage) |
16-10 | dat(10) | Carried Water (Carried_Water) |
16-11 | dat(11) | Carried Loss (Carried_Loss) |
16-12 | dat(12) | From Soil (From_Soil) |
16-13 | dat(13) | Total Supply (Total_Supply) |
16-14 | dat(14) | Total Short (Total_Short) |
16-15 | dat(15) | CU Short (CU_Short) |
16-16 | dat(16) | CU (Consumptive_Use) |
16-17 | dat(17) | To Soil (To_Soil) |
16-18 | dat(18) | Total Return (Total_Return) |
16-19 | dat(19) | Loss (Loss) |
16-20 | dat(20) | Upstream Inflow (Upstream_Inflow) |
16-21 | dat(21) | Reach Gain (Reach_Gain) |
16-22 | dat(22) | Return Flow (Return_Flow) |
16-23 | dat(23) | Well Depletion (Well_Depletion) |
16-24 | dat(24) | To_From GWStor (To_From_GW_Storage) |
16-25 | dat(25) | River Inflow (River_Inflow) |
16-26 | dat(26) | River Divert (River_Divert) |
16-27 | dat(27) | River by Well (River_By_Well) |
16-28 | dat(28) | River Outflow (River_Outflow) |
16-29 | dat(29) | Available Flow (Available_Flow) |
16-30 | dat(30) | Diversion by an instream Flow (Divert_For_Instream_Flow) |
16-31 | dat(31) | Diversion to Power (Divert_For_Power) |
16-32 | dat(32) | Diversion from Carrier by Storage (Diversion_From_Carrier) |
16-33 | Placeholder that currently contains the same data as field 16-19 (loss) | |
16-34 | dat(34) | Released from plan. (This includes 1. Water diverted into then released from a plan and 2. Water released from a plan to a carrier that returns water to the river) |
16-35 | dat(35) | Structure type see table below |
Structure Type Codes
Code (na) | Structure Type |
---|---|
< 0 | Baseflow node1 |
< 10,001 | Baseflow node only1 |
0 | Well Only |
1-5,000 | Diversion |
5,001 - 7,500 | Instream Flow |
7,501 - 10,000 | Reservoir |
1Note a code of 1 indicates a diversion, a code of -1 indicates a diversion with at baseflow, a code of –10001 indicates a baseflow node only.
Row-data | Variable | Description |
---|---|---|
16-36 | dat(36) | Number of structures at this node |
16-37 | dat(37) | Calling river node (-1 means NA) |
16-38 | dat(38) | Calling right amount (-1 means NA) |
Repeat for every river node numsta |
||
Repeat for every month of simulation |