zerothi / sisl

Electronic structure Python package for post analysis and large scale tight-binding DFT/NEGF calculations
https://zerothi.github.io/sisl
Mozilla Public License 2.0
181 stars 58 forks source link

ex_03.py in sisl/examples could not finish normally. #40

Closed staniba closed 6 years ago

staniba commented 6 years ago

Dear Nick,

Drawing on your advice, I firstly installed 4.1-b3 of Siesta. Next, I obtained an execution file of "phtrans" by just typing "make phtrans", at "siesta-4.1-b3/Util/TS/TBtrans/" .

So I tried to run ex_03.py in sisl/examples, but I could not finish it normally.

What I did so far are followings: (1) python ex_03.py => obtained {zz.gin, ZZ.fdf}. (2) gulp < zz.gin >zz.gout => seems to be finished normally. (3) python ex_03.py => obtained {ELEC_zz.nc, DEVICE_zz.nc} (4) phtrans ZZ.out =>obtained the following message: forrtl: severe (24): end-of-file during read, unit 12, file /home/satoru/work/sisl.test/DEVICE_zz.nc

ZZ.out

PHtrans Version: siesta-4.1--736 Architecture : x86_64-unknown-linux-gnu--unknown Compiler flags: mpif90 -g PP flags : -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DTBTRANS -DTBT_PHONON Libraries : -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_lapack95_lp64 -lmkl_blas95_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread PARALLEL version

reinit: Reading from standard input ** Dump of input data file **** SystemLabel ZZ TBT.DOS.Gf T TBT.k [51 1 1] TBT.HS DEVICE_zz.nc %block TBT.Contour.line part line from 0. eV to .23 eV points 400 method mid-rule %endblock TBT.Contour.line %block TBT.Elec.Left HS ELEC_zz.nc semi-inf-direction -a2 electrode-position 1 %endblock %block TBT.Elec.Right HS ELEC_zz.nc semi-inf-direction +a2 electrode-position end -1 %endblock ** End of input data file *****

reinit: ----------------------------------------------------------------------- reinit: System Name: reinit: ----------------------------------------------------------------------- reinit: System Label: ZZ reinit: -----------------------------------------------------------------------

zerothi commented 6 years ago

Yes.

Do you still see problems? Could you please supply as much information as possible. I can't reproduce your errors.

zerothi commented 6 years ago

ok, you need to compile phtrans with netcdf-4 support.

Please read the tbtrans manual on compilation and assert you have netcdf-4 support.

staniba commented 6 years ago

I failed to create libncdf.a.

What I did so far after recieving your help: (1) Downloaded five files:{ m4-latest, zlib-1.2.11, hdf5-1.8.18, netcdf-c-4.4.1.1, netcdf-fortran-4.4.4 }. (2) Installed m4-latest. (3) Moved four files { zlib, hdf5, netcdf-c, netcdf-fortran } to "siesta-4.1-b3/Doc". (4) Carried out "install_netcdf4.bash". (5) Obtained the following message in the tail:

Please add the following to the BOTTOM of your arch.make file

INCFLAGS += -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include LDFLAGS += -L/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib LDFLAGS += -L/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib LDFLAGS += -L/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib LIBS += -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz COMP_LIBS += libncdf.a libfdict.a FPPFLAGS += -DCDF -DNCDF -DNCDF_4

(6) Added those above to my arch.make, and moved to "siesta-4.1-b3/Util/TS/TBtrans" . (7) Typed "make phtrans". (8) Obtained Some error messages in the tails.

compilation aborted for netcdf_ncdf.f90 (code 1) failed in the recipe of 'netcdf_ncdf.o' failed in the recipe of 'libncdf.a'

satoru

staniba commented 6 years ago

Details of error message related to compilation of " netcdf_netcdf.f90 ":

mpif90 -c -o netcdf_ncdf.o -g -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include -I../ netcdf_ncdf.f90 netcdf_ncdf.f90(59): error #7013: This module file was not generated by any release of this compiler. [NETCDF] use netcdf ------^ netcdf_ncdf.f90(95): error #8237: The character length in a component declaration shall either be a colon, be an initialization expression, or be a specification expression. [GRP] character(len=NF90_MAX_NAME) :: grp = " " -------------------------------------^ netcdf_ncdf.f90(95): error #6404: This name does not have a type, and must have an explicit type. [NF90_MAX_NAME] character(len=NF90_MAX_NAME) :: grp = " " -------------------^ netcdf_ncdf.f90(255): error #6404: This name does not have a type, and must have an explicit type. [NF90_MPIIO] par = iand(NF90_MPIIO,this%mode) == NF90_MPIIO ---------------^ netcdf_ncdf.f90(255): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [IAND] par = iand(NF90_MPIIO,this%mode) == NF90_MPIIO ---------------^ netcdf_ncdf.f90(255): error #6363: The intrinsic data types of the arguments must be the same. [IAND] par = iand(NF90_MPIIO,this%mode) == NF90_MPIIO --------------------------^ netcdf_ncdf.f90(255): error #6404: This name does not have a type, and must have an explicit type. [IAND] par = iand(NF90_MPIIO,this%mode) == NF90_MPIIO ----------^ netcdf_ncdf.f90(257): error #6404: This name does not have a type, and must have an explicit type. [NF90_MPIPOSIX] par = iand(NF90_MPIPOSIX,this%mode) == NF90_MPIPOSIX ---------------^ netcdf_ncdf.f90(259): error #6404: This name does not have a type, and must have an explicit type. [NF90_PNETCDF] par = iand(NF90_PNETCDF,this%mode) == NF90_PNETCDF ---------------^ netcdf_ncdf.f90(303): error #6404: This name does not have a type, and must have an explicit type. [NF90_64BIT_OFFSET] this%mode = IOR(this%mode,NF90_64BIT_OFFSET) ---------------------------------^ netcdf_ncdf.f90(303): error #6363: The intrinsic data types of the arguments must be the same. [IOR] this%mode = IOR(this%mode,NF90_64BIT_OFFSET) ---------------------------------^ netcdf_ncdf.f90(323): error #6404: This name does not have a type, and must have an explicit type. [NF90_SHARE] this%mode = ior(this%mode, NF90_SHARE) ----------------------------------^ netcdf_ncdf.f90(323): error #6363: The intrinsic data types of the arguments must be the same. [IOR] this%mode = ior(this%mode, NF90_SHARE) ----------------------------------^ netcdf_ncdf.f90(336): error #6404: This name does not have a type, and must have an explicit type. [NF90_NOCLOBBER] this%mode = ior(this%mode, NF90_NOCLOBBER) -------------------------------------^ netcdf_ncdf.f90(336): error #6363: The intrinsic data types of the arguments must be the same. [IOR] this%mode = ior(this%mode, NF90_NOCLOBBER) -------------------------------------^ netcdf_ncdf.f90(362): error #6404: This name does not have a type, and must have an explicit type. [NF90_NETCDF4] if ( iand(NF90_NETCDF4,this%mode) == NF90_NETCDF4 ) then --------------^ netcdf_ncdf.f90(362): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [IAND] if ( iand(NF90_NETCDF4,this%mode) == NF90_NETCDF4 ) then --------------^ netcdf_ncdf.f90(362): error #6363: The intrinsic data types of the arguments must be the same. [IAND] if ( iand(NF90_NETCDF4,this%mode) == NF90_NETCDF4 ) then ---------------------------^ netcdf_ncdf.f90(362): error #6404: This name does not have a type, and must have an explicit type. [IAND] if ( iand(NF90_NETCDF4,this%mode) == NF90_NETCDF4 ) then ---------^ netcdf_ncdf.f90(373): error #6404: This name does not have a type, and must have an explicit type. [NF90_CREATE] call ncdf_err(nf90_create(filename, this%mode , this%f_id), & ---------------------^ netcdf_ncdf.f90(398): warning #7319: This argument's data type is incompatible with this intrinsic procedure; procedure assumed EXTERNAL. [IAND] if ( iand(NF90_NETCDF4,this%mode) == NF90_NETCDF4 ) then --------------^ netcdf_ncdf.f90(398): error #6363: The intrinsic data types of the arguments must be the same. [IAND] if ( iand(NF90_NETCDF4,this%mode) == NF90_NETCDF4 ) then ---------------------------^ netcdf_ncdf.f90(398): error #6404: This name does not have a type, and must have an explicit type. [IAND] if ( iand(NF90_NETCDF4,this%mode) == NF90_NETCDF4 ) then ---------^ netcdf_ncdf.f90(411): error #6404: This name does not have a type, and must have an explicit type. [NF90_NOWRITE] this%mode = IOR(this%mode,NF90_NOWRITE) ---------------------------------^ netcdf_ncdf.f90(411): error #6363: The intrinsic data types of the arguments must be the same. [IOR] this%mode = IOR(this%mode,NF90_NOWRITE) ---------------------------------^ netcdf_ncdf.f90(416): error #6404: This name does not have a type, and must have an explicit type. [NF90_OPEN] call ncdf_err(nf90_open(filename, this%mode , this%f_id), & ---------------------^ netcdf_ncdf.f90(426): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQ_GRP_FULL_NCID] call ncdf_err(nf90_inq_grp_full_ncid(this%f_id, trim(this%grp), this%id)) ---------------------^ netcdf_ncdf.f90(627): error #6404: This name does not have a type, and must have an explicit type. [NF90_CLOSE] call ncdf_err(nf90_close(this%f_id),"Closing NetCDF file: "//this) ------------------^ netcdf_ncdf.f90(653): error #6632: Keyword arguments are invalid without an explicit interface. [FORMATNUM] call ncdf_err(nf90_inquire(this%id,ldims,lvars,latts,formatNum=lformat), & ---------------------------------------------------------^ netcdf_ncdf.f90(653): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQUIRE] call ncdf_err(nf90_inquire(this%id,ldims,lvars,latts,formatNum=lformat), & ------------------^ netcdf_ncdf.f90(663): error #6632: Keyword arguments are invalid without an explicit interface. [NAME] call ncdf_err(nf90_inquire_dimension(this%id,i,name=key)) ---------------------------------------------------------^ netcdf_ncdf.f90(663): error #6404: This name does not have a type, and must have an explicit type. [NF90_INQUIRE_DIMENSION] call ncdf_err(nf90_inquire_dimension(this%id,i,name=key)) ------------------------^ netcdf_ncdf.f90(2995): catastrophic error: Too many errors, exiting compilation aborted for netcdf_ncdf.f90 (code 1)

zerothi commented 6 years ago

Try and do LIBS += $(LDFLAGS) and make clean ; make

staniba commented 6 years ago

I added LIBS += $(LDFLAGS) to my arch.make . I moved to siesta-4.1-b3/Util/TS/TBtrans. I typed " make clean ", then " make phtrans ". However, it did not improve. In setup.make, " LIBS += $(LDFLAGS) to my arch.make " was reflected. The contents of setup.make is below:

FC=mpif90 AR=ar RANLIB=ranlib FFLAGS=-g FPPFLAGS = -DMPI -DFC_HAVE_FLUSH -DFC_HAVE_ABORT -DCDF -DNCDF -DNCDF_4 -DTBTRANS -DTBT_PHONON INCLUDES = -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include -I../ LIBS = -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_lapack95_lp64 -lmkl_blas95_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -L/opt/intel/mkl/lib/intel64 -L/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib -L/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib -L/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -lfdict

zerothi commented 6 years ago

Perhaps it should be in front:

LIBS := $(LDFLAGS) $(LIBS)

staniba commented 6 years ago

It did not improve. I replaced " LIBS += $(LDFLAGS) " to " LIBS := $(LDFLAGS) $(LIBS) ". And I typed " make clean ", then " make phtrans ". The above change of LIBS was reflected in setup.make in " Util/TS/TBtrans/ncdf ".

LIBS = -L/opt/intel/mkl/lib/intel64 -L/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib -L/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib -L/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -lmkl_scalapack_lp64 -lmkl_blacs_openmpi_lp64 -lmkl_lapack95_lp64 -lmkl_blas95_lp64 -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -lfdict

staniba commented 6 years ago

Current status:

In siesta-4.1-b3/Util/TS/TBtrans/fdict/, libfdict.a is created.

In siesta-4.1-b3/Util/TS/TBtrans/ncdf/, libncdf.a is NOT created.

siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib/, libnetcdf.a and libnetcdff.a are created.

zerothi commented 6 years ago

Could you run: /home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/bin/nf-config --all

staniba commented 6 years ago

Now I have done it. The result is like this:

This netCDF-Fortran 4.4.4 has been built with the following features:

--cc -> gcc --cflags -> -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include -DgFortran -I/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/include -I/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/include -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include

--fc -> gfortran --fflags -> -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include --flibs -> -L/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -lnetcdff -lnetcdf -L/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib -L/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib -L/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -lnetcdf -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -lz --has-f90 -> no --has-f03 -> yes

--has-nc2 -> yes --has-nc4 -> yes

--prefix -> /home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1 --includedir-> /home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include --version -> netCDF-Fortran 4.4.4

See you tomorrow.

satoru

zerothi commented 6 years ago

Could you list the files in: /home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include

zerothi commented 6 years ago

Sorry, now I know what has gone wrong. The libraries you compiled with install_netcdf was done using the gfortran compiler. However, you are using the intel compiler for phtrans. And thus the error will occur.

  1. You have to use the same compiler for all libraries to make this work.
  2. Recompile the zlib, hdf5 and netcdf libraries with the intel compiler.
  3. Compile phtrans.
staniba commented 6 years ago

The files in " /home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include ":

netcdf.h
netcdf.inc
netcdf.mod
netcdf4_f03.mod
netcdf4_nc_interfaces.mod
netcdf4_nf_interfaces.mod
netcdf_f03.mod
netcdf_fortv2_c_interfaces.mod
netcdf_mem.h
netcdf_meta.h
netcdf_nc_data.mod
netcdf_nc_interfaces.mod
netcdf_nf_data.mod
netcdf_nf_interfaces.mod
typesizes.mod

Now I will recompile the zlib, hdf5 and netcdf libraries with the intel compiler. See you later.

satoru

staniba commented 6 years ago

Thank you very much for your help. I think I succeeded in runnning ex_03.py . All of files created while running ex_03.py are bellow:

CLOCK
DEVICE_zz.nc
ELEC_zz.nc
INPUT_TMP.1806877018
NON_TRIMMED_KP_LIST
ZZ.PHT.AVDOS
ZZ.PHT.AVTRANS_Left-Right
ZZ.PHT.CC
ZZ.PHT.DOS
ZZ.PHT.KP
ZZ.PHT.TRANS_Left-Right
ZZ.PHT.nc
ZZ.fdf
ZZ.out
ex_03.py
fdf-77021.log
zz.gin
zz.gout

satoru

staniba commented 6 years ago

The last time I compiled the zlib, hdf5 and netcdf libraries, I just typed " ./install_netcdf4.bash ".

This time, I edited it slightly. I just added { export CC=icc, export CXX=icpc, export FC=ifort, export F90=ifort } to the bash script, and also deleted " -Dgfortran " from CPPFLAGS in " Install NetCDF-Fortran ".

/Docs/build/netcdf/4.4.1.1/bin/nf-config --all

  --cc        -> icc
  --cflags    ->  -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include -I/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/include    -I/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/include -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include

  --fc        -> ifort
  --fflags    -> -I/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include
  --flibs     -> -L/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -lnetcdff  -lnetcdf -L/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/zlib/1.2.11/lib         -L/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/hdf5/1.8.18/lib        -L/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib -Wl,-rpath=/home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/lib   -lnetcdf -lhdf5hl_fortran -lhdf5_fortran -lhdf5_hl -lhdf5 -lz
  --has-f90   -> no
  --has-f03   -> yes

  --has-nc2   -> yes
  --has-nc4   -> yes

  --prefix    -> /home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1
  --includedir-> /home/satoru/siesta-4.1-b3/Docs/build/netcdf/4.4.1.1/include
  --version   -> netCDF-Fortran 4.4.4

satoru