-
Notifications
You must be signed in to change notification settings - Fork 4
History Output Internals
goldy edited this page Oct 4, 2020
·
2 revisions
hist_output is based on several types of data structures:
-
hist_hashable_t:- The abstract type,
hist_hashable_t, contains a single (deferred) method,keywhich takes no arguments and returns the key for that object. All hashable types (e.g., extended fromhist_hashable_t) must implement this method which is howhist_hash_table_tcreates hash keys for adding and searching. -
hist_hashable_tis located modulehist_hashablein src/hash/hist_hashable.F90 - hist_hashable.F90 also contains extended types,
hist_hashable_char_tandhist_hashable_int_twhich hold a character string and an integer respectively -
hist_hashable_tis located in its own module to avoid circular dependencies (e.g., betweenhist_field_info_tandhist_buffer_t)
- The abstract type,
-
hist_hash_table_t: A general-purpose hash table for storing hashable objects-
hist_hash_table_thandles hash collisions via a linked-list mechanism (every table entry contains a linked list of values) - Each element of a
hist_hash_table_tcontains an object (table_entry_t) which contains a pointer to a hashable object (extended from abstract type,hist_hashable_t) and a pointer to anothertable_entry_tobject (for storing overflow entries). -
hist_hash_table_tis located modulehist_hash_tablein src/hash/hist_hash_table.F90 - The unit tests for
hist_hash_table_tand other DDTs inhist_hash_tableare in test/test_hash.F90
-
-
hist_buffer_t: An abstract class with type extensions for different field shapes and processing options. The base class provides a pointer back to the buffer's field metadata (fieldmethod) and the host-model volume for that buffer (volumemethod).- All types extended from
hist_buffer_tmust support the following methods.-
accumulate: Sample the current field state and process according to the buffer type and sampling rule. -
value: Return the normalized value for this buffer (e.g., average, last sampled value) -
clear: Clear any accumulation buffers and counters
-
- All accumulation methods for a particular
type/kind/rankcombination are derived from a base class for that also serves as the class for 'instantaneous' sampling methods (last, min, max). The derived classes are currently average and variance (standard deviation). -
hist_buffer_tand derived classes are located in modulehist_bufferin src/hist_buffer.F90 - The unit tests for
hist_buffer_tand derived classes are in test/test_hist_buffer.F90
- All types extended from
-
hist_field_info_t: Contains field metadata and a linked list of output buffers (from classhist_buffer_t)-
hist_field_info_tis derived fromhist_hashable_tso that fields can easily be stored in a hash table. -
hist_field_info_tis located in modulehist_fieldin src/hist_field.F90 - The unit tests for
hist_field_info_tare also in test/test_hist_buffer.F90
-