mod_extrapolation_warning¶
This module provides an implementation of AbstractWarningHandler
for the book keeping of extrapolation warnings
Authors: Redouan El Haouari
Dependencies¶
Module Variables¶
-
IPRINT_SUM: integer -
IPRINT_N2P2: integer -
IPRINT_N2P2_EXTENDED: integer -
MAX_EW_LENGTH: integer -
ew_handler: type(ExtrapolationHandler)– Initialized `ExtrapolationHandler`
Derived Types Summary¶
| Name | Description |
|---|---|
ExtrapolationWarning |
Container for a single extrapolation warning |
ExtrapolationHandler |
Handler for ExtrapolationWarnings |
Procedures Summary¶
| Name | Type | Description |
|---|---|---|
add_extrapolation |
Subroutine | Adds an ExtrapolationWarning to self (OMP thread-safe). Increases moreover self%count... |
collect_warnings_to_msg |
Subroutine | Collects all ExtrapolationWarnings currently owned by self and writes them to c_msg. ... |
report_extrapolation_warnings |
Subroutine | Prints all ExtrapolationWarnings currently owned by self to STDOUT. For its behavior with... |
free_extrapolation_warnings |
Subroutine | Deallocates all ExtrapolationWarning. Called by parent routine free_memory and therefore... |
print_extrapolation_warning_n2p2 |
Subroutine | Writes ExtrapolationWarnings in the format known from n2p2 to msg. |
print_extrapolation_warning_n2p2_extended |
Subroutine | Writes ExtrapolationWarnings in the format known from n2p2 to msg. This routine writes the... |
Derived Types Details¶
type ExtrapolationWarning¶
Container for a single extrapolation warning
Components
-
istruc: integer -
iatom: integer -
atomic_number: integer -
committee_index: integer -
idx_sorted_feature: integer -
feat_type: character -
feat_min: real(DP) -
feat_max: real(DP) -
feat_val: real(DP) -
handle: type(ExtrapolationWarning)– Handle to next element in linked list
Inherited By
type ExtrapolationHandler¶
Handler for ExtrapolationWarnings
Components
-
count: integer– Count of warnings owned by `self` – Inherited from AbstractWarningHandler -
head: type(ExtrapolationWarning)– Head of linked list -
tail: type(ExtrapolationWarning)– Tail of linked list -
total_extrapolation_count: integer(DI)– Total count of extraploation warnings during runtime. Is not resetted by `self%free_memory()`
Type-Bound Procedures
| Name | Attributes | Binding |
|---|---|---|
| free_memory | public | ⇒ free_memory |
| add | public | ⇒ add_extrapolation |
| report | public | ⇒ report_extrapolation_warnings |
| free_memory_child | public | ⇒ free_extrapolation_warnings |
| collect_warnings_to_msg | public | ⇒ collect_warnings_to_msg |
Inherits
Procedure Details¶
subroutine add_extrapolation¶
subroutine add_extrapolation( &
self, &
atomic_number, &
feat_type, &
committee_index, &
idx_sorted_feature, &
feat_min, &
feat_max, &
feat_val, &
iatom, &
istruc &
)
Adds an ExtrapolationWarning to self (OMP thread-safe).
Increases moreover self%count and self%tot_ew_count by 1.
Arguments
-
self: class(ExtrapolationHandler) [inout] -
atomic_number: integer [in]– Atomic number of the extrapolating atom -
feat_type: character [in]– Name of the extrapolating feature map. -
committee_index: integer [in]– Index of the extrapolating committee member. This is needed to account for the fact that the values of global features generally differ between the committee members, which means that extrapolations of global features are dependent on the committee member. -
idx_sorted_feature: integer [in]– Sorted index of the extrapolating feature -
feat_min: real(DP) [in]– Minimum of the extrapolating feature as reference -
feat_max: real(DP) [in]– Maximum of the extrapolating feature as reference -
feat_val: real(DP) [in]– Value of the extrapolating feature -
iatom: integer [in]– Index of the extrapolating atom -
istruc: integer [in]– Index of the structure in which the extrapolation occured
Called By
subroutine collect_warnings_to_msg¶
subroutine collect_warnings_to_msg( &
self, &
ew_type, &
c_msg, &
msg_length, &
global_atom_ids &
)
Collects all ExtrapolationWarnings currently owned by self and writes them to c_msg.
c_msg is a C-interoperable character array needed for the RuNNer-LAMMPS interface.
Behavior differs with verbosity which is set by the extrapolation_warning_type keyword:
0 = Sum of ExtrapolationWarnings per structure batch,
1 = ExtrapolationWarnings are issued in the same format known from n2p2.
2 = ExtrapolationWarnings are issued in the same format known from n2p2
with the committee index in addition.
Arguments
-
self: class(ExtrapolationHandler) [in] -
ew_type: integer [in]– Type of the extrapolation warnings printed to `STDOUT` -
c_msg: character(c_char) [out] -
msg_length: integer(CINT) [out]– Actual length of `c_msg`. -
global_atom_ids: integer(CINT) (dim: (:)) [in]– If provided, a map to the global atom ids from an interfacing MD code.
Called By
subroutine report_extrapolation_warnings¶
subroutine report_extrapolation_warnings( &
self, &
verbosity &
)
Prints all ExtrapolationWarnings currently owned by self to STDOUT.
For its behavior with respect to verbosity, see
collect_warnings_to_msg.
Arguments
-
self: class(ExtrapolationHandler) [in] -
verbosity: integer [in]– Type of the extrapolation warnings printed to `STDOUT`
Called By
subroutine free_extrapolation_warnings¶
subroutine free_extrapolation_warnings( &
self &
)
Deallocates all ExtrapolationWarning.
Called by parent routine free_memory and therefore thread-safe
via !$OMP CRITICAL directives.
Arguments
-
self: class(ExtrapolationHandler) [inout]
subroutine print_extrapolation_warning_n2p2¶
subroutine print_extrapolation_warning_n2p2( &
ptr, &
msg, &
atom_id &
)
Writes ExtrapolationWarnings in the format known from n2p2 to msg.
Arguments
-
ptr: type(ExtrapolationWarning) [in] -
msg: character [inout] -
atom_id: integer [in]
Called By
subroutine print_extrapolation_warning_n2p2_extended¶
subroutine print_extrapolation_warning_n2p2_extended( &
ptr, &
msg, &
atom_id &
)
Writes ExtrapolationWarnings in the format known from n2p2 to msg.
This routine writes the message with the committee index in addition. (This is needed due to the global features being dependent on the committee member)
Arguments
-
ptr: type(ExtrapolationWarning) [in] -
msg: character [inout] -
atom_id: integer [in]
Called By