Commit 28d607fd authored by Gregor Michalicek's avatar Gregor Michalicek

Introduced "-old" mode in inpgen

With -old mode only the old inp file is generated.
Without -old mode only the new inp.xml file is generated.

Also added some checks and errors if there already is an input file present.
parent cc886382
...@@ -162,9 +162,9 @@ PROGRAM inpgen ...@@ -162,9 +162,9 @@ PROGRAM inpgen
nops = sym%nop nops = sym%nop
symfn = 'sym.out' symfn = 'sym.out'
IF (.not.input%film) sym%nop2=sym%nop IF (.not.input%film) sym%nop2=sym%nop
CALL rw_symfile(& IF ((juDFT_was_argument("-old")).OR.(.NOT.juDFT_was_argument("-explicit"))) THEN
& 'W',symfh,symfn,nops,cell%bmat,& CALL rw_symfile('W',symfh,symfn,nops,cell%bmat,sym%mrot,sym%tau,sym%nop,sym%nop2,sym%symor)
& sym%mrot,sym%tau,sym%nop,sym%nop2,sym%symor) END IF
ALLOCATE (atomTypeSpecies(atoms%ntype)) ALLOCATE (atomTypeSpecies(atoms%ntype))
ALLOCATE (speciesRepAtomType(atoms%nat)) ALLOCATE (speciesRepAtomType(atoms%nat))
......
...@@ -358,12 +358,15 @@ ...@@ -358,12 +358,15 @@
IF (input%film) atoms%taual(3,:) = atoms%taual(3,:) * a3(3) / dtild IF (input%film) atoms%taual(3,:) = atoms%taual(3,:) * a3(3) / dtild
CLOSE (6) CLOSE (6)
inquire(file="inp",exist=l_exists) INQUIRE(file="inp",exist=l_exists)
IF (l_exists) THEN IF (l_exists) THEN
CALL juDFT_error("Cannot overwrite existing inp-file ",calledby& CALL juDFT_error("inp-file exists. Cannot write another input file in this directory.",calledby="set_inp")
& ="set_inp")
ENDIF ENDIF
INQUIRE(file="inp.xml",exist=l_exists)
IF (l_exists) THEN
CALL juDFT_error("inp.xml-file exists. Cannot write another input file in this directory.",calledby="set_inp")
ENDIF
nu = 8 nu = 8
input%gw = 0 input%gw = 0
...@@ -412,7 +415,7 @@ ...@@ -412,7 +415,7 @@
Jij%phnd=1 Jij%phnd=1
IF(.NOT.juDFT_was_argument("-noXML")) THEN IF(.NOT.juDFT_was_argument("-old")) THEN
nkptOld = kpts%nkpt nkptOld = kpts%nkpt
latnamTemp = cell%latnam latnamTemp = cell%latnam
...@@ -498,7 +501,7 @@ ...@@ -498,7 +501,7 @@
IF (atoms%ntype.GT.999) THEN IF (atoms%ntype.GT.999) THEN
WRITE(*,*) 'More than 999 atom types -> no conventional inp file generated!' WRITE(*,*) 'More than 999 atom types -> no conventional inp file generated!'
WRITE(*,*) 'Use inp.xml file instead!' WRITE(*,*) 'Use inp.xml file instead!'
ELSE ELSE IF (juDFT_was_argument("-old")) THEN
CALL rw_inp(& CALL rw_inp(&
& ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,& & ch_rw,atoms,obsolete,vacuum,input,stars,sliceplot,banddos,&
& cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,& & cell,sym,xcpot,noco,jij,oneD,hybrid,kpts,&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment