From 4dde03bf3828c7b14f909d261990939899ee10c9 Mon Sep 17 00:00:00 2001 From: Anthony Scemama Date: Tue, 26 Nov 2019 14:27:48 +0100 Subject: [PATCH] Allow negative charges in qp_create_ezfio --- ocaml/qp_create_ezfio.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ocaml/qp_create_ezfio.ml b/ocaml/qp_create_ezfio.ml index 083db4de..b4a78bde 100644 --- a/ocaml/qp_create_ezfio.ml +++ b/ocaml/qp_create_ezfio.ml @@ -644,7 +644,7 @@ If a file with the same name as the basis set exists, this file will be read. O { opt=Optional ; short='c'; long="charge"; arg=With_arg ""; - doc="Total charge of the molecule. Default is 0."} ; + doc="Total charge of the molecule. Default is 0. For negative values, use m instead of -, for ex m1"} ; { opt=Optional ; short='d'; long="dummy"; arg=With_arg ""; @@ -686,7 +686,10 @@ If a file with the same name as the basis set exists, this file will be read. O let charge = match Command_line.get "charge" with | None -> 0 - | Some x -> int_of_string x + | Some x -> ( if x.[0] = 'm' then + ~- (int_of_string (String.sub x 1 (String.length x - 1))) + else + int_of_string x ) in let dummy =