’nˆæ–§’…Œ^ƒGƒŠƒAL”zMƒŠƒNƒ‹[ƒg‚Ì’nˆæ–§’…Œ^LƒhƒRƒCƒNHƒAƒhƒlƒbƒgƒ[ƒN Ads by ƒhƒRƒCƒNH[–³—¿‚Ńz[ƒ€ƒy[ƒW‚ðì¬] [’Ê•ñEíœˆË—Š]
[–³—¿‚Ńz[ƒ€ƒy[ƒW‚ðì¬] [’Ê•ñEíœˆË—Š]

Ubuntu 14.04 LTS (64bit)

   Ubuntu 14.04 LTS amd64 (64 bit”Å)‚ðƒCƒ“ƒXƒg[ƒ‹‚µA‘æˆêŒ´—ŒvŽZƒR[ƒh‚ðƒZƒbƒgƒAƒbƒv‚·‚é‚Ü‚Å‚ð‰ðà‚·‚éB
------------------------------------------------------------------------------
¡ Ubuntu 12.04 LTS -> 14.04 LTS
1. sudo apt-get update
2. sudo apt-get upgrade
3. apt-cache policy update-manager-core
4. sudo apt-get install update-manager-core
5. sudo do-release-upgrade
iformation -> system settings -> Details or lsb_release -a
[1] https://www.digitalocean.com/community/tutorials/how-to-upgrade-ubuntu-12-04-lts-to-ubuntu-14-04-lts
[2] https://help.ubuntu.com/community/CheckingYourUbuntuVersion
------------------------------------------------------------------------------
¡ PC
Magnate GE Windows 7 model ( 97,178 yen  + 32 GB memory)
0. ƒ‚ƒjƒ^Fnone
1. OS: none
2. CPU: Intel Core i7-4790 CPU @ 3.60GHz x 8
3. CPUƒtƒ@ƒ“: normal
4. ƒOƒŠƒXF normal
5. ƒƒ‚ƒŠ: 8 GB DDR3 SDRAM (PC3-12800/8GB x 4/dual channel) -> 32 GB
6. ƒOƒ‰ƒtƒBƒbƒN: Omte; HD graphics 4600
7. ƒn[ƒhƒfƒBƒXƒN: 500 GB HDD
8. ƒp[ƒeƒBƒVƒ‡ƒ“•ªŠ„: none
9. ’ljÁƒn[ƒhƒfƒBƒXƒN: none
10. ŒõŠwƒhƒ‰ƒCƒu: normal
11. ƒ}ƒU[ƒ{[ƒhFƒCƒ“ƒeƒ‹H97 Chipset MicroATX mother board
12. ƒJ[ƒhƒŠ[ƒ_[Fnone
13. 350W Ã‰¹“dŒ¹
-----------------------------------------------------------------------------
¡ gcc-4.9 binary install
1. sudo add-apt-repository ppa:ubuntu-toolchain-r/test
2. sudo apt-get update
3. sudo apt-get install g++-4.9
4. sudo apt-get install gcc-4.9
5. sudo apt-get install gfortran-4.9

options
1.  g++-4.9 -v --help > g++-4.9-options.txt
1.  gcc-4.9 -v --help > gcc-4.9-options.txt
2.  gfortran-4.9 -v --help > gfortran-4.9-options.txt
check
1.  g++-4.9 -march=native -E -v - &1 | grep cc1
2.  gcc-4.9 -march=native -E -v - &1 | grep cc1
3. gfortran-4.9 -march=native -E -v - &1 | grep cc1
Is your kind of CPU OK ?

gfortran-4.9
-march=haswell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=haswell -fstack-protector -Wformat -Wformat-security

gfortran-4.8
-march=core-avx2 -mcx16 -msahf -mmovbe -maes -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mno-rdseed -mno-prfchw -mno-adx -mfxsr -mxsave -mxsaveopt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=8192 -mtune=core-avx2 -fstack-protector -Wformat -Wformat-security

[1] http://www.mk-mode.com/octopress/2014/09/30/installation-newest-gcc-by-src-on-linux-mint/
[2] http://blog.livedoor.jp/yoka3/archives/6713640.html
[3] http://askubuntu.com/questions/428198/getting-installing-gcc-g-4-9-on-ubuntu
------------------------------------------------------------------------------
¡ sudo apt-get install
  • sudo apt-get update
  • sudo apt-get install build-essential
  • sudo apt-get install gfortran ( is not need including gcc-4.9 or later )
gcc version 4.8.2 (2015/01/06)
  • sudo apt-get install csh
  • sudo apt-get install tcsh
  • sudo apt-get install tcl
  • sudo apt-get install tk
  • sudo apt-get install tclx
  • sudo apt-get install xterm
  • sudo apt-get -y install patch
  • sudo apt-get install gnuplot
  • sudo apt-get install grace
  • sudo apt-get install rasmol
  • sudo apt-get install python-dev
  • sudo apt-get install python-numpy
  • sudo apt-get install python-matplotlib
  • sudo apt-get install python-tk
  • sudo apt-get install python-lxml
  • sudo apt-get install python-yaml
  • sudo apt-get install python-scipy
  • sudo apt-get install python-setuptools
  • sudo apt-get install texlive
  • sudo apt-get install imagemagick
  • sudo apt-get install graphicsmagick-imagemagick-compat
  • sudo apt-get install iwidgets4
What is command ? -> Ubuntu Software Center -> Search command
-----------------------------------------------------------------------------
¡ OpenMPI
1. download: http://www.open-mpi.org/
2. tar zxvf $HOME/Downloads/openmpi-1.8.4.tar.gz
3. cd open*
4. ./configure -prefix=/usr/local/openmpi
  gcc-4.9 case: ./configure -prefix=/usr/local/openmpi CXX=g++-4.9 CC=gcc-4.9 FC=gfortran-4.9
or
./configure -prefix=/home/user_amne/openmpi
gcc-4.9 case: ./configure -prefix=/home/user_amne/openmpi CXX=g++-4.9 CC=gcc-4.9 FC=gfortran-4.9
5. make
6. sudo make install
or make install

  ŠÂ‹«Ý’è ( gedit ~/.bashrc  )
# OpenMPI environmental setting
export MPIROOT=/usr/local/openmpi
export PATH=$MPIROOT/bin:$PATH
export LD_LIBRARY_PATH=$MPIROOT/lib:$LD_LIBRARY_PATH
export MANPATH=$MPIROOT/share/man:$MANPATH
or
export MPIROOT=/home/user_name/openmpi
export PATH=$MPIROOT/bin:$PATH
export LD_LIBRARY_PATH=$MPIROOT/lib:$LD_LIBRARY_PATH
export MANPATH=$MPIROOT/share/man:$MANPATH
-----------------------------------------------------------------------------
¡ FFTW3
1. http://www.fftw.org/download.html -> fftw-3.3.4.tar.gz
2. tar zxvf $HOME/Downloads/fftw-3.3.4.tar.gz
3. cd fft*
4. ./configure  F77="gfortran -m64 -mtune=native -march=native -O2 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp" CC="gcc -O2 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -mieee-fp" MPICC="mpicc -O2 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -mieee-fp" --enable-silent-rules --enable-sse2 --enable-avx --enable-mpi --enable-openmp --enable-threads
  gcc-4.9 case: ./configure  F77="gfortran-4.9 -m64 -mtune=native -march=native -O2 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp" CC="gcc-4.9 -O2 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -mieee-fp" MPICC="mpicc -O2 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -mieee-fp" --enable-silent-rules --enable-sse2 --enable-avx --enable-mpi --enable-openmp --enable-threads
5. make
6. make check

7. sudo make install
¦ --enable-float -> libfftw3f.a
-----------------------------------------------------------------------------
¡ LAPACK
1. http://www.netlib.org/lapack/ -> lapack-3.5.0.tgz
2. tar -zxvf $HOME/Downloads/lapack-3.5.0.tgz
3. cp lapack*
4. cp make.inc.example make.inc
5. gedit make.inc

  FORTRAN  = gfortran-4.9 #gcc-4.9 case
  OPTS     = -O2 -frecursive -m64 -fstack-arrays -fsignaling-nans -funroll-all-loops -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp -mtune=native -march=native
  LOADER   = gfortran-4.9 #gcc-4.9 case
  CFLAGS = -O3 -ffast-math -m64 -ftree-vectorize -funroll-all-loops -mieee-fp -mtune=native -march=native
  CC = gcc-4.9 #gcc-4.9 case
6. make blaslib
7. make lapacklib
8. sudo ln -s ~
/lapack-3.5.0/librefblas.a /usr/local/lib/libblas.a
  sudo ln -s ~/lapack-3.5.0/liblapack.a /usr/local/lib/liblapack.a
¦ ƒRƒ“ƒpƒCƒ‹‚µ’¼‚·‚Æ‚«‚́A‚»‚Ì‘O‚É make clean ‚ð“ü—Í‚·‚éB
------------------------------------------------------------------------------
¡ ATLAS
1. download: http://math-atlas.sourceforge.net/
2. tar xvjf $HOME/Downloads/atlas3.10.2.tar.bz2
3. cd ATLAS
4. mkdir BUILD
5. cd BUILD
6. sudo apt-get install cpufrequtils
7. sudo
cpufreq-set -r -g performance #-r for related (all) the cores
8. ../configure -b 64  -C ic gcc-4.9 -F ic '-O3 -fpic' -C if gfortran-4.9 -F if  '-O3 -fpic' -Fa al -fpic --with-netlib-lapack-tarfile=$HOME/Downloads/lapack-3.5.0.tgz
9. make
10. make check
11. make ptcheck
12. make time
13. sudo make install

  link
/usr/local/atlas/lib
libatlas.a  libcblas.a  libf77blas.a  liblapack.a  libptcblas.a  libptf77blas.a

  using
-Wl,-rpath=/usr/local/atlas/lib -L/usr/local/atlas/lib -llapack -lf77blas -latlas

[1] http://www2.rikkyo.ac.jp/web/tokiwa/menu/bioLib/library/python/atlas.html (icc and ifort)
[2] http://sourceforge.net/p/math-atlas/support-requests/856/
[3] http://d.hatena.ne.jp/saket/20121121/1353475324 (Ubuntu12.04)
[4] http://www-als.ics.nitech.ac.jp/~suzumura/dev_tips/dev_tips2.html (Japanese)
[5] http://askubuntu.com/questions/20271/how-do-i-set-the-cpu-frequency-scaling-governor-for-all-cores-at-once (CPU THROTTLING OFF)
[6] http://askubuntu.com/questions/523640/how-i-can-disable-cpu-frequency-scaling-and-set-the-system-to-performance
[7] http://www.jsces.org/Issue/Journal/pdf/nakata-0411.pdf
[8] http://www.abc-lib.org/MyHTML/paper/Taikai2004-03%28Kinoshita%29.pdf
------------------------------------------------------------------------------
¡ GotoBLAS (unsuccess)
1. download: https://www.tacc.utexas.edu/research-development/tacc-software/gotoblas2
2. tar zxvf $HOME/Downloads/GotoBLAS2-1.13.tar.gz
3. cd GotoBLAS2
4. cat /proc/cpuinfo
5. gedit Makefile.rule
8. ./quickbuild.64bit

  link
sudo cp libgoto2_core2p-r1.13.a /usr/local/lib/libgoto2.a

  using
gfortran -o case case.f -L/usr/local/lib -lgoto2 -lpthread

¦1 Å‘åƒXƒŒƒbƒh”‚Í goto_set_num_threadsi®”j‚ÅŽw’è
¦2 GotoBLAS include automatically LAPACK
-----------------------------------------------------------------------------
¡ ScaLAPACK (+BLACS)
1. download: http://www.netlib.org/scalapack/
2. tar zxvf $HOME/Downloads/scalapack-2.0.2.tgz
3. cd sca*
4. cp SLmake.inc.example SLmake.inc
5. gedit SLmake.inc
  FCFLAGS       = -O3 -m64 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp
  CCFLAGS       = -O3 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -mieee-fp
  BLASLIB       = /usr/local/lib/libblas.a
  LAPACKLIB     = /usr/local/lib/liblapack.a
6. make lib
7. sudo ln -s ~/scalapack-2.0.2/libscalapack.a /usr/local/lib/libscalapack.a
¦ ƒRƒ“ƒpƒCƒ‹‚µ’¼‚·‚Æ‚«‚́A‚»‚Ì‘O‚É make clean ‚ð“ü—Í‚·‚éB
-----------------------------------------------------------------------------
¡ ACML
  ACML 4.4.0 (gfortran , gcc)
1) mkdir acml4.4.0
2) cd acml4.4.0
3) tar zxvf $HOME/Downloads/acml-4-4-0-gfortran-64bit1.tgz
4) sudo ./install-acml-4-4-0-gfortran-64bit.sh
6) gedit .bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/acml4.4.0/gfortran64_mp/lib:/usr/local/openmpi/lib

  ACML 5.3.1 (gfortran , gcc)
1. download: http://developer.amd.com/tools-and-sdks/cpu-development/amd-core-math-library-acml/ -> Downloads -> Get the latest downloads from the table below.
2. mkdir ACML-5.3.1
3. cd ACML-5.3.1
4. tar zxvf $HOME/Downloads/acml-5-3-1-gfortran-64bit.tgz
5. sudo ./install-acml-5-3-1-gfortran-64bit.sh
6. gedit ~/.bashrc
    export LD_LIBRARY_PATH=/opt/acml5.3.1/gfortran64_mp/lib:$LD_LIBRARY_PATH
7. bash
------------------------------------------------------------------------------
¡ cif2cell
1. download: http://cif2cell.sourceforge.net -> Download CIF2Cell files
2. tar zxvf $HOME/Downloads/cif2cell-1.2.2.tar.gz
3. cd cif*
4. sudo python setup.py install

check
5. cif2cell -h

Adresss
/usr/local/lib/cif2cell
creating /usr/local/lib/cif2cell/docs
copying docs/cif2cell.pdf -> /usr/local/lib/cif2cell/docs
------------------------------------------------------------------------------
¡ QE-Abinit
1. download: http://qe-forge.org/gf/project/q-e/frs/?action=index
2. tar zxvf $HOME/Downloads/QE-ABINIT.tar.gz
3. cd QE*
4. cd Src
5. gedit abinit2pw.plx
   a) Œë‚è‚̏C³1
     print FILEPWOUT " $cell31 $cell22 $cell33\n"; ← miss
     print FILEPWOUT " $cell31 $cell32 $cell33\n"; ← correct
   b)  Œë‚è‚̏C³2
     elsif(@pwsplitline[0] =~ /nspin/ && length($nspint) !~ 0){print FILEPWOUT " nspin = $nspin,\n";} ← miss
     elsif(@pwsplitline[0] =~ /nspin/ && length($nspin) !~ 0){print FILEPWOUT " nspin = $nspin,\n";} ← correct
   c) K_POINTS automatic ‚Ì’¼‚®Œã‚ð‰üs‚·‚é‚Ì‚ª–Ê“|‚ȏꍇ
     print FILEPWOUT " @meshk $shift $shift $shift\n"; ‚ð‰º‹L‚̂悤‚ɏ‘‚«Š·‚¦‚éB
     print FILEPWOUT "\n @meshk $shift $shift $shift\n";
   c) ÅV”łɏC³
     if($abinitsplitline[0] =~ /nspp/) ← old
     if($abinitsplitline[0] =~ /nsppol/)  ← new
  d) C³
     chop($fileinput);  ← miss
     chomp($fileinput);  ← correct
------------------------------------------------------------------------------
¡ XcrySDen
1) download: http://www.xcrysden.org/Download.html
2) tar zxvf $HOME/Downloads/xc-1.5.23-linux_x86_64-semishared.tar.gz
3) cd XCr*
4) ./xcConfigure
5) Do you have a CRYSTAL package ([y]es/[n]o): n
6) Is this correct ([y]es/[n]o): y
7) Would you like to add xcrysden icon to the desktop ([y]es/[n]o): n
8) bsah
* command: xcrysden
------------------------------------------------------------------------------
¡ VESTA
1. download: http://jp-minerals.org/vesta/jp/
2. tar xjf $HOME/Downloads/VESTA-x86_64.tar.bz2
check
3. ./VESTA
------------------------------------------------------------------------------
¡ WIEN2k ( OpenMP + OpenMPI + FFTW3 + LAPACK_LAPW)
1) mkdir WIEN2k_14
2) cd WIEN2k_14
3) cp $HOME/Downloads/WIEN2k_14.2.tar .
4) tar xvf WIEN2k_14.2.tar
5) gunzip *.gz
6) chmod +x ./expand_lapw
7) ./expand_lapw
8) continue (y/n) y
9) ./siteconfig_lapw
10) continue or stop (c/s) c
11) Specify a system
  1. v
  2. gfortran, gcc
  3. Current settings:
    O Compiler options: -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -ffree-form -O2 -ffree-line-length-none -mpc80 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp
       gcc-4.9 case: O Compiler options: -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -ffree-form -O2 -ffree-line-length-none -mpc80 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp
    F   FFTW options:            -DFFTW3 -I/usr/local/include
    L   Linker Flags:            $(FOPT) -L../SRC_lib -lpthread -static
    P   Preprocessor flags       '-DParallel'
    R   R_LIB (LAPACK+BLAS):    -llapack_lapw -lblas_lapw -llapack_lapw -lblas_lapw
    FL  FFTW_LIBS:               -lfftw3f_mpi -lfftw3f_omp -lfftw3f_threads -lfftw3f -L/usr/local/lib
  4. Shared Memory Architecture? (y/n):y
  5. (like taskset -c). Enter N / your_specific_command:
  6. You need to KNOW dedtails about your installed MPI and FFTW ) n
  7. NMATMAX=18000ANUME=1800
   formula
     NMATMAX=√(32 000 000 000 /10j/√2=40000
       but I set up 18000.
     NUME=NMATMAX/10=4000
       but I set up 1800.
12) a
13) ./userconfig
14) bash
15) w2web
------------------------------------------------------------------------------
¡ WIEN2k ( OpenMP + OpenMPI + FFTW3 + Netlib LAPACK + Scalapack)
1) mkdir WIEN2k_14
2) cd WIEN2k_14
3) cp $HOME/Downloads/WIEN2k_14.2.tar .
4) tar xvf WIEN2k_14.2.tar
5) gunzip *.gz
6) chmod +x ./expand_lapw
7) ./expand_lapw
8) continue (y/n) y
9) ./siteconfig_lapw
10) continue or stop (c/s) c
11) Specify a system
  1. v
  2. gfortran, gcc
  3. Current settings:
    O Compiler options: -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -ffree-form -O2 -ffree-line-length-none -mpc80 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp
    F   FFTW options:            -DFFTW3 -I/usr/local/include
    L   Linker Flags:            $(FOPT) -lfftw3 -L/usr/local/lib -L/usr/local/lib
    P   Preprocessor flags       '-DParallel'
    R   R_LIB (LAPACK+BLAS):    -llapack -lblas -fopenmp
    FL  FFTW_LIBS:               -lfftw3f_mpi -lfftw3f_omp -lfftw3f_threads -lfftw3f -L/usr/local/lib
  4. Shared Memory Architecture? (y/n):y
  5. (like taskset -c). Enter N / your_specific_command:
  6. Set MPI_REMOTE to 0 / 1:
  7. Your compiler: mpif90
  8.  Current settings:
    FFTW_LIB + FFTW_OPT    : -lfftw3_mpi -lfftw3 -L/usr/local/lib  +  -DFFTW3 -I/usr/local/include (already set)
    RP  RP_LIB(SCALAPACK+PBLAS): -L/usr/local/lib -lscalapack $(R_LIBS)
    FP  FPOPT(par.comp.options): -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.8 -ffree-form -O2 -ffree-line-length-none -mpc80 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp
    MP  MPIRUN commando        : mpirun -np _NP_ -machinefile _HOSTS_ _EXEC_
  9. NMATMAX=18000ANUME=1800
   formula
     NMATMAX=√(32 000 000 000 /10j/√2=40000
       but I set up 18000.
     NUME=NMATMAX/10=4000
       but I set up 1800.
12) a
13) ./userconfig
14) bash
15) w2web

TiC: start (Wed Jan 7 15:17:42 JST 2015) -> cycle 9 (Wed Jan 7 15:18:00 JST 2015) stop : = 18 s
------------------------------------------------------------------------------
¡ Elk (Netlib Blas + Lapack + Scalapack)
(compile: gcc-4.9)
1. download: http://elk.sourceforge.net -> download -> http://sourceforge.net/projects/elk/files/
2. tar zxvf $HOME/Downloads/elk-2.3.22.tgz
​3. cd elk*
4. ./setup
5. 2
6. gedit make.inc
 MAKE = make
 F90 = mpif90
# F90_OPTS = -O3 -ffast-math -funroll-loops -fopenmp
 F90_OPTS = -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O3 -pipe -ffast-math -funroll-all-loops -fopenmp -mtune=native -march=native -m64 -mpc80 -fstack-arrays -m64 -fsignaling-nans -ftree-vectorize -fno-protect-parens -mieee-fp -fopenmp -L/usr/local/lib
 F77 = mpif90
# F77_OPTS = -O3 -ffast-math -funroll-loops -fopenmp
 F77_OPTS = -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O3 -pipe -ffast-math -funroll-all-loops -fopenmp -mtune=native -march=native -m64 -mpc80 -fstack-arrays -m64 -fsignaling-nans -ftree-vectorize -fno-protect-parens -mieee-fp -fopenmp -L/usr/local/lib
 AR = ar
 LIB_SYS =
#LIB_LPK = lapack.a blas.a
 LIB_LPK = -L/usr/local/lib -lscalapack -llapack -lblas -fopenmp
#SRC_MPI = mpi_stub.f90
 F90 = mpif90
 F77 = mpif90
 SRC_MPI =
# LIB_libxc = libxcf90.a libxc.a
 LIB_FFT = fftlib.a

# SRC_libxc = libxc_funcs.f90 libxc.f90 libxcifc.f90
 SRC_libxc = libxcifc_stub.f90
 SRC_FFT = zfftifc.f90
7. make all
8. make test
  all passed

mpirun -np 4 $HOME/elk-2.3.22/src/elk
-----
Elk code version 2.3.22 started
Using MPI, number of processes :        4
Info(main): current task :      0
-----

[1] http://sourceforge.net/p/elk/discussion/897820/thread/7dfab48c ( importance : MPI case, SRC_MPI = mpi_stub.f90 -> #SRC_MPI = mpi_stub.f90)
------------------------------------------------------------------------------
¡ Elk (Netlib Blas + Lapack + Scalapack + FFTW3) (unsuccess?)
(compile: gcc-4.9)
1. download: http://elk.sourceforge.net -> download -> http://sourceforge.net/projects/elk/files/
2. tar zxvf $HOME/Downloads/elk-2.3.22.tgz
​3. cd elk*
4. ./setup
5. 2
6. gedit make.inc
 MAKE = make
 F90 = mpif90
# F90_OPTS = -O3 -ffast-math -funroll-loops -fopenmp
 F90_OPTS = -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O3 -pipe -ffast-math -funroll-all-loops -fopenmp -mtune=native -march=native -m64 -mpc80 -fstack-arrays -m64 -fsignaling-nans -ftree-vectorize -fno-protect-parens -mieee-fp -fopenmp -L/usr/local/lib
 F77 = mpif90
# F77_OPTS = -O3 -ffast-math -funroll-loops -fopenmp
 F77_OPTS = -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O3 -pipe -ffast-math -funroll-all-loops -fopenmp -mtune=native -march=native -m64 -mpc80 -fstack-arrays -m64 -fsignaling-nans -ftree-vectorize -fno-protect-parens -mieee-fp -fopenmp -L/usr/local/lib
 AR = ar
 LIB_SYS =
#LIB_LPK = lapack.a blas.a
 LIB_LPK = -L/usr/local/lib -lscalapack -llapack -lblas -fopenmp
#SRC_MPI = mpi_stub.f90
 F90 = mpif90
 F77 = mpif90
 SRC_MPI =
# LIB_libxc = libxcf90.a libxc.a
 LIB_FFT = fftlib.a

# SRC_libxc = libxc_funcs.f90 libxc.f90 libxcifc.f90
 SRC_libxc = libxcifc_stub.f90
#SRC_FFT = zfftifc.f90
 SRC_FFT = zfftifc_fftw.f90
#LIB_FFT = libfftw3.a
#SRC_FFT = mkl_dfti.f90 zfftifc_mkl.f90
 LIB_FFT = -L/usr/local/lib -lfftw3_mpi -lfftw3_omp -lfftw3_threads -lfftw3 -lm
7. make all
8. make test
  Running test in directory test-013..., Failed! See test.log and output files
  but others passed

[1] http://sourceforge.net/p/elk/discussion/897820/thread/7dfab48c ( importance : MPI case, SRC_MPI = mpi_stub.f90 -> #SRC_MPI = mpi_stub.f90)
------------------------------------------------------------------------------
¡ Abinit (OpenMPI + FFTW3 + Netlib LAPACK + Scalapack)
(compile: gcc-4.9)
1. download: http://www.abinit.org -> ABINIT package -> List all releases.... -> ABINIT 7.10.2 -> Sources and complete tests
2. tar zxvf $HOME/Downloads/abinit-7.10.2.tar.gz
3. cd abinit*
4. gedit build.ac
-----

#FC="gfortran-4.9"
#F77="gfortran-4.9"
FC="mpif90"
F77="mpif90"
FCFLAGS="-lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O2 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -g -ffree-line-length-none"
#CC="gcc-4.9"
CC="mpicc"
CFLAGS="-lgcc -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O2 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -g"
#CXX="g++-4.9"
CXX="mpicxx"
CXXFLAGS="-lstdc++6 -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O2 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -g"
#enable_optim="standard"
enable_optim="aggressive"
enable_gw_dpc="yes"
enable_64bit_flags="yes"
with_trio_flavor="netcdf+etsf_io+fox"
#with_dft_flavor="atompaw+bigdft+libxc+wannier90"
with_dft_flavor="atompaw+libxc+wannier90"
with_fft_flavor="fftw3"
with_fft_libs="-L/usr/local/lib -lfftw3 -lfftw3f"
with_fft_incs="-I/usr/local/include"
#with_fft_flavor="fftw3-threads"
#with_fft_libs="-L/usr/local/lib -lfftw3f_threads -lfftw3f -lfftw3_threads -lfftw3
#with_fft_libs="-L/usr/local/lib -lfftw3f_threads -lfftw3f -lfftw3_threads -lfftw3 -lm -lpthread"
#with_fft_libs="-L/usr/local/lib -lfftw3f_omp -lfftw3f -lfftw3_omp -lfftw3 -fopenmp"
#with_fft_incs="-I/usr/local/include"
#with_fft_flavor="fftw3-mpi"
#with_fft_libs="-L/usr/local/lib -lfftw3f_mpi -lfftw3f -lfftw3_mpi -lfftw3"
#with_fft_incs="-I/usr/local/include"
enable_mpi="yes"
enable_mpi_io="yes"
with_mpi_prefix="/usr/local/openmpi"
#with_linalg_flavor="netlib"
#with_linalg_libs="-L/usr/local/lib -llapack -lblas"
with_linalg_flavor="netlib+scalapack"
with_linalg_libs="-L/usr/local/lib -lscalapack -llapack -lblas"
-----
5. ./configure --with-config-file=./build.ac
6. make mj4
7. sudo make install

¦ see doc/config/build-config.ac

  test
1. cd $HOME/abinit*/tests
2. ./runtests.py
-j 4 fast
-----
Test suite completed in 7.62 s (average time for test = 1.61 s, stdev = 1.61 s)
failed: 0, succeeded: 10, passed: 1, skipped: 0, disabled: 0
[fast][t27-t28-t29] has run_etime 5.40 s
Suite   failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
fast         0       1         10        0         0      17.70      18.35
Test suite results in HTML format are available in Test_suite/suite_report.html
-----
3. ./runtests.py paral -n4
-----
Test suite completed in 203.23 s (average time for test = 2.22 s, stdev = 5.74 s)
failed: 0, succeeded: 25, passed: 9, skipped: 56, disabled: 0
[paral][t92_MPI4][np=4] has run_etime 48.22 s
Suite   failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
paral        0       9         25       56         0     200.12     202.33
Test suite results in HTML format are available in Test_suite/suite_report.html
-----
4. ./runtests.py -j 4
-----
Test suite completed in 1239.27 s (average time for test = 6.04 s, stdev = 14.27 s)
failed: 3, succeeded: 501, passed: 153, skipped: 142, disabled: 0
Suite        failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
atompaw           0       1          1        0         0       9.89       9.99
bigdft            0       0          0       22         0       0.00       0.01
built-in          0       0          6        1         0       3.45       3.45
etsf_io           0       1          6        0         0      10.60      10.76
fast              0       1         10        0         0      19.11      19.80
fox               0       1          1        0         0      23.12      23.17
gpu               0       0          0        4         0       0.00       0.00
libxc             0       6         15        0         0     159.89     161.48
mpiio             0       0          1       13         0       1.04       1.07
paral             0       5         16       69         0     243.89     245.60
seq               0       0          0       19         0       0.00       0.00
tutoparal         0       0          1        1         0       0.35       0.35
tutoplugs         0       4          0        0         0      15.55      15.67
tutorespfn        1      11         11        0         0     803.57     809.80
tutorial          0       8         40        0         0     569.09     572.23
unitary           0       0         21       13         0      55.84      56.00
v1                0       6         70        0         0     109.62     112.64
v2                1      15         63        0         0     164.95     168.94
v3                1      12         67        0         0     226.14     232.85
v4                0      20         42        0         0     271.52     277.13
v5                0      20         54        0         0     670.25     679.35
v6                0      14         46        0         0     495.46     502.47
v67mbpt           0       5         13        0         0     220.41     222.22
v7                0      16         16        0         0     710.56     714.49
vdwxc             0       0          1        0         0       9.95       9.98
wannier90         0       7          0        0         0      28.60      28.84
Test suite results in HTML format are available in Test_suite/suite_report.html
-----
[tutorespfn][trf2_1][np=1]: failed: absolute error 5.21e-05 > 5e-05
[v2][t98][np=1]: failed: erroneous lines 18 > 17
[v3][t83][np=1]: failed: erroneous lines 5 > 3
5. ./runtests.py -n4
-----
Test suite completed in 37753.68 s (average time for test = 47.16 s, stdev = 1185.52 s)
failed: 17, succeeded: 514, passed: 148, skipped: 120, disabled: 0
Suite        failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
atompaw           0       1          1        0         0       9.04       9.12
bigdft            0       0          0       22         0       0.00       0.00
built-in          0       0          6        1         0       4.46       4.47
etsf_io           0       1          6        0         0      11.27      11.48
fast              0       1         10        0         0      23.65      24.37
fox               0       1          1        0         0      16.75      16.81
gpu               0       0          0        4         0       0.00       0.00
libxc             0       7         14        0         0     125.38     126.86
mpiio             0       1          9        4         0      58.95      59.59
paral             0      10         24       56         0     199.62     201.86
seq               0       0          0       19         0       0.00       0.00
tutoparal         0       0          1        1         0       0.42       0.43
tutoplugs         0       4          0        0         0      12.22      12.33
tutorespfn        1       9         13        0         0     372.20     377.88
tutorial          0       8         40        0         0     261.24     264.17
unitary           0       0         21       13         0      44.34      44.53
v1                0       6         70        0         0     110.79     113.75
v2                1      15         63        0         0     147.18     150.88
v3                1      11         68        0         0     195.78     201.80
v4                0      19         43        0         0     186.37     191.32
v5                2      19         53        0         0   33911.40   33919.62
v6                1      13         46        0         0     434.54     440.60
v67mbpt           2       6         10        0         0    1036.42    1037.99
v7                7      11         14        0         0     485.95     489.39
vdwxc             0       0          1        0         0       8.97       9.00
wannier90         2       5          0        0         0      21.00      21.23
Test suite results in HTML format are available in Test_suite/suite_report.html
-----
[1] https://www.nersc.gov/users/computational-systems/edison/performance-and-optimization/math-library-performance/

Error: libieee.a and -mieee-fp
[1] https://proteusmaster.urcf.drexel.edu/urcfwiki/index.php/Compiling_ABINIT
---------------------------------------
  Abinit (OpenMPI + FFTW3 + Netlib ATLAS) (compile: gcc-4.9)
build.ac
-----
#FC="gfortran-4.9"
#F77="gfortran-4.9"
FC="mpif90"
F77="mpif90"
FCFLAGS=" -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O2 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -g -ffree-line-length-none"
#CC="gcc-4.9"
CC="mpicc"
CFLAGS="-lgcc -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O2 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -g"
#CXX="g++-4.9"
CXX="mpicxx"
CXXFLAGS="-lstdc++6 -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O2 -ffast-math -m64 -ftree-vectorize -mtune=native -march=native -funroll-all-loops -g"
#enable_optim="standard"
enable_optim="aggressive"
enable_gw_dpc="yes"
enable_64bit_flags="yes"
#with_trio_flavor="netcdf+etsf_io+fox"
#with_dft_flavor="atompaw+bigdft+libxc+wannier90"
#with_dft_flavor="atompaw+libxc+wannier90"
with_fft_flavor="fftw3"
with_fft_libs="-L/usr/local/lib -lfftw3 -lfftw3f"
with_fft_incs="-I/usr/local/include"
#with_fft_flavor="fftw3-threads"
#with_fft_libs="-L/usr/local/lib -lfftw3f_threads -lfftw3f -lfftw3_threads -lfftw3
#with_fft_libs="-L/usr/local/lib -lfftw3f_threads -lfftw3f -lfftw3_threads -lfftw3 -lm -lpthread"
#with_fft_libs="-L/usr/local/lib -lfftw3f_omp -lfftw3f -lfftw3_omp -lfftw3 -fopenmp"
#with_fft_incs="-I/usr/local/include"
#with_fft_flavor="fftw3-mpi"
#with_fft_libs="-L/usr/local/lib -lfftw3f_mpi -lfftw3f -lfftw3_mpi -lfftw3"
#with_fft_incs="-I/usr/local/include"
enable_mpi="yes"
enable_mpi_io="yes"
with_mpi_prefix="/usr/local/openmpi"
#with_linalg_flavor="netlib"
#with_linalg_libs="-L/usr/local/lib -llapack -lblas"
with_linalg_flavor="atlas"
with_linalg_libs="-Wl,-rpath=/usr/local/atlas/lib -L/usr/local/atlas/lib -llapack -lf77blas -latlas"
#with_linalg_flavor="netlib+scalapack"
#with_linalg_libs="-L/usr/local/lib -lscalapack -llapack -lblas"
-----

./runtests.py -j 4 fast
-----
Test suite completed in 7.62 s (average time for test = 1.61 s, stdev = 1.61 s)
failed: 0, succeeded: 10, passed: 1, skipped: 0, disabled: 0
[fast][t27-t28-t29] has run_etime 5.40 s
Suite   failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
fast         0       1         10        0         0      17.70      18.35
Test suite results in HTML format are available in Test_suite/suite_report.html

./runtests.py paral -n4
-----
Test suite completed in 206.03 s (average time for test = 2.25 s, stdev = 5.85 s)
failed: 1, succeeded: 23, passed: 10, skipped: 56, disabled: 0
[paral][t92_MPI4][np=4] has run_etime 49.26 s
Suite   failed  passed  succeeded  skipped  disabled  run_etime  tot_etime
paral        1      10         23       56         0     202.91     205.02
Test suite results in HTML format are available in Test_suite/suite_report.html
-----
------------------------------------------------------------------------------
¡ PWscf ( OpenMPI + FFTW3 + Netlib LAPACK + Scalapack)
1. download: http://www.quantum-espresso.org -> DOWNLOAD -> http://www.quantum-espresso.org/download/ -> download page -> http://qe-forge.org/gf/project/q-e/frs/?action=FrsReleaseBrowse&frs_package_id=18
1. tar zxvf $HOME/Downloads/espresso-5.1.tar.gz
2. cd esp*
3. tar zxvf $HOME/Downloads/tddfpt*
  tar zxvf $HOME/Downloads/pwcond*
  tar zxvf $HOME/Downloads/atomic*
  tar zxvf $HOME/Downloads/GWW*
  tar zxvf $HOME/Downloads/PWgui*
  tar zxvf $HOME/Downloads/PHonon*
  tar zxvf $HOME/Downloads/neb*
  tar zxvf $HOME/Downloads/xspectra*
4. ./configure

5. make all
6. gedit ~/.bashrc   
  export PATH=$PATH:$HOME/espresso-5.1/bin
  export PATH=$PATH:$HOME/espresso-5.1/PWgui-5.1

  ŽÀs•û–@
1. mpirun -np 4 ~/espresso-5.1/bin/pw.x case.out
  or pw.x case.out

  PWgui
1. 
~/espresso-5.1/PWgui-5.1/pwgui
  or pwgui

  test
1. tar zxvf $HOME/Downloads/espresso-4.3.2-examples.tar.gz
2. ’†g‚ð‘S‚ăRƒs[‚·‚éBƒXƒLƒbƒv‚às‚¤B(copy all, and skip)
3. cd tests

4. check-pw.x.j
  Total wall time (s) spent in this run:  460.64
  Reference                            :  851.06
5. gedit $HOME/esp*/examples/environment_variables
  PARA_PREFIX='mpirun -np 4'
6. check-pw.x.j
  Total wall time (s) spent in this run:  236.71
  Reference                            :  851.06

Attention:
O.pz-kjpaw.UPF not found
H.coulomb-ae.UPF not found
C.pbe-van_bm.UPF not found

  other case1:
./configure FC="mpif90" FCFLAGS="
-O3 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp -g -ffree-line-length-none" FFLAGS="-O3 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -mieee-fp -g -ffree-line-length-none"
----- (single)
Total wall time (s) spent in this run:  420.41
Reference                            :  851.06
----- (mpirun -np 4)
Total wall time (s) spent in this run:  216.92
Reference                            :  851.06
-----

[1] http://www.prace-ri.eu/IMG/pdf/enabling_ffte_library_and_fftw3_threading_in_quantum_espresso.pdf
[2] http://www.hpcadvisorycouncil.com/pdf/ESPRESSO_Best_Practices.pdf
[3] http://training.uhem.itu.edu.tr/docs/18hazirannano/PW-III-para.pdf
[4] http://glennklockwood.blogspot.jp/2014/02/quantum-espresso-compiling-and-choice.html (ACML)
[5] http://d.hatena.ne.jp/cmphys/20120531/1338457995 (PWgui)
-----------------------------------------------------------------------------
¡ SPR-KKR

  xband
1) mkdir sprkkr
2) cd sprkkr
3) cp $HOME/Downloads/xband_6.3.tar.gz .
4) tar -zxvf xband_6.3.tar.gz
5) cd xband
6) gedit ~/.bashrc
   export XBANDPATH=$HOME/sprkkr/xband
   export PATH=$PATH:$XBANDPATH:
   export XLIB_SKIP_ARGB_VISUALS=1
7) gfortran case
   gedit geometry/MakefileFFC=ifort -> FC=gfortran-4.9
   gedit graphics/makefileFlinuxFC=ifort -> linuxFC=gfortran-4.9, linux-gnuFC = ifort -> linux-gnuFC = gfortran-4.9, FC=ifort -O2 -> FC=gfortran-4.9 -O2
   gedit spheres/makefileFlinuxFC=ifort -> linuxFC=gfortran-4.9, FC=ifort -O2 -> FC=gfortran-4.9 -O2
   gedit symmetry/makefileFlinuxFC = ifort -> linuxFC = gfortran-4.9, FC=ifort -> FC=gfortran-4.9 -O2
8) bash
9) xband

  SPRKKR 6.3
1) cp $HOME/Downloads/sprkkr6.3.2pub20121219.tgz ./sprkkr
2) cd sprkkr
3) tar -zxvf $HOME/Downloads/sprkkr6.3.2pub20121219.tgz
4) cp make.inc_example make.inc
5) gedit make.inc
  LIB = -L/usr/local/lib -llapack -lblas
  LIBMPI = -L/usr/local/lib -lscalapack -llapack -lblas
  LIBMPI=
  INCLUDE = -I/usr/local/openmpi/include
  FFLAGS = -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O2 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens
  FC = mpif90 -c $(FFLAGS) $(INCLUDE)
  LINK = mpif90 $(FFLAGS) $(INCLUDE)
6) make scfmpiisingle type: make scf )
   ã‹L‚̍ì‹Æ‚Å binary ‚ªì¬‚³‚ê‚éBPC‚ª 4 core ‚̏ꍇ‚͉º‹L‚Æ‚È‚é
    mpirun -np 4 kkrscf6.3MPI *.inp > OUTPUT
7) ‚±‚Ì‘¼‚É‚àƒvƒƒOƒ‰ƒ€‚ðì¬‚·‚邱‚Æ‚ª‚Å‚«‚é
   a) make all
     gen, scf, embgen, embscf ‚ªì¬‚³‚ê‚é
   b) make allmpi
     scfmpi, embscfmpi, specmpi ‚ªì¬‚³‚ê‚é
   c) Makefile ‚ðŒ©‚é‚ƈꉞ‰º‹L‚̃Rƒ}ƒ“ƒh‚ª‚ ‚é
     make genmpi, make embscfmpi, make chi,
    make opm, make opmmpi, make spec
-----------------------------------------------------------------------------
¡ Akai-KKR
1. download: http://kkr.phys.sci.osaka-u.ac.jp/jp/
2. tar zxvf $HOME/Downloads/cpa2002v009c.tgz
3. cd cpa*
4. touch source/*.f
5. gedit makefile
  omp = -fopenmp
  nomp = -openmp-stubs
  fort = gfortran
  flag = -lgfortran -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -O2 -fstack-arrays -m64 -fsignaling-nans -funroll-all-loops -mtune=native -march=native -ftree-vectorize -ffast-math -fno-protect-parens -mpc80
6. make
7. gfortran-4.9 source/gpd.f -o gpd

  using
export OMP_NUM_THREADS=4
specx < in/fe2val
specx < in/fe2val > out/fe2val_dos
./gpd out/fe2val_dos
export OMP_NUM_THREADS=1

source/specx.f
      parameter
     & (natmmx=10, ncmpmx=10, msizmx=99, mxlmx=3, nk1x=500, nk3x=350,
     & msex=201, ngmx=15, nrpmx=650, ngpmx=650, npmx=350, msr=400)
-----------------------------------------------------------------------------
¡ gnuplot for elk

chmod +x plot_tdos
plot_tdos

plot_tdos
-----
#!/bin/csh -f

set file     = `pwd`
set filename = $file:t
#
set elk_dos_format = "TDOS.OUT"
set psformat = ".ps"
set epsformat = ".eps"
#
set plot_data_name = $elk_dos_format
#
# check
echo "------------------------------"
echo "plot start"
echo "adress   :" $file
echo "file name:" $filename
echo "ef       : 0 eV"
echo "read file:" $plot_data_name
echo "read adr.:" "$file/$plot_data_name"
echo "------------------------------"

gnuplot -persist << EOF

set title "$filename"
set size 0.7,1.0
set xtics 0.1
set xr[-0.5:0.5]
set xl "{/=30 Energy / Ha }"
set yl "{/=30 Density of State / Ha }"
set yzeroaxis


# linetype=lt, linecolor=lc, linewidth=lw, pointtype=pt, pointsize=ps
# with=w, line=l, color setting=lc rgb "",
set key box center top
plot "$file/$plot_data_name" u 1:2 w l lw 2 lc rgb "red" t "$filename total DOS FP-LAPW"

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"
#replot

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"
replot

set terminal x11

EOF
-----
-----------------------------------------------------------------------------
¡ gnuplot for abinit

chmod +x plot_tdos
plot_tdos filename ef(Ha unit)

e.g.  caseo_DOS -> filename = case
plot_tdos case 0.34250

plot_tdos
-----
#!/bin/csh -f

# plot_tdos filename ef(Ha unit)
# remove o_DOS for filename

set file     = `pwd`
#set filename = $file:h
set filename = $1
set EF = $2
set abinit_dos_format = "o_DOS"
set psformat = ".ps"
set epsformat = ".eps"
set plot_data_name = $filename$abinit_dos_format
#
# check
echo "------------------------------"
echo "plot start"
echo "adress   :" $file
echo "file name:" $filename
echo "ef       :" $EF "Ha"
echo "read file:" $plot_data_name
echo "read adr.:" "$file/$plot_data_name"
echo "------------------------------"

gnuplot -persist << EOF

set title "$filename"
set size 0.7,1.0
set xtics 0.1
set xr[$EF-0.5:$EF+0.5]
set xl "{/=30 Energy / Ha }"
set yl "{/=30 Density of State / Ha }"
#set yzeroaxis
set y2tics
set y2l "{/=30 Integrated DOS }"
set parametric
set x=const
set y2=t
set const=$EF
set tr[0:70]
set y2r[0:70]

# linetype=lt, linecolor=lc, linewidth=lw, pointtype=pt, pointsize=ps
# with=w, line=l, color setting=lc rgb "",
set key box center top
#plot "$file/$plot_data_name" u ($1-$EF)*27.2113845:($2/27.2113845) w l t "$filename total DOS PAW(JTH v2)"
plot "$file/$plot_data_name" u 1:3 w l lw 2 lc rgb "green" t "$filename IDOS PAW(JTH v2)" axes x1y2
replot "$file/$plot_data_name" u 1:2 w l lw 2 lc rgb "red" t "$filename total DOS PAW(JTH v2)"
replot $EF,t w d lw 2 lc rgb "blue" t "EF" axes x1y2

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"
#replot

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"
replot

set terminal x11

EOF
-----
-----------------------------------------------------------------------------
¡ gnuplot for PWscf

chmod +x plot_tdos
plot_tdos

folder (case) = filename (case.pw)
read: pwscf.pdos_tot

plot_tdos
-----
#!/bin/csh -f

set file     = `pwd`
set filename = $file:t
#
grep "Fermi" $filename.pw.out > ef_.txt
cut -c 25-36 ef_.txt > ef.txt
set EF = `cat ef.txt`
#
set pwscf_dos_format = "pwscf.pdos_tot"
set psformat = ".ps"
set epsformat = ".eps"
#
set plot_data_name = $pwscf_dos_format
rm ef_.txt
rm ef.txt
#
# check
echo "------------------------------"
echo "plot start"
echo "adress   :" $file
echo "file name:" $filename
echo "ef       :" $EF "eV"
echo "read file:" $plot_data_name
echo "read adr.:" "$file/$plot_data_name"
echo "------------------------------"

gnuplot -persist << EOF

set title "$filename"
set size 0.7,1.0
set xtics 2
set xr[$EF-12:$EF+5]
set xl "{/=30 Energy / eV }"
set yl "{/=30 Density of State / eV }"
set parametric
set x=const
set y=t
set const=$EF
set tr[0:70]

# linetype=lt, linecolor=lc, linewidth=lw, pointtype=pt, pointsize=ps
# with=w, line=l, color setting=lc rgb "",
set key box center top
plot "$file/$plot_data_name" u 1:2 w l lw 2 lc rgb "red" t "$filename total DOS PAW"
replot $EF,t w d lw 2 lc rgb "blue" t "EF" axes x1y2

#set size 1.0,1.0
#set terminal postscript color enhanced "Arial" 30
#set out "$filename$psformat"
#replot

set size 1.5,2.1
set terminal postscript eps color enhanced "Arial" 30
set out "$filename$epsformat"
replot

set terminal x11

EOF
-----
-----------------------------------------------------------------------------
QRƒR[ƒh
Œg‘Ñ—pQRƒR[ƒh
ƒAƒNƒZƒX”
ƒy[ƒWƒrƒ…[”