QCaml/run_integrals.ml

38 lines
1.0 KiB
OCaml
Raw Normal View History

2018-01-18 00:21:05 +01:00
let basis_file : string option ref = ref None
let coord_file : string option ref = ref None
let speclist = [
( "-b" , Arg.String (fun x -> basis_file := Some x) ,
"File containing the atomic basis set.") ;
( "-c" , Arg.String (fun x -> coord_file := Some x) ,
"File containing the nuclear coordinates.") ;
]
let run ~coord ~basis =
let coord_file =
match coord with
| None -> raise (Invalid_argument "Coordinate file should be specified")
| Some x -> x
and basis_file =
match basis with
| None -> raise (Invalid_argument "Basis set file should be specified")
| Some x -> x
in
let nuclei =
Nuclei.of_xyz_file ~filename:coord_file
and general_basis =
Gamess_reader.read ~filename:basis_file
in
let basis =
Basis.of_nuclei_and_general_basis nuclei general_basis
in
Array.map Basis.to_string basis
|> Array.iter print_endline
let () =
let usage_msg = "Quantum Chemistry Package. Options available:" in
Arg.parse speclist (fun _ -> ()) usage_msg;
run ~coord:!coord_file ~basis:!basis_file