From 53110375189a9bff856bbbe2a4d6aa9bee8909f3 Mon Sep 17 00:00:00 2001 From: Dynamics of Condensed Matter <30792324+DCM-Uni-Paderborn@users.noreply.github.com> Date: Sun, 17 May 2026 20:51:06 +0200 Subject: [PATCH] Improve REFTRAJ label mismatch error (#5230) Co-authored-by: Thomas D. Kuehne --- src/motion/integrator.F | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/motion/integrator.F b/src/motion/integrator.F index 8e5a7d184b..90c9bd569f 100644 --- a/src/motion/integrator.F +++ b/src/motion/integrator.F @@ -1585,10 +1585,15 @@ CONTAINS CALL uppercase(element_symbol_ref0) CALL uppercase(element_kind_ref0) IF (element_symbol /= element_symbol_ref0) THEN - ! Make sure the kind also does not match a potential alias name + ! Make sure the label also does not match a potential kind alias. IF (element_symbol /= element_kind_ref0) THEN - errmsg = "Atomic configuration from trajectory file does not match the reference configuration: Check atom "// & - TRIM(ADJUSTL(cp_to_string(i)))//" of step "//TRIM(ADJUSTL(cp_to_string(trj_itimes))) + errmsg = "Atomic configuration from trajectory file does not match the reference configuration: "// & + "Check atom "//TRIM(ADJUSTL(cp_to_string(i)))//" of step "// & + TRIM(ADJUSTL(cp_to_string(trj_itimes)))//". Found trajectory label '"// & + TRIM(element_symbol)//"', expected element '"//TRIM(element_symbol_ref0)// & + "' or kind label '"//TRIM(element_kind_ref0)// & + "'. REFTRAJ trajectories usually contain element labels; check whether the "// & + "trajectory was modified to contain kind aliases instead." CPABORT(errmsg) END IF END IF @@ -1607,10 +1612,15 @@ CONTAINS CALL uppercase(element_symbol_ref0) CALL uppercase(element_kind_ref0) IF (element_symbol /= element_symbol_ref0) THEN - ! Make sure the kind also does not match a potential alias name + ! Make sure the label also does not match a potential kind alias. IF (element_symbol /= element_kind_ref0) THEN - errmsg = "Atomic configuration from trajectory file does not match the reference configuration: Check atom "// & - TRIM(ADJUSTL(cp_to_string(i)))//" of step "//TRIM(ADJUSTL(cp_to_string(trj_itimes))) + errmsg = "Atomic configuration from trajectory file does not match the reference configuration: "// & + "Check atom "//TRIM(ADJUSTL(cp_to_string(i)))//" of step "// & + TRIM(ADJUSTL(cp_to_string(trj_itimes)))//". Found trajectory label '"// & + TRIM(element_symbol)//"', expected element '"//TRIM(element_symbol_ref0)// & + "' or kind label '"//TRIM(element_kind_ref0)// & + "'. REFTRAJ trajectories usually contain element labels; check whether the "// & + "trajectory was modified to contain kind aliases instead." CPABORT(errmsg) END IF END IF