Create new configuration data from TOML data structure
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(rmsd_config_type), | intent(out) | :: | self | Instance of the configuration data |
||
type(toml_table), | intent(inout) | :: | table | TOML data structure |
||
type(error_type), | intent(out), | allocatable | :: | error | Error handling |
subroutine new_rmsd_config(self, table, error)
!> Instance of the configuration data
type(rmsd_config_type), intent(out) :: self
!> TOML data structure
type(toml_table), intent(inout) :: table
!> Error handling
type(error_type), allocatable, intent(out) :: error
type(toml_table), pointer :: child, child2
type(toml_array), pointer :: array
integer :: stat
call get_value(table, "strict", self%strict, .true., stat=stat)
if (stat /= toml_stat%success) then
call fatal_error(error, "Could not error policy value from strict entry")
return
end if
call get_value(table, "unit", self%length_unit, "AA")
if (.not.allocated(self%length_unit)) then
call fatal_error(error, "Could not retrieve length unit")
return
end if
call get_unit_conversion(self%conv, self%length_unit, error)
if (allocated(error)) return
call get_value(table, "filter", child, requested=.false.)
if (associated(child)) then
call new_rmsd_filter(self%filter, child, error)
if (allocated(error)) return
else
call add_table(table, "filter", child)
call add_table(child, "heavy", child2)
call add_array(child2, "exclude", array)
call set_value(array, 1, "H")
call set_value(array, 2, "h")
call new_rmsd_filter(self%filter, child, error)
if (allocated(error)) return
end if
end subroutine new_rmsd_config