TABLE OF CONTENTS


ABINIT/m_abiimages [ Modules ]

[ Top ] [ Modules ]

NAME

 m_abiimages

FUNCTION

 This module contains definition one type to store the atomic
 configuration of a set of images, and some methods to
 create, manipulate and destroy the defined type


 Datatypes :

 * abiimages     : Atomic configuration of a set of images



 Subroutines :

 * abiimages_ini
 * abiimages_fin
 * abiimages_bcast
 * abiimages_compare

COPYRIGHT

 Copyright (C) 2001-2024 ABINIT group (XG)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .

SOURCE

33 #if defined HAVE_CONFIG_H
34 #include "config.h"
35 #endif
36 
37 #include "abi_common.h"
38 
39 module m_abiimages
40 
41  use m_abicore
42  use defs_basis
43  use m_abihist
44  use m_xmpi
45 
46  implicit none
47 
48  private
49 
50  public ::  abiimages
51  public ::  abiimages_ini
52  public ::  abiimages_fin
53 
54 
55 !----------------------------------------------------------------------

m_abiimages/abiimages [ Types ]

[ Top ] [ m_abiimages ] [ Types ]

NAME

 abiimages

FUNCTION

 The type abiimages contains the configurations of N images,
 The history of those images are store using N abihist objects
 And the present configuration use a single abihist object

 It contains:
  img_present: An abihist object with the present values
               of the N images
  img_past:    An N-array of abihist objects containing the
               old values of the N images

SOURCE

75  type abiimages
76 
77 ! scalars
78 ! Index of the last element on all records
79     integer :: irecord
80 ! Maximun size of the historical records
81     integer :: nrecord
82 ! Number of images
83     integer :: nimage
84 ! Number of images
85     integer :: natom
86 
87 ! Atomic configurations of N images
88     type(abihist)         :: img_present
89 ! N historic records for N images
90     type(abihist),allocatable :: img_past(:)
91 
92 
93  end type abiimages

m_abiimages/abiimages_fin [ Functions ]

[ Top ] [ m_abiimages ] [ Functions ]

NAME

 abiimages_fin

FUNCTION

 Deallocate all the pointers in a abiimages

INPUTS

OUTPUT

SIDE EFFECTS

  images <type(abiimages)> = The abiimages to deallocate

NOTES

SOURCE

165 subroutine abiimages_fin(images)
166 
167  implicit none
168 
169 !Arguments ------------------------------------
170  type(abiimages),intent(inout) :: images
171 !Local variables-------------------------------
172  integer :: i
173 
174 ! ***************************************************************
175 
176  call abihist_fin(images%img_present)
177 
178 !Nullify the past
179  do i=1,images%natom
180     call abihist_fin(images%img_past(i))
181  end do
182 
183  ABI_FREE(images%img_past)
184 
185 end subroutine abiimages_fin

m_abiimages/abiimages_ini [ Functions ]

[ Top ] [ m_abiimages ] [ Functions ]

NAME

 abiimages_ini

FUNCTION

 Initialize the abiimages type

INPUTS

  natom = Number of atoms per unitary cell for each image
  mxhist = Maximal number of records store per image

OUTPUT

  abiimages <type(abiimages)> = The abiimages to initialize

SOURCE

115 subroutine abiimages_ini(images,nimages,natom,nrecord)
116 
117  implicit none
118 
119 !Arguments ------------------------------------
120  type(abiimages) ,intent(out) :: images
121  integer         ,intent(in)  :: natom,nimages
122  integer         ,intent(in)  :: nrecord
123 !Local variables-------------------------------
124  integer :: i
125 
126 ! ***************************************************************
127 
128 !Initialize indexes
129  images%irecord=1
130  images%nrecord=nrecord
131 
132 !Allocate the present
133  call abihist_ini(images%img_present,natom,nimages)
134 
135 !Allocate the past
136  ABI_MALLOC(images%img_past,(nimages))
137 
138  do i=1,nimages
139     call abihist_ini(images%img_past(i),natom,nrecord)
140  end do
141 
142 end subroutine abiimages_ini