anchor.diff:  PROGRAM APS
   
   ! Program to calculate the radius of gyration of sphere models
  -! Hard limit of 5000 spheres
  +! Hard limit of 6000 spheres
   
   ! Original Fortran 77 code:
   ! S.J. Perkins July 1981
  
positive.code: 
  ! Rewritten in Fortran 90 by David W. Wright November 2013
  
  ! TODO: For reasons currently beyond my comprehension this results in X having a
  ! start index of 0 and D of 1, this needs to be fixed as it is odd
  ! and makes the code difficult to understand
  DIMENSION X(5000,3),D(5000)
  
  WRITE(6,"(A/)") "APS: VERSION 2.50"
  WRITE(6,"(A/)") "CALCULATION OF Rg FOR UP TO 5000 SPHERE MODELS"
  
negative.code: RADSQ = 0.0
  RRAD = 0.0
  
  DO N = 1, NSPHERE
  
      D(N+1) = ((X(N,1)-XMEAN)**2 + (X(N,2)-YMEAN)**2 + (X(N,3)-ZMEAN)**2)
      RADSQ = RADSQ + D(N+1)
  