9
1
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-11-07 05:53:37 +01:00

allow no basis set
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Anthony Scemama 2023-05-10 14:44:45 +02:00
parent 52da1de877
commit 46e3faed3c
6 changed files with 161 additions and 157 deletions

5
data/basis/none Normal file
View File

@ -0,0 +1,5 @@
$DATA
HYDROGEN
$END

View File

@ -247,8 +247,7 @@ end = struct
let read () = let read () =
if (Ezfio.has_ao_basis_ao_basis ()) then try
begin
let result = let result =
{ ao_basis = read_ao_basis (); { ao_basis = read_ao_basis ();
ao_num = read_ao_num () ; ao_num = read_ao_num () ;
@ -267,9 +266,8 @@ end = struct
|> MD5.to_string |> MD5.to_string
|> Ezfio.set_ao_basis_ao_md5 ; |> Ezfio.set_ao_basis_ao_md5 ;
Some result Some result
end with
else | _ -> (Ezfio.set_ao_basis_ao_md5 "None" ; None)
None
;; ;;

View File

@ -478,6 +478,7 @@ let run ?o b au c d m p cart xyz_file =
let nmax = let nmax =
Nucl_number.get_max () Nucl_number.get_max ()
in in
let rec do_work (accu:(Atom.t*Nucl_number.t) list) (n:int) = function let rec do_work (accu:(Atom.t*Nucl_number.t) list) (n:int) = function
| [] -> accu | [] -> accu
| e::tail -> | e::tail ->
@ -520,6 +521,8 @@ let run ?o b au c d m p cart xyz_file =
in in
let long_basis = Long_basis.of_basis basis in let long_basis = Long_basis.of_basis basis in
let ao_num = List.length long_basis in let ao_num = List.length long_basis in
if ao_num > 0 then
begin
Ezfio.set_ao_basis_ao_num ao_num; Ezfio.set_ao_basis_ao_num ao_num;
Ezfio.set_ao_basis_ao_basis b; Ezfio.set_ao_basis_ao_basis b;
Ezfio.set_basis_basis b; Ezfio.set_basis_basis b;
@ -655,6 +658,7 @@ let run ?o b au c d m p cart xyz_file =
match Input.Ao_basis.read () with match Input.Ao_basis.read () with
| None -> failwith "Error in basis" | None -> failwith "Error in basis"
| Some x -> Input.Ao_basis.write x | Some x -> Input.Ao_basis.write x
end
in in
let () = let () =
try write_file () with try write_file () with
@ -781,7 +785,7 @@ If a file with the same name as the basis set exists, this file will be read. O
run ?o:output basis au charge dummy multiplicity pseudo cart xyz_filename run ?o:output basis au charge dummy multiplicity pseudo cart xyz_filename
) )
with with
| Failure txt -> Printf.eprintf "Fatal error: %s\n%!" txt (* | Failure txt -> Printf.eprintf "Fatal error: %s\n%!" txt *)
| Command_line.Error txt -> Printf.eprintf "Command line error: %s\n%!" txt | Command_line.Error txt -> Printf.eprintf "Command line error: %s\n%!" txt

View File

@ -172,11 +172,8 @@ let run check_only ?ndet ?state ezfio_filename =
(* Reorder basis set *) (* Reorder basis set *)
begin begin
let aos =
match Input.Ao_basis.read() with match Input.Ao_basis.read() with
| Some x -> x | Some aos ->
| _ -> assert false
in
let ordering = Input.Ao_basis.ordering aos in let ordering = Input.Ao_basis.ordering aos in
let test = Array.copy ordering in let test = Array.copy ordering in
Array.sort compare test ; Array.sort compare test ;
@ -191,6 +188,7 @@ let run check_only ?ndet ?state ezfio_filename =
let new_mos = Input.Mo_basis.reorder mos ordering in let new_mos = Input.Mo_basis.reorder mos ordering in
Input.Mo_basis.write new_mos Input.Mo_basis.write new_mos
end end
| _ -> ()
end; end;
begin begin

View File

@ -22,4 +22,4 @@ ezfio_name: direct
type: logical type: logical
doc: Perform Cholesky decomposition of AO integrals doc: Perform Cholesky decomposition of AO integrals
interface: ezfio,provider,ocaml interface: ezfio,provider,ocaml
default: True default: False

View File

@ -3,7 +3,6 @@ subroutine save_mos
double precision, allocatable :: buffer(:,:) double precision, allocatable :: buffer(:,:)
integer :: i,j integer :: i,j
call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename))
call ezfio_set_mo_basis_mo_num(mo_num) call ezfio_set_mo_basis_mo_num(mo_num)
call ezfio_set_mo_basis_mo_label(mo_label) call ezfio_set_mo_basis_mo_label(mo_label)
call ezfio_set_mo_basis_ao_md5(ao_md5) call ezfio_set_mo_basis_ao_md5(ao_md5)
@ -27,7 +26,7 @@ subroutine save_mos_no_occ
double precision, allocatable :: buffer(:,:) double precision, allocatable :: buffer(:,:)
integer :: i,j integer :: i,j
call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename)) ! call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename))
!call ezfio_set_mo_basis_mo_num(mo_num) !call ezfio_set_mo_basis_mo_num(mo_num)
!call ezfio_set_mo_basis_mo_label(mo_label) !call ezfio_set_mo_basis_mo_label(mo_label)
!call ezfio_set_mo_basis_ao_md5(ao_md5) !call ezfio_set_mo_basis_ao_md5(ao_md5)
@ -48,7 +47,7 @@ subroutine save_mos_truncated(n)
double precision, allocatable :: buffer(:,:) double precision, allocatable :: buffer(:,:)
integer :: i,j,n integer :: i,j,n
call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename)) ! call system('$QP_ROOT/scripts/save_current_mos.sh '//trim(ezfio_filename))
call ezfio_set_mo_basis_mo_num(n) call ezfio_set_mo_basis_mo_num(n)
call ezfio_set_mo_basis_mo_label(mo_label) call ezfio_set_mo_basis_mo_label(mo_label)