Re: [Wien] Print plane wave coefficients flom LAPW1 with -p option

2014-01-09 Thread Elias Assmann

On 01/08/2014 06:49 PM, Oleg Rubel wrote:

I tried to compile the FORTRAN code you attached. It has the include statement

   use util,  only: line_count
   use structmod, only: struct, struct_read
   use const, only: BUFSZ

I was able to find 'util.f' in the w2w package, but not 'structmod'
and 'const'. Would you please send me those too.


Sorry, I forgot about that.  I attach ‘util.F’ (which contains all those 
modules) and a header file it needs.  The ‘util.f’ from the current 
wien2wannier distribution will not work with this ‘vec2ascii.f90’.


When compiling remember that for the ‘.F’ file you have tell that 
compiler that it is free-form, so


$ ifort -warn all -free util.F vec2ascii.f90 -o vec2ascii

or

$ gfortran -ffree-form -Wall util.F vec2ascii.f90 -o vec2ascii

(of course you need to use the same as for lapw1 …)


Elias

!!! wien2wannier/util/util.f90
!!!
!!!Collection of routines for the programs in util/ and woptic/
!!!
!!! Copyright 2010-2012 Philipp Wissgott
!!! Copyright 2013  Elias Assmann


!---  Constants mathematical and configurational  ---
module const
  use iso_fortran_env, only: int32

  implicit none
  public

  integer, parameter :: BUFSZ = 256
  !! Default kinds
  integer, parameter :: DP = selected_real_kind(15,300) ! inherited from W90
  integer, parameter :: IP = int32
  !! Kinds for WIEN-compatibility
  real*4, private :: four_real
  real*8, private :: eight_real
  complex*16, private :: sixteen_complex
  integer, parameter :: R4 = kind(four_real)
  integer, parameter :: R8 = kind(eight_real)
  integer, parameter :: C16= kind(sixteen_complex)

  real(DP), parameter :: PI = 3.1415926535897932d0
  real(DP), parameter :: ORTHO_TEST = 1.d-12
  real(DP), parameter :: SQ3= sqrt(3d0)
end module const


!--- Assorted miscellanea ---
MODULE util
  use const, only: DP, BUFSZ
  implicit none

  private
  public :: string, inverse3x3, ptime, uppercase, lowercase, line_count

  interface string
 module procedure int2str, real2str
  end interface string
contains
  character(len=10) function int2str(n)
integer, intent(in) :: n
write(int2str,(I5)) n
  end function int2str

  character(len=15) function real2str(r)
real(DP), intent(in) :: r
write(real2str,(E16.9)) r
  end function real2str

  subroutine inverse3x3(a, ainv)
!inverse of th 3x3 matrix A
implicit none

real(DP), intent(in)  :: a(3,3)
real(DP), intent(out) :: ainv(3,3)
real(DP) :: det

det = a(1,1)*a(2,2)*a(3,3) + a(1,2)*a(2,3)*a(3,1) 
 +a(1,3)*a(2,1)*a(3,2) - a(3,1)*a(2,2)*a(1,3) 
 -a(1,1)*a(3,2)*a(2,3) - a(2,1)*a(1,2)*a(3,3)

ainv(1,1) = (  a(2,2)*a(3,3) - a(2,3)*a(3,2) ) / det
ainv(2,1) = (- a(2,1)*a(3,3) + a(2,3)*a(3,1) ) / det
ainv(3,1) = (  a(2,1)*a(3,2) - a(2,2)*a(3,1) ) / det
ainv(1,2) = (- a(1,2)*a(3,3) + a(1,3)*a(3,2) ) / det
ainv(2,2) = (  a(1,1)*a(3,3) - a(1,3)*a(3,1) ) / det
ainv(3,2) = (- a(1,1)*a(3,2) + a(1,2)*a(3,1) ) / det
ainv(1,3) = (  a(1,2)*a(2,3) - a(1,3)*a(2,2) ) / det
ainv(2,3) = (- a(1,1)*a(2,3) + a(1,3)*a(2,1) ) / det
ainv(3,3) = (  a(1,1)*a(2,2) - a(1,2)*a(2,1) ) / det
  end subroutine inverse3x3

  subroutine ptime(descr, unit)
character(len=*), intent(in), optional :: descr
integer,  intent(in), optional :: unit

character(len=*), parameter :: fmt = ('Times for ', A, T33, '(sec):', 
  F8.3, ' wall;', F9.3)!, ' cpu =', F8.3, ' user +', F8.3, ' sys')

real(DP),   save :: cputime1, cputime2
integer,save :: walltime1, walltime2, count_rate
integer,save :: default_lun
integer  :: lun

if (.not. present(descr)) then
   call cpu_time(cputime1)
   call system_clock(walltime1, count_rate)

   if (present(unit)) default_lun=unit

   return
end if

if (present(unit)) then
   lun=unit
else
   lun=default_lun
end if

call cpu_time(cputime2)
call system_clock(walltime2)

write(lun, fmt) descr, real(walltime2-walltime1)/count_rate, 
  (cputime2-cputime1)

walltime1 = walltime2
cputime1  = cputime2
  end subroutine ptime

  pure function uppercase(str)
character(*), intent(in) :: str
character(len(str))  :: uppercase

integer :: ic, i

character(26), parameter :: CAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
character(26), parameter :: low = 'abcdefghijklmnopqrstuvwxyz'

uppercase = str
do i = 1, len_trim(str)
   ic = index(low, str(i:i))
   if (ic  0) uppercase(i:i) = CAP(ic:ic)
end do
  end function uppercase

  pure function lowercase(str)
character(*), intent(in) :: str
character(len(str))  :: lowercase

integer :: ic, i

character(26), parameter :: CAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
character(26), parameter :: low = 'abcdefghijklmnopqrstuvwxyz'

lowercase = str
do i = 1, len_trim(str)
   ic = 

[Wien] (no subject)

2014-01-09 Thread Rekha Bs
i am a new user of Wien 2K.  Whether ubuntu 13.04 suits well for Wien2K or else 
Ubuntu 12.04LTS has to be installed.
___
Wien mailing list
Wien@zeus.theochem.tuwien.ac.at
http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
SEARCH the MAILING-LIST at:  
http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html


Re: [Wien] (no subject)

2014-01-09 Thread Gavin Abo

Wien2k will likely work fine on 13.04.

However, the Ubuntu developers have or will drop support of 13.04 soon 
[http://askubuntu.com/questions/239278/how-long-will-ubuntu-13-04-be-supported-for]. 
So you can see why it is likely better to use 12.04LTS.


If you use an ifort compiler and want support from Intel, you will want 
to check the System Requirements section of the release notes for the 
version that you plan to use 
[http://software.intel.com/en-us/articles/intel-fortran-composer-xe-2013-sp1-release-notes].


On 1/9/2014 4:11 AM, Rekha Bs wrote:
i am a new user of Wien 2K.  Whether ubuntu 13.04 suits well for 
Wien2K or else Ubuntu 12.04LTS has to be installed.


___
Wien mailing list
Wien@zeus.theochem.tuwien.ac.at
http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
SEARCH the MAILING-LIST at:  
http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html