var tipuesearch = {"pages":[{"title":" d-SEAMS ","text":"d-SEAMS This is the generated API reference for the Fortran package dseams . seams is the module a program uses. seams_c is the iso_c_binding image of include/seams.h . seams_kinds holds seams_real and seams_int . Coordinates are real(seams_real) with shape (3, n) . A missing stat and a missing errmsg make a failed call stop with the library\nmessage. The last finalizer of a handle destroys the C object.\nAssignment shares that object. Installation, tutorials and how-tos are the other parts of the dseams\nmanual. The engine manual is docs.dseams.info . Developer Info Rohit Goswami d-SEAMS developers","tags":"home","url":"index.html"},{"title":"seams_frame – d-SEAMS ","text":"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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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\nspelling of that keyword. Giving both different values is an error. Arguments Type Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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 Intent Optional 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","tags":"","url":"type/seams_frame.html"},{"title":"seams_neighbours – d-SEAMS ","text":"type, public :: seams_neighbours Cutoff or neighbour graph. offsets and columns allocate copies. Finalization Procedures final :: neighbour_final private  subroutine neighbour_final(self) Release this owner’s reference to the neighbour list. Arguments Type Intent Optional Attributes Name type( seams_neighbours ), intent(inout) :: self Type-Bound Procedures procedure, public :: count => neighbour_count interface private module function neighbour_count(self) result(n) Arguments Type Intent Optional Attributes Name class( seams_neighbours ), intent(in) :: self Return Value integer(kind=seams_int) procedure, public :: offsets => neighbour_offsets interface private module subroutine neighbour_offsets(self, offsets, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_neighbours ), intent(in) :: self integer(kind=seams_int), intent(out), allocatable :: offsets (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: columns => neighbour_columns interface private module subroutine neighbour_columns(self, columns, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_neighbours ), intent(in) :: self integer(kind=seams_int), intent(out), allocatable :: columns (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: close => neighbour_close private  subroutine neighbour_close(self) Release this owner’s reference to the neighbour list. Arguments Type Intent Optional Attributes Name class( seams_neighbours ), intent(inout) :: self Source Code type , public :: seams_neighbours private type ( handle_box ), pointer :: box => null () contains procedure , public :: count => neighbour_count procedure , public :: offsets => neighbour_offsets procedure , public :: columns => neighbour_columns procedure , public :: close => neighbour_close final :: neighbour_final end type seams_neighbours","tags":"","url":"type/seams_neighbours.html"},{"title":"seams_rings – d-SEAMS ","text":"type, public :: seams_rings Primitive rings. histogram is 0-based: index k is rings of size k. Finalization Procedures final :: ring_final private  subroutine ring_final(self) Release this owner’s reference to the ring set. Arguments Type Intent Optional Attributes Name type( seams_rings ), intent(inout) :: self Type-Bound Procedures procedure, public :: count => ring_count interface private module function ring_count(self) result(n) Arguments Type Intent Optional Attributes Name class( seams_rings ), intent(in) :: self Return Value integer(kind=seams_int) procedure, public :: histogram => ring_histogram interface private module subroutine ring_histogram(self, counts, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_rings ), intent(in) :: self integer(kind=seams_int), intent(out), allocatable :: counts (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: fraction => ring_fraction interface private module subroutine ring_fraction(self, size, fraction, stat, errmsg) size 0 counts atoms that sit on any ring. Arguments Type Intent Optional Attributes Name class( seams_rings ), intent(in) :: self integer(kind=seams_int), intent(in) :: size real(kind=seams_real), intent(out) :: fraction integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: sizes => ring_sizes interface private module subroutine ring_sizes(self, sizes, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_rings ), intent(in) :: self integer(kind=seams_int), intent(out), allocatable :: sizes (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: symmetry => ring_symmetry interface private module subroutine ring_symmetry(self, codes, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_rings ), intent(in) :: self integer(kind=seams_int), intent(out), allocatable :: codes (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: vertices => ring_vertices interface private module subroutine ring_vertices(self, index, atoms, stat, errmsg) index is 1-based. Arguments Type Intent Optional Attributes Name class( seams_rings ), intent(in) :: self integer(kind=seams_int), intent(in) :: index integer(kind=seams_int), intent(out), allocatable :: atoms (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: close => ring_close private  subroutine ring_close(self) Release this owner’s reference to the ring set. Arguments Type Intent Optional Attributes Name class( seams_rings ), intent(inout) :: self Source Code type , public :: seams_rings private type ( handle_box ), pointer :: box => null () integer ( seams_int ) :: max_depth = 0_seams_int contains procedure , public :: count => ring_count procedure , public :: histogram => ring_histogram procedure , public :: fraction => ring_fraction procedure , public :: sizes => ring_sizes procedure , public :: symmetry => ring_symmetry procedure , public :: vertices => ring_vertices procedure , public :: close => ring_close final :: ring_final end type seams_rings","tags":"","url":"type/seams_rings.html"},{"title":"seams_cages – d-SEAMS ","text":"type, public :: seams_cages Hexagonal and double-diamond membership. Finalization Procedures final :: cage_final private  subroutine cage_final(self) Release this owner’s reference to the cage set. Arguments Type Intent Optional Attributes Name type( seams_cages ), intent(inout) :: self Type-Bound Procedures procedure, public :: counts => cage_counts interface private module subroutine cage_counts(self, n_hex, n_cubic, n_water, n_both, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_cages ), intent(in) :: self integer(kind=seams_int), intent(out) :: n_hex integer(kind=seams_int), intent(out) :: n_cubic integer(kind=seams_int), intent(out) :: n_water integer(kind=seams_int), intent(out) :: n_both integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: labels => cage_labels interface private module subroutine cage_labels(self, labels, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_cages ), intent(in) :: self integer(kind=seams_int), intent(out), allocatable :: labels (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: close => cage_close private  subroutine cage_close(self) Release this owner’s reference to the cage set. Arguments Type Intent Optional Attributes Name class( seams_cages ), intent(inout) :: self Source Code type , public :: seams_cages private type ( handle_box ), pointer :: box => null () integer ( seams_int ) :: natoms = 0_seams_int contains procedure , public :: counts => cage_counts procedure , public :: labels => cage_labels procedure , public :: close => cage_close final :: cage_final end type seams_cages","tags":"","url":"type/seams_cages.html"},{"title":"seams_topo – d-SEAMS ","text":"type, public :: seams_topo Topological fingerprint. Finalization Procedures final :: topo_final private  subroutine topo_final(self) Release this owner’s reference to the fingerprint. Arguments Type Intent Optional Attributes Name type( seams_topo ), intent(inout) :: self Type-Bound Procedures procedure, public :: key => topo_key interface private module subroutine topo_key(self, key, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_topo ), intent(in) :: self character(len=:), intent(out), allocatable :: key integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: atom_key => topo_atom_key interface private module subroutine topo_atom_key(self, index, key, stat, errmsg) index is 1-based. Arguments Type Intent Optional Attributes Name class( seams_topo ), intent(in) :: self integer(kind=seams_int), intent(in) :: index character(len=:), intent(out), allocatable :: key integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: rings => topo_rings interface private module subroutine topo_rings(self, counts, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_topo ), intent(in) :: self integer(kind=seams_int), intent(out), allocatable :: counts (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: close => topo_close private  subroutine topo_close(self) Release this owner’s reference to the fingerprint. Arguments Type Intent Optional Attributes Name class( seams_topo ), intent(inout) :: self Source Code type , public :: seams_topo private type ( handle_box ), pointer :: box => null () contains procedure , public :: key => topo_key procedure , public :: atom_key => topo_atom_key procedure , public :: rings => topo_rings procedure , public :: close => topo_close final :: topo_final end type seams_topo","tags":"","url":"type/seams_topo.html"},{"title":"seams_brine – d-SEAMS ","text":"type, public :: seams_brine Planar ice/brine front. Finalization Procedures final :: brine_final private  subroutine brine_final(self) Release this owner’s reference to the brine front. Arguments Type Intent Optional Attributes Name type( seams_brine ), intent(inout) :: self Type-Bound Procedures procedure, public :: fronts => brine_fronts interface private module subroutine brine_fronts(self, z_enter, z_exit, thickness, found, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_brine ), intent(in) :: self real(kind=seams_real), intent(out), optional :: z_enter real(kind=seams_real), intent(out), optional :: z_exit real(kind=seams_real), intent(out), optional :: thickness integer(kind=seams_int), intent(out), optional :: found integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: rejection => brine_rejection interface private module subroutine brine_rejection(self, c_ice, c_liquid, k, defined, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_brine ), intent(in) :: self real(kind=seams_real), intent(out), optional :: c_ice real(kind=seams_real), intent(out), optional :: c_liquid real(kind=seams_real), intent(out), optional :: k integer(kind=seams_int), intent(out), optional :: defined integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: profile => brine_profile interface private module subroutine brine_profile(self, z_mid, molality, ice_fraction, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_brine ), intent(in) :: self real(kind=seams_real), intent(out), allocatable :: z_mid (:) real(kind=seams_real), intent(out), allocatable :: molality (:) real(kind=seams_real), intent(out), allocatable :: ice_fraction (:) integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: pockets => brine_pockets interface private module subroutine brine_pockets(self, n_pockets, reservoir_waters, stat, errmsg) Arguments Type Intent Optional Attributes Name class( seams_brine ), intent(in) :: self integer(kind=seams_int), intent(out) :: n_pockets integer(kind=seams_int), intent(out) :: reservoir_waters integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg procedure, public :: close => brine_close private  subroutine brine_close(self) Release this owner’s reference to the brine front. Arguments Type Intent Optional Attributes Name class( seams_brine ), intent(inout) :: self Source Code type , public :: seams_brine private type ( handle_box ), pointer :: box => null () contains procedure , public :: fronts => brine_fronts procedure , public :: rejection => brine_rejection procedure , public :: profile => brine_profile procedure , public :: pockets => brine_pockets procedure , public :: close => brine_close final :: brine_final end type seams_brine","tags":"","url":"type/seams_brine.html"},{"title":"c_chars – d-SEAMS","text":"public  function c_chars(text) result(buf) Copy a Fortran string into a NUL-terminated C buffer. Arguments Type Intent Optional Attributes Name character(len=*), intent(in) :: text Return Value character(kind=c_char, len=1), allocatable, (:)","tags":"","url":"proc/c_chars.html"},{"title":"read_frame – d-SEAMS","text":"public  function read_frame(sys, path, frame, type_filter) result(code) Read one frame. path is a Fortran string. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: path integer, intent(in) :: frame integer, intent(in) :: type_filter Return Value integer(kind=c_int)","tags":"","url":"proc/read_frame.html"},{"title":"signature_count – d-SEAMS","text":"public  function signature_count(sys, spec, n_cages, n_atoms) result(code) Count cages of spec on the cutoff graph at 3.5 angstrom. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: spec integer(kind=c_size_t), intent(out) :: n_cages integer(kind=c_size_t), intent(out) :: n_atoms Return Value integer(kind=c_int)","tags":"","url":"proc/signature_count.html"},{"title":"site_kinds – d-SEAMS","text":"public  function site_kinds(sys, spec, kinds, n) result(code) Per-atom site kinds for spec. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: spec integer(kind=c_int), intent(out) :: kinds (*) integer(kind=c_size_t), value :: n Return Value integer(kind=c_int)","tags":"","url":"proc/site_kinds.html"},{"title":"pair_count – d-SEAMS","text":"public  function pair_count(sys, spec, n_pairs, n_cation, n_anion) result(code) Contact-pair census for spec. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: spec integer(kind=c_size_t), intent(out) :: n_pairs integer(kind=c_int), intent(out) :: n_cation integer(kind=c_int), intent(out) :: n_anion Return Value integer(kind=c_int)","tags":"","url":"proc/pair_count.html"},{"title":"domain_size – d-SEAMS","text":"public  function domain_size(sys, spec, n_subset, largest, percolation) result(code) Apolar domain size for spec at 3.5 angstrom. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: spec integer(kind=c_int), intent(out) :: n_subset integer(kind=c_int), intent(out) :: largest real(kind=c_double), intent(out) :: percolation Return Value integer(kind=c_int)","tags":"","url":"proc/domain_size.html"},{"title":"seams_version_string – d-SEAMS","text":"interface public  function seams_version_string() bind(C, name=\"seams_version_string\") Arguments None Return Value type(c_ptr) Description Version text, for example 2.14.0. The pointer is static; the caller does not free it.","tags":"","url":"interface/seams_version_string.html"},{"title":"seams_last_error – d-SEAMS","text":"interface public  function seams_last_error() bind(C, name=\"seams_last_error\") Arguments None Return Value type(c_ptr) Description Thread-local detail of the last failing call on this thread. Never NULL.","tags":"","url":"interface/seams_last_error.html"},{"title":"seams_set_num_threads – d-SEAMS","text":"interface public  function seams_set_num_threads(n) bind(C, name=\"seams_set_num_threads\") Arguments Type Intent Optional Attributes Name integer(kind=c_int), value :: n Return Value integer(kind=c_int) Description Set the OpenMP team used by later analysis. Zero restores the saved default.","tags":"","url":"interface/seams_set_num_threads.html"},{"title":"seams_get_num_threads – d-SEAMS","text":"interface public  function seams_get_num_threads() bind(C, name=\"seams_get_num_threads\") Arguments None Return Value integer(kind=c_int) Description Team width the next analysis call will request.","tags":"","url":"interface/seams_get_num_threads.html"},{"title":"seams_system_create – d-SEAMS","text":"interface public  function seams_system_create() bind(C, name=\"seams_system_create\") Arguments None Return Value type(c_ptr) Description Allocate an empty frame. NULL means allocation failed.","tags":"","url":"interface/seams_system_create.html"},{"title":"seams_system_set_ortho – d-SEAMS","text":"interface public  function seams_system_set_ortho(sys, xyz, n, ox, oy, oz, lx, ly, lz, types, ids) bind(C, name=\"seams_system_set_ortho\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), intent(in) :: xyz (*) integer(kind=c_int), value :: n real(kind=c_double), value :: ox real(kind=c_double), value :: oy real(kind=c_double), value :: oz real(kind=c_double), value :: lx real(kind=c_double), value :: ly real(kind=c_double), value :: lz type(c_ptr), value :: types type(c_ptr), value :: ids Return Value integer(kind=c_int) Description Store points and an orthorhombic cell. types and ids may be c_null_ptr.","tags":"","url":"interface/seams_system_set_ortho.html"},{"title":"seams_system_set_frame – d-SEAMS","text":"interface public  function seams_system_set_frame(sys, xyz, n, box9, types, ids) bind(C, name=\"seams_system_set_frame\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), intent(in) :: xyz (*) integer(kind=c_int), value :: n real(kind=c_double), intent(in) :: box9 (*) type(c_ptr), value :: types type(c_ptr), value :: ids Return Value integer(kind=c_int) Description Store points and a nine-number LAMMPS cell.","tags":"","url":"interface/seams_system_set_frame.html"},{"title":"seams_chill_plus – d-SEAMS","text":"interface public  function seams_chill_plus(sys, cutoff, typ, graph, rule, labels, counts) bind(C, name=\"seams_chill_plus\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph integer(kind=c_int), value :: rule integer(kind=c_int), intent(out) :: labels (*) integer(kind=c_int), intent(out) :: counts (*) Return Value integer(kind=c_int) Description CHILL+ labels and nine population counts. counts is label order, 1-based in Fortran.","tags":"","url":"interface/seams_chill_plus.html"},{"title":"seams_q4q6 – d-SEAMS","text":"interface public  function seams_q4q6(sys, cutoff, typ, q4, q6) bind(C, name=\"seams_q4q6\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ real(kind=c_double), intent(out) :: q4 (*) real(kind=c_double), intent(out) :: q6 (*) Return Value integer(kind=c_int) Description Local q4 and q6 on the cutoff shell.","tags":"","url":"interface/seams_q4q6.html"},{"title":"seams_neighbours_build – d-SEAMS","text":"interface public  function seams_neighbours_build(sys, cutoff, typ, graph, out) bind(C, name=\"seams_neighbours_build\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) Description Build a cutoff or mutual neighbour list. out receives the handle.","tags":"","url":"interface/seams_neighbours_build.html"},{"title":"seams_neighbours_csr – d-SEAMS","text":"interface public  function seams_neighbours_csr(nb, offsets, n_offsets, cols, nnz) bind(C, name=\"seams_neighbours_csr\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: nb type(c_ptr), intent(out) :: offsets integer(kind=c_int), intent(out) :: n_offsets type(c_ptr), intent(out) :: cols integer(kind=c_int), intent(out) :: nnz Return Value integer(kind=c_int) Description Borrow the neighbour CSR. The pointers are owned by the handle.","tags":"","url":"interface/seams_neighbours_csr.html"},{"title":"seams_rings_find – d-SEAMS","text":"interface public  function seams_rings_find(sys, cutoff, typ, graph, max_depth, out) bind(C, name=\"seams_rings_find\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph integer(kind=c_int), value :: max_depth type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) Description Primitive rings up to max_depth. out receives the handle.","tags":"","url":"interface/seams_rings_find.html"},{"title":"seams_rings_histogram – d-SEAMS","text":"interface public  function seams_rings_histogram(rings, counts, counts_len) bind(C, name=\"seams_rings_histogram\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings integer(kind=c_int), intent(out) :: counts (*) integer(kind=c_int), value :: counts_len Return Value integer(kind=c_int) Description Count rings by size. counts(k) is the number of rings of size k-1 when the array is 1-based; a 0-based array stores size k at index k.","tags":"","url":"interface/seams_rings_histogram.html"},{"title":"seams_rings_fraction – d-SEAMS","text":"interface public  function seams_rings_fraction(rings, size, fraction) bind(C, name=\"seams_rings_fraction\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings integer(kind=c_int), value :: size real(kind=c_double), intent(out) :: fraction Return Value integer(kind=c_int) Description Fraction of atoms that sit on a ring. size 0 counts every ring.","tags":"","url":"interface/seams_rings_fraction.html"},{"title":"seams_handle_error – d-SEAMS","text":"interface public  function seams_handle_error(handle) bind(C, name=\"seams_handle_error\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: handle Return Value type(c_ptr) Description Detail string stored on a handle. Survives a later call on another handle.","tags":"","url":"interface/seams_handle_error.html"},{"title":"seams_system_count – d-SEAMS","text":"interface public  function seams_system_count(sys) bind(C, name=\"seams_system_count\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys Return Value integer(kind=c_int) Description Number of points in the frame, or 0 when the handle is empty.","tags":"","url":"interface/seams_system_count.html"},{"title":"seams_system_read – d-SEAMS","text":"interface public  function seams_system_read(sys, path, frame, type_filter) bind(C, name=\"seams_system_read\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(kind=c_char, len=1), intent(in) :: path (*) integer(kind=c_int), value :: frame integer(kind=c_int), value :: type_filter Return Value integer(kind=c_int) Description Read one 1-based frame. type_filter negative keeps every atom.","tags":"","url":"interface/seams_system_read.html"},{"title":"seams_chill – d-SEAMS","text":"interface public  function seams_chill(sys, cutoff, typ, graph, rule, labels, labels_len, counts) bind(C, name=\"seams_chill\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph integer(kind=c_int), value :: rule integer(kind=c_int), intent(out) :: labels (*) integer(kind=c_size_t), value :: labels_len integer(kind=c_int), intent(out) :: counts (*) Return Value integer(kind=c_int) Description Original CHILL labels. labels_len is at least the frame count.","tags":"","url":"interface/seams_chill.html"},{"title":"seams_steinhardt – d-SEAMS","text":"interface public  function seams_steinhardt(sys, cutoff, typ, order_l, ql, ql_len, qlbar, qlbar_len) bind(C, name=\"seams_steinhardt\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: order_l real(kind=c_double), intent(out) :: ql (*) integer(kind=c_size_t), value :: ql_len real(kind=c_double), intent(out) :: qlbar (*) integer(kind=c_size_t), value :: qlbar_len Return Value integer(kind=c_int) Description Local q_l and the Lechner-Dellago average on the cutoff shell.","tags":"","url":"interface/seams_steinhardt.html"},{"title":"seams_cages – d-SEAMS","text":"interface public  function seams_cages(sys, cutoff, typ, graph, k, complete, out) bind(C, name=\"seams_cages\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph integer(kind=c_int), value :: k integer(kind=c_int), value :: complete type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) Description Hexagonal and double-diamond cage membership.","tags":"","url":"interface/seams_cages.html"},{"title":"seams_cages_counts – d-SEAMS","text":"interface public  function seams_cages_counts(cages, n_hex, n_cubic, n_water, n_both) bind(C, name=\"seams_cages_counts\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: cages integer(kind=c_int), intent(out) :: n_hex integer(kind=c_int), intent(out) :: n_cubic integer(kind=c_int), intent(out) :: n_water integer(kind=c_int), intent(out) :: n_both Return Value integer(kind=c_int) Description Disjoint cage population counts. The four counts sum to the atoms the search kept.","tags":"","url":"interface/seams_cages_counts.html"},{"title":"seams_signature_cages – d-SEAMS","text":"interface public  function seams_signature_cages(sys, cutoff, typ, graph, spec, n_cages, n_atoms) bind(C, name=\"seams_signature_cages\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph character(kind=c_char, len=1), intent(in) :: spec (*) integer(kind=c_size_t), intent(out) :: n_cages integer(kind=c_size_t), intent(out) :: n_atoms Return Value integer(kind=c_int) Description Closed cages whose ring census matches spec, for example 512.","tags":"","url":"interface/seams_signature_cages.html"},{"title":"seams_neighbours_knn – d-SEAMS","text":"interface public  function seams_neighbours_knn(sys, k, cutoff, typ, mutual, out) bind(C, name=\"seams_neighbours_knn\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys integer(kind=c_int), value :: k real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: mutual type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) Description k-nearest neighbour list. mutual nonzero keeps the mutual graph.","tags":"","url":"interface/seams_neighbours_knn.html"},{"title":"seams_rdf – d-SEAMS","text":"interface public  function seams_rdf(sys, rmax, bins, type_i, type_j, r, g, count, cap, n_out, volume) bind(C, name=\"seams_rdf\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: rmax integer(kind=c_int), value :: bins integer(kind=c_int), value :: type_i integer(kind=c_int), value :: type_j type(c_ptr), value :: r type(c_ptr), value :: g type(c_ptr), value :: count integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out type(c_ptr), value :: volume Return Value integer(kind=c_int) Description Partial radial distribution. A null column queries the length.","tags":"","url":"interface/seams_rdf.html"},{"title":"seams_running_cn – d-SEAMS","text":"interface public  function seams_running_cn(sys, rmax, bins, type_i, type_j, r, cn, cap, n_out) bind(C, name=\"seams_running_cn\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: rmax integer(kind=c_int), value :: bins integer(kind=c_int), value :: type_i integer(kind=c_int), value :: type_j type(c_ptr), value :: r type(c_ptr), value :: cn integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) Description Running coordination number along the partial RDF.","tags":"","url":"interface/seams_running_cn.html"},{"title":"seams_coordination – d-SEAMS","text":"interface public  function seams_coordination(sys, rmax, bins, type_i, type_j, cn) bind(C, name=\"seams_coordination\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: rmax integer(kind=c_int), value :: bins integer(kind=c_int), value :: type_i integer(kind=c_int), value :: type_j real(kind=c_double), intent(out) :: cn Return Value integer(kind=c_int) Description Coordination number integrated to rmax.","tags":"","url":"interface/seams_coordination.html"},{"title":"seams_hbonds – d-SEAMS","text":"interface public  function seams_hbonds(sys, cutoff, oxygen_type, hydrogen_type, dist_cutoff, angle_cutoff, n_bonds) bind(C, name=\"seams_hbonds\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: oxygen_type integer(kind=c_int), value :: hydrogen_type real(kind=c_double), value :: dist_cutoff real(kind=c_double), value :: angle_cutoff integer(kind=c_int), intent(out) :: n_bonds Return Value integer(kind=c_int) Description Hydrogen-bond count. dist_cutoff is angstrom and angle_cutoff is degrees.","tags":"","url":"interface/seams_hbonds.html"},{"title":"seams_density_axis – d-SEAMS","text":"interface public  function seams_density_axis(sys, typ, bins, axis, z, rho, cap, n_out) bind(C, name=\"seams_density_axis\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys integer(kind=c_int), value :: typ integer(kind=c_int), value :: bins integer(kind=c_int), value :: axis type(c_ptr), value :: z type(c_ptr), value :: rho integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) Description Number density along one cell axis. axis is 0, 1, or 2.","tags":"","url":"interface/seams_density_axis.html"},{"title":"seams_fingerprint – d-SEAMS","text":"interface public  function seams_fingerprint(sys, cutoff, typ, k, graph, hops, color_types, out) bind(C, name=\"seams_fingerprint\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: k integer(kind=c_int), value :: graph integer(kind=c_int), value :: hops integer(kind=c_int), value :: color_types type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) Description Topological fingerprint of the bonded graph.","tags":"","url":"interface/seams_fingerprint.html"},{"title":"seams_fingerprint_key – d-SEAMS","text":"interface public  function seams_fingerprint_key(fp, buf, cap, n_out) bind(C, name=\"seams_fingerprint_key\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: fp type(c_ptr), value :: buf integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) Description Frame key text. A null buffer queries the length without the terminating NUL.","tags":"","url":"interface/seams_fingerprint_key.html"},{"title":"seams_fingerprint_rings – d-SEAMS","text":"interface public  function seams_fingerprint_rings(fp, counts, counts_len) bind(C, name=\"seams_fingerprint_rings\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: fp integer(kind=c_int), intent(out) :: counts (*) integer(kind=c_size_t), value :: counts_len Return Value integer(kind=c_int) Description Primitive-ring census stored on the fingerprint. counts(k) is size k for a 0-based buffer.","tags":"","url":"interface/seams_fingerprint_rings.html"},{"title":"seams_contact_pairs – d-SEAMS","text":"interface public  function seams_contact_pairs(sys, spec, n_pairs, n_cation, n_anion) bind(C, name=\"seams_contact_pairs\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(kind=c_char, len=1), intent(in) :: spec (*) integer(kind=c_size_t), intent(out) :: n_pairs integer(kind=c_int), intent(out) :: n_cation integer(kind=c_int), intent(out) :: n_anion Return Value integer(kind=c_int) Description Mutual nearest unlike contacts of a site table.","tags":"","url":"interface/seams_contact_pairs.html"},{"title":"seams_domains – d-SEAMS","text":"interface public  function seams_domains(sys, cutoff, spec, subset, n_subset, largest, percolation) bind(C, name=\"seams_domains\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff character(kind=c_char, len=1), intent(in) :: spec (*) integer(kind=c_int), value :: subset integer(kind=c_int), intent(out) :: n_subset integer(kind=c_int), intent(out) :: largest real(kind=c_double), intent(out) :: percolation Return Value integer(kind=c_int) Description Largest polar or apolar domain. subset 0 is apolar and 1 is polar.","tags":"","url":"interface/seams_domains.html"},{"title":"seams_prisms – d-SEAMS","text":"interface public  function seams_prisms(sys, cutoff, typ, perfect, imperfect, len) bind(C, name=\"seams_prisms\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), intent(out) :: perfect (*) integer(kind=c_int), intent(out) :: imperfect (*) integer(kind=c_size_t), value :: len Return Value integer(kind=c_int) Description Perfect and imperfect prism counts by ring size.","tags":"","url":"interface/seams_prisms.html"},{"title":"seams_monolayer – d-SEAMS","text":"interface public  function seams_monolayer(sys, cutoff, typ, max_depth, sheet_area, counts, counts_len) bind(C, name=\"seams_monolayer\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: max_depth real(kind=c_double), value :: sheet_area integer(kind=c_int), intent(out) :: counts (*) integer(kind=c_size_t), value :: counts_len Return Value integer(kind=c_int) Description Primitive-ring histogram of a monolayer.","tags":"","url":"interface/seams_monolayer.html"},{"title":"seams_rings_count – d-SEAMS","text":"interface public  function seams_rings_count(rings) bind(C, name=\"seams_rings_count\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings Return Value integer(kind=c_int) Description Number of primitive rings.","tags":"","url":"interface/seams_rings_count.html"},{"title":"seams_rings_vertices – d-SEAMS","text":"interface public  function seams_rings_vertices(rings, index, atoms, cap, n_out) bind(C, name=\"seams_rings_vertices\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings integer(kind=c_int), value :: index integer(kind=c_int), intent(out) :: atoms (*) integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) Description Atom indices of one ring. index is 0-based. A null buffer queries the length.","tags":"","url":"interface/seams_rings_vertices.html"},{"title":"seams_site_table – d-SEAMS","text":"interface public  function seams_site_table(sys, spec, kinds, len) bind(C, name=\"seams_site_table\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(kind=c_char, len=1), intent(in) :: spec (*) integer(kind=c_int), intent(out) :: kinds (*) integer(kind=c_size_t), value :: len Return Value integer(kind=c_int) Description Per-atom site kind from a site-table spec.","tags":"","url":"interface/seams_site_table.html"},{"title":"seams_abi – d-SEAMS","text":"interface public  function seams_abi() bind(C, name=\"seams_abi\") Arguments None Return Value integer(kind=c_int) Description ABI number compiled into this library. It is 1.","tags":"","url":"interface/seams_abi.html"},{"title":"seams_version – d-SEAMS","text":"interface public  function seams_version() bind(C, name=\"seams_version\") Arguments None Return Value integer(kind=c_int) Description Packed release number, (major << 16) | (minor << 8) | patch.","tags":"","url":"interface/seams_version.html"},{"title":"seams_version_major – d-SEAMS","text":"interface public  function seams_version_major() bind(C, name=\"seams_version_major\") Arguments None Return Value integer(kind=c_int) Description Major version.","tags":"","url":"interface/seams_version_major.html"},{"title":"seams_version_minor – d-SEAMS","text":"interface public  function seams_version_minor() bind(C, name=\"seams_version_minor\") Arguments None Return Value integer(kind=c_int) Description Minor version.","tags":"","url":"interface/seams_version_minor.html"},{"title":"seams_version_patch – d-SEAMS","text":"interface public  function seams_version_patch() bind(C, name=\"seams_version_patch\") Arguments None Return Value integer(kind=c_int) Description Patch version.","tags":"","url":"interface/seams_version_patch.html"},{"title":"seams_status_string – d-SEAMS","text":"interface public  function seams_status_string(status) bind(C, name=\"seams_status_string\") Arguments Type Intent Optional Attributes Name integer(kind=c_int), value :: status Return Value type(c_ptr) Description Short name of a status code. The pointer is static.","tags":"","url":"interface/seams_status_string.html"},{"title":"seams_label_name – d-SEAMS","text":"interface public  function seams_label_name(label) bind(C, name=\"seams_label_name\") Arguments Type Intent Optional Attributes Name integer(kind=c_int), value :: label Return Value type(c_ptr) Description Name of a CHILL label. Unknown codes return “unknown”.","tags":"","url":"interface/seams_label_name.html"},{"title":"seams_ring_symmetry_name – d-SEAMS","text":"interface public  function seams_ring_symmetry_name(symmetry) bind(C, name=\"seams_ring_symmetry_name\") Arguments Type Intent Optional Attributes Name integer(kind=c_int), value :: symmetry Return Value type(c_ptr) Description Name of a ring-symmetry code.","tags":"","url":"interface/seams_ring_symmetry_name.html"},{"title":"seams_system_set_atoms – d-SEAMS","text":"interface public  function seams_system_set_atoms(sys, xyz, n, box9, box_len, types, ids) bind(C, name=\"seams_system_set_atoms\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), intent(in) :: xyz (*) integer(kind=c_size_t), value :: n real(kind=c_double), intent(in) :: box9 (*) integer(kind=c_size_t), value :: box_len type(c_ptr), value :: types type(c_ptr), value :: ids Return Value integer(kind=c_int) Description Store points and a cell. n and box_len are size_t. box_len must be 9.","tags":"","url":"interface/seams_system_set_atoms.html"},{"title":"seams_path_nframes – d-SEAMS","text":"interface public  function seams_path_nframes(path, nframes) bind(C, name=\"seams_path_nframes\") Arguments Type Intent Optional Attributes Name character(kind=c_char, len=1), intent(in) :: path (*) integer(kind=c_size_t), intent(out) :: nframes Return Value integer(kind=c_int) Description Number of frames in a trajectory path.","tags":"","url":"interface/seams_path_nframes.html"},{"title":"seams_neighbours_count – d-SEAMS","text":"interface public  function seams_neighbours_count(nb) bind(C, name=\"seams_neighbours_count\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: nb Return Value integer(kind=c_int) Description Number of neighbour rows.","tags":"","url":"interface/seams_neighbours_count.html"},{"title":"seams_neighbours_copy – d-SEAMS","text":"interface public  function seams_neighbours_copy(nb, offsets, offsets_cap, n_offsets, cols, cols_cap, nnz) bind(C, name=\"seams_neighbours_copy\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: nb type(c_ptr), value :: offsets integer(kind=c_size_t), value :: offsets_cap integer(kind=c_size_t), intent(out) :: n_offsets type(c_ptr), value :: cols integer(kind=c_size_t), value :: cols_cap integer(kind=c_size_t), intent(out) :: nnz Return Value integer(kind=c_int) Description Copy the neighbour CSR into caller buffers. A null buffer queries the length.","tags":"","url":"interface/seams_neighbours_copy.html"},{"title":"seams_ql – d-SEAMS","text":"interface public  function seams_ql(sys, cutoff, typ, order_l, graph, ql, ql_len, qlbar, qlbar_len) bind(C, name=\"seams_ql\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: order_l integer(kind=c_int), value :: graph type(c_ptr), value :: ql integer(kind=c_size_t), value :: ql_len type(c_ptr), value :: qlbar integer(kind=c_size_t), value :: qlbar_len Return Value integer(kind=c_int) Description Local q_l and, on request, its neighbour average.","tags":"","url":"interface/seams_ql.html"},{"title":"seams_q6bar – d-SEAMS","text":"interface public  function seams_q6bar(sys, cutoff, typ, ice_cut, q6bar, q6bar_len, mean, median, n_ice) bind(C, name=\"seams_q6bar\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ real(kind=c_double), value :: ice_cut type(c_ptr), value :: q6bar integer(kind=c_size_t), value :: q6bar_len type(c_ptr), value :: mean type(c_ptr), value :: median type(c_ptr), value :: n_ice Return Value integer(kind=c_int) Description Lechner-Dellago q6-bar and the ice count above ice_cut.","tags":"","url":"interface/seams_q6bar.html"},{"title":"seams_rings_labels – d-SEAMS","text":"interface public  function seams_rings_labels(rings, sizes, symmetry) bind(C, name=\"seams_rings_labels\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings type(c_ptr), value :: sizes type(c_ptr), value :: symmetry Return Value integer(kind=c_int) Description Size and symmetry of each ring. Either pointer may be c_null_ptr, not both.","tags":"","url":"interface/seams_rings_labels.html"},{"title":"seams_cages_labels – d-SEAMS","text":"interface public  function seams_cages_labels(cages, per_atom, len) bind(C, name=\"seams_cages_labels\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: cages integer(kind=c_int), intent(out) :: per_atom (*) integer(kind=c_size_t), value :: len Return Value integer(kind=c_int) Description Per-atom cage code. len is at least the frame count stored on the handle.","tags":"","url":"interface/seams_cages_labels.html"},{"title":"seams_system_symmetry – d-SEAMS","text":"interface public  function seams_system_symmetry(sys, shell_rmsd, labels, labels_len) bind(C, name=\"seams_system_symmetry\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: shell_rmsd integer(kind=c_int), intent(out) :: labels (*) integer(kind=c_size_t), value :: labels_len Return Value integer(kind=c_int) Description Per-atom ice shell label. A non-positive shell_rmsd selects the library ceiling.","tags":"","url":"interface/seams_system_symmetry.html"},{"title":"seams_brine_analyse – d-SEAMS","text":"interface public  function seams_brine_analyse(sys, ice, n_ice, water_type, ion_type, n_bins, axis, out) bind(C, name=\"seams_brine_analyse\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys integer(kind=c_int), intent(in) :: ice (*) integer(kind=c_size_t), value :: n_ice integer(kind=c_int), value :: water_type integer(kind=c_int), value :: ion_type integer(kind=c_int), value :: n_bins integer(kind=c_int), value :: axis type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) Description Planar ice front. ice(i) nonzero means atom i is ice.","tags":"","url":"interface/seams_brine_analyse.html"},{"title":"seams_brine_fronts – d-SEAMS","text":"interface public  function seams_brine_fronts(front, z_enter, z_exit, thickness, found) bind(C, name=\"seams_brine_fronts\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front type(c_ptr), value :: z_enter type(c_ptr), value :: z_exit type(c_ptr), value :: thickness type(c_ptr), value :: found Return Value integer(kind=c_int) Description The two planar crossings of the ice slab. Lengths are angstrom.","tags":"","url":"interface/seams_brine_fronts.html"},{"title":"seams_brine_rejection – d-SEAMS","text":"interface public  function seams_brine_rejection(front, c_ice, c_liquid, k, defined) bind(C, name=\"seams_brine_rejection\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front type(c_ptr), value :: c_ice type(c_ptr), value :: c_liquid type(c_ptr), value :: k type(c_ptr), value :: defined Return Value integer(kind=c_int) Description Molal rejection coefficient k = c_ice / c_liquid.","tags":"","url":"interface/seams_brine_rejection.html"},{"title":"seams_brine_profile – d-SEAMS","text":"interface public  function seams_brine_profile(front, z_mid, molality, ice_fraction, cap, n_out) bind(C, name=\"seams_brine_profile\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front type(c_ptr), value :: z_mid type(c_ptr), value :: molality type(c_ptr), value :: ice_fraction integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) Description Concentration profile. A null column is skipped. cap is the capacity of each column.","tags":"","url":"interface/seams_brine_profile.html"},{"title":"seams_brine_pockets – d-SEAMS","text":"interface public  function seams_brine_pockets(front, n_pockets, reservoir_waters) bind(C, name=\"seams_brine_pockets\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front type(c_ptr), value :: n_pockets type(c_ptr), value :: reservoir_waters Return Value integer(kind=c_int) Description Brine pockets trapped in the ice, excluding the liquid reservoir.","tags":"","url":"interface/seams_brine_pockets.html"},{"title":"seams_fingerprint_atom – d-SEAMS","text":"interface public  function seams_fingerprint_atom(fp, index, buf, cap, n_out) bind(C, name=\"seams_fingerprint_atom\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: fp integer(kind=c_int), value :: index type(c_ptr), value :: buf integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) Description Local key of one atom. Same buffer rule as seams_fingerprint_key.","tags":"","url":"interface/seams_fingerprint_atom.html"},{"title":"seams_system_destroy – d-SEAMS","text":"interface public  subroutine seams_system_destroy(sys) bind(C, name=\"seams_system_destroy\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys Description Free a frame. NULL is ignored. Neighbour and ring handles keep their own copies.","tags":"","url":"interface/seams_system_destroy.html"},{"title":"seams_neighbours_destroy – d-SEAMS","text":"interface public  subroutine seams_neighbours_destroy(nb) bind(C, name=\"seams_neighbours_destroy\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: nb Description Free a neighbour list. NULL is ignored.","tags":"","url":"interface/seams_neighbours_destroy.html"},{"title":"seams_rings_destroy – d-SEAMS","text":"interface public  subroutine seams_rings_destroy(rings) bind(C, name=\"seams_rings_destroy\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings Description Free a ring set. NULL is ignored.","tags":"","url":"interface/seams_rings_destroy.html"},{"title":"seams_cages_destroy – d-SEAMS","text":"interface public  subroutine seams_cages_destroy(cages) bind(C, name=\"seams_cages_destroy\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: cages Description Free a cage-membership handle. NULL is ignored.","tags":"","url":"interface/seams_cages_destroy.html"},{"title":"seams_fingerprint_destroy – d-SEAMS","text":"interface public  subroutine seams_fingerprint_destroy(fp) bind(C, name=\"seams_fingerprint_destroy\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: fp Description Free a fingerprint. NULL is ignored.","tags":"","url":"interface/seams_fingerprint_destroy.html"},{"title":"seams_brine_destroy – d-SEAMS","text":"interface public  subroutine seams_brine_destroy(front) bind(C, name=\"seams_brine_destroy\") Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front Description Free a brine-front handle. NULL is ignored.","tags":"","url":"interface/seams_brine_destroy.html"},{"title":"assignment(=) – d-SEAMS","text":"public interface assignment(=) Module Procedures private  subroutine frame_assign(lhs, rhs) Share the C frame. The last finalizer destroys it. Arguments Type Intent Optional Attributes Name type( seams_frame ), intent(inout) :: lhs type( seams_frame ), intent(in) :: rhs private  subroutine neighbour_assign(lhs, rhs) Share the neighbour list. Arguments Type Intent Optional Attributes Name type( seams_neighbours ), intent(inout) :: lhs type( seams_neighbours ), intent(in) :: rhs private  subroutine ring_assign(lhs, rhs) Share the ring set and its maximum depth. Arguments Type Intent Optional Attributes Name type( seams_rings ), intent(inout) :: lhs type( seams_rings ), intent(in) :: rhs private  subroutine cage_assign(lhs, rhs) Share the cage set and the atom count it was built for. Arguments Type Intent Optional Attributes Name type( seams_cages ), intent(inout) :: lhs type( seams_cages ), intent(in) :: rhs private  subroutine topo_assign(lhs, rhs) Share the fingerprint. Arguments Type Intent Optional Attributes Name type( seams_topo ), intent(inout) :: lhs type( seams_topo ), intent(in) :: rhs private  subroutine brine_assign(lhs, rhs) Share the brine front. Arguments Type Intent Optional Attributes Name type( seams_brine ), intent(inout) :: lhs type( seams_brine ), intent(in) :: rhs","tags":"","url":"interface/assignment(=).html"},{"title":"new_frame – d-SEAMS","text":"interface public module function new_frame(stat, errmsg) result(self) Arguments Type Intent Optional Attributes Name integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg Return Value type( seams_frame )","tags":"","url":"interface/new_frame.html"},{"title":"version_text – d-SEAMS","text":"interface public module function version_text() result(text) Arguments None Return Value character(len=:),allocatable","tags":"","url":"interface/version_text.html"},{"title":"num_threads – d-SEAMS","text":"interface public module function num_threads() result(n) Arguments None Return Value integer(kind=seams_int)","tags":"","url":"interface/num_threads.html"},{"title":"label_name – d-SEAMS","text":"interface public module function label_name(code) result(text) Arguments Type Intent Optional Attributes Name integer(kind=seams_int), intent(in) :: code Return Value character(len=:),allocatable","tags":"","url":"interface/label_name.html"},{"title":"status_text – d-SEAMS","text":"interface public module function status_text(code) result(text) Arguments Type Intent Optional Attributes Name integer(kind=seams_int), intent(in) :: code Return Value character(len=:),allocatable","tags":"","url":"interface/status_text.html"},{"title":"path_nframes – d-SEAMS","text":"interface public module function path_nframes(path, stat, errmsg) result(nframes) Arguments Type Intent Optional Attributes Name character(len=*), intent(in) :: path integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg Return Value integer(kind=seams_int)","tags":"","url":"interface/path_nframes.html"},{"title":"set_num_threads – d-SEAMS","text":"interface public module subroutine set_num_threads(n, stat, errmsg) Arguments Type Intent Optional Attributes Name integer(kind=seams_int), intent(in) :: n integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg","tags":"","url":"interface/set_num_threads.html"},{"title":"seams_c – d-SEAMS","text":"Thin iso_c_binding image of include/seams.h . Every procedure is bind(C) to the C symbol of the same name,\nexcept the string helpers at the bottom, which only pack Fortran\nstrings. Lengths that the C header types as size_t stay integer(c_size_t) . A null pointer is c_null_ptr . This module\ndoes not allocate result arrays and does not own handles: the\ncaller creates, sizes, and destroys them. The seams module is\nthe Fortran API. Uses iso_c_binding Variables Type Visibility Attributes Name Initial integer(kind=c_int), public, parameter :: SEAMS_OK = 0 The call succeeded. integer(kind=c_int), public, parameter :: SEAMS_ERR_NULL = 1 A required pointer is null. integer(kind=c_int), public, parameter :: SEAMS_ERR_RANGE = 2 A number is outside the accepted range. integer(kind=c_int), public, parameter :: SEAMS_ERR_BOX = 3 The cell is missing or has no volume. integer(kind=c_int), public, parameter :: SEAMS_ERR_ARG = 4 A caller argument is the wrong shape. integer(kind=c_int), public, parameter :: SEAMS_ERR_STATE = 5 The handle has no frame yet. integer(kind=c_int), public, parameter :: SEAMS_ERR_NOMEM = 6 An allocation failed. integer(kind=c_int), public, parameter :: SEAMS_ERR_INTERNAL = 7 The library hit an internal failure. integer(kind=c_int), public, parameter :: SEAMS_CHILL_PUBLISHED = 0 CHILL+ rule from Nguyen and Molinero, 2015. Inclusive c_ij edges. integer(kind=c_int), public, parameter :: SEAMS_CHILL_OVITO = 1 CHILL+ rule used by OVITO. The same thresholds, open edges. integer(kind=c_int), public, parameter :: SEAMS_GRAPH_CUTOFF = 0 Neighbour graph of every pair inside the cutoff. integer(kind=c_int), public, parameter :: SEAMS_GRAPH_MUTUAL = 1 Mutual four-nearest neighbour graph. integer(kind=c_int), public, parameter :: SEAMS_GRAPH_SEEDED = 2 Cage graph: mutual seeds and union completions. integer(kind=c_int), public, parameter :: SEAMS_LABEL_CUBIC = 0 CHILL+ cubic-ice label. Interfaces interface public  function seams_version_string() bind(C, name=\"seams_version_string\") Version text, for example 2.14.0. The pointer is static; the caller does not free it. Arguments None Return Value type(c_ptr) interface public  function seams_last_error() bind(C, name=\"seams_last_error\") Thread-local detail of the last failing call on this thread. Never NULL. Arguments None Return Value type(c_ptr) interface public  function seams_set_num_threads(n) bind(C, name=\"seams_set_num_threads\") Set the OpenMP team used by later analysis. Zero restores the saved default. Arguments Type Intent Optional Attributes Name integer(kind=c_int), value :: n Return Value integer(kind=c_int) interface public  function seams_get_num_threads() bind(C, name=\"seams_get_num_threads\") Team width the next analysis call will request. Arguments None Return Value integer(kind=c_int) interface public  function seams_system_create() bind(C, name=\"seams_system_create\") Allocate an empty frame. NULL means allocation failed. Arguments None Return Value type(c_ptr) interface public  function seams_system_set_ortho(sys, xyz, n, ox, oy, oz, lx, ly, lz, types, ids) bind(C, name=\"seams_system_set_ortho\") Store points and an orthorhombic cell. types and ids may be c_null_ptr. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), intent(in) :: xyz (*) integer(kind=c_int), value :: n real(kind=c_double), value :: ox real(kind=c_double), value :: oy real(kind=c_double), value :: oz real(kind=c_double), value :: lx real(kind=c_double), value :: ly real(kind=c_double), value :: lz type(c_ptr), value :: types type(c_ptr), value :: ids Return Value integer(kind=c_int) interface public  function seams_system_set_frame(sys, xyz, n, box9, types, ids) bind(C, name=\"seams_system_set_frame\") Store points and a nine-number LAMMPS cell. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), intent(in) :: xyz (*) integer(kind=c_int), value :: n real(kind=c_double), intent(in) :: box9 (*) type(c_ptr), value :: types type(c_ptr), value :: ids Return Value integer(kind=c_int) interface public  function seams_chill_plus(sys, cutoff, typ, graph, rule, labels, counts) bind(C, name=\"seams_chill_plus\") CHILL+ labels and nine population counts. counts is label order, 1-based in Fortran. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph integer(kind=c_int), value :: rule integer(kind=c_int), intent(out) :: labels (*) integer(kind=c_int), intent(out) :: counts (*) Return Value integer(kind=c_int) interface public  function seams_q4q6(sys, cutoff, typ, q4, q6) bind(C, name=\"seams_q4q6\") Local q4 and q6 on the cutoff shell. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ real(kind=c_double), intent(out) :: q4 (*) real(kind=c_double), intent(out) :: q6 (*) Return Value integer(kind=c_int) interface public  function seams_neighbours_build(sys, cutoff, typ, graph, out) bind(C, name=\"seams_neighbours_build\") Build a cutoff or mutual neighbour list. out receives the handle. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) interface public  function seams_neighbours_csr(nb, offsets, n_offsets, cols, nnz) bind(C, name=\"seams_neighbours_csr\") Borrow the neighbour CSR. The pointers are owned by the handle. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: nb type(c_ptr), intent(out) :: offsets integer(kind=c_int), intent(out) :: n_offsets type(c_ptr), intent(out) :: cols integer(kind=c_int), intent(out) :: nnz Return Value integer(kind=c_int) interface public  function seams_rings_find(sys, cutoff, typ, graph, max_depth, out) bind(C, name=\"seams_rings_find\") Primitive rings up to max_depth. out receives the handle. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph integer(kind=c_int), value :: max_depth type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) interface public  function seams_rings_histogram(rings, counts, counts_len) bind(C, name=\"seams_rings_histogram\") Count rings by size. counts(k) is the number of rings of size k-1 when the array is 1-based; a 0-based array stores size k at index k. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings integer(kind=c_int), intent(out) :: counts (*) integer(kind=c_int), value :: counts_len Return Value integer(kind=c_int) interface public  function seams_rings_fraction(rings, size, fraction) bind(C, name=\"seams_rings_fraction\") Fraction of atoms that sit on a ring. size 0 counts every ring. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings integer(kind=c_int), value :: size real(kind=c_double), intent(out) :: fraction Return Value integer(kind=c_int) interface public  function seams_handle_error(handle) bind(C, name=\"seams_handle_error\") Detail string stored on a handle. Survives a later call on another handle. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: handle Return Value type(c_ptr) interface public  function seams_system_count(sys) bind(C, name=\"seams_system_count\") Number of points in the frame, or 0 when the handle is empty. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys Return Value integer(kind=c_int) interface public  function seams_system_read(sys, path, frame, type_filter) bind(C, name=\"seams_system_read\") Read one 1-based frame. type_filter negative keeps every atom. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(kind=c_char, len=1), intent(in) :: path (*) integer(kind=c_int), value :: frame integer(kind=c_int), value :: type_filter Return Value integer(kind=c_int) interface public  function seams_chill(sys, cutoff, typ, graph, rule, labels, labels_len, counts) bind(C, name=\"seams_chill\") Original CHILL labels. labels_len is at least the frame count. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph integer(kind=c_int), value :: rule integer(kind=c_int), intent(out) :: labels (*) integer(kind=c_size_t), value :: labels_len integer(kind=c_int), intent(out) :: counts (*) Return Value integer(kind=c_int) interface public  function seams_steinhardt(sys, cutoff, typ, order_l, ql, ql_len, qlbar, qlbar_len) bind(C, name=\"seams_steinhardt\") Local q_l and the Lechner-Dellago average on the cutoff shell. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: order_l real(kind=c_double), intent(out) :: ql (*) integer(kind=c_size_t), value :: ql_len real(kind=c_double), intent(out) :: qlbar (*) integer(kind=c_size_t), value :: qlbar_len Return Value integer(kind=c_int) interface public  function seams_cages(sys, cutoff, typ, graph, k, complete, out) bind(C, name=\"seams_cages\") Hexagonal and double-diamond cage membership. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph integer(kind=c_int), value :: k integer(kind=c_int), value :: complete type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) interface public  function seams_cages_counts(cages, n_hex, n_cubic, n_water, n_both) bind(C, name=\"seams_cages_counts\") Disjoint cage population counts. The four counts sum to the atoms the search kept. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: cages integer(kind=c_int), intent(out) :: n_hex integer(kind=c_int), intent(out) :: n_cubic integer(kind=c_int), intent(out) :: n_water integer(kind=c_int), intent(out) :: n_both Return Value integer(kind=c_int) interface public  function seams_signature_cages(sys, cutoff, typ, graph, spec, n_cages, n_atoms) bind(C, name=\"seams_signature_cages\") Closed cages whose ring census matches spec, for example 512. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: graph character(kind=c_char, len=1), intent(in) :: spec (*) integer(kind=c_size_t), intent(out) :: n_cages integer(kind=c_size_t), intent(out) :: n_atoms Return Value integer(kind=c_int) interface public  function seams_neighbours_knn(sys, k, cutoff, typ, mutual, out) bind(C, name=\"seams_neighbours_knn\") k-nearest neighbour list. mutual nonzero keeps the mutual graph. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys integer(kind=c_int), value :: k real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: mutual type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) interface public  function seams_rdf(sys, rmax, bins, type_i, type_j, r, g, count, cap, n_out, volume) bind(C, name=\"seams_rdf\") Partial radial distribution. A null column queries the length. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: rmax integer(kind=c_int), value :: bins integer(kind=c_int), value :: type_i integer(kind=c_int), value :: type_j type(c_ptr), value :: r type(c_ptr), value :: g type(c_ptr), value :: count integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out type(c_ptr), value :: volume Return Value integer(kind=c_int) interface public  function seams_running_cn(sys, rmax, bins, type_i, type_j, r, cn, cap, n_out) bind(C, name=\"seams_running_cn\") Running coordination number along the partial RDF. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: rmax integer(kind=c_int), value :: bins integer(kind=c_int), value :: type_i integer(kind=c_int), value :: type_j type(c_ptr), value :: r type(c_ptr), value :: cn integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) interface public  function seams_coordination(sys, rmax, bins, type_i, type_j, cn) bind(C, name=\"seams_coordination\") Coordination number integrated to rmax. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: rmax integer(kind=c_int), value :: bins integer(kind=c_int), value :: type_i integer(kind=c_int), value :: type_j real(kind=c_double), intent(out) :: cn Return Value integer(kind=c_int) interface public  function seams_hbonds(sys, cutoff, oxygen_type, hydrogen_type, dist_cutoff, angle_cutoff, n_bonds) bind(C, name=\"seams_hbonds\") Hydrogen-bond count. dist_cutoff is angstrom and angle_cutoff is degrees. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: oxygen_type integer(kind=c_int), value :: hydrogen_type real(kind=c_double), value :: dist_cutoff real(kind=c_double), value :: angle_cutoff integer(kind=c_int), intent(out) :: n_bonds Return Value integer(kind=c_int) interface public  function seams_density_axis(sys, typ, bins, axis, z, rho, cap, n_out) bind(C, name=\"seams_density_axis\") Number density along one cell axis. axis is 0, 1, or 2. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys integer(kind=c_int), value :: typ integer(kind=c_int), value :: bins integer(kind=c_int), value :: axis type(c_ptr), value :: z type(c_ptr), value :: rho integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) interface public  function seams_fingerprint(sys, cutoff, typ, k, graph, hops, color_types, out) bind(C, name=\"seams_fingerprint\") Topological fingerprint of the bonded graph. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: k integer(kind=c_int), value :: graph integer(kind=c_int), value :: hops integer(kind=c_int), value :: color_types type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) interface public  function seams_fingerprint_key(fp, buf, cap, n_out) bind(C, name=\"seams_fingerprint_key\") Frame key text. A null buffer queries the length without the terminating NUL. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: fp type(c_ptr), value :: buf integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) interface public  function seams_fingerprint_rings(fp, counts, counts_len) bind(C, name=\"seams_fingerprint_rings\") Primitive-ring census stored on the fingerprint. counts(k) is size k for a 0-based buffer. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: fp integer(kind=c_int), intent(out) :: counts (*) integer(kind=c_size_t), value :: counts_len Return Value integer(kind=c_int) interface public  function seams_contact_pairs(sys, spec, n_pairs, n_cation, n_anion) bind(C, name=\"seams_contact_pairs\") Mutual nearest unlike contacts of a site table. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(kind=c_char, len=1), intent(in) :: spec (*) integer(kind=c_size_t), intent(out) :: n_pairs integer(kind=c_int), intent(out) :: n_cation integer(kind=c_int), intent(out) :: n_anion Return Value integer(kind=c_int) interface public  function seams_domains(sys, cutoff, spec, subset, n_subset, largest, percolation) bind(C, name=\"seams_domains\") Largest polar or apolar domain. subset 0 is apolar and 1 is polar. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff character(kind=c_char, len=1), intent(in) :: spec (*) integer(kind=c_int), value :: subset integer(kind=c_int), intent(out) :: n_subset integer(kind=c_int), intent(out) :: largest real(kind=c_double), intent(out) :: percolation Return Value integer(kind=c_int) interface public  function seams_prisms(sys, cutoff, typ, perfect, imperfect, len) bind(C, name=\"seams_prisms\") Perfect and imperfect prism counts by ring size. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), intent(out) :: perfect (*) integer(kind=c_int), intent(out) :: imperfect (*) integer(kind=c_size_t), value :: len Return Value integer(kind=c_int) interface public  function seams_monolayer(sys, cutoff, typ, max_depth, sheet_area, counts, counts_len) bind(C, name=\"seams_monolayer\") Primitive-ring histogram of a monolayer. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: max_depth real(kind=c_double), value :: sheet_area integer(kind=c_int), intent(out) :: counts (*) integer(kind=c_size_t), value :: counts_len Return Value integer(kind=c_int) interface public  function seams_rings_count(rings) bind(C, name=\"seams_rings_count\") Number of primitive rings. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings Return Value integer(kind=c_int) interface public  function seams_rings_vertices(rings, index, atoms, cap, n_out) bind(C, name=\"seams_rings_vertices\") Atom indices of one ring. index is 0-based. A null buffer queries the length. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings integer(kind=c_int), value :: index integer(kind=c_int), intent(out) :: atoms (*) integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) interface public  function seams_site_table(sys, spec, kinds, len) bind(C, name=\"seams_site_table\") Per-atom site kind from a site-table spec. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(kind=c_char, len=1), intent(in) :: spec (*) integer(kind=c_int), intent(out) :: kinds (*) integer(kind=c_size_t), value :: len Return Value integer(kind=c_int) interface public  function seams_abi() bind(C, name=\"seams_abi\") ABI number compiled into this library. It is 1. Arguments None Return Value integer(kind=c_int) interface public  function seams_version() bind(C, name=\"seams_version\") Packed release number, (major << 16) | (minor << 8) | patch. Arguments None Return Value integer(kind=c_int) interface public  function seams_version_major() bind(C, name=\"seams_version_major\") Major version. Arguments None Return Value integer(kind=c_int) interface public  function seams_version_minor() bind(C, name=\"seams_version_minor\") Minor version. Arguments None Return Value integer(kind=c_int) interface public  function seams_version_patch() bind(C, name=\"seams_version_patch\") Patch version. Arguments None Return Value integer(kind=c_int) interface public  function seams_status_string(status) bind(C, name=\"seams_status_string\") Short name of a status code. The pointer is static. Arguments Type Intent Optional Attributes Name integer(kind=c_int), value :: status Return Value type(c_ptr) interface public  function seams_label_name(label) bind(C, name=\"seams_label_name\") Name of a CHILL label. Unknown codes return “unknown”. Arguments Type Intent Optional Attributes Name integer(kind=c_int), value :: label Return Value type(c_ptr) interface public  function seams_ring_symmetry_name(symmetry) bind(C, name=\"seams_ring_symmetry_name\") Name of a ring-symmetry code. Arguments Type Intent Optional Attributes Name integer(kind=c_int), value :: symmetry Return Value type(c_ptr) interface public  function seams_system_set_atoms(sys, xyz, n, box9, box_len, types, ids) bind(C, name=\"seams_system_set_atoms\") Store points and a cell. n and box_len are size_t. box_len must be 9. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), intent(in) :: xyz (*) integer(kind=c_size_t), value :: n real(kind=c_double), intent(in) :: box9 (*) integer(kind=c_size_t), value :: box_len type(c_ptr), value :: types type(c_ptr), value :: ids Return Value integer(kind=c_int) interface public  function seams_path_nframes(path, nframes) bind(C, name=\"seams_path_nframes\") Number of frames in a trajectory path. Arguments Type Intent Optional Attributes Name character(kind=c_char, len=1), intent(in) :: path (*) integer(kind=c_size_t), intent(out) :: nframes Return Value integer(kind=c_int) interface public  function seams_neighbours_count(nb) bind(C, name=\"seams_neighbours_count\") Number of neighbour rows. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: nb Return Value integer(kind=c_int) interface public  function seams_neighbours_copy(nb, offsets, offsets_cap, n_offsets, cols, cols_cap, nnz) bind(C, name=\"seams_neighbours_copy\") Copy the neighbour CSR into caller buffers. A null buffer queries the length. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: nb type(c_ptr), value :: offsets integer(kind=c_size_t), value :: offsets_cap integer(kind=c_size_t), intent(out) :: n_offsets type(c_ptr), value :: cols integer(kind=c_size_t), value :: cols_cap integer(kind=c_size_t), intent(out) :: nnz Return Value integer(kind=c_int) interface public  function seams_ql(sys, cutoff, typ, order_l, graph, ql, ql_len, qlbar, qlbar_len) bind(C, name=\"seams_ql\") Local q_l and, on request, its neighbour average. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ integer(kind=c_int), value :: order_l integer(kind=c_int), value :: graph type(c_ptr), value :: ql integer(kind=c_size_t), value :: ql_len type(c_ptr), value :: qlbar integer(kind=c_size_t), value :: qlbar_len Return Value integer(kind=c_int) interface public  function seams_q6bar(sys, cutoff, typ, ice_cut, q6bar, q6bar_len, mean, median, n_ice) bind(C, name=\"seams_q6bar\") Lechner-Dellago q6-bar and the ice count above ice_cut. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: cutoff integer(kind=c_int), value :: typ real(kind=c_double), value :: ice_cut type(c_ptr), value :: q6bar integer(kind=c_size_t), value :: q6bar_len type(c_ptr), value :: mean type(c_ptr), value :: median type(c_ptr), value :: n_ice Return Value integer(kind=c_int) interface public  function seams_rings_labels(rings, sizes, symmetry) bind(C, name=\"seams_rings_labels\") Size and symmetry of each ring. Either pointer may be c_null_ptr, not both. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings type(c_ptr), value :: sizes type(c_ptr), value :: symmetry Return Value integer(kind=c_int) interface public  function seams_cages_labels(cages, per_atom, len) bind(C, name=\"seams_cages_labels\") Per-atom cage code. len is at least the frame count stored on the handle. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: cages integer(kind=c_int), intent(out) :: per_atom (*) integer(kind=c_size_t), value :: len Return Value integer(kind=c_int) interface public  function seams_system_symmetry(sys, shell_rmsd, labels, labels_len) bind(C, name=\"seams_system_symmetry\") Per-atom ice shell label. A non-positive shell_rmsd selects the library ceiling. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys real(kind=c_double), value :: shell_rmsd integer(kind=c_int), intent(out) :: labels (*) integer(kind=c_size_t), value :: labels_len Return Value integer(kind=c_int) interface public  function seams_brine_analyse(sys, ice, n_ice, water_type, ion_type, n_bins, axis, out) bind(C, name=\"seams_brine_analyse\") Planar ice front. ice(i) nonzero means atom i is ice. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys integer(kind=c_int), intent(in) :: ice (*) integer(kind=c_size_t), value :: n_ice integer(kind=c_int), value :: water_type integer(kind=c_int), value :: ion_type integer(kind=c_int), value :: n_bins integer(kind=c_int), value :: axis type(c_ptr), intent(out) :: out Return Value integer(kind=c_int) interface public  function seams_brine_fronts(front, z_enter, z_exit, thickness, found) bind(C, name=\"seams_brine_fronts\") The two planar crossings of the ice slab. Lengths are angstrom. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front type(c_ptr), value :: z_enter type(c_ptr), value :: z_exit type(c_ptr), value :: thickness type(c_ptr), value :: found Return Value integer(kind=c_int) interface public  function seams_brine_rejection(front, c_ice, c_liquid, k, defined) bind(C, name=\"seams_brine_rejection\") Molal rejection coefficient k = c_ice / c_liquid. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front type(c_ptr), value :: c_ice type(c_ptr), value :: c_liquid type(c_ptr), value :: k type(c_ptr), value :: defined Return Value integer(kind=c_int) interface public  function seams_brine_profile(front, z_mid, molality, ice_fraction, cap, n_out) bind(C, name=\"seams_brine_profile\") Concentration profile. A null column is skipped. cap is the capacity of each column. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front type(c_ptr), value :: z_mid type(c_ptr), value :: molality type(c_ptr), value :: ice_fraction integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) interface public  function seams_brine_pockets(front, n_pockets, reservoir_waters) bind(C, name=\"seams_brine_pockets\") Brine pockets trapped in the ice, excluding the liquid reservoir. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front type(c_ptr), value :: n_pockets type(c_ptr), value :: reservoir_waters Return Value integer(kind=c_int) interface public  function seams_fingerprint_atom(fp, index, buf, cap, n_out) bind(C, name=\"seams_fingerprint_atom\") Local key of one atom. Same buffer rule as seams_fingerprint_key. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: fp integer(kind=c_int), value :: index type(c_ptr), value :: buf integer(kind=c_size_t), value :: cap integer(kind=c_size_t), intent(out) :: n_out Return Value integer(kind=c_int) interface public  subroutine seams_system_destroy(sys) bind(C, name=\"seams_system_destroy\") Free a frame. NULL is ignored. Neighbour and ring handles keep their own copies. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys interface public  subroutine seams_neighbours_destroy(nb) bind(C, name=\"seams_neighbours_destroy\") Free a neighbour list. NULL is ignored. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: nb interface public  subroutine seams_rings_destroy(rings) bind(C, name=\"seams_rings_destroy\") Free a ring set. NULL is ignored. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: rings interface public  subroutine seams_cages_destroy(cages) bind(C, name=\"seams_cages_destroy\") Free a cage-membership handle. NULL is ignored. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: cages interface public  subroutine seams_fingerprint_destroy(fp) bind(C, name=\"seams_fingerprint_destroy\") Free a fingerprint. NULL is ignored. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: fp interface public  subroutine seams_brine_destroy(front) bind(C, name=\"seams_brine_destroy\") Free a brine-front handle. NULL is ignored. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: front Functions public  function c_chars (text) result(buf) Copy a Fortran string into a NUL-terminated C buffer. Arguments Type Intent Optional Attributes Name character(len=*), intent(in) :: text Return Value character(kind=c_char, len=1), allocatable, (:) public  function read_frame (sys, path, frame, type_filter) result(code) Read one frame. path is a Fortran string. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: path integer, intent(in) :: frame integer, intent(in) :: type_filter Return Value integer(kind=c_int) public  function signature_count (sys, spec, n_cages, n_atoms) result(code) Count cages of spec on the cutoff graph at 3.5 angstrom. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: spec integer(kind=c_size_t), intent(out) :: n_cages integer(kind=c_size_t), intent(out) :: n_atoms Return Value integer(kind=c_int) public  function site_kinds (sys, spec, kinds, n) result(code) Per-atom site kinds for spec. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: spec integer(kind=c_int), intent(out) :: kinds (*) integer(kind=c_size_t), value :: n Return Value integer(kind=c_int) public  function pair_count (sys, spec, n_pairs, n_cation, n_anion) result(code) Contact-pair census for spec. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: spec integer(kind=c_size_t), intent(out) :: n_pairs integer(kind=c_int), intent(out) :: n_cation integer(kind=c_int), intent(out) :: n_anion Return Value integer(kind=c_int) public  function domain_size (sys, spec, n_subset, largest, percolation) result(code) Apolar domain size for spec at 3.5 angstrom. Arguments Type Intent Optional Attributes Name type(c_ptr), value :: sys character(len=*), intent(in) :: spec integer(kind=c_int), intent(out) :: n_subset integer(kind=c_int), intent(out) :: largest real(kind=c_double), intent(out) :: percolation Return Value integer(kind=c_int)","tags":"","url":"module/seams_c.html"},{"title":"seams – d-SEAMS","text":"Fortran API for d-SEAMS. A program use s this module. Handles are derived types. The last\nfinalizer, or an explicit close , destroys the C object. Assignment\nshares the handle. Coordinates are real(seams_real) with shape (3, n) , x/y/z down the first index, which is the same memory order\nas the C array. A missing stat and a missing errmsg make a\nfailed call error stop with the library message. Present stat receives the seams.h code and errmsg receives the detail.\nWorking precision. It is real64 and it matches C double .\nInteger kind for labels, counts, and stat . It is int32 . Empty frame. The caller owns the result.\nLibrary version text.\nSet the OpenMP width. Zero restores the default.\nWidth the next analysis will request.\nName of a CHILL label code.\nName of a status code.\nNumber of frames in a trajectory path. Uses seams_support seams_kinds Used by Descendants: seams_methods Variables Type Visibility Attributes Name Initial integer(kind=seams_int), public, parameter :: SEAMS_OK = 0_seams_int The call succeeded. integer(kind=seams_int), public, parameter :: SEAMS_ERR_NULL = 1_seams_int A required pointer is null. integer(kind=seams_int), public, parameter :: SEAMS_ERR_RANGE = 2_seams_int A number is outside the accepted range. integer(kind=seams_int), public, parameter :: SEAMS_ERR_BOX = 3_seams_int The cell is missing or has no volume. integer(kind=seams_int), public, parameter :: SEAMS_ERR_ARG = 4_seams_int A caller argument is the wrong shape. integer(kind=seams_int), public, parameter :: SEAMS_ERR_STATE = 5_seams_int The handle has no frame yet. integer(kind=seams_int), public, parameter :: SEAMS_ERR_NOMEM = 6_seams_int An allocation failed. integer(kind=seams_int), public, parameter :: SEAMS_ERR_INTERNAL = 7_seams_int The library hit an internal failure. integer(kind=seams_int), public, parameter :: SEAMS_CHILL_PUBLISHED = 0_seams_int Published CHILL+ rule. Inclusive c_ij edges. integer(kind=seams_int), public, parameter :: SEAMS_CHILL_OVITO = 1_seams_int OVITO CHILL+ rule. Open c_ij edges. integer(kind=seams_int), public, parameter :: SEAMS_GRAPH_CUTOFF = 0_seams_int Pairs inside the cutoff. integer(kind=seams_int), public, parameter :: SEAMS_GRAPH_MUTUAL = 1_seams_int Mutual four-nearest neighbours. integer(kind=seams_int), public, parameter :: SEAMS_GRAPH_SEEDED = 2_seams_int Cage graph of mutual seeds and union completions. integer(kind=seams_int), public, parameter :: SEAMS_LABEL_CUBIC = 0_seams_int CHILL cubic ice. Population counts use this index plus one. integer(kind=seams_int), public, parameter :: SEAMS_LABEL_HEXAGONAL = 1_seams_int CHILL hexagonal ice. integer(kind=seams_int), public, parameter :: SEAMS_LABEL_WATER = 2_seams_int CHILL liquid water. integer(kind=seams_int), public, parameter :: SEAMS_LABEL_INTERFACIAL = 3_seams_int CHILL interfacial ice. integer(kind=seams_int), public, parameter :: SEAMS_LABEL_CLATHRATE = 4_seams_int CHILL clathrate. The population count is counts(5) . integer(kind=seams_int), public, parameter :: SEAMS_LABEL_INTERCLATHRATE = 5_seams_int CHILL interfacial clathrate. integer(kind=seams_int), public, parameter :: SEAMS_LABEL_UNCLASSIFIED = 6_seams_int CHILL atom that matched no class. integer(kind=seams_int), public, parameter :: SEAMS_LABEL_RECUBIC = 7_seams_int CHILL reclassified cubic ice. integer(kind=seams_int), public, parameter :: SEAMS_LABEL_REHEX = 8_seams_int CHILL reclassified hexagonal ice. integer(kind=seams_int), public, parameter :: SEAMS_CAGE_WATER = 0_seams_int Atom in neither cage. integer(kind=seams_int), public, parameter :: SEAMS_CAGE_HEX = 1_seams_int Hexagonal cage only. integer(kind=seams_int), public, parameter :: SEAMS_CAGE_CUBIC = 2_seams_int Double-diamond cage only. integer(kind=seams_int), public, parameter :: SEAMS_CAGE_BOTH = 3_seams_int Both cages. Interfaces public        interface assignment(=) private  subroutine frame_assign(lhs, rhs) Share the C frame. The last finalizer destroys it. Arguments Type Intent Optional Attributes Name type( seams_frame ), intent(inout) :: lhs type( seams_frame ), intent(in) :: rhs private  subroutine neighbour_assign(lhs, rhs) Share the neighbour list. Arguments Type Intent Optional Attributes Name type( seams_neighbours ), intent(inout) :: lhs type( seams_neighbours ), intent(in) :: rhs private  subroutine ring_assign(lhs, rhs) Share the ring set and its maximum depth. Arguments Type Intent Optional Attributes Name type( seams_rings ), intent(inout) :: lhs type( seams_rings ), intent(in) :: rhs private  subroutine cage_assign(lhs, rhs) Share the cage set and the atom count it was built for. Arguments Type Intent Optional Attributes Name type( seams_cages ), intent(inout) :: lhs type( seams_cages ), intent(in) :: rhs private  subroutine topo_assign(lhs, rhs) Share the fingerprint. Arguments Type Intent Optional Attributes Name type( seams_topo ), intent(inout) :: lhs type( seams_topo ), intent(in) :: rhs private  subroutine brine_assign(lhs, rhs) Share the brine front. Arguments Type Intent Optional Attributes Name type( seams_brine ), intent(inout) :: lhs type( seams_brine ), intent(in) :: rhs interface public module function new_frame(stat, errmsg) result(self) Arguments Type Intent Optional Attributes Name integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg Return Value type( seams_frame ) interface public module function version_text() result(text) Arguments None Return Value character(len=:), allocatable interface public module function num_threads() result(n) Arguments None Return Value integer(kind=seams_int) interface public module function label_name(code) result(text) Arguments Type Intent Optional Attributes Name integer(kind=seams_int), intent(in) :: code Return Value character(len=:), allocatable interface public module function status_text(code) result(text) Arguments Type Intent Optional Attributes Name integer(kind=seams_int), intent(in) :: code Return Value character(len=:), allocatable interface public module function path_nframes(path, stat, errmsg) result(nframes) Arguments Type Intent Optional Attributes Name character(len=*), intent(in) :: path integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg Return Value integer(kind=seams_int) interface public module subroutine set_num_threads(n, stat, errmsg) Arguments Type Intent Optional Attributes Name integer(kind=seams_int), intent(in) :: n integer(kind=seams_int), intent(out), optional :: stat character(len=:), intent(out), optional, allocatable :: errmsg Derived Types type, public :: seams_frame One frame. The finalizer frees the C frame. Finalizations Procedures final :: frame_final Type-Bound Procedures 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 type, public :: seams_neighbours Cutoff or neighbour graph. offsets and columns allocate copies. Finalizations Procedures final :: neighbour_final Type-Bound Procedures procedure, public :: count => neighbour_count procedure, public :: offsets => neighbour_offsets procedure, public :: columns => neighbour_columns procedure, public :: close => neighbour_close type, public :: seams_rings Primitive rings. histogram is 0-based: index k is rings of size k. Finalizations Procedures final :: ring_final Type-Bound Procedures procedure, public :: count => ring_count procedure, public :: histogram => ring_histogram procedure, public :: fraction => ring_fraction procedure, public :: sizes => ring_sizes procedure, public :: symmetry => ring_symmetry procedure, public :: vertices => ring_vertices procedure, public :: close => ring_close type, public :: seams_cages Hexagonal and double-diamond membership. Finalizations Procedures final :: cage_final Type-Bound Procedures procedure, public :: counts => cage_counts procedure, public :: labels => cage_labels procedure, public :: close => cage_close type, public :: seams_topo Topological fingerprint. Finalizations Procedures final :: topo_final Type-Bound Procedures procedure, public :: key => topo_key procedure, public :: atom_key => topo_atom_key procedure, public :: rings => topo_rings procedure, public :: close => topo_close type, public :: seams_brine Planar ice/brine front. Finalizations Procedures final :: brine_final Type-Bound Procedures procedure, public :: fronts => brine_fronts procedure, public :: rejection => brine_rejection procedure, public :: profile => brine_profile procedure, public :: pockets => brine_pockets procedure, public :: close => brine_close","tags":"","url":"module/seams.html"},{"title":"seams_kinds – d-SEAMS","text":"Numeric kinds for the Fortran API. Kinds come from iso_fortran_env . The C entry points hand double and int buffers across iso_c_binding , so seams_real must be c_double and seams_int must be c_int . A mismatch would\nsilently reinterpret memory. The assertions divide by zero in a\nconstant expression, which a conforming compiler rejects. Uses iso_c_binding iso_fortran_env Variables Type Visibility Attributes Name Initial integer, public, parameter :: seams_real = real64 Working precision for coordinates, cutoffs, and order parameters. integer, public, parameter :: seams_int = int32 Default integer kind for counts, labels, and the stat argument.","tags":"","url":"module/seams_kinds.html"},{"title":"seams_methods – d-SEAMS","text":"Uses seams_c seams_support seams_kinds Ancestors: seams","tags":"","url":"module/seams_methods.html"},{"title":"seams_c.f90 – d-SEAMS","text":"Source Code ! Copyright (c) d-SEAMS developers ! !> Thin `iso_c_binding` image of `include/seams.h`. !! !! Every procedure is `bind(C)` to the C symbol of the same name, !! except the string helpers at the bottom, which only pack Fortran !! strings. Lengths that the C header types as `size_t` stay !! `integer(c_size_t)`. A null pointer is `c_null_ptr`. This module !! does not allocate result arrays and does not own handles: the !! caller creates, sizes, and destroys them. The `seams` module is !! the Fortran API. module seams_c use , intrinsic :: iso_c_binding implicit none !> The call succeeded. integer ( c_int ), parameter :: SEAMS_OK = 0 !> A required pointer is null. integer ( c_int ), parameter :: SEAMS_ERR_NULL = 1 !> A number is outside the accepted range. integer ( c_int ), parameter :: SEAMS_ERR_RANGE = 2 !> The cell is missing or has no volume. integer ( c_int ), parameter :: SEAMS_ERR_BOX = 3 !> A caller argument is the wrong shape. integer ( c_int ), parameter :: SEAMS_ERR_ARG = 4 !> The handle has no frame yet. integer ( c_int ), parameter :: SEAMS_ERR_STATE = 5 !> An allocation failed. integer ( c_int ), parameter :: SEAMS_ERR_NOMEM = 6 !> The library hit an internal failure. integer ( c_int ), parameter :: SEAMS_ERR_INTERNAL = 7 !> CHILL+ rule from Nguyen and Molinero, 2015. Inclusive c_ij edges. integer ( c_int ), parameter :: SEAMS_CHILL_PUBLISHED = 0 !> CHILL+ rule used by OVITO. The same thresholds, open edges. integer ( c_int ), parameter :: SEAMS_CHILL_OVITO = 1 !> Neighbour graph of every pair inside the cutoff. integer ( c_int ), parameter :: SEAMS_GRAPH_CUTOFF = 0 !> Mutual four-nearest neighbour graph. integer ( c_int ), parameter :: SEAMS_GRAPH_MUTUAL = 1 !> Cage graph: mutual seeds and union completions. integer ( c_int ), parameter :: SEAMS_GRAPH_SEEDED = 2 !> CHILL+ cubic-ice label. integer ( c_int ), parameter :: SEAMS_LABEL_CUBIC = 0 interface !> Version text, for example 2.14.0. The pointer is static; the caller does not free it. function seams_version_string () bind ( C , name = \"seams_version_string\" ) import :: c_ptr type ( c_ptr ) :: seams_version_string end function !> Thread-local detail of the last failing call on this thread. Never NULL. function seams_last_error () bind ( C , name = \"seams_last_error\" ) import :: c_ptr type ( c_ptr ) :: seams_last_error end function !> Set the OpenMP team used by later analysis. Zero restores the saved default. function seams_set_num_threads ( n ) bind ( C , name = \"seams_set_num_threads\" ) import :: c_int integer ( c_int ), value :: n integer ( c_int ) :: seams_set_num_threads end function !> Team width the next analysis call will request. function seams_get_num_threads () bind ( C , name = \"seams_get_num_threads\" ) import :: c_int integer ( c_int ) :: seams_get_num_threads end function !> Allocate an empty frame. NULL means allocation failed. function seams_system_create () bind ( C , name = \"seams_system_create\" ) import :: c_ptr type ( c_ptr ) :: seams_system_create end function !> Free a frame. NULL is ignored. Neighbour and ring handles keep their own copies. subroutine seams_system_destroy ( sys ) bind ( C , name = \"seams_system_destroy\" ) import :: c_ptr type ( c_ptr ), value :: sys end subroutine !> Store points and an orthorhombic cell. types and ids may be c_null_ptr. function seams_system_set_ortho ( sys , xyz , n , ox , oy , oz , lx , ly , lz , types , ids ) & bind ( C , name = \"seams_system_set_ortho\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), intent ( in ) :: xyz ( * ) integer ( c_int ), value :: n real ( c_double ), value :: ox , oy , oz , lx , ly , lz type ( c_ptr ), value :: types , ids integer ( c_int ) :: seams_system_set_ortho end function !> Store points and a nine-number LAMMPS cell. function seams_system_set_frame ( sys , xyz , n , box9 , types , ids ) & bind ( C , name = \"seams_system_set_frame\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), intent ( in ) :: xyz ( * ) integer ( c_int ), value :: n real ( c_double ), intent ( in ) :: box9 ( * ) type ( c_ptr ), value :: types , ids integer ( c_int ) :: seams_system_set_frame end function !> CHILL+ labels and nine population counts. counts is label order, 1-based in Fortran. function seams_chill_plus ( sys , cutoff , typ , graph , rule , labels , counts ) & bind ( C , name = \"seams_chill_plus\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , graph , rule integer ( c_int ), intent ( out ) :: labels ( * ) integer ( c_int ), intent ( out ) :: counts ( * ) integer ( c_int ) :: seams_chill_plus end function !> Local q4 and q6 on the cutoff shell. function seams_q4q6 ( sys , cutoff , typ , q4 , q6 ) bind ( C , name = \"seams_q4q6\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ real ( c_double ), intent ( out ) :: q4 ( * ) real ( c_double ), intent ( out ) :: q6 ( * ) integer ( c_int ) :: seams_q4q6 end function !> Build a cutoff or mutual neighbour list. out receives the handle. function seams_neighbours_build ( sys , cutoff , typ , graph , out ) & bind ( C , name = \"seams_neighbours_build\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , graph type ( c_ptr ), intent ( out ) :: out integer ( c_int ) :: seams_neighbours_build end function !> Free a neighbour list. NULL is ignored. subroutine seams_neighbours_destroy ( nb ) bind ( C , name = \"seams_neighbours_destroy\" ) import :: c_ptr type ( c_ptr ), value :: nb end subroutine !> Borrow the neighbour CSR. The pointers are owned by the handle. function seams_neighbours_csr ( nb , offsets , n_offsets , cols , nnz ) & bind ( C , name = \"seams_neighbours_csr\" ) import :: c_ptr , c_int type ( c_ptr ), value :: nb type ( c_ptr ), intent ( out ) :: offsets , cols integer ( c_int ), intent ( out ) :: n_offsets , nnz integer ( c_int ) :: seams_neighbours_csr end function !> Primitive rings up to max_depth. out receives the handle. function seams_rings_find ( sys , cutoff , typ , graph , max_depth , out ) & bind ( C , name = \"seams_rings_find\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , graph , max_depth type ( c_ptr ), intent ( out ) :: out integer ( c_int ) :: seams_rings_find end function !> Free a ring set. NULL is ignored. subroutine seams_rings_destroy ( rings ) bind ( C , name = \"seams_rings_destroy\" ) import :: c_ptr type ( c_ptr ), value :: rings end subroutine !> Count rings by size. counts(k) is the number of rings of size k-1 when the array is 1-based; a 0-based array stores size k at index k. function seams_rings_histogram ( rings , counts , counts_len ) & bind ( C , name = \"seams_rings_histogram\" ) import :: c_ptr , c_int type ( c_ptr ), value :: rings integer ( c_int ), intent ( out ) :: counts ( * ) integer ( c_int ), value :: counts_len integer ( c_int ) :: seams_rings_histogram end function !> Fraction of atoms that sit on a ring. size 0 counts every ring. function seams_rings_fraction ( rings , size , fraction ) bind ( C , name = \"seams_rings_fraction\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: rings integer ( c_int ), value :: size real ( c_double ), intent ( out ) :: fraction integer ( c_int ) :: seams_rings_fraction end function !> Detail string stored on a handle. Survives a later call on another handle. function seams_handle_error ( handle ) bind ( C , name = \"seams_handle_error\" ) import :: c_ptr type ( c_ptr ), value :: handle type ( c_ptr ) :: seams_handle_error end function !> Number of points in the frame, or 0 when the handle is empty. function seams_system_count ( sys ) bind ( C , name = \"seams_system_count\" ) import :: c_ptr , c_int type ( c_ptr ), value :: sys integer ( c_int ) :: seams_system_count end function !> Read one 1-based frame. type_filter negative keeps every atom. function seams_system_read ( sys , path , frame , type_filter ) bind ( C , name = \"seams_system_read\" ) import :: c_ptr , c_int , c_char type ( c_ptr ), value :: sys character ( kind = c_char ), intent ( in ) :: path ( * ) integer ( c_int ), value :: frame , type_filter integer ( c_int ) :: seams_system_read end function !> Original CHILL labels. labels_len is at least the frame count. function seams_chill ( sys , cutoff , typ , graph , rule , labels , labels_len , counts ) & bind ( C , name = \"seams_chill\" ) import :: c_ptr , c_int , c_double , c_size_t type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , graph , rule integer ( c_int ), intent ( out ) :: labels ( * ) integer ( c_size_t ), value :: labels_len integer ( c_int ), intent ( out ) :: counts ( * ) integer ( c_int ) :: seams_chill end function !> Local q_l and the Lechner-Dellago average on the cutoff shell. function seams_steinhardt ( sys , cutoff , typ , order_l , ql , ql_len , qlbar , qlbar_len ) & bind ( C , name = \"seams_steinhardt\" ) import :: c_ptr , c_int , c_double , c_size_t type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , order_l real ( c_double ), intent ( out ) :: ql ( * ), qlbar ( * ) integer ( c_size_t ), value :: ql_len , qlbar_len integer ( c_int ) :: seams_steinhardt end function !> Hexagonal and double-diamond cage membership. function seams_cages ( sys , cutoff , typ , graph , k , complete , out ) bind ( C , name = \"seams_cages\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , graph , k , complete type ( c_ptr ), intent ( out ) :: out integer ( c_int ) :: seams_cages end function !> Free a cage-membership handle. NULL is ignored. subroutine seams_cages_destroy ( cages ) bind ( C , name = \"seams_cages_destroy\" ) import :: c_ptr type ( c_ptr ), value :: cages end subroutine !> Disjoint cage population counts. The four counts sum to the atoms the search kept. function seams_cages_counts ( cages , n_hex , n_cubic , n_water , n_both ) & bind ( C , name = \"seams_cages_counts\" ) import :: c_ptr , c_int type ( c_ptr ), value :: cages integer ( c_int ), intent ( out ) :: n_hex , n_cubic , n_water , n_both integer ( c_int ) :: seams_cages_counts end function !> Closed cages whose ring census matches spec, for example 512. function seams_signature_cages ( sys , cutoff , typ , graph , spec , n_cages , n_atoms ) & bind ( C , name = \"seams_signature_cages\" ) import :: c_ptr , c_int , c_double , c_char , c_size_t type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , graph character ( kind = c_char ), intent ( in ) :: spec ( * ) integer ( c_size_t ), intent ( out ) :: n_cages , n_atoms integer ( c_int ) :: seams_signature_cages end function !> k-nearest neighbour list. mutual nonzero keeps the mutual graph. function seams_neighbours_knn ( sys , k , cutoff , typ , mutual , out ) & bind ( C , name = \"seams_neighbours_knn\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys integer ( c_int ), value :: k , typ , mutual real ( c_double ), value :: cutoff type ( c_ptr ), intent ( out ) :: out integer ( c_int ) :: seams_neighbours_knn end function !> Partial radial distribution. A null column queries the length. function seams_rdf ( sys , rmax , bins , type_i , type_j , r , g , count , cap , n_out , volume ) & bind ( C , name = \"seams_rdf\" ) import :: c_ptr , c_int , c_double , c_size_t type ( c_ptr ), value :: sys real ( c_double ), value :: rmax integer ( c_int ), value :: bins , type_i , type_j type ( c_ptr ), value :: r , g , count , volume integer ( c_size_t ), value :: cap integer ( c_size_t ), intent ( out ) :: n_out integer ( c_int ) :: seams_rdf end function !> Running coordination number along the partial RDF. function seams_running_cn ( sys , rmax , bins , type_i , type_j , r , cn , cap , n_out ) & bind ( C , name = \"seams_running_cn\" ) import :: c_ptr , c_int , c_double , c_size_t type ( c_ptr ), value :: sys real ( c_double ), value :: rmax integer ( c_int ), value :: bins , type_i , type_j type ( c_ptr ), value :: r , cn integer ( c_size_t ), value :: cap integer ( c_size_t ), intent ( out ) :: n_out integer ( c_int ) :: seams_running_cn end function !> Coordination number integrated to rmax. function seams_coordination ( sys , rmax , bins , type_i , type_j , cn ) & bind ( C , name = \"seams_coordination\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), value :: rmax integer ( c_int ), value :: bins , type_i , type_j real ( c_double ), intent ( out ) :: cn integer ( c_int ) :: seams_coordination end function !> Hydrogen-bond count. dist_cutoff is angstrom and angle_cutoff is degrees. function seams_hbonds ( sys , cutoff , oxygen_type , hydrogen_type , dist_cutoff , angle_cutoff , & n_bonds ) bind ( C , name = \"seams_hbonds\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff , dist_cutoff , angle_cutoff integer ( c_int ), value :: oxygen_type , hydrogen_type integer ( c_int ), intent ( out ) :: n_bonds integer ( c_int ) :: seams_hbonds end function !> Number density along one cell axis. axis is 0, 1, or 2. function seams_density_axis ( sys , typ , bins , axis , z , rho , cap , n_out ) & bind ( C , name = \"seams_density_axis\" ) import :: c_ptr , c_int , c_double , c_size_t type ( c_ptr ), value :: sys integer ( c_int ), value :: typ , bins , axis type ( c_ptr ), value :: z , rho integer ( c_size_t ), value :: cap integer ( c_size_t ), intent ( out ) :: n_out integer ( c_int ) :: seams_density_axis end function !> Topological fingerprint of the bonded graph. function seams_fingerprint ( sys , cutoff , typ , k , graph , hops , color_types , out ) & bind ( C , name = \"seams_fingerprint\" ) import :: c_ptr , c_int , c_double type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , k , graph , hops , color_types type ( c_ptr ), intent ( out ) :: out integer ( c_int ) :: seams_fingerprint end function !> Free a fingerprint. NULL is ignored. subroutine seams_fingerprint_destroy ( fp ) bind ( C , name = \"seams_fingerprint_destroy\" ) import :: c_ptr type ( c_ptr ), value :: fp end subroutine !> Frame key text. A null buffer queries the length without the terminating NUL. function seams_fingerprint_key ( fp , buf , cap , n_out ) bind ( C , name = \"seams_fingerprint_key\" ) import :: c_ptr , c_size_t , c_int type ( c_ptr ), value :: fp , buf integer ( c_size_t ), value :: cap integer ( c_size_t ), intent ( out ) :: n_out integer ( c_int ) :: seams_fingerprint_key end function !> Primitive-ring census stored on the fingerprint. counts(k) is size k for a 0-based buffer. function seams_fingerprint_rings ( fp , counts , counts_len ) & bind ( C , name = \"seams_fingerprint_rings\" ) import :: c_ptr , c_int , c_size_t type ( c_ptr ), value :: fp integer ( c_int ), intent ( out ) :: counts ( * ) integer ( c_size_t ), value :: counts_len integer ( c_int ) :: seams_fingerprint_rings end function !> Mutual nearest unlike contacts of a site table. function seams_contact_pairs ( sys , spec , n_pairs , n_cation , n_anion ) & bind ( C , name = \"seams_contact_pairs\" ) import :: c_ptr , c_char , c_size_t , c_int type ( c_ptr ), value :: sys character ( kind = c_char ), intent ( in ) :: spec ( * ) integer ( c_size_t ), intent ( out ) :: n_pairs integer ( c_int ), intent ( out ) :: n_cation , n_anion integer ( c_int ) :: seams_contact_pairs end function !> Largest polar or apolar domain. subset 0 is apolar and 1 is polar. function seams_domains ( sys , cutoff , spec , subset , n_subset , largest , percolation ) & bind ( C , name = \"seams_domains\" ) import :: c_ptr , c_double , c_char , c_int type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff character ( kind = c_char ), intent ( in ) :: spec ( * ) integer ( c_int ), value :: subset integer ( c_int ), intent ( out ) :: n_subset , largest real ( c_double ), intent ( out ) :: percolation integer ( c_int ) :: seams_domains end function !> Perfect and imperfect prism counts by ring size. function seams_prisms ( sys , cutoff , typ , perfect , imperfect , len ) bind ( C , name = \"seams_prisms\" ) import :: c_ptr , c_double , c_int , c_size_t type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff integer ( c_int ), value :: typ integer ( c_int ), intent ( out ) :: perfect ( * ), imperfect ( * ) integer ( c_size_t ), value :: len integer ( c_int ) :: seams_prisms end function !> Primitive-ring histogram of a monolayer. function seams_monolayer ( sys , cutoff , typ , max_depth , sheet_area , counts , counts_len ) & bind ( C , name = \"seams_monolayer\" ) import :: c_ptr , c_double , c_int , c_size_t type ( c_ptr ), value :: sys real ( c_double ), value :: cutoff , sheet_area integer ( c_int ), value :: typ , max_depth integer ( c_int ), intent ( out ) :: counts ( * ) integer ( c_size_t ), value :: counts_len integer ( c_int ) :: seams_monolayer end function !> Number of primitive rings. function seams_rings_count ( rings ) bind ( C , name = \"seams_rings_count\" ) import :: c_ptr , c_int type ( c_ptr ), value :: rings integer ( c_int ) :: seams_rings_count end function !> Atom indices of one ring. index is 0-based. A null buffer queries the length. function seams_rings_vertices ( rings , index , atoms , cap , n_out ) & bind ( C , name = \"seams_rings_vertices\" ) import :: c_ptr , c_int , c_size_t type ( c_ptr ), value :: rings integer ( c_int ), value :: index integer ( c_int ), intent ( out ) :: atoms ( * ) integer ( c_size_t ), value :: cap integer ( c_size_t ), intent ( out ) :: n_out integer ( c_int ) :: seams_rings_vertices end function !> Per-atom site kind from a site-table spec. function seams_site_table ( sys , spec , kinds , len ) bind ( C , name = \"seams_site_table\" ) import :: c_ptr , c_char , c_int , c_size_t type ( c_ptr ), value :: sys character ( kind = c_char ), intent ( in ) :: spec ( * ) integer ( c_int ), intent ( out ) :: kinds ( * ) integer ( c_size_t ), value :: len integer ( c_int ) :: seams_site_table end function !> ABI number compiled into this library. It is 1. function seams_abi () bind ( C , name = \"seams_abi\" ) import :: c_int integer ( c_int ) :: seams_abi end function !> Packed release number, (major << 16) | (minor << 8) | patch. function seams_version () bind ( C , name = \"seams_version\" ) import :: c_int integer ( c_int ) :: seams_version end function !> Major version. function seams_version_major () bind ( C , name = \"seams_version_major\" ) import :: c_int integer ( c_int ) :: seams_version_major end function !> Minor version. function seams_version_minor () bind ( C , name = \"seams_version_minor\" ) import :: c_int integer ( c_int ) :: seams_version_minor end function !> Patch version. function seams_version_patch () bind ( C , name = \"seams_version_patch\" ) import :: c_int integer ( c_int ) :: seams_version_patch end function !> Short name of a status code. The pointer is static. function seams_status_string ( status ) bind ( C , name = \"seams_status_string\" ) import :: c_int , c_ptr integer ( c_int ), value :: status type ( c_ptr ) :: seams_status_string end function !> Name of a CHILL label. Unknown codes return \"unknown\". function seams_label_name ( label ) bind ( C , name = \"seams_label_name\" ) import :: c_int , c_ptr integer ( c_int ), value :: label type ( c_ptr ) :: seams_label_name end function !> Name of a ring-symmetry code. function seams_ring_symmetry_name ( symmetry ) bind ( C , name = \"seams_ring_symmetry_name\" ) import :: c_int , c_ptr integer ( c_int ), value :: symmetry type ( c_ptr ) :: seams_ring_symmetry_name end function !> Store points and a cell. n and box_len are size_t. box_len must be 9. function seams_system_set_atoms ( sys , xyz , n , box9 , box_len , types , ids ) & bind ( C , name = \"seams_system_set_atoms\" ) import :: c_ptr , c_double , c_size_t , c_int type ( c_ptr ), value :: sys real ( c_double ), intent ( in ) :: xyz ( * ) integer ( c_size_t ), value :: n real ( c_double ), intent ( in ) :: box9 ( * ) integer ( c_size_t ), value :: box_len type ( c_ptr ), value :: types , ids integer ( c_int ) :: seams_system_set_atoms end function !> Number of frames in a trajectory path. function seams_path_nframes ( path , nframes ) bind ( C , name = \"seams_path_nframes\" ) import :: c_char , c_size_t , c_int character ( kind = c_char ), intent ( in ) :: path ( * ) integer ( c_size_t ), intent ( out ) :: nframes integer ( c_int ) :: seams_path_nframes end function !> Number of neighbour rows. function seams_neighbours_count ( nb ) bind ( C , name = \"seams_neighbours_count\" ) import :: c_ptr , c_int type ( c_ptr ), value :: nb integer ( c_int ) :: seams_neighbours_count end function !> Copy the neighbour CSR into caller buffers. A null buffer queries the length. function seams_neighbours_copy ( nb , offsets , offsets_cap , n_offsets , cols , cols_cap , nnz ) & bind ( C , name = \"seams_neighbours_copy\" ) import :: c_ptr , c_size_t , c_int type ( c_ptr ), value :: nb , offsets , cols integer ( c_size_t ), value :: offsets_cap , cols_cap integer ( c_size_t ), intent ( out ) :: n_offsets , nnz integer ( c_int ) :: seams_neighbours_copy end function !> Local q_l and, on request, its neighbour average. function seams_ql ( sys , cutoff , typ , order_l , graph , ql , ql_len , qlbar , qlbar_len ) & bind ( C , name = \"seams_ql\" ) import :: c_ptr , c_double , c_int , c_size_t type ( c_ptr ), value :: sys , ql , qlbar real ( c_double ), value :: cutoff integer ( c_int ), value :: typ , order_l , graph integer ( c_size_t ), value :: ql_len , qlbar_len integer ( c_int ) :: seams_ql end function !> Lechner-Dellago q6-bar and the ice count above ice_cut. function seams_q6bar ( sys , cutoff , typ , ice_cut , q6bar , q6bar_len , mean , median , n_ice ) & bind ( C , name = \"seams_q6bar\" ) import :: c_ptr , c_double , c_int , c_size_t type ( c_ptr ), value :: sys , q6bar , mean , median , n_ice real ( c_double ), value :: cutoff , ice_cut integer ( c_int ), value :: typ integer ( c_size_t ), value :: q6bar_len integer ( c_int ) :: seams_q6bar end function !> Size and symmetry of each ring. Either pointer may be c_null_ptr, not both. function seams_rings_labels ( rings , sizes , symmetry ) bind ( C , name = \"seams_rings_labels\" ) import :: c_ptr , c_int type ( c_ptr ), value :: rings , sizes , symmetry integer ( c_int ) :: seams_rings_labels end function !> Per-atom cage code. len is at least the frame count stored on the handle. function seams_cages_labels ( cages , per_atom , len ) bind ( C , name = \"seams_cages_labels\" ) import :: c_ptr , c_int , c_size_t type ( c_ptr ), value :: cages integer ( c_int ), intent ( out ) :: per_atom ( * ) integer ( c_size_t ), value :: len integer ( c_int ) :: seams_cages_labels end function !> Per-atom ice shell label. A non-positive shell_rmsd selects the library ceiling. function seams_system_symmetry ( sys , shell_rmsd , labels , labels_len ) & bind ( C , name = \"seams_system_symmetry\" ) import :: c_ptr , c_double , c_int , c_size_t type ( c_ptr ), value :: sys real ( c_double ), value :: shell_rmsd integer ( c_int ), intent ( out ) :: labels ( * ) integer ( c_size_t ), value :: labels_len integer ( c_int ) :: seams_system_symmetry end function !> Planar ice front. ice(i) nonzero means atom i is ice. function seams_brine_analyse ( sys , ice , n_ice , water_type , ion_type , n_bins , axis , out ) & bind ( C , name = \"seams_brine_analyse\" ) import :: c_ptr , c_int , c_size_t type ( c_ptr ), value :: sys integer ( c_int ), intent ( in ) :: ice ( * ) integer ( c_size_t ), value :: n_ice integer ( c_int ), value :: water_type , ion_type , n_bins , axis type ( c_ptr ), intent ( out ) :: out integer ( c_int ) :: seams_brine_analyse end function !> Free a brine-front handle. NULL is ignored. subroutine seams_brine_destroy ( front ) bind ( C , name = \"seams_brine_destroy\" ) import :: c_ptr type ( c_ptr ), value :: front end subroutine !> The two planar crossings of the ice slab. Lengths are angstrom. function seams_brine_fronts ( front , z_enter , z_exit , thickness , found ) & bind ( C , name = \"seams_brine_fronts\" ) import :: c_ptr , c_int type ( c_ptr ), value :: front , z_enter , z_exit , thickness , found integer ( c_int ) :: seams_brine_fronts end function !> Molal rejection coefficient k = c_ice / c_liquid. function seams_brine_rejection ( front , c_ice , c_liquid , k , defined ) & bind ( C , name = \"seams_brine_rejection\" ) import :: c_ptr , c_int type ( c_ptr ), value :: front , c_ice , c_liquid , k , defined integer ( c_int ) :: seams_brine_rejection end function !> Concentration profile. A null column is skipped. cap is the capacity of each column. function seams_brine_profile ( front , z_mid , molality , ice_fraction , cap , n_out ) & bind ( C , name = \"seams_brine_profile\" ) import :: c_ptr , c_size_t , c_int type ( c_ptr ), value :: front , z_mid , molality , ice_fraction integer ( c_size_t ), value :: cap integer ( c_size_t ), intent ( out ) :: n_out integer ( c_int ) :: seams_brine_profile end function !> Brine pockets trapped in the ice, excluding the liquid reservoir. function seams_brine_pockets ( front , n_pockets , reservoir_waters ) & bind ( C , name = \"seams_brine_pockets\" ) import :: c_ptr , c_int type ( c_ptr ), value :: front , n_pockets , reservoir_waters integer ( c_int ) :: seams_brine_pockets end function !> Local key of one atom. Same buffer rule as seams_fingerprint_key. function seams_fingerprint_atom ( fp , index , buf , cap , n_out ) & bind ( C , name = \"seams_fingerprint_atom\" ) import :: c_ptr , c_int , c_size_t type ( c_ptr ), value :: fp , buf integer ( c_int ), value :: index integer ( c_size_t ), value :: cap integer ( c_size_t ), intent ( out ) :: n_out integer ( c_int ) :: seams_fingerprint_atom end function end interface contains !> Copy a Fortran string into a NUL-terminated C buffer. function c_chars ( text ) result ( buf ) character ( len =* ), intent ( in ) :: text character ( kind = c_char ), allocatable :: buf (:) integer :: i , n n = len_trim ( text ) allocate ( buf ( n + 1 )) do i = 1 , n buf ( i ) = text ( i : i ) end do buf ( n + 1 ) = c_null_char end function !> Read one frame. path is a Fortran string. function read_frame ( sys , path , frame , type_filter ) result ( code ) type ( c_ptr ), value :: sys character ( len =* ), intent ( in ) :: path integer , intent ( in ) :: frame , type_filter integer ( c_int ) :: code character ( kind = c_char ), allocatable :: text (:) text = c_chars ( path ) code = seams_system_read ( sys , text , int ( frame , c_int ), int ( type_filter , c_int )) end function !> Count cages of spec on the cutoff graph at 3.5 angstrom. function signature_count ( sys , spec , n_cages , n_atoms ) result ( code ) type ( c_ptr ), value :: sys character ( len =* ), intent ( in ) :: spec integer ( c_size_t ), intent ( out ) :: n_cages , n_atoms integer ( c_int ) :: code character ( kind = c_char ), allocatable :: text (:) text = c_chars ( spec ) code = seams_signature_cages ( sys , 3.5d0 , 0 , SEAMS_GRAPH_CUTOFF , text , n_cages , n_atoms ) end function !> Per-atom site kinds for spec. function site_kinds ( sys , spec , kinds , n ) result ( code ) type ( c_ptr ), value :: sys character ( len =* ), intent ( in ) :: spec integer ( c_int ), intent ( out ) :: kinds ( * ) integer ( c_size_t ), value :: n integer ( c_int ) :: code character ( kind = c_char ), allocatable :: text (:) text = c_chars ( spec ) code = seams_site_table ( sys , text , kinds , n ) end function !> Contact-pair census for spec. function pair_count ( sys , spec , n_pairs , n_cation , n_anion ) result ( code ) type ( c_ptr ), value :: sys character ( len =* ), intent ( in ) :: spec integer ( c_size_t ), intent ( out ) :: n_pairs integer ( c_int ), intent ( out ) :: n_cation , n_anion integer ( c_int ) :: code character ( kind = c_char ), allocatable :: text (:) text = c_chars ( spec ) code = seams_contact_pairs ( sys , text , n_pairs , n_cation , n_anion ) end function !> Apolar domain size for spec at 3.5 angstrom. function domain_size ( sys , spec , n_subset , largest , percolation ) result ( code ) type ( c_ptr ), value :: sys character ( len =* ), intent ( in ) :: spec integer ( c_int ), intent ( out ) :: n_subset , largest real ( c_double ), intent ( out ) :: percolation integer ( c_int ) :: code character ( kind = c_char ), allocatable :: text (:) text = c_chars ( spec ) code = seams_domains ( sys , 3.5d0 , text , 0 , n_subset , largest , percolation ) end function end module seams_c","tags":"","url":"sourcefile/seams_c.f90.html"},{"title":"seams.f90 – d-SEAMS","text":"Source Code ! Copyright (c) d-SEAMS developers ! !> Fortran API for d-SEAMS. !! !! A program `use`s this module. Handles are derived types. The last !! finalizer, or an explicit `close`, destroys the C object. Assignment !! shares the handle. Coordinates are `real(seams_real)` with shape !! `(3, n)`, x/y/z down the first index, which is the same memory order !! as the C array. A missing `stat` and a missing `errmsg` make a !! failed call `error stop` with the library message. Present `stat` !! receives the `seams.h` code and `errmsg` receives the detail. module seams use seams_kinds , only : seams_int , seams_real use seams_support , only : handle_box , handle_share , handle_release implicit none private !> Working precision. It is `real64` and it matches C `double`. public :: seams_real !> Integer kind for labels, counts, and `stat`. It is `int32`. public :: seams_int !> The call succeeded. integer ( seams_int ), public , parameter :: SEAMS_OK = 0_seams_int !> A required pointer is null. integer ( seams_int ), public , parameter :: SEAMS_ERR_NULL = 1_seams_int !> A number is outside the accepted range. integer ( seams_int ), public , parameter :: SEAMS_ERR_RANGE = 2_seams_int !> The cell is missing or has no volume. integer ( seams_int ), public , parameter :: SEAMS_ERR_BOX = 3_seams_int !> A caller argument is the wrong shape. integer ( seams_int ), public , parameter :: SEAMS_ERR_ARG = 4_seams_int !> The handle has no frame yet. integer ( seams_int ), public , parameter :: SEAMS_ERR_STATE = 5_seams_int !> An allocation failed. integer ( seams_int ), public , parameter :: SEAMS_ERR_NOMEM = 6_seams_int !> The library hit an internal failure. integer ( seams_int ), public , parameter :: SEAMS_ERR_INTERNAL = 7_seams_int !> Published CHILL+ rule. Inclusive c_ij edges. integer ( seams_int ), public , parameter :: SEAMS_CHILL_PUBLISHED = 0_seams_int !> OVITO CHILL+ rule. Open c_ij edges. integer ( seams_int ), public , parameter :: SEAMS_CHILL_OVITO = 1_seams_int !> Pairs inside the cutoff. integer ( seams_int ), public , parameter :: SEAMS_GRAPH_CUTOFF = 0_seams_int !> Mutual four-nearest neighbours. integer ( seams_int ), public , parameter :: SEAMS_GRAPH_MUTUAL = 1_seams_int !> Cage graph of mutual seeds and union completions. integer ( seams_int ), public , parameter :: SEAMS_GRAPH_SEEDED = 2_seams_int !> CHILL cubic ice. Population counts use this index plus one. integer ( seams_int ), public , parameter :: SEAMS_LABEL_CUBIC = 0_seams_int !> CHILL hexagonal ice. integer ( seams_int ), public , parameter :: SEAMS_LABEL_HEXAGONAL = 1_seams_int !> CHILL liquid water. integer ( seams_int ), public , parameter :: SEAMS_LABEL_WATER = 2_seams_int !> CHILL interfacial ice. integer ( seams_int ), public , parameter :: SEAMS_LABEL_INTERFACIAL = 3_seams_int !> CHILL clathrate. The population count is `counts(5)`. integer ( seams_int ), public , parameter :: SEAMS_LABEL_CLATHRATE = 4_seams_int !> CHILL interfacial clathrate. integer ( seams_int ), public , parameter :: SEAMS_LABEL_INTERCLATHRATE = 5_seams_int !> CHILL atom that matched no class. integer ( seams_int ), public , parameter :: SEAMS_LABEL_UNCLASSIFIED = 6_seams_int !> CHILL reclassified cubic ice. integer ( seams_int ), public , parameter :: SEAMS_LABEL_RECUBIC = 7_seams_int !> CHILL reclassified hexagonal ice. integer ( seams_int ), public , parameter :: SEAMS_LABEL_REHEX = 8_seams_int !> Atom in neither cage. integer ( seams_int ), public , parameter :: SEAMS_CAGE_WATER = 0_seams_int !> Hexagonal cage only. integer ( seams_int ), public , parameter :: SEAMS_CAGE_HEX = 1_seams_int !> Double-diamond cage only. integer ( seams_int ), public , parameter :: SEAMS_CAGE_CUBIC = 2_seams_int !> Both cages. integer ( seams_int ), public , parameter :: SEAMS_CAGE_BOTH = 3_seams_int !> One frame. The finalizer frees the C frame. 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 !> Cutoff or neighbour graph. `offsets` and `columns` allocate copies. type , public :: seams_neighbours private type ( handle_box ), pointer :: box => null () contains procedure , public :: count => neighbour_count procedure , public :: offsets => neighbour_offsets procedure , public :: columns => neighbour_columns procedure , public :: close => neighbour_close final :: neighbour_final end type seams_neighbours !> Primitive rings. `histogram` is 0-based: index k is rings of size k. type , public :: seams_rings private type ( handle_box ), pointer :: box => null () integer ( seams_int ) :: max_depth = 0_seams_int contains procedure , public :: count => ring_count procedure , public :: histogram => ring_histogram procedure , public :: fraction => ring_fraction procedure , public :: sizes => ring_sizes procedure , public :: symmetry => ring_symmetry procedure , public :: vertices => ring_vertices procedure , public :: close => ring_close final :: ring_final end type seams_rings !> Hexagonal and double-diamond membership. type , public :: seams_cages private type ( handle_box ), pointer :: box => null () integer ( seams_int ) :: natoms = 0_seams_int contains procedure , public :: counts => cage_counts procedure , public :: labels => cage_labels procedure , public :: close => cage_close final :: cage_final end type seams_cages !> Topological fingerprint. type , public :: seams_topo private type ( handle_box ), pointer :: box => null () contains procedure , public :: key => topo_key procedure , public :: atom_key => topo_atom_key procedure , public :: rings => topo_rings procedure , public :: close => topo_close final :: topo_final end type seams_topo !> Planar ice/brine front. type , public :: seams_brine private type ( handle_box ), pointer :: box => null () contains procedure , public :: fronts => brine_fronts procedure , public :: rejection => brine_rejection procedure , public :: profile => brine_profile procedure , public :: pockets => brine_pockets procedure , public :: close => brine_close final :: brine_final end type seams_brine !> Empty frame. The caller owns the result. public :: new_frame !> Library version text. public :: version_text !> Set the OpenMP width. Zero restores the default. public :: set_num_threads !> Width the next analysis will request. public :: num_threads !> Name of a CHILL label code. public :: label_name !> Name of a status code. public :: status_text !> Number of frames in a trajectory path. public :: path_nframes public :: assignment ( = ) interface assignment ( = ) module procedure frame_assign module procedure neighbour_assign module procedure ring_assign module procedure cage_assign module procedure topo_assign module procedure brine_assign end interface interface module function new_frame ( stat , errmsg ) result ( self ) type ( seams_frame ) :: self integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end function module function version_text () result ( text ) character ( len = :), allocatable :: text end function module subroutine set_num_threads ( n , stat , errmsg ) integer ( seams_int ), intent ( in ) :: n integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module function num_threads () result ( n ) integer ( seams_int ) :: n end function module function label_name ( code ) result ( text ) integer ( seams_int ), intent ( in ) :: code character ( len = :), allocatable :: text end function module function status_text ( code ) result ( text ) integer ( seams_int ), intent ( in ) :: code character ( len = :), allocatable :: text end function module function path_nframes ( path , stat , errmsg ) result ( nframes ) character ( len =* ), intent ( in ) :: path integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg integer ( seams_int ) :: nframes end function !> `xyz` has shape `(3, n)`. Lengths are angstrom. The origin defaults to zero. module subroutine frame_set_ortho ( self , xyz , lx , ly , lz , ox , oy , oz , types , ids , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), intent ( in ), contiguous :: xyz (:, :) real ( seams_real ), intent ( in ) :: lx , ly , lz real ( seams_real ), intent ( in ), optional :: ox , oy , oz integer ( seams_int ), intent ( in ), optional , contiguous :: types (:), ids (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `box` is ox, oy, oz, lx, ly, lz, xy, xz, yz. module subroutine frame_set_frame ( self , xyz , box , types , ids , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), intent ( in ), contiguous :: xyz (:, :) real ( seams_real ), intent ( in ) :: box ( 9 ) integer ( seams_int ), intent ( in ), optional , contiguous :: types (:), ids (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `frame` is 1-based. A negative `type_filter` keeps every atom. Zero guesses oxygen. module subroutine frame_read ( self , path , frame , type_filter , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self character ( len =* ), intent ( in ) :: path integer ( seams_int ), intent ( in ), optional :: frame , type_filter integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module function frame_count ( self ) result ( n ) class ( seams_frame ), intent ( in ) :: self integer ( seams_int ) :: n end function module subroutine frame_chill ( self , labels , counts , cutoff , typ , graph , rule , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), allocatable , intent ( out ) :: labels (:) integer ( seams_int ), allocatable , intent ( out ), optional :: counts (:) real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , graph , rule integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine frame_chill_plus ( self , labels , counts , cutoff , typ , graph , rule , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), allocatable , intent ( out ) :: labels (:) integer ( seams_int ), allocatable , intent ( out ), optional :: counts (:) real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , graph , rule integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine frame_q4q6 ( self , q4 , q6 , cutoff , typ , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), allocatable , intent ( out ) :: q4 (:), q6 (:) real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `order_l` is 3, 4, 6, 8, or 12. `qlbar` is omitted to skip the average. module subroutine frame_ql ( self , order_l , ql , qlbar , cutoff , typ , graph , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), intent ( in ) :: order_l real ( seams_real ), allocatable , intent ( out ) :: ql (:) real ( seams_real ), allocatable , intent ( out ), optional :: qlbar (:) real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , graph integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine frame_steinhardt ( self , order_l , ql , qlbar , cutoff , typ , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), intent ( in ) :: order_l real ( seams_real ), allocatable , intent ( out ) :: ql (:) real ( seams_real ), allocatable , intent ( out ), optional :: qlbar (:) real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `ice_cut` defaults to 0.36. At least one of the outputs is required. module subroutine frame_q6bar ( self , q6bar , mean , median , n_ice , cutoff , typ , ice_cut , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), allocatable , intent ( out ), optional :: q6bar (:) real ( seams_real ), intent ( out ), optional :: mean , median integer ( seams_int ), intent ( out ), optional :: n_ice real ( seams_real ), intent ( in ), optional :: cutoff , ice_cut integer ( seams_int ), intent ( in ), optional :: typ integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module function frame_neighbours ( self , cutoff , typ , graph , stat , errmsg ) result ( list ) class ( seams_frame ), intent ( inout ) :: self type ( seams_neighbours ) :: list real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , graph integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end function !> `mutual` defaults to true. module function frame_knn ( self , k , cutoff , typ , mutual , stat , errmsg ) result ( list ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), intent ( in ) :: k type ( seams_neighbours ) :: list real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ logical , intent ( in ), optional :: mutual integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end function !> `max_depth` defaults to 6 and must be from 3 through 12. module function frame_rings ( self , cutoff , typ , graph , max_depth , stat , errmsg ) result ( rings ) class ( seams_frame ), intent ( inout ) :: self type ( seams_rings ) :: rings real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , graph , max_depth integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end function !> `graph` defaults to the seeded cage graph. `k` defaults to 4. module function frame_cages ( self , cutoff , typ , graph , k , complete , stat , errmsg ) result ( cages ) class ( seams_frame ), intent ( inout ) :: self type ( seams_cages ) :: cages real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , graph , k logical , intent ( in ), optional :: complete integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end function !> `spec` is a census such as \"512\" or a name such as \"hc\". module subroutine frame_signature ( self , spec , n_cages , n_atoms , cutoff , typ , graph , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self character ( len =* ), intent ( in ) :: spec integer ( seams_int ), intent ( out ) :: n_cages , n_atoms real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , graph integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine frame_rdf ( self , r , g , volume , rmax , bins , type_i , type_j , count , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), allocatable , intent ( out ) :: r (:), g (:) real ( seams_real ), intent ( out ), optional :: volume real ( seams_real ), intent ( in ), optional :: rmax integer ( seams_int ), intent ( in ), optional :: bins , type_i , type_j integer ( seams_int ), allocatable , intent ( out ), optional :: count (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine frame_running_cn ( self , r , cn , rmax , bins , type_i , type_j , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), allocatable , intent ( out ) :: r (:), cn (:) real ( seams_real ), intent ( in ), optional :: rmax integer ( seams_int ), intent ( in ), optional :: bins , type_i , type_j integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module function frame_coordination ( self , rmax , bins , type_i , type_j , stat , errmsg ) result ( cn ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), intent ( in ), optional :: rmax integer ( seams_int ), intent ( in ), optional :: bins , type_i , type_j integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg real ( seams_real ) :: cn end function module function frame_hbonds ( self , cutoff , oxygen_type , hydrogen_type , dist , angle , stat , errmsg ) & result ( n_bonds ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), intent ( in ), optional :: cutoff , dist , angle integer ( seams_int ), intent ( in ), optional :: oxygen_type , hydrogen_type integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg integer ( seams_int ) :: n_bonds end function !> `axis` is 0, 1, or 2. It defaults to 2. module subroutine frame_density ( self , z , rho , typ , bins , axis , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self real ( seams_real ), allocatable , intent ( out ) :: z (:), rho (:) integer ( seams_int ), intent ( in ), optional :: typ , bins , axis integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `colors` partitions keys by atom type. `colours` is the deprecated !> spelling of that keyword. Giving both different values is an error. module function frame_fingerprint ( self , cutoff , typ , k , graph , hops , colors , colours , stat , errmsg ) & result ( fp ) class ( seams_frame ), intent ( inout ) :: self type ( seams_topo ) :: fp real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , k , graph , hops logical , intent ( in ), optional :: colors , colours integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end function module subroutine frame_contact_pairs ( self , spec , n_pairs , n_cation , n_anion , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self character ( len =* ), intent ( in ) :: spec integer ( seams_int ), intent ( out ) :: n_pairs , n_cation , n_anion integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `polar` false is the apolar subset. module subroutine frame_domains ( self , spec , n_subset , largest , percolation , cutoff , polar , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self character ( len =* ), intent ( in ) :: spec integer ( seams_int ), intent ( out ) :: n_subset , largest real ( seams_real ), intent ( out ) :: percolation real ( seams_real ), intent ( in ), optional :: cutoff logical , intent ( in ), optional :: polar integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine frame_prisms ( self , perfect , imperfect , cutoff , typ , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), allocatable , intent ( out ) :: perfect (:), imperfect (:) real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine frame_monolayer ( self , counts , sheet_area , cutoff , typ , max_depth , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), allocatable , intent ( out ) :: counts (:) real ( seams_real ), intent ( in ) :: sheet_area real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , max_depth integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine frame_site_kinds ( self , spec , kinds , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self character ( len =* ), intent ( in ) :: spec integer ( seams_int ), allocatable , intent ( out ) :: kinds (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> A non-positive `shell_rmsd` selects the library ceiling. module subroutine frame_symmetry ( self , labels , shell_rmsd , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), allocatable , intent ( out ) :: labels (:) real ( seams_real ), intent ( in ), optional :: shell_rmsd integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `ice(i)` nonzero marks atom i as ice. `axis` defaults to 2. `n_bins` 0 selects 20. module function frame_brine ( self , ice , water_type , ion_type , n_bins , axis , stat , errmsg ) result ( front ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), intent ( in ), contiguous :: ice (:) type ( seams_brine ) :: front integer ( seams_int ), intent ( in ), optional :: water_type , ion_type , n_bins , axis integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end function module function neighbour_count ( self ) result ( n ) class ( seams_neighbours ), intent ( in ) :: self integer ( seams_int ) :: n end function module subroutine neighbour_offsets ( self , offsets , stat , errmsg ) class ( seams_neighbours ), intent ( in ) :: self integer ( seams_int ), allocatable , intent ( out ) :: offsets (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine neighbour_columns ( self , columns , stat , errmsg ) class ( seams_neighbours ), intent ( in ) :: self integer ( seams_int ), allocatable , intent ( out ) :: columns (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module function ring_count ( self ) result ( n ) class ( seams_rings ), intent ( in ) :: self integer ( seams_int ) :: n end function module subroutine ring_histogram ( self , counts , stat , errmsg ) class ( seams_rings ), intent ( in ) :: self integer ( seams_int ), allocatable , intent ( out ) :: counts (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `size` 0 counts atoms that sit on any ring. module subroutine ring_fraction ( self , size , fraction , stat , errmsg ) class ( seams_rings ), intent ( in ) :: self integer ( seams_int ), intent ( in ) :: size real ( seams_real ), intent ( out ) :: fraction integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine ring_sizes ( self , sizes , stat , errmsg ) class ( seams_rings ), intent ( in ) :: self integer ( seams_int ), allocatable , intent ( out ) :: sizes (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine ring_symmetry ( self , codes , stat , errmsg ) class ( seams_rings ), intent ( in ) :: self integer ( seams_int ), allocatable , intent ( out ) :: codes (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `index` is 1-based. module subroutine ring_vertices ( self , index , atoms , stat , errmsg ) class ( seams_rings ), intent ( in ) :: self integer ( seams_int ), intent ( in ) :: index integer ( seams_int ), allocatable , intent ( out ) :: atoms (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine cage_counts ( self , n_hex , n_cubic , n_water , n_both , stat , errmsg ) class ( seams_cages ), intent ( in ) :: self integer ( seams_int ), intent ( out ) :: n_hex , n_cubic , n_water , n_both integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine cage_labels ( self , labels , stat , errmsg ) class ( seams_cages ), intent ( in ) :: self integer ( seams_int ), allocatable , intent ( out ) :: labels (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine topo_key ( self , key , stat , errmsg ) class ( seams_topo ), intent ( in ) :: self character ( len = :), allocatable , intent ( out ) :: key integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine !> `index` is 1-based. module subroutine topo_atom_key ( self , index , key , stat , errmsg ) class ( seams_topo ), intent ( in ) :: self integer ( seams_int ), intent ( in ) :: index character ( len = :), allocatable , intent ( out ) :: key integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine topo_rings ( self , counts , stat , errmsg ) class ( seams_topo ), intent ( in ) :: self integer ( seams_int ), allocatable , intent ( out ) :: counts (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine brine_fronts ( self , z_enter , z_exit , thickness , found , stat , errmsg ) class ( seams_brine ), intent ( in ) :: self real ( seams_real ), intent ( out ), optional :: z_enter , z_exit , thickness integer ( seams_int ), intent ( out ), optional :: found integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine brine_rejection ( self , c_ice , c_liquid , k , defined , stat , errmsg ) class ( seams_brine ), intent ( in ) :: self real ( seams_real ), intent ( out ), optional :: c_ice , c_liquid , k integer ( seams_int ), intent ( out ), optional :: defined integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine brine_profile ( self , z_mid , molality , ice_fraction , stat , errmsg ) class ( seams_brine ), intent ( in ) :: self real ( seams_real ), allocatable , intent ( out ) :: z_mid (:), molality (:), ice_fraction (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine module subroutine brine_pockets ( self , n_pockets , reservoir_waters , stat , errmsg ) class ( seams_brine ), intent ( in ) :: self integer ( seams_int ), intent ( out ) :: n_pockets , reservoir_waters integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg end subroutine end interface contains !> Share the C frame. The last finalizer destroys it. subroutine frame_assign ( lhs , rhs ) type ( seams_frame ), intent ( inout ) :: lhs type ( seams_frame ), intent ( in ) :: rhs call handle_share ( lhs % box , rhs % box ) end subroutine frame_assign !> Release this owner's reference to the frame. subroutine frame_final ( self ) type ( seams_frame ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine frame_final !> Release this owner's reference to the frame. subroutine frame_close ( self ) class ( seams_frame ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine frame_close !> Share the neighbour list. subroutine neighbour_assign ( lhs , rhs ) type ( seams_neighbours ), intent ( inout ) :: lhs type ( seams_neighbours ), intent ( in ) :: rhs call handle_share ( lhs % box , rhs % box ) end subroutine neighbour_assign !> Release this owner's reference to the neighbour list. subroutine neighbour_final ( self ) type ( seams_neighbours ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine neighbour_final !> Release this owner's reference to the neighbour list. subroutine neighbour_close ( self ) class ( seams_neighbours ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine neighbour_close !> Share the ring set and its maximum depth. subroutine ring_assign ( lhs , rhs ) type ( seams_rings ), intent ( inout ) :: lhs type ( seams_rings ), intent ( in ) :: rhs call handle_share ( lhs % box , rhs % box ) if ( associated ( rhs % box )) then lhs % max_depth = rhs % max_depth else lhs % max_depth = 0_seams_int end if end subroutine ring_assign !> Release this owner's reference to the ring set. subroutine ring_final ( self ) type ( seams_rings ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine ring_final !> Release this owner's reference to the ring set. subroutine ring_close ( self ) class ( seams_rings ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine ring_close !> Share the cage set and the atom count it was built for. subroutine cage_assign ( lhs , rhs ) type ( seams_cages ), intent ( inout ) :: lhs type ( seams_cages ), intent ( in ) :: rhs call handle_share ( lhs % box , rhs % box ) if ( associated ( rhs % box )) then lhs % natoms = rhs % natoms else lhs % natoms = 0_seams_int end if end subroutine cage_assign !> Release this owner's reference to the cage set. subroutine cage_final ( self ) type ( seams_cages ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine cage_final !> Release this owner's reference to the cage set. subroutine cage_close ( self ) class ( seams_cages ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine cage_close !> Share the fingerprint. subroutine topo_assign ( lhs , rhs ) type ( seams_topo ), intent ( inout ) :: lhs type ( seams_topo ), intent ( in ) :: rhs call handle_share ( lhs % box , rhs % box ) end subroutine topo_assign !> Release this owner's reference to the fingerprint. subroutine topo_final ( self ) type ( seams_topo ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine topo_final !> Release this owner's reference to the fingerprint. subroutine topo_close ( self ) class ( seams_topo ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine topo_close !> Share the brine front. subroutine brine_assign ( lhs , rhs ) type ( seams_brine ), intent ( inout ) :: lhs type ( seams_brine ), intent ( in ) :: rhs call handle_share ( lhs % box , rhs % box ) end subroutine brine_assign !> Release this owner's reference to the brine front. subroutine brine_final ( self ) type ( seams_brine ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine brine_final !> Release this owner's reference to the brine front. subroutine brine_close ( self ) class ( seams_brine ), intent ( inout ) :: self call handle_release ( self % box ) end subroutine brine_close end module seams","tags":"","url":"sourcefile/seams.f90.html"},{"title":"seams_methods.f90 – d-SEAMS","text":"Source Code ! Copyright (c) d-SEAMS developers submodule ( seams ) seams_methods use seams_kinds , only : c_ptr , c_null_ptr , c_associated , c_loc , c_int , c_double , c_size_t , c_char use seams_c , only : seams_version_string , seams_label_name , seams_status_string , & seams_set_num_threads , seams_get_num_threads , seams_system_create , & seams_system_set_ortho , seams_system_set_frame , seams_system_read , seams_system_count , & seams_chill , seams_chill_plus , seams_q4q6 , seams_ql , seams_steinhardt , seams_q6bar , & seams_neighbours_build , seams_neighbours_knn , seams_neighbours_count , seams_neighbours_copy , & seams_rings_find , seams_rings_count , seams_rings_histogram , seams_rings_fraction , & seams_rings_labels , seams_rings_vertices , c_seams_cages => seams_cages , seams_cages_counts , seams_cages_labels , & seams_signature_cages , seams_rdf , seams_running_cn , seams_coordination , seams_hbonds , & seams_density_axis , seams_fingerprint , seams_fingerprint_key , seams_fingerprint_atom , & seams_fingerprint_rings , seams_contact_pairs , seams_domains , seams_prisms , seams_monolayer , & seams_site_table , seams_system_symmetry , seams_brine_analyse , seams_brine_fronts , & seams_brine_rejection , seams_brine_profile , seams_brine_pockets , seams_path_nframes use seams_support , only : handle_acquire , handle_release , handle_share , handle_get , & c_to_f , f_to_c , check_status , copy_key , kind_system , kind_neighbours , kind_rings , & kind_cages , kind_topo , kind_brine implicit none contains function opt_real ( value , fallback ) result ( out ) real ( seams_real ), intent ( in ), optional :: value real ( seams_real ), intent ( in ) :: fallback real ( seams_real ) :: out if ( present ( value )) then out = value else out = fallback end if end function opt_real function opt_int ( value , fallback ) result ( out ) integer ( seams_int ), intent ( in ), optional :: value integer ( seams_int ), intent ( in ) :: fallback integer ( c_int ) :: out if ( present ( value )) then out = int ( value , c_int ) else out = int ( fallback , c_int ) end if end function opt_int function opt_flag ( value , fallback ) result ( out ) logical , intent ( in ), optional :: value logical , intent ( in ) :: fallback integer ( c_int ) :: out logical :: chosen if ( present ( value )) then chosen = value else chosen = fallback end if if ( chosen ) then out = 1_c_int else out = 0_c_int end if end function opt_flag function open_raw ( box , stat , errmsg , what ) result ( raw ) type ( handle_box ), pointer , intent ( in ) :: box integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg character ( len =* ), intent ( in ) :: what type ( c_ptr ) :: raw raw = handle_get ( box ) if (. not . c_associated ( raw )) then call check_status ( int ( SEAMS_ERR_NULL , c_int ), c_null_ptr , stat , errmsg , trim ( what ) // \" is closed\" ) end if end function open_raw function pack_optional ( n , values , buf , ptr , stat , errmsg , what ) result ( ok ) integer , intent ( in ) :: n integer ( seams_int ), intent ( in ), optional :: values (:) integer ( c_int ), allocatable , target , intent ( out ) :: buf (:) type ( c_ptr ), intent ( out ) :: ptr integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg character ( len =* ), intent ( in ) :: what logical :: ok ok = . true . ptr = c_null_ptr if (. not . present ( values )) return if ( size ( values ) /= n ) then ok = . false . call check_status ( int ( SEAMS_ERR_ARG , c_int ), c_null_ptr , stat , errmsg , trim ( what ) // \" length is not the atom count\" ) return end if allocate ( buf ( n )) buf = int ( values , c_int ) ptr = c_loc ( buf ) end function pack_optional function shape_ok ( xyz , stat , errmsg ) result ( ok ) real ( seams_real ), intent ( in ) :: xyz (:, :) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg logical :: ok ok = size ( xyz , 1 ) == 3 if (. not . ok ) then call check_status ( int ( SEAMS_ERR_ARG , c_int ), c_null_ptr , stat , errmsg , \"xyz must have shape (3, n)\" ) end if end function shape_ok subroutine take_key ( raw , index , key , stat , errmsg ) type ( c_ptr ), intent ( in ) :: raw integer ( c_int ), intent ( in ) :: index character ( len = :), allocatable , intent ( out ) :: key integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg integer ( c_size_t ) :: n , cap integer ( c_int ) :: code character ( kind = c_char ), allocatable , target :: buf (:) if ( index < 0_c_int ) then code = seams_fingerprint_key ( raw , c_null_ptr , 0_c_size_t , n ) else code = seams_fingerprint_atom ( raw , index , c_null_ptr , 0_c_size_t , n ) end if if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) key = \"\" return end if allocate ( buf ( int ( n ) + 1 )) cap = n + 1_c_size_t if ( index < 0_c_int ) then code = seams_fingerprint_key ( raw , c_loc ( buf ), cap , n ) else code = seams_fingerprint_atom ( raw , index , c_loc ( buf ), cap , n ) end if if ( code /= SEAMS_OK ) then deallocate ( buf ) call check_status ( code , raw , stat , errmsg ) key = \"\" return end if key = copy_key ( buf , int ( n )) ! c_loc on this buffer keeps gfortran from freeing it on return. deallocate ( buf ) call check_status ( code , raw , stat , errmsg ) end subroutine take_key module procedure new_frame type ( c_ptr ) :: raw raw = seams_system_create () if (. not . c_associated ( raw )) then call check_status ( int ( SEAMS_ERR_NOMEM , c_int ), c_null_ptr , stat , errmsg , \"out of memory\" ) return end if call handle_acquire ( self % box , raw , kind_system ) call check_status ( 0_c_int , raw , stat , errmsg ) end procedure new_frame module procedure version_text text = c_to_f ( seams_version_string ()) end procedure version_text module procedure set_num_threads integer ( c_int ) :: code code = seams_set_num_threads ( int ( n , c_int )) call check_status ( code , c_null_ptr , stat , errmsg ) end procedure set_num_threads module procedure num_threads n = int ( seams_get_num_threads (), seams_int ) end procedure num_threads module procedure label_name text = c_to_f ( seams_label_name ( int ( code , c_int ))) end procedure label_name module procedure status_text text = c_to_f ( seams_status_string ( int ( code , c_int ))) end procedure status_text module procedure path_nframes character ( kind = c_char ), allocatable , target :: text (:) integer ( c_size_t ) :: count integer ( c_int ) :: code nframes = 0_seams_int text = f_to_c ( path ) code = seams_path_nframes ( text , count ) if ( code /= SEAMS_OK ) then call check_status ( code , c_null_ptr , stat , errmsg ) return end if nframes = int ( count , seams_int ) call check_status ( code , c_null_ptr , stat , errmsg ) end procedure path_nframes module procedure frame_set_ortho type ( c_ptr ) :: raw , types_ptr , ids_ptr integer ( c_int ), allocatable , target :: types_buf (:), ids_buf (:) integer ( c_int ) :: code , n real ( seams_real ), allocatable :: flat (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return if (. not . shape_ok ( xyz , stat , errmsg )) return n = int ( size ( xyz , 2 ), c_int ) flat = reshape ( xyz , [ 3 * size ( xyz , 2 )]) if (. not . pack_optional ( size ( xyz , 2 ), types , types_buf , types_ptr , stat , errmsg , \"types\" )) return if (. not . pack_optional ( size ( xyz , 2 ), ids , ids_buf , ids_ptr , stat , errmsg , \"ids\" )) return code = seams_system_set_ortho ( raw , flat , n , opt_real ( ox , 0.0_seams_real ), & opt_real ( oy , 0.0_seams_real ), opt_real ( oz , 0.0_seams_real ), lx , ly , lz , types_ptr , ids_ptr ) call check_status ( code , raw , stat , errmsg ) end procedure frame_set_ortho module procedure frame_set_frame type ( c_ptr ) :: raw , types_ptr , ids_ptr integer ( c_int ), allocatable , target :: types_buf (:), ids_buf (:) integer ( c_int ) :: code , n real ( seams_real ), allocatable :: flat (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return if (. not . shape_ok ( xyz , stat , errmsg )) return n = int ( size ( xyz , 2 ), c_int ) flat = reshape ( xyz , [ 3 * size ( xyz , 2 )]) if (. not . pack_optional ( size ( xyz , 2 ), types , types_buf , types_ptr , stat , errmsg , \"types\" )) return if (. not . pack_optional ( size ( xyz , 2 ), ids , ids_buf , ids_ptr , stat , errmsg , \"ids\" )) return code = seams_system_set_frame ( raw , flat , n , box , types_ptr , ids_ptr ) call check_status ( code , raw , stat , errmsg ) end procedure frame_set_frame module procedure frame_read type ( c_ptr ) :: raw character ( kind = c_char ), allocatable , target :: text (:) integer ( c_int ) :: code raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return text = f_to_c ( path ) code = seams_system_read ( raw , text , opt_int ( frame , 1_seams_int ), opt_int ( type_filter , - 1_seams_int )) call check_status ( code , raw , stat , errmsg ) end procedure frame_read module procedure frame_count type ( c_ptr ) :: raw raw = handle_get ( self % box ) if (. not . c_associated ( raw )) then n = 0_seams_int else n = int ( seams_system_count ( raw ), seams_int ) end if end procedure frame_count subroutine chill_common ( self , labels , counts , cutoff , typ , graph , rule , which , stat , errmsg ) class ( seams_frame ), intent ( inout ) :: self integer ( seams_int ), allocatable , intent ( out ) :: labels (:) integer ( seams_int ), allocatable , intent ( out ), optional :: counts (:) real ( seams_real ), intent ( in ), optional :: cutoff integer ( seams_int ), intent ( in ), optional :: typ , graph , rule integer , intent ( in ) :: which integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg type ( c_ptr ) :: raw integer ( c_int ) :: code , n integer ( seams_int ), allocatable , target :: tally (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return n = seams_system_count ( raw ) if ( n <= 0_c_int ) then call check_status ( int ( SEAMS_ERR_STATE , c_int ), raw , stat , errmsg , \"frame has no atoms\" ) return end if allocate ( labels ( n ), tally ( 9 )) if ( which == 0 ) then code = seams_chill ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & opt_int ( graph , SEAMS_GRAPH_CUTOFF ), opt_int ( rule , SEAMS_CHILL_PUBLISHED ), labels , & int ( n , c_size_t ), tally ) else code = seams_chill_plus ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & opt_int ( graph , SEAMS_GRAPH_CUTOFF ), opt_int ( rule , SEAMS_CHILL_PUBLISHED ), labels , tally ) end if if ( code /= SEAMS_OK ) then deallocate ( labels ) call check_status ( code , raw , stat , errmsg ) return end if if ( present ( counts )) counts = tally call check_status ( code , raw , stat , errmsg ) end subroutine chill_common module procedure frame_chill call chill_common ( self , labels , counts , cutoff , typ , graph , rule , 0 , stat , errmsg ) end procedure frame_chill module procedure frame_chill_plus call chill_common ( self , labels , counts , cutoff , typ , graph , rule , 1 , stat , errmsg ) end procedure frame_chill_plus module procedure frame_q4q6 type ( c_ptr ) :: raw integer ( c_int ) :: code , n raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return n = seams_system_count ( raw ) allocate ( q4 ( n ), q6 ( n )) code = seams_q4q6 ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), q4 , q6 ) if ( code /= SEAMS_OK ) then deallocate ( q4 , q6 ) call check_status ( code , raw , stat , errmsg ) return end if call check_status ( code , raw , stat , errmsg ) end procedure frame_q4q6 module procedure frame_ql type ( c_ptr ) :: raw , bar_ptr integer ( c_int ) :: code , n integer ( c_size_t ) :: bar_len real ( seams_real ), allocatable , target :: qbuf (:), barbuf (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return n = seams_system_count ( raw ) allocate ( qbuf ( n )) bar_ptr = c_null_ptr bar_len = 0_c_size_t if ( present ( qlbar )) then allocate ( barbuf ( n )) bar_ptr = c_loc ( barbuf ) bar_len = int ( n , c_size_t ) end if code = seams_ql ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & int ( order_l , c_int ), opt_int ( graph , SEAMS_GRAPH_CUTOFF ), c_loc ( qbuf ), int ( n , c_size_t ), & bar_ptr , bar_len ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if ql = qbuf if ( present ( qlbar )) qlbar = barbuf call check_status ( code , raw , stat , errmsg ) end procedure frame_ql module procedure frame_steinhardt type ( c_ptr ) :: raw integer ( c_int ) :: code , n real ( seams_real ), allocatable :: bar (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return n = seams_system_count ( raw ) allocate ( ql ( n ), bar ( n )) code = seams_steinhardt ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & int ( order_l , c_int ), ql , int ( n , c_size_t ), bar , int ( n , c_size_t )) if ( code /= SEAMS_OK ) then deallocate ( ql ) call check_status ( code , raw , stat , errmsg ) return end if if ( present ( qlbar )) qlbar = bar call check_status ( code , raw , stat , errmsg ) end procedure frame_steinhardt module procedure frame_q6bar type ( c_ptr ) :: raw , qptr , mean_ptr , median_ptr , ice_ptr integer ( c_int ) :: code , n integer ( c_size_t ) :: qlen real ( seams_real ), allocatable , target :: qbuf (:) real ( seams_real ), target :: mean_b , median_b integer ( c_int ), target :: ice_b raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return if (. not . ( present ( q6bar ) . or . present ( mean ) . or . present ( median ) . or . present ( n_ice ))) then call check_status ( int ( SEAMS_ERR_ARG , c_int ), raw , stat , errmsg , \"q6bar needs one output\" ) return end if n = seams_system_count ( raw ) qptr = c_null_ptr mean_ptr = c_null_ptr median_ptr = c_null_ptr ice_ptr = c_null_ptr qlen = 0_c_size_t if ( present ( q6bar )) then allocate ( qbuf ( n )) qptr = c_loc ( qbuf ) qlen = int ( n , c_size_t ) end if if ( present ( mean )) mean_ptr = c_loc ( mean_b ) if ( present ( median )) median_ptr = c_loc ( median_b ) if ( present ( n_ice )) ice_ptr = c_loc ( ice_b ) code = seams_q6bar ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & opt_real ( ice_cut , 0.36_seams_real ), qptr , qlen , mean_ptr , median_ptr , ice_ptr ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if if ( present ( q6bar )) call move_alloc ( qbuf , q6bar ) if ( present ( mean )) mean = mean_b if ( present ( median )) median = median_b if ( present ( n_ice )) n_ice = int ( ice_b , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure frame_q6bar module procedure frame_neighbours type ( c_ptr ) :: raw , out integer ( c_int ) :: code raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = seams_neighbours_build ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & opt_int ( graph , SEAMS_GRAPH_CUTOFF ), out ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if call handle_acquire ( list % box , out , kind_neighbours ) call check_status ( code , raw , stat , errmsg ) end procedure frame_neighbours module procedure frame_knn type ( c_ptr ) :: raw , out integer ( c_int ) :: code raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = seams_neighbours_knn ( raw , int ( k , c_int ), opt_real ( cutoff , 3.5_seams_real ), & opt_int ( typ , 0_seams_int ), opt_flag ( mutual , . true .), out ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if call handle_acquire ( list % box , out , kind_neighbours ) call check_status ( code , raw , stat , errmsg ) end procedure frame_knn module procedure frame_rings type ( c_ptr ) :: raw , out integer ( c_int ) :: code , depth raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return depth = opt_int ( max_depth , 6_seams_int ) code = seams_rings_find ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & opt_int ( graph , SEAMS_GRAPH_CUTOFF ), depth , out ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if call handle_acquire ( rings % box , out , kind_rings ) rings % max_depth = int ( depth , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure frame_rings module procedure frame_cages type ( c_ptr ) :: raw , out integer ( c_int ) :: code raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = c_seams_cages ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & opt_int ( graph , SEAMS_GRAPH_SEEDED ), opt_int ( k , 4_seams_int ), opt_flag ( complete , . false .), out ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if call handle_acquire ( cages % box , out , kind_cages ) cages % natoms = int ( seams_system_count ( raw ), seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure frame_cages module procedure frame_signature type ( c_ptr ) :: raw character ( kind = c_char ), allocatable , target :: text (:) integer ( c_size_t ) :: cages_n , atoms_n integer ( c_int ) :: code n_cages = 0_seams_int n_atoms = 0_seams_int raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return text = f_to_c ( spec ) code = seams_signature_cages ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & opt_int ( graph , SEAMS_GRAPH_CUTOFF ), text , cages_n , atoms_n ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if n_cages = int ( cages_n , seams_int ) n_atoms = int ( atoms_n , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure frame_signature module procedure frame_rdf type ( c_ptr ) :: raw , count_ptr , volume_ptr integer ( c_size_t ) :: n , cap integer ( c_int ) :: code real ( seams_real ), allocatable , target :: rbuf (:), gbuf (:) integer ( seams_int ), allocatable , target :: cbuf (:) real ( seams_real ), target :: volume_b raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = seams_rdf ( raw , opt_real ( rmax , 6.0_seams_real ), opt_int ( bins , 0_seams_int ), & opt_int ( type_i , 0_seams_int ), opt_int ( type_j , 0_seams_int ), c_null_ptr , c_null_ptr , & c_null_ptr , 0_c_size_t , n , c_null_ptr ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if allocate ( rbuf ( n ), gbuf ( n )) count_ptr = c_null_ptr if ( present ( count )) then allocate ( cbuf ( n )) count_ptr = c_loc ( cbuf ) end if volume_ptr = c_null_ptr if ( present ( volume )) volume_ptr = c_loc ( volume_b ) cap = n code = seams_rdf ( raw , opt_real ( rmax , 6.0_seams_real ), opt_int ( bins , 0_seams_int ), & opt_int ( type_i , 0_seams_int ), opt_int ( type_j , 0_seams_int ), c_loc ( rbuf ), c_loc ( gbuf ), & count_ptr , cap , n , volume_ptr ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if r = rbuf g = gbuf if ( present ( count )) count = cbuf if ( present ( volume )) volume = volume_b call check_status ( code , raw , stat , errmsg ) end procedure frame_rdf module procedure frame_running_cn type ( c_ptr ) :: raw integer ( c_size_t ) :: n , cap integer ( c_int ) :: code real ( seams_real ), allocatable , target :: rbuf (:), cbuf (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = seams_running_cn ( raw , opt_real ( rmax , 6.0_seams_real ), opt_int ( bins , 0_seams_int ), & opt_int ( type_i , 0_seams_int ), opt_int ( type_j , 0_seams_int ), c_null_ptr , c_null_ptr , & 0_c_size_t , n ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if allocate ( rbuf ( n ), cbuf ( n )) cap = n code = seams_running_cn ( raw , opt_real ( rmax , 6.0_seams_real ), opt_int ( bins , 0_seams_int ), & opt_int ( type_i , 0_seams_int ), opt_int ( type_j , 0_seams_int ), c_loc ( rbuf ), c_loc ( cbuf ), cap , n ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if r = rbuf cn = cbuf call check_status ( code , raw , stat , errmsg ) end procedure frame_running_cn module procedure frame_coordination type ( c_ptr ) :: raw integer ( c_int ) :: code real ( c_double ), target :: value cn = 0.0_seams_real raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = seams_coordination ( raw , opt_real ( rmax , 3.5_seams_real ), opt_int ( bins , 0_seams_int ), & opt_int ( type_i , 0_seams_int ), opt_int ( type_j , 0_seams_int ), value ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if cn = value call check_status ( code , raw , stat , errmsg ) end procedure frame_coordination module procedure frame_hbonds type ( c_ptr ) :: raw integer ( c_int ) :: code , bonds n_bonds = 0_seams_int raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = seams_hbonds ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( oxygen_type , 1_seams_int ), & opt_int ( hydrogen_type , 2_seams_int ), opt_real ( dist , 2.42_seams_real ), & opt_real ( angle , 3 0.0_seams_real ), bonds ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if n_bonds = int ( bonds , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure frame_hbonds module procedure frame_density type ( c_ptr ) :: raw integer ( c_size_t ) :: n , cap integer ( c_int ) :: code real ( seams_real ), allocatable , target :: zbuf (:), rbuf (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = seams_density_axis ( raw , opt_int ( typ , 0_seams_int ), opt_int ( bins , 0_seams_int ), & opt_int ( axis , 2_seams_int ), c_null_ptr , c_null_ptr , 0_c_size_t , n ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if allocate ( zbuf ( n ), rbuf ( n )) cap = n code = seams_density_axis ( raw , opt_int ( typ , 0_seams_int ), opt_int ( bins , 0_seams_int ), & opt_int ( axis , 2_seams_int ), c_loc ( zbuf ), c_loc ( rbuf ), cap , n ) if ( code /= SEAMS_OK ) then deallocate ( zbuf , rbuf ) call check_status ( code , raw , stat , errmsg ) return end if z = zbuf rho = rbuf deallocate ( zbuf , rbuf ) call check_status ( code , raw , stat , errmsg ) end procedure frame_density module procedure frame_fingerprint type ( c_ptr ) :: raw , out integer ( c_int ) :: code , color_flag logical :: colored if ( present ( colors ) . and . present ( colours )) then if ( colors . neqv . colours ) then call check_status ( int ( SEAMS_ERR_ARG , c_int ), c_null_ptr , stat , errmsg , & \"colors and colours disagree\" ) return end if end if colored = . false . if ( present ( colors )) colored = colors if ( present ( colours )) colored = colours color_flag = merge ( 1_c_int , 0_c_int , colored ) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return code = seams_fingerprint ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & opt_int ( k , 4_seams_int ), opt_int ( graph , SEAMS_GRAPH_CUTOFF ), opt_int ( hops , 2_seams_int ), & color_flag , out ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if call handle_acquire ( fp % box , out , kind_topo ) call check_status ( code , raw , stat , errmsg ) end procedure frame_fingerprint module procedure frame_contact_pairs type ( c_ptr ) :: raw character ( kind = c_char ), allocatable , target :: text (:) integer ( c_size_t ) :: pairs integer ( c_int ) :: code , cations , anions n_pairs = 0_seams_int n_cation = 0_seams_int n_anion = 0_seams_int raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return text = f_to_c ( spec ) code = seams_contact_pairs ( raw , text , pairs , cations , anions ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if n_pairs = int ( pairs , seams_int ) n_cation = int ( cations , seams_int ) n_anion = int ( anions , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure frame_contact_pairs module procedure frame_domains type ( c_ptr ) :: raw character ( kind = c_char ), allocatable , target :: text (:) integer ( c_int ) :: code , subset_n , largest_n real ( c_double ), target :: perc n_subset = 0_seams_int largest = 0_seams_int percolation = 0.0_seams_real raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return text = f_to_c ( spec ) code = seams_domains ( raw , opt_real ( cutoff , 3.5_seams_real ), text , opt_flag ( polar , . false .), & subset_n , largest_n , perc ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if n_subset = int ( subset_n , seams_int ) largest = int ( largest_n , seams_int ) percolation = perc call check_status ( code , raw , stat , errmsg ) end procedure frame_domains module procedure frame_prisms type ( c_ptr ) :: raw integer ( c_int ) :: code integer ( seams_int ), allocatable , target :: perfect_b (:), imperfect_b (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return allocate ( perfect_b ( 0 : 6 ), imperfect_b ( 0 : 6 )) code = seams_prisms ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & perfect_b , imperfect_b , 7_c_size_t ) if ( code /= SEAMS_OK ) then deallocate ( perfect_b , imperfect_b ) call check_status ( code , raw , stat , errmsg ) return end if perfect = perfect_b imperfect = imperfect_b deallocate ( perfect_b , imperfect_b ) call check_status ( code , raw , stat , errmsg ) end procedure frame_prisms module procedure frame_monolayer type ( c_ptr ) :: raw integer ( c_int ) :: code , depth integer ( seams_int ), allocatable , target :: buf (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return depth = opt_int ( max_depth , 6_seams_int ) allocate ( buf ( 0 : depth )) buf = 0_seams_int code = seams_monolayer ( raw , opt_real ( cutoff , 3.5_seams_real ), opt_int ( typ , 0_seams_int ), & depth , sheet_area , buf , int ( size ( buf ), c_size_t )) if ( code /= SEAMS_OK ) then deallocate ( buf ) call check_status ( code , raw , stat , errmsg ) return end if counts = buf deallocate ( buf ) call check_status ( code , raw , stat , errmsg ) end procedure frame_monolayer module procedure frame_site_kinds type ( c_ptr ) :: raw character ( kind = c_char ), allocatable , target :: text (:) integer ( c_int ) :: code , n raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return n = seams_system_count ( raw ) allocate ( kinds ( n )) text = f_to_c ( spec ) code = seams_site_table ( raw , text , kinds , int ( n , c_size_t )) if ( code /= SEAMS_OK ) then deallocate ( kinds ) call check_status ( code , raw , stat , errmsg ) return end if call check_status ( code , raw , stat , errmsg ) end procedure frame_site_kinds module procedure frame_symmetry type ( c_ptr ) :: raw integer ( c_int ) :: code , n raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return n = seams_system_count ( raw ) allocate ( labels ( n )) code = seams_system_symmetry ( raw , opt_real ( shell_rmsd , 0.0_seams_real ), labels , int ( n , c_size_t )) if ( code /= SEAMS_OK ) then deallocate ( labels ) call check_status ( code , raw , stat , errmsg ) return end if call check_status ( code , raw , stat , errmsg ) end procedure frame_symmetry module procedure frame_brine type ( c_ptr ) :: raw , out integer ( c_int ) :: code integer ( c_int ), allocatable , target :: flags (:) raw = open_raw ( self % box , stat , errmsg , \"frame\" ) if (. not . c_associated ( raw )) return if ( size ( ice ) /= seams_system_count ( raw )) then call check_status ( int ( SEAMS_ERR_ARG , c_int ), raw , stat , errmsg , \"ice length is not the atom count\" ) return end if flags = int ( ice , c_int ) code = seams_brine_analyse ( raw , flags , int ( size ( flags ), c_size_t ), opt_int ( water_type , 0_seams_int ), & opt_int ( ion_type , 0_seams_int ), opt_int ( n_bins , 0_seams_int ), opt_int ( axis , 2_seams_int ), out ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if call handle_acquire ( front % box , out , kind_brine ) call check_status ( code , raw , stat , errmsg ) end procedure frame_brine module procedure neighbour_count type ( c_ptr ) :: raw raw = handle_get ( self % box ) if (. not . c_associated ( raw )) then n = 0_seams_int else n = int ( seams_neighbours_count ( raw ), seams_int ) end if end procedure neighbour_count subroutine neighbour_column ( self , which , values , stat , errmsg ) class ( seams_neighbours ), intent ( in ) :: self integer , intent ( in ) :: which integer ( seams_int ), allocatable , intent ( out ) :: values (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg type ( c_ptr ) :: raw , off_ptr , col_ptr integer ( c_size_t ) :: n_off , nnz , off_cap , col_cap integer ( c_int ) :: code integer ( c_int ), allocatable , target :: off_buf (:), col_buf (:) integer :: i raw = open_raw ( self % box , stat , errmsg , \"neighbours\" ) if (. not . c_associated ( raw )) return code = seams_neighbours_copy ( raw , c_null_ptr , 0_c_size_t , n_off , c_null_ptr , 0_c_size_t , nnz ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if off_ptr = c_null_ptr col_ptr = c_null_ptr if ( which == 0 ) then allocate ( off_buf ( n_off )) off_ptr = c_loc ( off_buf ) else allocate ( col_buf ( nnz )) col_ptr = c_loc ( col_buf ) end if off_cap = n_off col_cap = nnz code = seams_neighbours_copy ( raw , off_ptr , off_cap , n_off , col_ptr , col_cap , nnz ) if ( code /= SEAMS_OK ) then if ( allocated ( off_buf )) deallocate ( off_buf ) if ( allocated ( col_buf )) deallocate ( col_buf ) call check_status ( code , raw , stat , errmsg ) return end if ! int() on the whole array builds a temporary that LeakSanitizer ! still sees after the assignment. Copy one element at a time. if ( which == 0 ) then allocate ( values ( size ( off_buf ))) do i = 1 , size ( off_buf ) values ( i ) = int ( off_buf ( i ), seams_int ) end do else allocate ( values ( size ( col_buf ))) do i = 1 , size ( col_buf ) values ( i ) = int ( col_buf ( i ), seams_int ) end do end if if ( allocated ( off_buf )) deallocate ( off_buf ) if ( allocated ( col_buf )) deallocate ( col_buf ) call check_status ( code , raw , stat , errmsg ) end subroutine neighbour_column module procedure neighbour_offsets call neighbour_column ( self , 0 , offsets , stat , errmsg ) end procedure neighbour_offsets module procedure neighbour_columns call neighbour_column ( self , 1 , columns , stat , errmsg ) end procedure neighbour_columns module procedure ring_count type ( c_ptr ) :: raw raw = handle_get ( self % box ) if (. not . c_associated ( raw )) then n = 0_seams_int else n = int ( seams_rings_count ( raw ), seams_int ) end if end procedure ring_count module procedure ring_histogram type ( c_ptr ) :: raw integer ( c_int ) :: code integer ( seams_int ), allocatable , target :: buf (:) raw = open_raw ( self % box , stat , errmsg , \"rings\" ) if (. not . c_associated ( raw )) return allocate ( buf ( 0 : self % max_depth )) buf = 0_seams_int code = seams_rings_histogram ( raw , buf , int ( size ( buf ), c_int )) if ( code /= SEAMS_OK ) then deallocate ( buf ) call check_status ( code , raw , stat , errmsg ) return end if counts = buf deallocate ( buf ) call check_status ( code , raw , stat , errmsg ) end procedure ring_histogram module procedure ring_fraction type ( c_ptr ) :: raw integer ( c_int ) :: code real ( c_double ), target :: value fraction = 0.0_seams_real raw = open_raw ( self % box , stat , errmsg , \"rings\" ) if (. not . c_associated ( raw )) return code = seams_rings_fraction ( raw , int ( size , c_int ), value ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if fraction = value call check_status ( code , raw , stat , errmsg ) end procedure ring_fraction subroutine ring_one ( self , which , values , stat , errmsg ) class ( seams_rings ), intent ( in ) :: self integer , intent ( in ) :: which integer ( seams_int ), allocatable , intent ( out ) :: values (:) integer ( seams_int ), intent ( out ), optional :: stat character ( len = :), allocatable , intent ( out ), optional :: errmsg type ( c_ptr ) :: raw , size_ptr , sym_ptr integer ( c_int ) :: code , n integer ( c_int ), allocatable , target :: size_buf (:), sym_buf (:) raw = open_raw ( self % box , stat , errmsg , \"rings\" ) if (. not . c_associated ( raw )) return n = seams_rings_count ( raw ) size_ptr = c_null_ptr sym_ptr = c_null_ptr if ( which == 0 ) then allocate ( size_buf ( n )) size_ptr = c_loc ( size_buf ) else allocate ( sym_buf ( n )) sym_ptr = c_loc ( sym_buf ) end if code = seams_rings_labels ( raw , size_ptr , sym_ptr ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if if ( which == 0 ) then values = int ( size_buf , seams_int ) else values = int ( sym_buf , seams_int ) end if call check_status ( code , raw , stat , errmsg ) end subroutine ring_one module procedure ring_sizes call ring_one ( self , 0 , sizes , stat , errmsg ) end procedure ring_sizes module procedure ring_symmetry call ring_one ( self , 1 , codes , stat , errmsg ) end procedure ring_symmetry module procedure ring_vertices type ( c_ptr ) :: raw integer ( c_int ) :: code integer ( c_size_t ) :: n integer ( c_int ), allocatable , target :: buf (:) raw = open_raw ( self % box , stat , errmsg , \"rings\" ) if (. not . c_associated ( raw )) return allocate ( buf ( 12 )) code = seams_rings_vertices ( raw , int ( index - 1 , c_int ), buf , 12_c_size_t , n ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if atoms = int ( buf ( 1 : int ( n )), seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure ring_vertices module procedure cage_counts type ( c_ptr ) :: raw integer ( c_int ) :: code , hex , cubic , water , both n_hex = 0_seams_int n_cubic = 0_seams_int n_water = 0_seams_int n_both = 0_seams_int raw = open_raw ( self % box , stat , errmsg , \"cages\" ) if (. not . c_associated ( raw )) return code = seams_cages_counts ( raw , hex , cubic , water , both ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if n_hex = int ( hex , seams_int ) n_cubic = int ( cubic , seams_int ) n_water = int ( water , seams_int ) n_both = int ( both , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure cage_counts module procedure cage_labels type ( c_ptr ) :: raw integer ( c_int ) :: code raw = open_raw ( self % box , stat , errmsg , \"cages\" ) if (. not . c_associated ( raw )) return allocate ( labels ( self % natoms )) code = seams_cages_labels ( raw , labels , int ( self % natoms , c_size_t )) if ( code /= SEAMS_OK ) then deallocate ( labels ) call check_status ( code , raw , stat , errmsg ) return end if call check_status ( code , raw , stat , errmsg ) end procedure cage_labels module procedure topo_key type ( c_ptr ) :: raw raw = open_raw ( self % box , stat , errmsg , \"fingerprint\" ) if (. not . c_associated ( raw )) return call take_key ( raw , - 1_c_int , key , stat , errmsg ) end procedure topo_key module procedure topo_atom_key type ( c_ptr ) :: raw raw = open_raw ( self % box , stat , errmsg , \"fingerprint\" ) if (. not . c_associated ( raw )) return call take_key ( raw , int ( index - 1 , c_int ), key , stat , errmsg ) end procedure topo_atom_key module procedure topo_rings type ( c_ptr ) :: raw integer ( c_int ) :: code integer ( seams_int ), allocatable , target :: buf (:) raw = open_raw ( self % box , stat , errmsg , \"fingerprint\" ) if (. not . c_associated ( raw )) return allocate ( buf ( 0 : 12 )) buf = 0_seams_int code = seams_fingerprint_rings ( raw , buf , int ( size ( buf ), c_size_t )) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if counts = buf call check_status ( code , raw , stat , errmsg ) end procedure topo_rings module procedure brine_fronts type ( c_ptr ) :: raw , enter_ptr , exit_ptr , thick_ptr , found_ptr integer ( c_int ) :: code real ( c_double ), target :: enter_b , exit_b , thick_b integer ( c_int ), target :: found_b raw = open_raw ( self % box , stat , errmsg , \"brine\" ) if (. not . c_associated ( raw )) return if (. not . ( present ( z_enter ) . or . present ( z_exit ) . or . present ( thickness ) . or . present ( found ))) then call check_status ( int ( SEAMS_ERR_ARG , c_int ), raw , stat , errmsg , \"fronts needs one output\" ) return end if enter_ptr = c_null_ptr exit_ptr = c_null_ptr thick_ptr = c_null_ptr found_ptr = c_null_ptr if ( present ( z_enter )) enter_ptr = c_loc ( enter_b ) if ( present ( z_exit )) exit_ptr = c_loc ( exit_b ) if ( present ( thickness )) thick_ptr = c_loc ( thick_b ) if ( present ( found )) found_ptr = c_loc ( found_b ) code = seams_brine_fronts ( raw , enter_ptr , exit_ptr , thick_ptr , found_ptr ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if if ( present ( z_enter )) z_enter = enter_b if ( present ( z_exit )) z_exit = exit_b if ( present ( thickness )) thickness = thick_b if ( present ( found )) found = int ( found_b , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure brine_fronts module procedure brine_rejection type ( c_ptr ) :: raw , ice_ptr , liquid_ptr , k_ptr , defined_ptr integer ( c_int ) :: code real ( c_double ), target :: ice_b , liquid_b , k_b integer ( c_int ), target :: defined_b raw = open_raw ( self % box , stat , errmsg , \"brine\" ) if (. not . c_associated ( raw )) return if (. not . ( present ( c_ice ) . or . present ( c_liquid ) . or . present ( k ) . or . present ( defined ))) then call check_status ( int ( SEAMS_ERR_ARG , c_int ), raw , stat , errmsg , \"rejection needs one output\" ) return end if ice_ptr = c_null_ptr liquid_ptr = c_null_ptr k_ptr = c_null_ptr defined_ptr = c_null_ptr if ( present ( c_ice )) ice_ptr = c_loc ( ice_b ) if ( present ( c_liquid )) liquid_ptr = c_loc ( liquid_b ) if ( present ( k )) k_ptr = c_loc ( k_b ) if ( present ( defined )) defined_ptr = c_loc ( defined_b ) code = seams_brine_rejection ( raw , ice_ptr , liquid_ptr , k_ptr , defined_ptr ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if if ( present ( c_ice )) c_ice = ice_b if ( present ( c_liquid )) c_liquid = liquid_b if ( present ( k )) k = k_b if ( present ( defined )) defined = int ( defined_b , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure brine_rejection module procedure brine_profile type ( c_ptr ) :: raw integer ( c_size_t ) :: n , cap integer ( c_int ) :: code real ( seams_real ), allocatable , target :: zbuf (:), mbuf (:), fbuf (:) raw = open_raw ( self % box , stat , errmsg , \"brine\" ) if (. not . c_associated ( raw )) return code = seams_brine_profile ( raw , c_null_ptr , c_null_ptr , c_null_ptr , 0_c_size_t , n ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if allocate ( zbuf ( n ), mbuf ( n ), fbuf ( n )) cap = n code = seams_brine_profile ( raw , c_loc ( zbuf ), c_loc ( mbuf ), c_loc ( fbuf ), cap , n ) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if z_mid = zbuf molality = mbuf ice_fraction = fbuf call check_status ( code , raw , stat , errmsg ) end procedure brine_profile module procedure brine_pockets type ( c_ptr ) :: raw integer ( c_int ), target :: code , pockets , waters n_pockets = 0_seams_int reservoir_waters = 0_seams_int raw = open_raw ( self % box , stat , errmsg , \"brine\" ) if (. not . c_associated ( raw )) return code = seams_brine_pockets ( raw , c_loc ( pockets ), c_loc ( waters )) if ( code /= SEAMS_OK ) then call check_status ( code , raw , stat , errmsg ) return end if n_pockets = int ( pockets , seams_int ) reservoir_waters = int ( waters , seams_int ) call check_status ( code , raw , stat , errmsg ) end procedure brine_pockets end submodule seams_methods","tags":"","url":"sourcefile/seams_methods.f90.html"},{"title":"seams_kinds.f90 – d-SEAMS","text":"Source Code ! Copyright (c) d-SEAMS developers ! !> Numeric kinds for the Fortran API. !! !! Kinds come from `iso_fortran_env`. The C entry points hand !! `double` and `int` buffers across `iso_c_binding`, so `seams_real` !! must be `c_double` and `seams_int` must be `c_int`. A mismatch would !! silently reinterpret memory. The assertions divide by zero in a !! constant expression, which a conforming compiler rejects. module seams_kinds use , intrinsic :: iso_fortran_env , only : real64 , int32 use , intrinsic :: iso_c_binding , only : c_double , c_int , c_ptr , c_null_ptr , & c_size_t , c_char , c_loc , c_f_pointer , c_associated , c_null_char implicit none private !> Working precision for coordinates, cutoffs, and order parameters. integer , parameter , public :: seams_real = real64 !> Default integer kind for counts, labels, and the stat argument. integer , parameter , public :: seams_int = int32 public :: c_double , c_int , c_ptr , c_null_ptr , c_size_t , c_char public :: c_loc , c_f_pointer , c_associated , c_null_char integer , parameter , private :: assert_real_is_c_double = 1 / merge ( 1 , 0 , seams_real == c_double ) integer , parameter , private :: assert_int_is_c_int = 1 / merge ( 1 , 0 , seams_int == c_int ) end module seams_kinds","tags":"","url":"sourcefile/seams_kinds.f90.html"}]}