TABLE OF CONTENTS


ABINIT/chkrprimd [ Functions ]

[ Top ] [ Functions ]

NAME

 chkrprimd

FUNCTION

 Test if {rprim,acell,rprimd}
 It means that rprimd can be reconstructed
 from the rprim and acell
 Output a message if is not the case

COPYRIGHT

 Copyright (C) 1998-2017 ABINIT group (DCA, XG, GMR)
 This file is distributed under the terms of the
 GNU General Public License, see ~abinit/COPYING
 or http://www.gnu.org/copyleft/gpl.txt .
 For the initials of contributors,
 see ~abinit/doc/developers/contributors.txt .

INPUTS

OUTPUT

  (only writing)

PARENTS

CHILDREN

SOURCE

32 #if defined HAVE_CONFIG_H
33 #include "config.h"
34 #endif
35 
36 #include "abi_common.h"
37 
38 
39 subroutine chkrprimd(acell,rprim,rprimd,iout)
40 
41  use defs_basis
42  use m_profiling_abi
43 
44 !This section has been created automatically by the script Abilint (TD).
45 !Do not modify the following lines by hand.
46 #undef ABI_FUNC
47 #define ABI_FUNC 'chkrprimd'
48 !End of the abilint section
49 
50 implicit none
51 
52 !Arguments ------------------------------------
53 !scalars
54 integer,intent(in) :: iout
55 !arrays
56 real(dp),intent(in) :: rprim(3,3)
57 real(dp),intent(in) :: rprimd(3,3)
58 real(dp),intent(in) :: acell(3)
59 
60 !Local variables-------------------------------
61 !scalars
62 integer :: ii,jj
63 !arrays
64 real(dp) :: rprimd_test(3,3)
65 logical :: equal
66 
67 ! ***********************************************************
68 
69 !###########################################################
70 !### 1. Compute rprimd from rprim and acell
71  do ii=1,3
72    do jj=1,3
73      rprimd_test(ii,jj)=rprim(ii,jj)*acell(jj)
74    end do
75  end do
76 
77 
78 !###########################################################
79 !### 2. Compare rprimd and rprimd_test
80 
81  equal=.TRUE.
82  do ii=1,3
83    do jj=1,3
84      if (abs(rprimd_test(ii,jj)-rprimd(ii,jj))>1.E-12) then
85        equal=.FALSE.
86      end if
87    end do
88  end do
89 
90  if (equal)then
91    write(iout,*) 'chkrprimd: rprimd is consistent'
92  else
93    write(iout,*) 'chkrprimd: rprimd is NOT consistent ERROR'
94  end if
95 
96 end subroutine chkrprimd