# Pull code (umbrella, distance): Fatal error "Pull reference distance … needs to be non-negative"

**URL:** <https://gromacs.bioexcel.eu/t/pull-code-umbrella-distance-fatal-error-pull-reference-distance-needs-to-be-non-negative/13207>\
**Category:** User discussions\
**Tags:** pull-code\
**Created:** [February 10, 2026, 10:22am UTC](https://gromacs.bioexcel.eu/t/pull-code-umbrella-distance-fatal-error-pull-reference-distance-needs-to-be-non-negative/13207 "2026-02-10T10:22:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![david1](https://avatars.discourse-cdn.com/v4/letter/d/73ab20/32.png) [@david1](https://gromacs.bioexcel.eu/u/david1)\
**Post date:** [February 10, 2026, 10:22am UTC](https://gromacs.bioexcel.eu/t/pull-code-umbrella-distance-fatal-error-pull-reference-distance-needs-to-be-non-negative/13207/1 "2026-02-10T10:22:42Z")

</div>

GROMACS version: 2025.1  
GROMACS modification: No

I’m using the **pull** option in GROMACS to bring together two **backbone portions** (see image below). I monitored the **distance between the centers of mass (COM)** of both backbone groups versus time:

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/a/a0ab77b9feac7a3f5852b0d039adcf65b143806b.png)

In the plot above, the **vertical lines** indicate where the simulation stopped due to the error shown in the following table. After each crash I restarted the simulation (lowering as well the pulling rate):

| Pull rate (nm/ps) | Time (this run) | Error / note in `.log` | Time (cumulative) |
| --- | --- | --- | --- |
| -0.005 | 1.276 ns | Fatal error:  
`Pull reference distance for coordinate 1 (-0.000009) needs to be non-negative` | |
| -0.0005 | 2.276 ns | No fatal error. Simulation runs cleanly for the 1 ns we asked for. | 2.276 ns |
| -0.0005 | 2.832 ns | Fatal error:  
`Pull reference distance for coordinate 1 (-0.000000) needs to be non-negative` | 5.108 ns |
| -0.0005 | 2.178 ns | Fatal error:  
`Pull reference distance for coordinate 1 (-0.000000) needs to be non-negative` | 7.286 ns |

Visualization suggests both backbones can come even closer than 9.86 Ang (the distance of the last snapshot of the last run, before crash).

Is there a way to overcome this “Fatal error” and bring them closer?

 ![image](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/2/2716c18f8ffba7296cf923f05709881ba466a8d6.jpeg)

Here the full `.mdp` of the last run:

```auto
integrator = md
dt = 0.002

nsteps = 4500000
nstxout-compressed = 5000
nstxout = 0
nstvout = 0
nstfout = 0
nstcalcenergy = 100
nstenergy = 1000
nstlog = 1000
;

cutoff-scheme = Verlet
nstlist = 20
vdwtype = Cut-off
vdw-modifier = Force-switch
rvdw_switch = 1.0
rvdw = 1.2
rlist = 1.2
rcoulomb = 1.2
coulombtype = PME
;

tcoupl = v-rescale
tc_grps = SOLU SOLV
tau_t = 1.0 1.0
ref_t = 303.15 303.15
;

pcoupl = C-rescale
pcoupltype = isotropic
tau_p = 5.0
compressibility = 4.5e-5
ref_p = 1.0
;

constraints = h-bonds
constraint_algorithm = LINCS
continuation = yes
;

nstcomm = 100
comm_mode = linear
comm_grps = SOLU SOLV
;

; -------------------
; Pull code additions
; -------------------
pull = yes
pull-ngroups = 2
pull-ncoords = 1

pull-group1-name = backbone_a_patch_5
pull-group2-name = backbone_c_patch

pull-coord1-type = umbrella
pull-coord1-geometry = distance
pull-coord1-groups = 1 2
pull-coord1-dim = Y Y Y

; Start from the current distance (recommended)
pull-coord1-start = yes

; Spring constant (kJ/mol/nm^2)
pull-coord1-k = 1000

; Pull rate (nm/ps). Negative means decreasing distance.
pull-coord1-rate = -0.0005  

pull-pbc-ref-prev-step-com = yes

pull-nstxout = 1000 

```

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [February 11, 2026, 8:27am UTC](https://gromacs.bioexcel.eu/t/pull-code-umbrella-distance-fatal-error-pull-reference-distance-needs-to-be-non-negative/13207/2 "2026-02-11T08:27:39Z")

</div>

The fatal error is not on the actual distance, but on the reference distance. You can not require a negative distance. If you want the distance to get smaller, you can try a large force constant. But obstacles can prevent the distance from getting shorter.
