seams_frame Derived Type

type, public :: seams_frame

One frame. The finalizer frees the C frame.


Finalization Procedures

final :: frame_final

  • private subroutine frame_final(self)

    Release this owner’s reference to the frame.

    Arguments

    Type IntentOptional Attributes Name
    type(seams_frame), intent(inout) :: self

Type-Bound Procedures

procedure, public :: set_ortho => frame_set_ortho

  • interface

    private module subroutine frame_set_ortho(self, xyz, lx, ly, lz, ox, oy, oz, types, ids, stat, errmsg)

    xyz has shape (3, n). Lengths are angstrom. The origin defaults to zero.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(in), contiguous :: xyz(:,:)
    real(kind=seams_real), intent(in) :: lx
    real(kind=seams_real), intent(in) :: ly
    real(kind=seams_real), intent(in) :: lz
    real(kind=seams_real), intent(in), optional :: ox
    real(kind=seams_real), intent(in), optional :: oy
    real(kind=seams_real), intent(in), optional :: oz
    integer(kind=seams_int), intent(in), optional, contiguous :: types(:)
    integer(kind=seams_int), intent(in), optional, contiguous :: ids(:)
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: set_frame => frame_set_frame

  • interface

    private module subroutine frame_set_frame(self, xyz, box, types, ids, stat, errmsg)

    box is ox, oy, oz, lx, ly, lz, xy, xz, yz.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(in), contiguous :: xyz(:,:)
    real(kind=seams_real), intent(in) :: box(9)
    integer(kind=seams_int), intent(in), optional, contiguous :: types(:)
    integer(kind=seams_int), intent(in), optional, contiguous :: ids(:)
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: read => frame_read

  • interface

    private module subroutine frame_read(self, path, frame, type_filter, stat, errmsg)

    frame is 1-based. A negative type_filter keeps every atom. Zero guesses oxygen.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    character(len=*), intent(in) :: path
    integer(kind=seams_int), intent(in), optional :: frame
    integer(kind=seams_int), intent(in), optional :: type_filter
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: count => frame_count

  • interface

    private module function frame_count(self) result(n)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(in) :: self

    Return Value integer(kind=seams_int)

procedure, public :: close => frame_close

  • private subroutine frame_close(self)

    Release this owner’s reference to the frame.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self

procedure, public :: chill => frame_chill

  • interface

    private module subroutine frame_chill(self, labels, counts, cutoff, typ, graph, rule, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(out), allocatable :: labels(:)
    integer(kind=seams_int), intent(out), optional, allocatable :: counts(:)
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: graph
    integer(kind=seams_int), intent(in), optional :: rule
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: chill_plus => frame_chill_plus

  • interface

    private module subroutine frame_chill_plus(self, labels, counts, cutoff, typ, graph, rule, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(out), allocatable :: labels(:)
    integer(kind=seams_int), intent(out), optional, allocatable :: counts(:)
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: graph
    integer(kind=seams_int), intent(in), optional :: rule
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: q4q6 => frame_q4q6

  • interface

    private module subroutine frame_q4q6(self, q4, q6, cutoff, typ, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(out), allocatable :: q4(:)
    real(kind=seams_real), intent(out), allocatable :: q6(:)
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: ql => frame_ql

  • interface

    private module subroutine frame_ql(self, order_l, ql, qlbar, cutoff, typ, graph, stat, errmsg)

    order_l is 3, 4, 6, 8, or 12. qlbar is omitted to skip the average.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(in) :: order_l
    real(kind=seams_real), intent(out), allocatable :: ql(:)
    real(kind=seams_real), intent(out), optional, allocatable :: qlbar(:)
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: graph
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: steinhardt => frame_steinhardt

  • interface

    private module subroutine frame_steinhardt(self, order_l, ql, qlbar, cutoff, typ, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(in) :: order_l
    real(kind=seams_real), intent(out), allocatable :: ql(:)
    real(kind=seams_real), intent(out), optional, allocatable :: qlbar(:)
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: q6bar => frame_q6bar

  • interface

    private module subroutine frame_q6bar(self, q6bar, mean, median, n_ice, cutoff, typ, ice_cut, stat, errmsg)

    ice_cut defaults to 0.36. At least one of the outputs is required.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(out), optional, allocatable :: q6bar(:)
    real(kind=seams_real), intent(out), optional :: mean
    real(kind=seams_real), intent(out), optional :: median
    integer(kind=seams_int), intent(out), optional :: n_ice
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    real(kind=seams_real), intent(in), optional :: ice_cut
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: neighbours => frame_neighbours

  • interface

    private module function frame_neighbours(self, cutoff, typ, graph, stat, errmsg) result(list)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: graph
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

    Return Value type(seams_neighbours)

procedure, public :: knn => frame_knn

  • interface

    private module function frame_knn(self, k, cutoff, typ, mutual, stat, errmsg) result(list)

    mutual defaults to true.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(in) :: k
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    logical, intent(in), optional :: mutual
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

    Return Value type(seams_neighbours)

procedure, public :: rings => frame_rings

  • interface

    private module function frame_rings(self, cutoff, typ, graph, max_depth, stat, errmsg) result(rings)

    max_depth defaults to 6 and must be from 3 through 12.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: graph
    integer(kind=seams_int), intent(in), optional :: max_depth
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

    Return Value type(seams_rings)

procedure, public :: cages => frame_cages

  • interface

    private module function frame_cages(self, cutoff, typ, graph, k, complete, stat, errmsg) result(cages)

    graph defaults to the seeded cage graph. k defaults to 4.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: graph
    integer(kind=seams_int), intent(in), optional :: k
    logical, intent(in), optional :: complete
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

    Return Value type(seams_cages)

procedure, public :: signature => frame_signature

  • interface

    private module subroutine frame_signature(self, spec, n_cages, n_atoms, cutoff, typ, graph, stat, errmsg)

    spec is a census such as “512” or a name such as “hc”.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    character(len=*), intent(in) :: spec
    integer(kind=seams_int), intent(out) :: n_cages
    integer(kind=seams_int), intent(out) :: n_atoms
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: graph
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: rdf => frame_rdf

  • interface

    private module subroutine frame_rdf(self, r, g, volume, rmax, bins, type_i, type_j, count, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(out), allocatable :: r(:)
    real(kind=seams_real), intent(out), allocatable :: g(:)
    real(kind=seams_real), intent(out), optional :: volume
    real(kind=seams_real), intent(in), optional :: rmax
    integer(kind=seams_int), intent(in), optional :: bins
    integer(kind=seams_int), intent(in), optional :: type_i
    integer(kind=seams_int), intent(in), optional :: type_j
    integer(kind=seams_int), intent(out), optional, allocatable :: count(:)
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: running_cn => frame_running_cn

  • interface

    private module subroutine frame_running_cn(self, r, cn, rmax, bins, type_i, type_j, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(out), allocatable :: r(:)
    real(kind=seams_real), intent(out), allocatable :: cn(:)
    real(kind=seams_real), intent(in), optional :: rmax
    integer(kind=seams_int), intent(in), optional :: bins
    integer(kind=seams_int), intent(in), optional :: type_i
    integer(kind=seams_int), intent(in), optional :: type_j
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: coordination => frame_coordination

  • interface

    private module function frame_coordination(self, rmax, bins, type_i, type_j, stat, errmsg) result(cn)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(in), optional :: rmax
    integer(kind=seams_int), intent(in), optional :: bins
    integer(kind=seams_int), intent(in), optional :: type_i
    integer(kind=seams_int), intent(in), optional :: type_j
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

    Return Value real(kind=seams_real)

procedure, public :: hbonds => frame_hbonds

  • interface

    private module function frame_hbonds(self, cutoff, oxygen_type, hydrogen_type, dist, angle, stat, errmsg) result(n_bonds)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: oxygen_type
    integer(kind=seams_int), intent(in), optional :: hydrogen_type
    real(kind=seams_real), intent(in), optional :: dist
    real(kind=seams_real), intent(in), optional :: angle
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

    Return Value integer(kind=seams_int)

procedure, public :: density => frame_density

  • interface

    private module subroutine frame_density(self, z, rho, typ, bins, axis, stat, errmsg)

    axis is 0, 1, or 2. It defaults to 2.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(out), allocatable :: z(:)
    real(kind=seams_real), intent(out), allocatable :: rho(:)
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: bins
    integer(kind=seams_int), intent(in), optional :: axis
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: fingerprint => frame_fingerprint

  • interface

    private module function frame_fingerprint(self, cutoff, typ, k, graph, hops, colors, colours, stat, errmsg) result(fp)

    colors partitions keys by atom type. colours is the deprecated spelling of that keyword. Giving both different values is an error.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: k
    integer(kind=seams_int), intent(in), optional :: graph
    integer(kind=seams_int), intent(in), optional :: hops
    logical, intent(in), optional :: colors
    logical, intent(in), optional :: colours
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

    Return Value type(seams_topo)

procedure, public :: contact_pairs => frame_contact_pairs

  • interface

    private module subroutine frame_contact_pairs(self, spec, n_pairs, n_cation, n_anion, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    character(len=*), intent(in) :: spec
    integer(kind=seams_int), intent(out) :: n_pairs
    integer(kind=seams_int), intent(out) :: n_cation
    integer(kind=seams_int), intent(out) :: n_anion
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: domains => frame_domains

  • interface

    private module subroutine frame_domains(self, spec, n_subset, largest, percolation, cutoff, polar, stat, errmsg)

    polar false is the apolar subset.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    character(len=*), intent(in) :: spec
    integer(kind=seams_int), intent(out) :: n_subset
    integer(kind=seams_int), intent(out) :: largest
    real(kind=seams_real), intent(out) :: percolation
    real(kind=seams_real), intent(in), optional :: cutoff
    logical, intent(in), optional :: polar
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: prisms => frame_prisms

  • interface

    private module subroutine frame_prisms(self, perfect, imperfect, cutoff, typ, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(out), allocatable :: perfect(:)
    integer(kind=seams_int), intent(out), allocatable :: imperfect(:)
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: monolayer => frame_monolayer

  • interface

    private module subroutine frame_monolayer(self, counts, sheet_area, cutoff, typ, max_depth, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(out), allocatable :: counts(:)
    real(kind=seams_real), intent(in) :: sheet_area
    real(kind=seams_real), intent(in), optional :: cutoff
    integer(kind=seams_int), intent(in), optional :: typ
    integer(kind=seams_int), intent(in), optional :: max_depth
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: site_kinds => frame_site_kinds

  • interface

    private module subroutine frame_site_kinds(self, spec, kinds, stat, errmsg)

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    character(len=*), intent(in) :: spec
    integer(kind=seams_int), intent(out), allocatable :: kinds(:)
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: symmetry => frame_symmetry

  • interface

    private module subroutine frame_symmetry(self, labels, shell_rmsd, stat, errmsg)

    A non-positive shell_rmsd selects the library ceiling.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(out), allocatable :: labels(:)
    real(kind=seams_real), intent(in), optional :: shell_rmsd
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

procedure, public :: brine => frame_brine

  • interface

    private module function frame_brine(self, ice, water_type, ion_type, n_bins, axis, stat, errmsg) result(front)

    ice(i) nonzero marks atom i as ice. axis defaults to 2. n_bins 0 selects 20.

    Arguments

    Type IntentOptional Attributes Name
    class(seams_frame), intent(inout) :: self
    integer(kind=seams_int), intent(in), contiguous :: ice(:)
    integer(kind=seams_int), intent(in), optional :: water_type
    integer(kind=seams_int), intent(in), optional :: ion_type
    integer(kind=seams_int), intent(in), optional :: n_bins
    integer(kind=seams_int), intent(in), optional :: axis
    integer(kind=seams_int), intent(out), optional :: stat
    character(len=:), intent(out), optional, allocatable :: errmsg

    Return Value type(seams_brine)

Source Code

  type, public :: seams_frame
    private
    type(handle_box), pointer :: box => null()
  contains
    procedure, public :: set_ortho => frame_set_ortho
    procedure, public :: set_frame => frame_set_frame
    procedure, public :: read => frame_read
    procedure, public :: count => frame_count
    procedure, public :: close => frame_close
    procedure, public :: chill => frame_chill
    procedure, public :: chill_plus => frame_chill_plus
    procedure, public :: q4q6 => frame_q4q6
    procedure, public :: ql => frame_ql
    procedure, public :: steinhardt => frame_steinhardt
    procedure, public :: q6bar => frame_q6bar
    procedure, public :: neighbours => frame_neighbours
    procedure, public :: knn => frame_knn
    procedure, public :: rings => frame_rings
    procedure, public :: cages => frame_cages
    procedure, public :: signature => frame_signature
    procedure, public :: rdf => frame_rdf
    procedure, public :: running_cn => frame_running_cn
    procedure, public :: coordination => frame_coordination
    procedure, public :: hbonds => frame_hbonds
    procedure, public :: density => frame_density
    procedure, public :: fingerprint => frame_fingerprint
    procedure, public :: contact_pairs => frame_contact_pairs
    procedure, public :: domains => frame_domains
    procedure, public :: prisms => frame_prisms
    procedure, public :: monolayer => frame_monolayer
    procedure, public :: site_kinds => frame_site_kinds
    procedure, public :: symmetry => frame_symmetry
    procedure, public :: brine => frame_brine
    final :: frame_final
  end type seams_frame