Merge branch 'myqe' into 'develop'

seqopn cleanup

See merge request QEF/q-e!566
This commit is contained in:
giannozz 2019-08-21 17:27:29 +00:00
commit 1a60172235
21 changed files with 42 additions and 62 deletions

View File

@ -62,7 +62,7 @@
USE mp, ONLY : mp_barrier, mp_bcast, mp_sum
USE io_global, ONLY : stdout
USE wavefunctions, ONLY : evc
USE io_files, ONLY : diropn, seqopn
USE io_files, ONLY : diropn
USE wvfct, ONLY : npwx
USE pwcom, ONLY : current_spin, lsda, nbnd, nks
USE klist_epw, ONLY : xk_loc, xk_all, isk_loc, et_all

View File

@ -18,7 +18,7 @@
!! Imported the noncolinear case implemented by xlzhang
!!
!-----------------------------------------------------------------------
USE io_files, ONLY : prefix, diropn, seqopn
USE io_files, ONLY : prefix, diropn
USE units_lr, ONLY : iuwfc, lrwfc
USE wvfct, ONLY : nbnd, npwx
USE noncollin_module, ONLY : npol, nspin_mag

View File

@ -30,7 +30,7 @@ SUBROUTINE openfilq()
USE wvfct, ONLY : nbnd, npwx
USE lsda_mod, ONLY : nspin
USE uspp, ONLY : nkb, okvan
USE io_files, ONLY : prefix,tmp_dir, diropn,seqopn
USE io_files, ONLY : prefix,tmp_dir, diropn
USE noncollin_module, ONLY : npol, nspin_mag
USE mp_pools, ONLY : me_pool
USE io_global, ONLY : ionode

View File

@ -20,7 +20,6 @@ program simple
use pwcom, only : nspin
use uspp, ONLY : okvan
use realus, ONLY : generate_qpointlist
USE io_files, ONLY : seqopn
USE wannier_gw, ONLY : num_nbndv
USE gvect, ONLY : ngm
USE gvecs, ONLY : doublegrid

View File

@ -33,7 +33,6 @@ SUBROUTINE hp_dnsq (lmetq0, iter, conv_root, dnsq)
USE buffers, ONLY : get_buffer
USE mp_pools, ONLY : intra_pool_comm, inter_pool_comm
USE mp, ONLY : mp_sum
USE io_files, ONLY : seqopn
USE io_global, ONLY : stdout
USE constants, ONLY : rytoev
USE control_flags, ONLY : iverbosity

View File

@ -12,7 +12,7 @@ SUBROUTINE hp_openfil_q()
!
! This subroutine opens all necessary files necessary.
!
USE io_files, ONLY : tmp_dir, seqopn, nwordwfcU
USE io_files, ONLY : tmp_dir, nwordwfcU
USE control_flags, ONLY : io_level
USE wvfct, ONLY : nbnd, npwx
USE io_files, ONLY : prefix

View File

@ -13,7 +13,7 @@ SUBROUTINE hp_run_nscf (do_band)
!
USE control_flags, ONLY : conv_ions, restart, iverbosity, isolve
USE basis, ONLY : starting_wfc, starting_pot, startingconfig
USE io_files, ONLY : prefix, tmp_dir, wfc_dir, seqopn
USE io_files, ONLY : prefix, tmp_dir, wfc_dir
USE lsda_mod, ONLY : nspin
USE check_stop, ONLY : check_stop_now
USE fft_types, ONLY : fft_type_allocate

View File

@ -26,7 +26,7 @@ SUBROUTINE compute_scf( fii, lii, stat )
USE ions_base, ONLY : tau, nat, ityp, zv
USE ener, ONLY : etot, ef
USE force_mod, ONLY : force
USE io_files, ONLY : prefix, tmp_dir, wfc_dir, iunupdate, seqopn, &
USE io_files, ONLY : prefix, tmp_dir, wfc_dir, iunupdate, &
exit_file, delete_if_present
USE path_io_units_module, ONLY : iunpath
USE path_formats, ONLY : scf_fmt, scf_fmt_para

View File

@ -43,7 +43,6 @@ SUBROUTINE dnsq_scf (npe, lmetq0, imode0, irr, lflag)
USE mp_pools, ONLY : inter_pool_comm
USE mp_bands, ONLY : intra_bgrp_comm
USE mp, ONLY : mp_sum
USE io_files, ONLY : seqopn
USE io_global, ONLY : stdout
USE buffers, ONLY : get_buffer
USE efermi_shift, ONLY : def

View File

@ -31,8 +31,7 @@ SUBROUTINE electrons()
kedtau, vnew
USE control_flags, ONLY : tr2, niter, conv_elec, restart, lmd, &
do_makov_payne
USE io_files, ONLY : iunmix, output_drho, &
iunres, iunefield, seqopn
USE io_files, ONLY : iunres, seqopn
USE ldaU, ONLY : eth
USE extfield, ONLY : tefield, etotefield
USE wvfct, ONLY : nbnd, wg, et
@ -384,8 +383,7 @@ SUBROUTINE electrons_scf ( printout, exxen )
llondon, ldftd3, scf_must_converge, lxdm, ts_vdw
USE control_flags, ONLY : n_scf_steps, scf_error
USE io_files, ONLY : iunmix, output_drho, &
iunres, iunefield, seqopn
USE io_files, ONLY : iunmix, output_drho
USE ldaU, ONLY : eth, Hubbard_U, Hubbard_lmax, &
niter_with_fixed_ns, lda_plus_u
USE extfield, ONLY : tefield, etotefield, gate, etotgatefield !TB

View File

@ -135,8 +135,6 @@ SUBROUTINE h_psi_( lda, n, m, psi, hpsi )
!
! ... Here the product with the local potential V_loc psi
!
CALL start_clock( 'h_psi:pot' ); !write (*,*) 'start h_pot';FLUSH(6)
!
IF ( gamma_only ) THEN
!
IF ( real_space .and. nkb > 0 ) then
@ -217,8 +215,6 @@ SUBROUTINE h_psi_( lda, n, m, psi, hpsi )
!
END IF
!
CALL stop_clock( 'h_psi:pot' )
!
if (dft_is_meta()) call h_psi_meta (lda, n, m, psi, hpsi)
!
! ... Here we add the Hubbard potential times psi

View File

@ -34,7 +34,7 @@ MODULE io_rho_xml
USE cell_base, ONLY : bg, tpiba
USE gvect, ONLY : ig_l2g, mill
USE control_flags, ONLY : gamma_only
USE io_files, ONLY : seqopn, postfix, restart_dir
USE io_files, ONLY : restart_dir
USE io_global, ONLY : ionode, ionode_id, stdout
USE mp_pools, ONLY : my_pool_id
USE mp_bands, ONLY : my_bgrp_id, root_bgrp_id, &
@ -83,8 +83,8 @@ MODULE io_rho_xml
!
iunocc = find_free_unit ()
IF ( ionode ) THEN
! postfix(2:6) = without the dot (seqopn already adds it)
CALL seqopn( iunocc, postfix(2:6)//'occup.txt', 'FORMATTED', lexist )
OPEN ( UNIT=iunocc, FILE = TRIM(dirname) // 'occup.txt', &
FORM='formatted', STATUS='unknown' )
if (noncolin) then
WRITE( iunocc, * , iostat = ierr) rho%ns_nc
else
@ -103,8 +103,8 @@ MODULE io_rho_xml
!
iunpaw = find_free_unit ()
IF ( ionode ) THEN
! postfix(2:6) = without the dot (seqopn already adds it)
CALL seqopn( iunpaw, postfix(2:6)//'paw.txt', 'FORMATTED', lexist )
OPEN ( UNIT=iunpaw, FILE = TRIM(dirname) // 'paw.txt', &
FORM='formatted', STATUS='unknown' )
WRITE( iunpaw, * , iostat = ierr) rho%bec
END IF
CALL mp_bcast( ierr, ionode_id, intra_image_comm )
@ -127,7 +127,7 @@ MODULE io_rho_xml
USE spin_orb, ONLY : domag
USE gvect, ONLY : ig_l2g
USE funct, ONLY : dft_is_meta
USE io_files, ONLY : seqopn, postfix, restart_dir
USE io_files, ONLY : restart_dir
USE io_global, ONLY : ionode, ionode_id, stdout
USE mp_bands, ONLY : root_bgrp, intra_bgrp_comm
USE mp_images, ONLY : intra_image_comm
@ -171,8 +171,8 @@ MODULE io_rho_xml
!
iunocc = find_free_unit ()
IF ( ionode ) THEN
! postfix(2:6) = without the dot (seqopn already adds it)
CALL seqopn( iunocc, postfix(2:6)//'occup.txt', 'FORMATTED', lexist )
OPEN ( UNIT=iunocc, FILE = TRIM(dirname) // 'occup.txt', &
FORM='formatted', STATUS='old', IOSTAT=ierr )
if (noncolin) then
READ( UNIT = iunocc, FMT = *, iostat = ierr ) rho%ns_nc
else
@ -206,8 +206,8 @@ MODULE io_rho_xml
!
iunpaw = find_free_unit ()
IF ( ionode ) THEN
! postfix(2:6) = without the dot (seqopn already adds it)
CALL seqopn( iunpaw, postfix(2:6)//'paw.txt', 'FORMATTED', lexist )
OPEN ( UNIT=iunpaw, FILE = TRIM(dirname) // 'paw.txt', &
FORM='formatted', STATUS='old', IOSTAT=ierr )
READ( UNIT = iunpaw, FMT = *, iostat=ierr ) rho%bec
END IF
CALL mp_bcast( ierr, ionode_id, intra_image_comm )

View File

@ -18,7 +18,7 @@
USE control_flags, ONLY : io_level, conv_elec, lbands
USE ener, ONLY : ef
USE io_global, ONLY : stdout, ionode
USE io_files, ONLY : iunwfc, nwordwfc, iunefield
USE io_files, ONLY : iunwfc, nwordwfc
USE buffers, ONLY : save_buffer
USE klist, ONLY : xk, wk, nks, nkstot
USE lsda_mod, ONLY : lsda, nspin

View File

@ -162,13 +162,12 @@ SUBROUTINE print_clock_pw()
END IF
!
WRITE( stdout, '(/5x,"Called by h_psi:")' )
! IF ( iverbosity > 0 ) THEN
CALL print_clock( 'h_psi:init' )
CALL print_clock( 'h_psi:pot' )
CALL print_clock( 'h_psi:calbec' )
! END IF
CALL print_clock( 'vloc_psi' ) ; CALL print_clock ( 'vloc_psi:tg_gather' ) ; CALL print_clock ( 'v_loc_psir' )
CALL print_clock( 'add_vuspsi' ) ; CALL print_clock ( 'add_vuspsir' )
CALL print_clock( 'h_psi:calbec' )
CALL print_clock( 'vloc_psi' )
CALL print_clock( 'vloc_psi:tg_gather' )
CALL print_clock( 'v_loc_psir' )
CALL print_clock( 'add_vuspsi' )
CALL print_clock( 'add_vuspsir' )
CALL print_clock( 'vhpsi' )
CALL print_clock( 'h_psi_meta' )
CALL print_clock( 'hs_1psi' )

View File

@ -31,7 +31,7 @@ MODULE pw_restart_new
qexsd_init_outputPBC, qexsd_init_gate_info, qexsd_init_hybrid,&
qexsd_init_dftU, qexsd_init_vdw
USE io_global, ONLY : ionode, ionode_id
USE io_files, ONLY : iunpun, xmlpun_schema, restart_dir
USE io_files, ONLY : iunpun, xmlfile
!
IMPLICIT NONE
!
@ -136,7 +136,6 @@ MODULE pw_restart_new
LOGICAL, INTENT(IN) :: only_init, wf_collect
!
CHARACTER(LEN=20) :: dft_name
CHARACTER(LEN=256) :: dirname
CHARACTER(LEN=8) :: smearing_loc
CHARACTER(LEN=8), EXTERNAL :: schema_smearing
INTEGER :: i, ig, ngg, ipol
@ -217,8 +216,6 @@ MODULE pw_restart_new
!
! XML descriptor
!
dirname = restart_dir ()
!
IF ( ionode ) THEN
!
! ... here we init the variables and finally write them to file
@ -651,8 +648,7 @@ MODULE pw_restart_new
!-------------------------------------------------------------------------------
10 CONTINUE
!
CALL qexsd_openschema(TRIM( dirname ) // TRIM( xmlpun_schema ), &
iunpun, 'PWSCF', title )
CALL qexsd_openschema( xmlfile(), iunpun, 'PWSCF', title )
CALL qes_write (qexsd_xf,output)
CALL qes_reset (output)
CALL qexsd_closeschema()
@ -684,7 +680,7 @@ MODULE pw_restart_new
!
USE mp, ONLY : mp_sum, mp_max
USE io_base, ONLY : write_wfc
USE io_files, ONLY : iunwfc, nwordwfc
USE io_files, ONLY : restart_dir, iunwfc, nwordwfc
USE cell_base, ONLY : tpiba, alat, bg
USE control_flags, ONLY : gamma_only, smallmem
USE gvect, ONLY : ig_l2g

View File

@ -14,7 +14,7 @@ FUNCTION read_config_from_file( lmovecell, at_old, omega_old ) RESULT (ierr)
!
USE kinds, ONLY : DP
USE io_global, ONLY : stdout
USE io_files, ONLY : restart_dir, xmlpun_schema, &
USE io_files, ONLY : restart_dir, xmlfile, &
psfile, pseudo_dir, pseudo_dir_cur
USE ions_base, ONLY : nat, nsp, ityp, amass, atm, tau
USE cell_base, ONLY : alat, ibrav, at, bg, omega
@ -38,7 +38,7 @@ FUNCTION read_config_from_file( lmovecell, at_old, omega_old ) RESULT (ierr)
!
! ... check if restart file is present, if so read config parameters
!
ierr = qexsd_readschema ( TRIM(pseudo_dir_cur)//xmlpun_schema, output_obj )
ierr = qexsd_readschema ( xmlfile(), output_obj )
!
IF (ierr == 0 ) THEN
!

View File

@ -22,7 +22,6 @@ SUBROUTINE remove_atomic_rho
USE cell_base, ONLY: bg, tpiba
!
IMPLICIT NONE
CHARACTER(LEN=256) :: filename
COMPLEX(DP), ALLOCATABLE :: drhog(:,:)
!
IF ( nspin > 1 ) CALL errore &
@ -36,9 +35,9 @@ SUBROUTINE remove_atomic_rho
CALL atomic_rho_g ( drhog, nspin)
drhog = rho%of_g - drhog
!
filename = TRIM( restart_dir( ) ) // output_drho
IF ( my_pool_id == 0 .AND. my_bgrp_id == root_bgrp_id ) &
CALL write_rhog( filename, root_bgrp, intra_bgrp_comm, &
CALL write_rhog( TRIM( restart_dir( ) ) // output_drho, &
root_bgrp, intra_bgrp_comm, &
bg(:,1)*tpiba, bg(:,2)*tpiba, bg(:,3)*tpiba, &
gamma_only, mill, ig_l2g, drhog )
!

View File

@ -92,7 +92,6 @@ SUBROUTINE setup()
INTEGER :: na, is, ierr, ibnd, ik, nrot_
LOGICAL :: magnetic_sym, skip_equivalence=.FALSE.
REAL(DP) :: iocc, ionic_charge, one
CHARACTER(LEN=320) :: filename
!
LOGICAL, EXTERNAL :: check_para_diag
!
@ -164,10 +163,9 @@ SUBROUTINE setup()
!
! ... in these cases, we need to read the Fermi energy
!
filename = xmlfile ( )
ierr = qexsd_readschema( filename , output_obj )
ierr = qexsd_readschema( xmlfile() , output_obj )
IF (ierr > 0) CALL errore( 'setup ', 'problem reading ef from file ' // &
& TRIM(filename), ierr )
& TRIM(xmlfile()), ierr )
CALL qexsd_copy_efermi ( output_obj%band_structure, &
nelec, ef, two_fermi_energies, ef_up, ef_dw )
CALL qes_reset ( output_obj )

View File

@ -39,7 +39,6 @@ SUBROUTINE wfcinit()
INTEGER :: ik, ierr
LOGICAL :: exst, exst_mem, exst_file, opnd_file, twfcollect_file = .FALSE.
CHARACTER (LEN=256) :: dirname
CHARACTER (LEN=320) :: filename
TYPE ( output_type ) :: output_obj
!
!
@ -57,8 +56,7 @@ SUBROUTINE wfcinit()
!
IF ( TRIM(starting_wfc) == 'file') THEN
dirname = restart_dir ( )
filename= xmlfile ( )
ierr = qexsd_readschema( filename, output_obj )
ierr = qexsd_readschema( xmlfile(), output_obj )
IF ( ierr <= 0 ) THEN
twfcollect_file = output_obj%band_structure%wf_collected
IF ( twfcollect_file ) THEN

View File

@ -620,7 +620,7 @@ CONTAINS
SUBROUTINE write_xdmdat()
! save the XDM coefficients and vdw radii to the xdm.dat file for ph.x
USE io_files, ONLY: seqopn, postfix
USE io_files, ONLY: restart_dir
USE io_global, ONLY: ionode
USE ions_base, ONLY: nat
INTEGER :: iunxdm, ierr
@ -630,13 +630,14 @@ CONTAINS
IF (ionode) THEN
iunxdm = find_free_unit ()
CALL seqopn(iunxdm,postfix(2:6)//'xdm.dat','UNFORMATTED',lexist)
OPEN ( UNIT=iunxdm, FILE = TRIM(restart_dir() ) // 'xdm.dat', &
FORM='unformatted', STATUS='unknown' )
WRITE (iunxdm,iostat=ierr) 1 ! version
IF (ierr /= 0) CALL errore('energy_xdm','writing xdm.dat',1)
WRITE (iunxdm,iostat=ierr) lmax, rmax2
IF (ierr /= 0) CALL errore('energy_xdm','writing xdm.dat',1)
IF (ierr /= 0) CALL errore('energy_xdm','writing xdm.dat',2)
WRITE (iunxdm,iostat=ierr) 2d0 * cx(1:nat,1:nat,2:4), rvdw(1:nat,1:nat)
IF (ierr /= 0) CALL errore('energy_xdm','writing xdm.dat',1)
IF (ierr /= 0) CALL errore('energy_xdm','writing xdm.dat',3)
CLOSE (UNIT=iunxdm, STATUS='KEEP')
ENDIF

View File

@ -10,14 +10,12 @@
SUBROUTINE openfil_cond()
!----------------------------------------------------------------------------
!
! ... This routine opens some files needed by pwcond,
! ... This routine opens some files needed by pwcond
!
USE kinds, ONLY : DP
USE io_global, ONLY : stdout
USE wvfct, ONLY : nbnd, npwx
USE io_files, ONLY : prefix, iunpun, iunsat, iunwfc, &
nwordwfc, nwordatwfc, iunefield, &
iunefieldm, iunefieldp
USE io_files, ONLY : iunwfc, nwordwfc
USE noncollin_module, ONLY : npol
USE buffers, ONLY : open_buffer
USE control_flags, ONLY : io_level