quantum-espresso/flib
giannozz bf4bfe222f General cleanup of intrinsic functions:
conversion to real    => DBLE
(including real part of a complex number)
conversion to complex => CMPLX
complex conjugate     => CONJG
imaginary part        => AIMAG

All functions are uppercase.
CMPLX is preprocessed by f_defs.h and performs an explicit cast:
#define CMPLX(a,b)  cmplx(a,b,kind=DP)
This implies that 1) f_defs.h must be included whenever a CMPLX is present,
2) CMPLX should stay in a single line, 3) DP must be defined.

All occurrences of real, float, dreal, dfloat, dconjg, dimag, dcmplx
removed - please do not reintroduce any of them.
Tested only with ifc7 and g95 - beware unintended side effects

Maybe not the best solution (explicit casts everywhere would be better)
but it can be easily changed with a script if the need arises.
The following code might be used to test for possible trouble:

program test_intrinsic

  implicit none
  integer, parameter :: dp = selected_real_kind(14,200)
  real (kind=dp) :: a = 0.123456789012345_dp
  real (kind=dp) :: b = 0.987654321098765_dp
  complex (kind=dp) :: c = ( 0.123456789012345_dp, 0.987654321098765_dp)

  print *, '      A = ', a
  print *, ' DBLE(A)= ', DBLE(a)
  print *, '      C = ', c
  print *, 'CONJG(C)= ', CONJG(c)
  print *, 'DBLE(c),AIMAG(C)  = ', DBLE(c), AIMAG(c)
  print *, 'CMPLX(A,B,kind=dp)= ', CMPLX( a, b, kind=dp)

end program test_intrinsic

Note that CMPLX and REAL without a cast yield single precision numbers on
ifc7 and g95 !!!


git-svn-id: http://qeforge.qe-forge.org/svn/q-e/trunk/espresso@2133 c92efa57-630b-4861-b058-cf58834340f0
2005-08-26 17:44:42 +00:00
..
Makefile - makefile update after yesterday changes 2005-08-09 07:34:23 +00:00
atomic_number.f90 Added missing copyright notice 2005-03-21 14:26:31 +00:00
avrec.f90 last end subroutine --> end subroutine name [Gerardo] 2005-05-18 14:02:51 +00:00
bachel.f90 - makefile update after yesterday changes 2005-08-09 07:34:23 +00:00
blas.f missing ZSYRK and ZSYR2K subroutines added to the local copy of blas 2004-09-01 08:56:36 +00:00
blockset.f90 O-sesame 2003-01-19 21:58:50 +00:00
capital.f90 Functions "capital" and "matches" taken out of module "parser" 2004-05-19 16:56:56 +00:00
date_and_tim.f90 - date_and_tim moved to flib and used by all code, 2004-03-28 21:36:28 +00:00
dlamch.f O-sesame 2003-01-19 21:58:50 +00:00
dost.f90 dos.f90 updated. It should now work also in the non collinear case. 2005-06-07 11:21:07 +00:00
dylmr2.f90 Machine-dependent definitions are now contained in two different files (both in /include): 2004-06-25 17:25:37 +00:00
eispack.f90 last end subroutine --> end subroutine name [Gerardo] 2005-05-18 14:02:51 +00:00
erf.f90 added support for g95 2004-05-06 13:06:16 +00:00
error.f90 The new subroutine flush_unit() is used everywhere. C.S. 2005-05-25 02:58:35 +00:00
flush_unit.f90 Added a new wrapper to the flush routine. Hereafter to flush a unit use: 2005-05-25 02:56:34 +00:00
functionals.f90 - common xc and gga functionals subroutines for all code PW/CP/FPMD 2004-12-31 11:14:32 +00:00
gridsetup.f90 last end --> end subroutine [Gerardo] 2005-05-12 15:32:15 +00:00
hangup.f90 last end --> end subroutine [Gerardo] 2005-05-12 15:32:15 +00:00
iceil.f90 more end --> end function [Gerardo] 2005-05-17 17:07:57 +00:00
iglocal.f90 Added missing copyright notice 2005-03-21 14:26:31 +00:00
ilcm.f O-sesame 2003-01-19 21:58:50 +00:00
indxg2l.f Support for SGI Altix (Martin Hilgeman) - see cpdocs/ChangeLog 2004-02-26 16:26:48 +00:00
indxg2p.f Support for SGI Altix (Martin Hilgeman) - see cpdocs/ChangeLog 2004-02-26 16:26:48 +00:00
indxl2g.f NEC doesn't like ampersand at column 73 in f77 files ... (Guido) 2005-04-12 07:38:19 +00:00
infog1l.f NEC doesn't like ampersand at column 73 in f77 files ... (Guido) 2005-04-12 07:38:19 +00:00
infog2l.f NEC doesn't like ampersand at column 73 in f77 files ... (Guido) 2005-04-12 07:38:19 +00:00
inpfile.f90 oops... 2005-06-22 13:56:55 +00:00
invmat.f90 Machine-dependent definitions are now contained in two different files (both in /include): 2004-06-25 17:25:37 +00:00
lapack.f Missing lapack routines added 2005-01-31 10:05:59 +00:00
lapack_atlas.f Added missing lapack for Mac OS + Atlas (Pascal Thibadeau) 2004-10-26 08:22:15 +00:00
lapack_ibm.f - unit 6 replaced by stdout in CPV 2003-11-09 10:42:50 +00:00
lapack_mkl.f Oops, zgesvd added where it is needed (together with many other routines) 2004-02-11 10:10:08 +00:00
lapack_t3e.f More T3E fixes 2004-06-25 14:23:03 +00:00
latgen.f90 Extensive module cleanup: DP moved from wrong place (parameters) to the 2004-01-23 15:08:03 +00:00
linpack.f90 last end --> end subroutine [Gerardo] 2005-05-12 15:32:15 +00:00
localdim.f90 more end --> end function [Gerardo] 2005-05-17 17:07:57 +00:00
localindex.f90 more end --> end function [Gerardo] 2005-05-17 17:07:57 +00:00
lsda_functionals.f90 - common xc and gga functionals subroutines for all code PW/CP/FPMD 2004-12-31 11:14:32 +00:00
matches.f90 Functions "capital" and "matches" taken out of module "parser" 2004-05-19 16:56:56 +00:00
matmul.f90 last end subroutine --> end subroutine name [Gerardo] 2005-05-18 14:02:51 +00:00
more_functionals.f90 General cleanup of intrinsic functions: 2005-08-26 17:44:42 +00:00
ngnr_set.f90 General cleanup of intrinsic functions: 2005-08-26 17:44:42 +00:00
npreroc.f Support for SGI Altix (Martin Hilgeman) - see cpdocs/ChangeLog 2004-02-26 16:26:48 +00:00
numroc.f O-sesame 2003-01-19 21:58:50 +00:00
ownerof.f90 more end --> end function [Gerardo] 2005-05-17 17:07:57 +00:00
proc_grid.f more error (subroutine) 2003-02-21 16:06:24 +00:00
recips.f90 Extensive module cleanup: DP moved from wrong place (parameters) to the 2004-01-23 15:08:03 +00:00
reduce.f90 Misc. installation and doc fixes 2003-02-27 13:59:04 +00:00
rranf.f90 General cleanup of intrinsic functions: 2005-08-26 17:44:42 +00:00
scnds.f90 Extensive module cleanup: DP moved from wrong place (parameters) to the 2004-01-23 15:08:03 +00:00
simpsn.f90 - makefile update after yesterday changes 2005-08-09 07:34:23 +00:00
sort.f90 last end --> end subroutine [Gerardo] 2005-05-12 15:32:15 +00:00
sort_gvec.f90 last end subroutine --> end subroutine name [Gerardo] 2005-05-18 14:02:51 +00:00
sph_bes.f90 - fpmd2upf made more user friendly 2005-05-27 13:49:19 +00:00
sph_besr.f90 Further cleanup of bessel functions. sph_besr moved from atomic to flib. 2004-11-17 13:35:03 +00:00
sph_dbes.f90 Cleanup of spherical bessel functions. 2004-11-17 12:05:53 +00:00
startup.f90 last end --> end subroutine [Gerardo] 2005-05-12 15:32:15 +00:00
syncronize.f90 last end --> end subroutine [Gerardo] 2005-05-12 15:32:15 +00:00
transto.f90 last end subroutine --> end subroutine name [Gerardo] 2005-05-18 14:02:51 +00:00
volume.f90 Extensive module cleanup: DP moved from wrong place (parameters) to the 2004-01-23 15:08:03 +00:00
ylmr2.f90 Small changes. (a double return in ylmr2 and the error message in sph_ind). 2004-06-04 16:05:57 +00:00