mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-07-25 04:07:24 +02:00
43 lines
1.1 KiB
OCaml
43 lines
1.1 KiB
OCaml
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 = "Available options:" in
|
|
Arg.parse speclist (fun _ -> ()) usage_msg;
|
|
try
|
|
run ~coord:!coord_file ~basis:!basis_file
|
|
with
|
|
| Invalid_argument e ->
|
|
(print_string "Error: " ; print_endline e; print_newline () ; Arg.usage speclist usage_msg)
|
|
;
|