Massimo
SELECT CASE (my_constraint_id)
CASE (fix_x)
gradient(1:2) = 0.0_dp
gradient(4) = 0.0_dp
CASE (fix_y)
gradient(2:3) = 0.0_dp
gradient(5) = 0.0_dp
CASE (fix_z)
gradient(4:6) = 0.0_dp
CASE (fix_xy)
gradient(1:5) = 0.0_dp
CASE (fix_xz)
gradient(1:2) = 0.0_dp
gradient(4:6) = 0.0_dp
CASE (fix_yz)
gradient(2:6) = 0.0_dp
CASE (fix_none)
! Nothing to do
END SELECT
CONSTRAINT X, Y, Z, XY, XZ, YZ under https://manual.cp2k.org/trunk/CP2K_INPUT/MOTION/CELL_OPT.html