OrderN / CONQUEST-release

Full public release of large scale and linear scaling DFT code CONQUEST
http://www.order-n.org/
MIT License
94 stars 24 forks source link

Properly abort the calculation if wrong method for variable temperatu… #319

Closed AugustinLu closed 2 months ago

AugustinLu commented 3 months ago

Related to #316

Then, please use cq_abort. If you use exit here, it would just exit the do-loop, I think.

When a wrong method for variable temperature MD is set, the program should abort and not just exit the loop.

Solution: Only the linear method is accepted. Any other value will lead to error message and CONQUEST will abort:

image
AugustinLu commented 2 months ago

The output should be written to the io_lun unit, not to * so that it is recorded in the output file.

It is indeed better to have in the output file rather than standard output. I will change it.

But I wonder if this check should be done in read_input in initial_read_module.f90 when we're reading in the various parameters: it would make sense to stop much earlier, I think.

Oh, yes. This is indeed the way it should be done. I will move that check to just after reading the input parameters, so that no time is wasted in initialising the calculation for nothing.

AugustinLu commented 2 months ago

In commit 0cf34260115ffc55ddc1d17beecbbfec444259bb, the target for the output has been updated from * to io_lun and the block for the verification of the variable temperature method has been moved from control.f90 to initial_read_module.f90.

Contents of output file:

image

Standard output:

image
AugustinLu commented 2 months ago

Can we please use leqi from input_module to compare strings? Something like if(.not.leqi(md_variable_temperature_method(1:6),'linear') would work I think and be more portable (in particular it will ignore case...)

Thank you for the suggestion. I have updated and checked the code accordingly.