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-2018 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

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

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

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

PARENTS

CHILDREN

      abihist_fin

NOTES

SOURCE

183 subroutine abiimages_fin(images)
184 
185 
186 !This section has been created automatically by the script Abilint (TD).
187 !Do not modify the following lines by hand.
188 #undef ABI_FUNC
189 #define ABI_FUNC 'abiimages_fin'
190 !End of the abilint section
191 
192  implicit none
193 
194 !Arguments ------------------------------------
195  type(abiimages),intent(inout) :: images
196 !Local variables-------------------------------
197  integer :: i
198 
199 ! ***************************************************************
200 
201  call abihist_fin(images%img_present)
202 
203 !Nullify the past
204  do i=1,images%natom
205     call abihist_fin(images%img_past(i))
206  end do
207 
208  ABI_DATATYPE_DEALLOCATE(images%img_past)
209 
210 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

PARENTS

CHILDREN

      abihist_fin

SOURCE

121 subroutine abiimages_ini(images,nimages,natom,nrecord)
122 
123 
124 !This section has been created automatically by the script Abilint (TD).
125 !Do not modify the following lines by hand.
126 #undef ABI_FUNC
127 #define ABI_FUNC 'abiimages_ini'
128 !End of the abilint section
129 
130  implicit none
131 
132 !Arguments ------------------------------------
133  type(abiimages) ,intent(out) :: images
134  integer         ,intent(in)  :: natom,nimages
135  integer         ,intent(in)  :: nrecord
136 !Local variables-------------------------------
137  integer :: i
138 
139 ! ***************************************************************
140 
141 !Initialize indexes
142  images%irecord=1
143  images%nrecord=nrecord
144 
145 !Allocate the present
146  call abihist_ini(images%img_present,natom,nimages)
147 
148 !Allocate the past
149  ABI_DATATYPE_ALLOCATE(images%img_past,(nimages))
150 
151  do i=1,nimages
152     call abihist_ini(images%img_past(i),natom,nrecord)
153  end do
154 
155 end subroutine abiimages_ini