This commit is contained in:
Anthony Scemama 2017-06-19 09:42:52 +02:00
parent 1d1d680bdd
commit 14158742bf
3 changed files with 26 additions and 17 deletions

View File

@ -120,10 +120,11 @@ let run slave exe ezfio_file =
| Some (_,x) -> x^" "
| None -> assert false
in
match (Sys.command (prefix^exe^ezfio_file)) with
| 0 -> ()
| i -> Printf.printf "Program exited with code %d.\n%!" i;
;
let exit_code =
match (Sys.command (prefix^exe^ezfio_file)) with
| 0 -> 0
| i -> (Printf.printf "Program exited with code %d.\n%!" i; i)
in
TaskServer.stop ~port:port_number;
Thread.join task_thread;
@ -132,7 +133,8 @@ let run slave exe ezfio_file =
let duration = Time.diff (Time.now()) time_start
|> Core.Span.to_string in
Printf.printf "Wall time : %s\n\n" duration
Printf.printf "Wall time : %s\n\n" duration;
exit exit_code
let spec =
let open Command.Spec in

View File

@ -5,7 +5,6 @@ program scf
! output: hartree_fock.energy
! optional: mo_basis.mo_coef
END_DOC
! call debug
call create_guess
call orthonormalize_mos
call run
@ -56,7 +55,7 @@ subroutine run
! Choose SCF algorithm
! call damping_SCF
! call damping_SCF ! Deprecated routine
call Roothaan_Hall_SCF
end

View File

@ -309,16 +309,16 @@ def write_ezfio(res, filename):
array_l_max_block.append(l_max_block)
array_z_remove.append(z_remove)
x = [[coef_n_zeta.split() for coef_n_zeta in l.split('\n')] \
x = [[ filter(None,coef_n_zeta.split()) for coef_n_zeta in l.split('\n')] \
for l in array_party[1:] ]
x = []
for l in array_party[1:]:
y = []
for coef_n_zeta in l.split('\n'):
z = coef_n_zeta.split()
if z : y.append(z)
x.append(y)
matrix.append(x)
# x = []
# for l in array_party[1:]:
# y = []
# for coef_n_zeta in l.split('\n'):
# z = coef_n_zeta.split()
# if z : y.append(z)
# x.append(y)
# matrix.append(x)
return (matrix, array_l_max_block, array_z_remove)
def get_local_stuff(matrix):
@ -444,4 +444,12 @@ if __name__ == '__main__':
print file_, 'recognized as', str(res_file).split('.')[-1].split()[0]
write_ezfio(res_file, ezfio_file)
os.system("qp_run save_ortho_mos "+ezfio_file)
if os.system("qp_run save_ortho_mos "+ezfio_file) != 0:
print """Warning: You need to run
qp_run save_ortho_mos """+ezfio_file+"""
to be sure your MOs will be orthogonal, which is not the case when
the MOs are read from output files (not enough precision in output)."""