Soil Water Balance (SWB2)
Loading...
Searching...
No Matches
precipitation__method_of_fragments Module Reference

Module precipitation__method_of_fragments provides support for creating synthetic daily precipitation given grids of monthly sum precipitation and a "fragments" file. The fragments file is generated from observations at discrete locations, the values of which range from 0 to 1, and the sum of which is 1. The fragment value is simply the daily observed precipitation value divided by the monthly sum of all observed precipitation values for that station. More...

Data Types

type  fragments_sequence_t
 Data structure to hold static (pre-calculated) fragment selection numbers. More...
type  fragments_set_t
 Data structure to hold the current active rainfall fragments for a particular rain gage zone. More...
type  fragments_t
 Data structure that holds a single line of data from the input rainfall fragments file. More...
type  ptr_fragments_t
 Pointer to a rainfall fragments data structure. More...

Functions/Subroutines

subroutine, public precipitation_method_of_fragments_initialize (lactive)
 Initialize method of fragments.
subroutine, public read_daily_fragments (sfilename)
subroutine process_fragment_sets ()
 after fragments file has been read in, iterate over a set of rainfall fragments
subroutine normalize_february_fragment_sequence (icount)
 eliminate rainfall on the 29th day of February; bump up all other values to ensure sum = 1
subroutine read_fragments_sequence (sfilename)
subroutine update_fragments (lshuffle)
 Update rainfall fragments on daily basis.
subroutine update_random_values ()
subroutine, public precipitation_method_of_fragments_calculate (lactive)

Variables

integer(c_int), dimension(:), allocatable, public rain_gage_id
 Module variable that holds the rainfall gage (zone) number.
real(c_float), dimension(:), allocatable, public fragment_value
 Module variable that holds the current day's rainfall fragment value.
integer(c_int), public simulation_number = 1
 Module variable indicating which "simulation number" is active Only has meaning if the rainfall fragments are being applied via a predetermined sequence file.
real(c_float), dimension(:), allocatable, public rainfall_adjust_factor
 Module variable that holds the rainfall adjustment factor.
real(c_double), dimension(:,:), allocatable random_values
 Module variable that holds a sequence of random numbers associated with the selection of the fragment set to use.
logical(c_bool), dimension(:), allocatable sequence_selection
 Module level variable used to create subsets of the FRAGMENT_SEQUENCES file.
logical(c_bool) random_fragment_sequences = .true._c_bool
 Module variable detemining whether fragment sequences are chosen at random or selected from an external file.
type(fragments_t), dimension(:), allocatable, target, public fragments
 Array of all fragments read in from the rainfall fragments file.
type(ptr_fragments_t), dimension(:,:), allocatable current_fragments
 Subset of rainfall fragments file pointing to the currently active fragments.
type(fragments_set_t), dimension(:), allocatable, public fragments_sets
 Array of fragments sets; fragments sets include indices to the start record associated with the fragment for each month; FRAGMENTS_SETS will have a number of elements equal to the number of rainfall gages in the model domain.
type(fragments_sequence_t), pointer pfragments_sequence
 Pointer to all or some of the FRAGMENTS_SEQUENCE array.
type(fragments_sequence_t), dimension(:), allocatable, public fragments_sequence
 Array of fragment sequence sets.
type(data_catalog_entry_t), pointer prainfall_adjust_factor
integer(c_int) lu_fragments_echo

Detailed Description

Module precipitation__method_of_fragments provides support for creating synthetic daily precipitation given grids of monthly sum precipitation and a "fragments" file. The fragments file is generated from observations at discrete locations, the values of which range from 0 to 1, and the sum of which is 1. The fragment value is simply the daily observed precipitation value divided by the monthly sum of all observed precipitation values for that station.

In addition, this routine accepts another set of rainfall adjustment grids, needed in order to ensure the resulting precipitation totals fall in line with other published values, in the development case, the Rainfall Atlas of Hawaii.

Function/Subroutine Documentation

◆ normalize_february_fragment_sequence()

subroutine precipitation__method_of_fragments::normalize_february_fragment_sequence ( integer (c_int), intent(in) icount)
private

eliminate rainfall on the 29th day of February; bump up all other values to ensure sum = 1

Definition at line 448 of file precipitation__method_of_fragments.F90.

◆ precipitation_method_of_fragments_calculate()

subroutine, public precipitation__method_of_fragments::precipitation_method_of_fragments_calculate ( logical (c_bool), dimension(:,:), intent(in) lactive)

Definition at line 823 of file precipitation__method_of_fragments.F90.

Here is the call graph for this function:

◆ precipitation_method_of_fragments_initialize()

subroutine, public precipitation__method_of_fragments::precipitation_method_of_fragments_initialize ( logical (c_bool), dimension(:,:), intent(in) lactive)

Initialize method of fragments.

This routine accesses the "RAINFALL_ZONE" gridded data object and calls the routine to read in the rainfall fragments file. Values of RAINFALL_ZONE are stored in a module variable RAIN_GAGE_ID for future reference.

@params[in] lActive 2-D boolean array defining active and inactive cells

Now the fragments file is in memory. Create an ancillary data structure to keep track of which records correspond to various rain zones

Definition at line 128 of file precipitation__method_of_fragments.F90.

Here is the call graph for this function:

◆ process_fragment_sets()

subroutine precipitation__method_of_fragments::process_fragment_sets
private

after fragments file has been read in, iterate over a set of rainfall fragments

Definition at line 364 of file precipitation__method_of_fragments.F90.

◆ read_daily_fragments()

subroutine, public precipitation__method_of_fragments::read_daily_fragments ( character (len=*), intent(in) sfilename)

Definition at line 217 of file precipitation__method_of_fragments.F90.

Here is the call graph for this function:

◆ read_fragments_sequence()

subroutine precipitation__method_of_fragments::read_fragments_sequence ( character (len=*), intent(in) sfilename)
private

Definition at line 474 of file precipitation__method_of_fragments.F90.

Here is the call graph for this function:

◆ update_fragments()

subroutine precipitation__method_of_fragments::update_fragments ( logical (c_bool), intent(in) lshuffle)
private

Update rainfall fragments on daily basis.

If called when lShuffle is TRUE: 1) update random values 2) random values are used to select the next active fragment set for the current RainGageZone

Each time the routine is called, the appropriate fragment is selected from the current active fragment set and is assigned to all cells that share a common RainGageZone

Definition at line 649 of file precipitation__method_of_fragments.F90.

Here is the call graph for this function:

◆ update_random_values()

subroutine precipitation__method_of_fragments::update_random_values
private

Definition at line 765 of file precipitation__method_of_fragments.F90.

Here is the call graph for this function:

Variable Documentation

◆ current_fragments

type (ptr_fragments_t), dimension(:,:), allocatable precipitation__method_of_fragments::current_fragments
private

Subset of rainfall fragments file pointing to the currently active fragments.

Definition at line 91 of file precipitation__method_of_fragments.F90.

◆ fragment_value

real (c_float), dimension(:), allocatable, public precipitation__method_of_fragments::fragment_value

Module variable that holds the current day's rainfall fragment value.

Definition at line 45 of file precipitation__method_of_fragments.F90.

◆ fragments

type (fragments_t), dimension(:), allocatable, target, public precipitation__method_of_fragments::fragments

Array of all fragments read in from the rainfall fragments file.

Definition at line 88 of file precipitation__method_of_fragments.F90.

◆ fragments_sequence

type (fragments_sequence_t), dimension(:), allocatable, public precipitation__method_of_fragments::fragments_sequence

Array of fragment sequence sets.

Definition at line 112 of file precipitation__method_of_fragments.F90.

◆ fragments_sets

type (fragments_set_t), dimension(:), allocatable, public precipitation__method_of_fragments::fragments_sets

Array of fragments sets; fragments sets include indices to the start record associated with the fragment for each month; FRAGMENTS_SETS will have a number of elements equal to the number of rainfall gages in the model domain.

Definition at line 96 of file precipitation__method_of_fragments.F90.

◆ lu_fragments_echo

integer (c_int) precipitation__method_of_fragments::lu_fragments_echo
private

Definition at line 116 of file precipitation__method_of_fragments.F90.

◆ pfragments_sequence

type ( fragments_sequence_t ), pointer precipitation__method_of_fragments::pfragments_sequence

Pointer to all or some of the FRAGMENTS_SEQUENCE array.

Definition at line 109 of file precipitation__method_of_fragments.F90.

◆ prainfall_adjust_factor

type (data_catalog_entry_t), pointer precipitation__method_of_fragments::prainfall_adjust_factor
private

Definition at line 114 of file precipitation__method_of_fragments.F90.

◆ rain_gage_id

integer (c_int), dimension(:), allocatable, public precipitation__method_of_fragments::rain_gage_id

Module variable that holds the rainfall gage (zone) number.

Definition at line 42 of file precipitation__method_of_fragments.F90.

◆ rainfall_adjust_factor

real (c_float), dimension(:), allocatable, public precipitation__method_of_fragments::rainfall_adjust_factor

Module variable that holds the rainfall adjustment factor.

Definition at line 53 of file precipitation__method_of_fragments.F90.

◆ random_fragment_sequences

logical (c_bool) precipitation__method_of_fragments::random_fragment_sequences = .true._c_bool
private

Module variable detemining whether fragment sequences are chosen at random or selected from an external file.

Definition at line 64 of file precipitation__method_of_fragments.F90.

◆ random_values

real (c_double), dimension(:,:), allocatable precipitation__method_of_fragments::random_values
private

Module variable that holds a sequence of random numbers associated with the selection of the fragment set to use.

Definition at line 57 of file precipitation__method_of_fragments.F90.

◆ sequence_selection

logical (c_bool), dimension(:), allocatable precipitation__method_of_fragments::sequence_selection
private

Module level variable used to create subsets of the FRAGMENT_SEQUENCES file.

Definition at line 60 of file precipitation__method_of_fragments.F90.

◆ simulation_number

integer (c_int), public precipitation__method_of_fragments::simulation_number = 1

Module variable indicating which "simulation number" is active Only has meaning if the rainfall fragments are being applied via a predetermined sequence file.

Definition at line 50 of file precipitation__method_of_fragments.F90.