MODFLOW 6
version 6.7.0.dev0
USGS Modular Hydrologic Model
|
This module contains the BudgetModule. More...
Data Types | |
type | budgettype |
Derived type for the Budget object. More... | |
Functions/Subroutines | |
subroutine, public | budget_cr (this, name_model) |
@ brief Create a new budget object More... | |
subroutine | budget_df (this, maxsize, bdtype, bddim, labeltitle, bdzone) |
@ brief Define information for this object More... | |
subroutine | value_to_string (val, string, big, small) |
@ brief Convert a number to a string More... | |
subroutine | budget_ot (this, kstp, kper, iout) |
@ brief Output the budget table More... | |
subroutine | budget_da (this) |
@ brief Deallocate memory More... | |
subroutine | reset (this) |
@ brief Reset the budget object More... | |
subroutine | add_single_entry (this, rin, rout, delt, text, isupress_accumulate, rowlabel) |
@ brief Add a single row of information More... | |
subroutine | add_multi_entry (this, budterm, delt, budtxt, isupress_accumulate, rowlabel) |
@ brief Add multiple rows of information More... | |
subroutine | finalize_step (this, delt) |
@ brief Update accumulators More... | |
subroutine | allocate_scalars (this, name_model) |
@ brief allocate scalar variables More... | |
subroutine | allocate_arrays (this) |
@ brief allocate array variables More... | |
subroutine | resize (this, maxsize) |
@ brief Resize the budget object More... | |
subroutine, public | rate_accumulator (flow, rin, rout) |
@ brief Rate accumulator subroutine More... | |
subroutine | set_ibudcsv (this, ibudcsv) |
@ brief Set unit number for csv output file More... | |
subroutine | writecsv (this, totim) |
@ brief Write csv output More... | |
subroutine | write_csv_header (this) |
@ brief Write csv header More... | |
New entries can be added for each time step, however, the same number of entries must be provided, and they must be provided in the same order. If not, the module will terminate with an error.
Maxsize is required as part of the df method and the arrays will be allocated to maxsize. If additional entries beyond maxsize are added, the arrays will dynamically increase in size, however, to avoid allocation and copying, it is best to set maxsize large enough up front.
vbvl(1, :) contains cumulative rate in vbvl(2, :) contains cumulative rate out vbvl(3, :) contains rate in vbvl(4, :) contains rate out vbnm(:) contains a LENBUDTXT character text string for each entry rowlabel(:) contains a LENBUDROWLABEL character text string to write as a label for each entry
|
private |
Add information corresponding to one multiple rows in the budget table budterm is an array with inflow in column 1 and outflow in column 2 delt is the time step length budtxt is the name of the entries. It should have one entry for each row in budterm isupress_accumulate is an optional flag. If specified as 1, then the volume is NOT added to the accumulators on vbvl(1, :) and vbvl(2, :). rowlabel is a LENBUDROWLABEL character text entry that is written to the right of the table. It can be used for adding package names to budget entries. For multiple entries, the same rowlabel is used for each entry.
this | BudgetType object | |
[in] | budterm | array of budget terms |
[in] | delt | time step length |
[in] | budtxt | name of the entries |
[in] | isupress_accumulate | suppress accumulate |
[in] | rowlabel | row label |
Definition at line 435 of file Budget.f90.
|
private |
Add information corresponding to one row in the budget table rin the inflow rate rout is the outflow rate delt is the time step length text is the name of the entry isupress_accumulate is an optional flag. If specified as 1, then the volume is NOT added to the accumulators on vbvl(1, :) and vbvl(2, :). rowlabel is a LENBUDROWLABEL character text entry that is written to the right of the table. It can be used for adding package names to budget entries.
this | BudgetType object | |
[in] | rin | inflow rate |
[in] | rout | outflow rate |
[in] | delt | time step length |
[in] | text | name of the entry |
[in] | isupress_accumulate | accumulate flag |
[in] | rowlabel | row label |
Definition at line 373 of file Budget.f90.
|
private |
Allocate array variables of this budget object
this | BudgetType object |
Definition at line 555 of file Budget.f90.
|
private |
Allocate scalar variables of this budget object
this | BudgetType object | |
[in] | name_model | name of the model |
Definition at line 519 of file Budget.f90.
subroutine, public budgetmodule::budget_cr | ( | type(budgettype), pointer | this, |
character(len=*), intent(in) | name_model | ||
) |
Create a new budget object.
this | BudgetType object | |
[in] | name_model | name of the model |
Definition at line 83 of file Budget.f90.
|
private |
Deallocate budget memory
this | BudgetType object |
Definition at line 318 of file Budget.f90.
|
private |
Allocate arrays and set member variables
this | BudgetType object | |
[in] | maxsize | maximum size of budget arrays |
bdtype | type of budget, default is VOLUME | |
bddim | dimensions of terms, default is L**3 | |
labeltitle | budget label, default is PACKAGE NAME | |
bdzone | corresponding zone, default is ENTIRE MODEL |
Definition at line 101 of file Budget.f90.
|
private |
Write the budget table for the current set of budget information.
this | BudgetType object | |
[in] | kstp | time step |
[in] | kper | stress period |
[in] | iout | output unit number |
Definition at line 178 of file Budget.f90.
|
private |
This must be called before any output is written in order to update the accumulators in vbvl(1,:) and vbl(2,:).
this | BudgetType object |
Definition at line 500 of file Budget.f90.
subroutine, public budgetmodule::rate_accumulator | ( | real(dp), dimension(:), intent(in), contiguous | flow, |
real(dp), intent(out) | rin, | ||
real(dp), intent(out) | rout | ||
) |
Routing for tallying inflows and outflows of an array
[in] | flow | array of flows |
[out] | rin | calculated sum of inflows |
[out] | rout | calculated sum of outflows |
Definition at line 631 of file Budget.f90.
|
private |
Reset the budget object in preparation for next set of entries
this | BudgetType object |
Definition at line 345 of file Budget.f90.
|
private |
If the size wasn't allocated to be large enough, then the budget object we reallocate itself to a larger size.
this | BudgetType object | |
[in] | maxsize | maximum size |
Definition at line 591 of file Budget.f90.
|
private |
This routine can be used to activate csv output by passing in a valid unit number opened for output
this | BudgetType object | |
[in] | ibudcsv | unit number for csv budget output |
Definition at line 656 of file Budget.f90.
|
private |
This is sometimes needed to avoid numbers that do not fit correctly into a text string
[in] | val | value to convert |
[out] | string | string to fill |
[in] | big | big value |
[in] | small | small value |
Definition at line 150 of file Budget.f90.
|
private |
This routine will write the csv header based on the names in vbnm
this | BudgetType object |
Definition at line 726 of file Budget.f90.
|
private |
This routine will write a row of output to the csv file, if it is available for output. Upon first call, it will write the csv header.
this | BudgetType object | |
[in] | totim | time corresponding to this data |
Definition at line 671 of file Budget.f90.