Re: [AMBER] ?==?utf-8?q? Increase maximum of atoms in COM distance restraint

From: Javier Carmona Garcia via AMBER <>
Date: Mon, 16 Jan 2023 12:05:18 +0100

Dear AMBER users,

Sorry for responding to my own question, but I have been trying to modify the sander22 source code to increase the maximum number of atoms that can define a COM on a NMR restraint file.

The modifications I have made are the following:

- NMR REaD subroutine (nmrred) in the nmr.F90 Fortran file:

I have modified the parameter maxigr, defined in the following way

   ! ... MAXIGR is the maximum number of atoms which can be used to define
   ! a center-of-mass group.

   integer ixpk,nxpk
   integer maxigr
   parameter (maxigr=4500)

In the original source code, the parameter is defined as maxigr=200. I have changed this value to the total number of atoms that I have in my specific system, 4500, which seems to be what pmemd does dynamically in the nmr_calls.F90 file:

  ! Set maxigr value to the number of atoms set in the prmtop file
  maxigr = natom

- RESTraint Allocation subroutine in the nmrcal.F90 fortran file:

Same modification as above: parameter (maxigr=4500)

With these modifications, the recompiled version seems to work and gives something reasonable, although I still need to do more tests in other machines to compare with the results I already have.

I wanted to ask if anyone has already modified this variable, as I still have doubts about how correct all of this is, and if there is anything else that I should consider prior to apply this modified code. I have seen for example that there is an integer variable in the "Subroutine NMR GRouP" named "igr" in the nmr.F90 file with dimension 200 which I do not know if must be modified as well. The same goes for "igrarr(200,8)", that is present in several subroutines such as "Subroutine PARSe COM grouping" or "Subroutine GENeralized coordinate" of the same file. Leaving the latter variable as it is seems to be harmless as I think it belongs to a different type of restraint input (the so-called natural language), but I am not so sure about the "igr" variable in "Subroutine NMR GRouP".

The variable MAXGRP (defined as "The maximum number of atom range definitions relating to group definitions (for center-of-mass distance restraints only) for which array space is available."), the one I asked about on my first mail, seems to be computed when reading the restraint files, but I am not sure if that is correct. Nevertheless, I have not found a place in the .F90 files I have modified in which this variable can be changed.

Sorry for the long mails, but I hope that this update can be of aid for anyone to understand my question better.

Best regards,

Javier Carmona García
Institute of Molecular Science (ICMol)
Valencia, Spain

El Miércoles 11 Enero 2023 15:56 CET, Javier Carmona Garcia via AMBER <> Ha escrito:
> Dear AMBER users,
> I have been using PMEMD-CUDA during the past few months to perform MD umbrella sampling simulations to obtain the free energy profile of a small molecule (HgBr2) going through an air-water interface. I have followed an approach similar to the one presented on the AMBER tutorial 7.5 (Transferring methanol trough a membrane), which for my specific case requires the definition of a distance restraint between the center of mass of HgBr2 and the center of mass of the 1499 water molecules that define my water layer.
> Now I am planning on obtaining this free energy profile at the QM-MM level using sander, but I have encountered with the 200 atoms limitation in the group definition of the distance restraint file. I read in the manual that this limitation is not present in PMEMD, which is why I was able to define a group of 4500 atoms (all O and H atoms of the 1499 water molecules).
> Nevertheless, I have tried to carry out a simulation with sander using this distance restraint file:
> &rst
> iat=-1,-1,
> r1=-10.00,
> r2=0.00,
> r3=0.00,
> r4=10.00,
> rk2=10.0,
> rk3=10.0,
> iresid=0,
> fxyz=0,0,1,
> outxyz=1,
> igr1=1,2,3,
> igr2=4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,/
> which has 201 atoms on the second group definition and, because of that, it obviously stops. However, it gives the following error:
> Error: Too many atom ranges need to be stored for center-of-mass distance
> restraints. MAXGRP = 1. This needs to be increased.
> Because of that, I wanted to ask if it was possible to get rid of the 200 atoms limitation in sander by increasing this variable (which by reading earlier posts from the forum I think it would require to modify the code and recompile). I am unsure though about how this can be done and if this modification can affect negatively other parts of the code. Another possibility could be to reduce my system (and maybe only use the oxygen atoms of the water molecules for the group definition, allowing me to at least have 200 water molecules), but I am interested in exploring first this modification.
> Thank you beforehand and best regards,
> Javier Carmona García
> Institute of Molecular Science (ICMol)
> Valencia, Spain
> _______________________________________________> AMBER mailing list

AMBER mailing list
Received on Mon Jan 16 2023 - 03:30:02 PST
Custom Search