diff --git a/sammy/src/ang/mang0.f b/sammy/src/ang/mang0.f
index dec2211c609834b385120f2fb76d4f5a4a81b6b0..13c3929f8a1fdffcccaa462d8d71ba4044f05f51 100644
--- a/sammy/src/ang/mang0.f
+++ b/sammy/src/ang/mang0.f
@@ -2,20 +2,19 @@ C
 C
       SUBROUTINE Samang_0
 C
-      use oops_common_m
-      use fixedi_m
-      use ifwrit_m
+      use fixedi_m, only : Iq_val, Jwwwww, K2reso, Kiniso, Kkkdex,
+     *                     Kkkrsl, Lllmax, Nangle, Ndasig, Ndbsig,
+     *                     Niniso, Nnniso, Nnnsig, Nudwhi, Numcro,
+     *                     Numorr, Numrpi, Kkkiso
+      use ifwrit_m, only : Kkkdop
       use exploc_common_m
       use array_sizes_common_m
-      use oopsch_common_m
-      use fixedr_m
-      use cbro_common_m
-      use lbro_common_m
-      use par_parameter_names_common_m
-      use EndfData_common_m
-      use AllocateFunctions_m
-      use rsl7_m
-      IMPLICIT DOUBLE PRECISION (a-h,o-z)
+      use oopsch_common_m, only : Nowwww, Segmen
+      use cbro_common_m, only : Segnam
+      use lbro_common_m, only : Debug, Ydoppr, Yresol
+      use EndfData_common_m, only : getNumAuxGridPoints
+      use rsl7_m, only : Set_Kws
+      IMPLICIT none
       real(kind=8),allocatable,dimension(:)::A_Icccll
       real(kind=8),allocatable,dimension(:)::A_Ipoly
       real(kind=8),allocatable,dimension(:)::A_Itotal
@@ -26,6 +25,7 @@ C
       real(kind=8),allocatable,dimension(:)::A_Isoq
       integer,allocatable,dimension(:)::I_Iruth
       integer::isigx_size
+      integer::Kdatb, N, Nc, Nd, Ndt, Np, Nt, Nq
 C
 C
       WRITE (6,99999)
@@ -43,7 +43,7 @@ C
          Nnniso = 1
          Kkkiso = 1
       END IF
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
 C *** Guesstimate size of array needed for Samang
       CALL Estang (Nc, Nd, Nt, Ndt, Np, Nq, Kdatb)
 C
diff --git a/sammy/src/ang/mang1.f b/sammy/src/ang/mang1.f
index e370f1b4aaac90f7b1c7c9356ad91e770e6de953..903a5173a108a46284be9d4b32164dbbb0549d01 100644
--- a/sammy/src/ang/mang1.f
+++ b/sammy/src/ang/mang1.f
@@ -258,7 +258,7 @@ C
       nauxSt = nauxSt + Kkkmin - 1
       if ( nauxSt.lt.1) nauxSt = 1
       call setAuxGridOffset(nauxSt)
-      Ndatmx = Kkkdat - 1
+      call setAuxGridRowMax(Kkkdat - 1)
       IF (Kkkdat.EQ.1) STOP '[STOP in Diffee in ang/mang1.f    # 4]'
       IF (Another_Process_Will_Happen) THEN
          Kkkmin = Kkkmin - 1
diff --git a/sammy/src/blk/EndfData_common.f90 b/sammy/src/blk/EndfData_common.f90
index 15e7ad313688a24c686cd62d3a428fc9467ef598..23995dde9198272e8160bcc511cb6266fcf4269d 100644
--- a/sammy/src/blk/EndfData_common.f90
+++ b/sammy/src/blk/EndfData_common.f90
@@ -1,9 +1,10 @@
 module EndfData_common_m
-      use  EndfData_M
+      use EndfData_M
       use SammyRMatrixParameters_M
       use CovarianceData_M
       use ResonanceCovariance_M
       use GridData_M
+      use SammyGridAccess_M
       use, intrinsic :: ISO_C_BINDING
       IMPLICIT NONE
       
@@ -48,23 +49,32 @@ module EndfData_common_m
          ioff =  grid%getRowOffset() + 1
        end function getAuxGridOffset
 
-       subroutine setAuxGridRowmax(ioff)
-           integer::ioff
+       subroutine setAuxGridRowMax(ioff)
+           integer::ioff, ii
 
            type(GridData)::grid
            call findAuxGrid(grid)
            if (.not.C_ASSOCIATED(grid%instance_ptr)) return
 
-           call grid%setRowMax(ioff-1)
+           ii  = ioff-1
+           if (ii.lt.0) ii = 0
+           call grid%setRowMax(ii)
        end subroutine setAuxGridRowmax
 
-       integer function getAuxGridRowmax() result(ioff)
-         type(GridData)::grid
-         call findAuxGrid(grid)
-         ioff = 0
-         if (.not.C_ASSOCIATED(grid%instance_ptr)) return
-         ioff =  grid%getRowMax() + 1
-       end function getAuxGridRowmax
+       integer function getNumAuxGridPoints() result (num)
+           use fixedi_m, only : numCro
 
+           type(GridData)::grid
+           num = 0
+           call findAuxGrid(grid)
+           if (.not.C_ASSOCIATED(grid%instance_ptr)) return
 
+           num = grid%getRowMax()
+           if (num.eq.0) then
+              num = grid%getLength()
+              if(numcro.gt.1) num = num/numcro
+           else
+              num = num + 1
+           end if
+       end function getNumAuxGridPoints
  end module EndfData_common_m
diff --git a/sammy/src/blk/Fixedi_common.f90 b/sammy/src/blk/Fixedi_common.f90
index 74cabdc3333bb1b916732873d0c694181eb24c93..92155075256c567daef95949cde5a01b44887c47 100644
--- a/sammy/src/blk/Fixedi_common.f90
+++ b/sammy/src/blk/Fixedi_common.f90
@@ -17,6 +17,8 @@ module fixedi_m
      ! Note:
      !    ndatmn (lf(122)), lower limit for auxillary grid is no longer used
      !                      covariance file will now always contain 0 for that value
+     !    ndatmx (lf(123)), upper limit for auxillary grid is no longer used
+     !                      covariance file will now always contain 0 for that value
      integer, target,save ::lf(300)
 
 
@@ -165,7 +167,6 @@ module fixedi_m
      integer,pointer :: Ndatrx  => lf(119)
      integer,pointer :: Ndatsx  => lf(120)
      integer,pointer :: Ndatdx  => lf(121)
-     integer,pointer :: Ndatmx  => lf(123)
      integer,pointer :: Ixxchn  => lf(124)
      integer,pointer :: Ktheta  => lf(125)
      integer,pointer :: Kvprrt  => lf(126)
diff --git a/sammy/src/clm/mclm3.f b/sammy/src/clm/mclm3.f
index f9c369a26068242f4e5fce4bf106662494b122c0..29cee9ebfaa808ad522c2cf164f3804f7f8106e7 100644
--- a/sammy/src/clm/mclm3.f
+++ b/sammy/src/clm/mclm3.f
@@ -14,7 +14,7 @@ C *** PURPOSE -- FORM DOPPLER-BROADENED CROSS SECTION AND DERIVATIVES
 C
       use fixedi_m, only : Nnnsig, Kkkiso, Ndaxxx, Ndbxxx, Kiniso,
      *                     Ktruet, Lllmax, Ndasig, Ndbsig,
-     *                     Niniso, Nnniso, Numiso, Ndatmx, numcro
+     *                     Niniso, Nnniso, Numiso, numcro
       use ifwrit_m, only : Kcros, Kdebug, Kfinit, Ksindi, Ksitmp,
      *                     ktzero, Kvtemp, Kvthck, Nonu
       use fixedr_m, only : Emax, Emaxs, Emin, Emins, Temp, Thick,
@@ -23,7 +23,8 @@ C
       use clm_common_m, only : Nbeta_Max, Tev
       use lbro_common_m, only : Yresol, Yssmsc, Ytrans
       use constn_common_m, only : Boltzm
-      use EndfData_common_m, only : expData, setAuxGridOffset
+      use EndfData_common_m, only : expData, setAuxGridOffset,
+     *                              setAuxGridRowMax
       use SammyGridAccess_M
       use xct2_m
       use mxct27_m
@@ -335,7 +336,7 @@ C *** end of do-loop on isotopes (nuclides)
 C
 C
       nauxSt = nauxSt + 1
-      Ndatmx = Kkkdat
+      call setAuxGridRowMax(Kkkdat)
       IF (Now.NE.0) WRITE (21,99997) Now, Kkkdat*Niniso
       IF (Now.NE.0 .AND. Kdebug.NE.0) WRITE (06,99997) Now,Kkkdat*Niniso
 99997 FORMAT (' No Doppler broadening occured', I8,
diff --git a/sammy/src/clq/mclq0.f b/sammy/src/clq/mclq0.f
index c75145823a4acef2082127c57aa73ecd7e02b788..55e2c38387a9e72766f3d88352dcb499d80793be 100644
--- a/sammy/src/clq/mclq0.f
+++ b/sammy/src/clq/mclq0.f
@@ -18,7 +18,7 @@ C
       use cbro_common_m
       use lbro_common_m
       use rsl7_m
-      use EndfData_common_m, only : setAuxGridOffset
+      use EndfData_common_m, only : setAuxGridOffset, setAuxGridRowMax
       IMPLICIT DOUBLE PRECISION (a-h,o-z)
 C
 C
@@ -40,6 +40,7 @@ C *** GUESSTIMATE SIZE OF ARRAY NEEDED FOR SAMMY-CLQ
       Nnniso = 1
       Iq_Iso = 1
       call setAuxGridOffset(1)
+      call setAuxGridRowMax(0)
       CALL Estclq
 C
 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <
@@ -93,6 +94,5 @@ C  sub-section
 C
       I = Idimen (0, 0, '0, 0')
 C
-      Ndatmx = Ndatb
       RETURN
       END
diff --git a/sammy/src/cro/mcro0.f b/sammy/src/cro/mcro0.f
index c9f1b51c70a42f6287b08aed5b219344fa3d6670..9a5cbb51f653eca4606408887e23615380479fa6 100644
--- a/sammy/src/cro/mcro0.f
+++ b/sammy/src/cro/mcro0.f
@@ -17,7 +17,8 @@ C
       use rsl7_m
       use xct_m
       use xct1_m
-      use EndfData_common_m, only : setAuxGridOffset
+      use EndfData_common_m, only : setAuxGridOffset,
+     *                              setAuxGridRowMax
       IMPLICIT DOUBLE PRECISION (a-h,o-z)
       real(kind=8),allocatable,dimension(:)::A_Ix1
       real(kind=8),allocatable,dimension(:)::A_Idum
@@ -65,6 +66,7 @@ c *** find array sizes for added cross section from endf/b-vi
       END IF
 C *** GUESSTIMATE SIZE OF ARRAY NEEDED FOR SAMMY-Cross section
       call setAuxGridOffset(1) ! reset auxillary grid offset
+      call setAuxGridRowMax(0)
       CALL Estcro (Na, Nb, N2, N3, N4, NN, N6, N8, Mxany)
 C
       N = Ndasig
@@ -294,7 +296,6 @@ C
       K = Idimen (K,  1, 'K,  1')
       I = Idimen (K, -1, 'K, -1')
       I = Idimen (0, 0, '0, 0')
-      Ndatmx = numE
       call grid%destroy()
       RETURN
       END
diff --git a/sammy/src/dat/mdat1.f90 b/sammy/src/dat/mdat1.f90
index e3f7190b5a578d642eb8ba25cfa060fbae4b9754..76eff36e84e01f13b258432607af41ac68848da3 100644
--- a/sammy/src/dat/mdat1.f90
+++ b/sammy/src/dat/mdat1.f90
@@ -427,6 +427,7 @@ contains
       use ifwrit_m
       use fixedr_m
       use mdat9_m
+      use EndfData_common_m, only : setAuxGridRowMax
       IMPLICIT DOUBLE PRECISION (a-h,o-z)
       real(kind=8),allocatable,dimension(:)::E(:), Energy(:)
       DIMENSION Energb(*)
@@ -544,7 +545,7 @@ contains
             END DO
 !
          END IF
-         Ndatmx = Ndatb
+         call setAuxGridRowMax(0)
 !
       ELSE
 !
diff --git a/sammy/src/dbd/mdbd1.f b/sammy/src/dbd/mdbd1.f
index 817cb8e4e1ea95d2243bc54952d4968f5e12b167..a2a3a3fb660a998fe5628d0b2d45c3b0b69663d3 100644
--- a/sammy/src/dbd/mdbd1.f
+++ b/sammy/src/dbd/mdbd1.f
@@ -10,7 +10,7 @@ C
 C *** PURPOSE -- FORM DOPPLER-BROADENED CROSS SECTION and derivatives
 C
       use fixedi_m, only : Nnnsig, Ndaxxx, Ndbxxx, Nnniso, Niniso,
-     *                     Ndasig, Ndbsig, Ktruet, Ndatmx,
+     *                     Ndasig, Ndbsig, Ktruet,
      *                     Ndats, numcro
       use ifwrit_m, only : ktzero, Kcros, Kdebug, Kfinit, Kvthck,
      *                     Ndat, Nolowb, Nonu
@@ -20,7 +20,8 @@ C
       use lbro_common_m, only : Yresol, Yssmsc, Ytrans
       use xct2_m
       use mxct27_m
-      use EndfData_common_m, only : expData, setAuxGridOffset
+      use EndfData_common_m, only : expData, setAuxGridOffset,
+     *                              setAuxGridRowMax
       use SammyGridAccess_M
       IMPLICIT none
       logical Need_isotopes
@@ -222,7 +223,7 @@ C     END DO Iso=1,Niniso
 C *** End of do loop on nuclides
 C
       nauxSt = nauxSt + 1
-      Ndatmx = Kkkdat
+      call setAuxGridRowMax(Kkkdat)
       IF (Iffy.EQ.0) WRITE (21,99998)
 99998 FORMAT (/,' ** NOTE -- NO DOPPLER BROADENING ACTUALLY OCCURED **')
       IF (Now.NE.0) WRITE (21,99997) Now, Kkkdat*Nnniso
diff --git a/sammy/src/dex/mdex0.f b/sammy/src/dex/mdex0.f
index e71d1f30dbc9c8627ad875d91a5c8ee130d2a6e4..d689543b3bad6c9d2c26577162cf58c2615aca51 100644
--- a/sammy/src/dex/mdex0.f
+++ b/sammy/src/dex/mdex0.f
@@ -4,7 +4,7 @@ C
 C
 C      use oops_common_m
       use fixedi_m, only : Jwwwww, K2reso, Kiniso, Kkkiso,
-     *                     Ndatmx, Niniso, Nnniso, Numorr, Numrpi,
+     *                     Niniso, Nnniso, Numorr, Numrpi,
      *                     Nudwhi
       use ifwrit_m, only : Jjjdop, Kplotu
       use exploc_common_m
@@ -13,7 +13,7 @@ C      use oops_common_m
       use brdd_common_m, only : Kdatb, Weights
       use cbro_common_m, only : Segnam
       use lbro_common_m, only : Debug
-      use EndfData_common_m, only : setAuxGridOffset
+      use EndfData_common_m, only : getNumAuxGridPoints
       use AllocateFunctions_m
       use rsl7_m
       IMPLICIT None
@@ -33,7 +33,7 @@ C
       Niniso = Nnniso
       Kiniso = Kkkiso
 C
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
 C
 C *** GUESSTIMATE SIZE OF ARRAY NEEDED FOR SAMDEX
       CALL Estdex (Kdatb)
diff --git a/sammy/src/dex/mdex1.f b/sammy/src/dex/mdex1.f
index 5a81ea1d91c995372ce62d63d5aeb4c2e1ec3751..869f17ef9e5ccde9c0f0bdaa1605d3b4ca143d11 100644
--- a/sammy/src/dex/mdex1.f
+++ b/sammy/src/dex/mdex1.f
@@ -13,7 +13,7 @@ C ***            function in energy between E and E-Dddeee)
 C ***            [or between E+Dddeee/2 & E-Dddeee/2, if Ndexxx=1]
 C
       use fixedi_m, only : Nnnsig, Ndaxxx, Ndbxxx, K2reso, Ndasig,
-     *                     Ndbsig, Ndatmx, ndexxx, Nnniso,
+     *                     Ndbsig, ndexxx, Nnniso,
      *                     numcro, Numnbk, Numorr, Numrpi, Numbgf
       use ifwrit_m, only : Kdebug, ktzero, Ndat
       use fixedr_m, only : Dddeee
@@ -22,7 +22,8 @@ C
       use mxct27_m
       use mdat9_m
       use rsl2_m
-      use EndfData_common_m, only : expData, getAuxGridOffset
+      use EndfData_common_m, only : expData, getAuxGridOffset,
+     *                              setAuxGridRowMax
       use SammyGridAccess_M
       IMPLICIT NOne
 C
@@ -186,7 +187,7 @@ C
 C *** end of experimental-energy loop
    61 CONTINUE
 C
-      Ndatmx = Kkkkkk
+      call setAuxGridRowMax(Kkkkkk)
       IF (Numorr.GT.0 .OR. Numrpi.GT.0) THEN
          Kkkmin = Kkkmin - 1
          CALL Write_Cross_Sections (Wsigxx, Wdasig, Wdbsig,
diff --git a/sammy/src/dop/mdop1.f90 b/sammy/src/dop/mdop1.f90
index bc9ef994dfce16a1f37588276b8e66cb0078f529..f996881b054178ba1a753e7f1d246dc5a3517198 100644
--- a/sammy/src/dop/mdop1.f90
+++ b/sammy/src/dop/mdop1.f90
@@ -203,7 +203,7 @@ module dop1_m
 !
       END DO
 !
-      Ndatmx = Kkkkkk
+      call setAuxGridRowMax(Kkkkkk)
       nauxSt = Kkkmin
 !
          Kkkmin = Kkkmin - 1
diff --git a/sammy/src/fgm/mfgm1.f b/sammy/src/fgm/mfgm1.f
index 4e2fa9c679b09ea17e7eba346ffa19bd6148212a..a8479994f0e627ad14308277219287a04dc982b7 100644
--- a/sammy/src/fgm/mfgm1.f
+++ b/sammy/src/fgm/mfgm1.f
@@ -54,7 +54,7 @@ C
 C *** PURPOSE -- FORM DOPPLER-BROADENED CROSS SECTION AND DERIVATIVES
 C
       use fixedi_m, only : Nnnsig, Kkkiso, Ndaxxx, Ndbxxx, Kiniso,
-     *                     Ktruet, Lllmax, Ndasig, Ndatmx,
+     *                     Ktruet, Lllmax, Ndasig,
      *                     Ndbsig, Niniso, Nnniso, numcro, Numiso
       use ifwrit_m, only : Kcros, Kdebug, Ksindi, ktzero, Kvtemp,
      *                     Kvthck, ndat, Nolowb, ndat, Nonu,
@@ -65,7 +65,8 @@ C
       use brdd_common_m, only : Ipnts, Iup, Kc, Kdatb
       use lbro_common_m, only : Yresol, Yssmsc, Ytrans
       use EndfData_common_m, only : expData, resparData,
-     *                              getAuxGridOffset, setAuxGridOffset
+     *                              getAuxGridOffset, setAuxGridOffset,
+     *                              setAuxGridRowMax
       use xct2_m
       use mxct27_m
       use SammyGridAccess_M
@@ -424,7 +425,7 @@ C *** end of do-loop on isotopes (nuclides)
 C
 C
       nauxSt = nauxSt + 1
-      Ndatmx = Kkkdat
+      call setAuxGridRowMax(Kkkdat)
       IF (Iffy.EQ.0) WRITE (21,99998)
 99998 FORMAT (/' ** NOTE -- NO DOPPLER BROADENING ACTUALLY OCCURED **')
       IF (Now.NE.0) WRITE (21,99997) Now, Kkkdat*Niniso
diff --git a/sammy/src/mlb/mmlb0.f b/sammy/src/mlb/mmlb0.f
index 71790be389683a0966791559b510e8c9960ae110..066b1503064caac83ad53f6507d9de0542d62a04 100644
--- a/sammy/src/mlb/mmlb0.f
+++ b/sammy/src/mlb/mmlb0.f
@@ -21,7 +21,7 @@ C
       use AllocateFunctions_m
       use rsl7_m
       use xct_m
-      use EndfData_common_m, only : setAuxGridOffset
+      use EndfData_common_m, only : setAuxGridOffset, setAuxGridRowMax
       IMPLICIT DOUBLE PRECISION (a-h,o-z)
       real(kind=8),allocatable,dimension(:)::A_Idum
 C
@@ -66,6 +66,7 @@ C
 C
 C *** guesstimate size of array needed for SAMMY-MLBW
       call setAuxGridOffset(1) ! reset starting point for auxillary grid
+      call setAuxGridRowMax(0)
       CALL Estmlb (N1, Ntwo, N2, N3, N5, N6, N7, Nrfil3, Npfil3)
 C
       N = Ndasig
@@ -204,6 +205,5 @@ C ### three ###
       I = Idimen (K, -1, 'K, -1')
       I = Idimen (0, 0, '0, 0')
 C
-      Ndatmx = Ndatb
       RETURN
       END
diff --git a/sammy/src/mso/mmso0.f b/sammy/src/mso/mmso0.f
index 805e13eac47d58cce2d57c42eaa5270d297083ed..633a36bf311303539f72134a8c1fe81dac506528 100644
--- a/sammy/src/mso/mmso0.f
+++ b/sammy/src/mso/mmso0.f
@@ -9,20 +9,22 @@ C ***              "Version 7.0.0 for multiple scattering" or "V7".
 C ***            This version is faster but probably not as accurate
 C ***              as subsequent versions.
 C
-      use oops_common_m
-      use fixedi_m
-      use ifwrit_m
+      use fixedi_m, only : Jtheta, Jwwwww, K2reso, Kiniso, Kkkdex,
+     *                     Kkkiso, Kkkrsl, Ktheta, Niniso, Nnnsig,
+     *                     Ntheta, Nudwhi, Numcro, Numrpi, Numorr,
+     *                     Nnniso, Numder
+      use ifwrit_m, only : Jjjdop, Kssmsc
       use exploc_common_m
       use array_sizes_common_m
-      use oopsch_common_m
-      use cbro_common_m
-      use lbro_common_m
-      use MultScatPars_common_m
-      use ssm_1_m
-      use EndfData_common_m
+      use oopsch_common_m, only : Nowwww, Segmen
+      use cbro_common_m, only : Segnam
+      use lbro_common_m, only : Debug, Yresol
+      use MultScatPars_common_m, only : multScat
+      use ssm_1_m, only : Thtget
+      use EndfData_common_m, only : getNumAuxGridPoints
       use AllocateFunctions_m
-      use rsl7_m
-      IMPLICIT DOUBLE PRECISION (a-h,o-z)
+      use rsl7_m, only : Set_Kws
+      IMPLICIT none
       real(kind=8),allocatable,dimension(:)::A_Ixtptv
       real(kind=8),allocatable,dimension(:)::A_Ixtptw
       integer,allocatable,dimension(:)::I_Iiex
@@ -65,6 +67,9 @@ C
       real(kind=8),allocatable,dimension(:)::A_Idy2aa
       real(kind=8),allocatable,dimension(:)::A_Idy2aq
       real(kind=8),allocatable,dimension(:)::A_Idyaqq
+      real(kind=8)::Delthe
+      integer::jkn1, jkn2, jkn3, Kdatb, M1, M2, M3, M4
+      integer:: Maxx, Mx, nd, ndbl, nf, ng, nh, Nnx, nx
 C
 C
       WRITE (6,99999)
@@ -84,7 +89,7 @@ C
          Ntheta = 33
       end if
 C
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
       CALL Estms1 (Nx, Mx)
 C - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <
       call allocate_real_data(A_Ixtptv, Nx)
diff --git a/sammy/src/mso/mmso2.f b/sammy/src/mso/mmso2.f
index fd476b63ccd19130f37d59005348bff9a7a284b4..38d3d7dd8ec16b6548bbf0e5f44243ee870a88e7 100644
--- a/sammy/src/mso/mmso2.f
+++ b/sammy/src/mso/mmso2.f
@@ -16,7 +16,7 @@ C *** Ssssds generates the [approximation to] the self-shielded,
 C ***   single-scattered, and double(plus)-scattered capture yield.
 C
       use fixedi_m, only : Ntepnt, Nxtptv, Nxtptw, Jtheta, Nnnsig,
-     *                     Ndaxxx, Kssmpr, Ndasig, Ndatmx,
+     *                     Ndaxxx, Kssmpr, Ndasig,
      *                     Ndbsig, Niniso, Ntheta, Numbgf, numcro,
      *                     Numiso, Numnbk, Ndbxxx
       use ifwrit_m, only : Nnpar, Kbrd, Kksave, Ksindi, Ksitmp,
@@ -32,7 +32,8 @@ C
       use mdat9_m, only : Findpr
       use ssm_1_m, only : Getcrs, Getem
       use EndfData_common_m, only : resParData, expData,
-     *                       setAuxGridOffset, getAuxGridOffset
+     *                       setAuxGridOffset, getAuxGridOffset,
+     *                       setAuxGridRowMax
       use SammyGridAccess_M
       use ssssss_common_m, only :  Area, Rb, Rs, Sthick, Dthick, Fffdbl
       IMPLICIT None
@@ -322,7 +323,7 @@ C ***       experimental grid; may need to interpolate
          CALL Reorder_Energy (Wsigxx, Wdasig, Wdbsig,
      *      Theory, Kdatmn, Kdatmx, Kkkdat)
       END IF
-      Ndatmx = Kkkdat
+      call setAuxGridRowMax(Kkkdat)
 C
       IF (Kwssms.EQ.1) CLOSE (UNIT=15)
       call setAuxGridOffset(nauxSt)
diff --git a/sammy/src/ntg/mntg0.f b/sammy/src/ntg/mntg0.f
index aa88ac158bca485aa86c0bc1e274e0d0ff5cae55..9237c869176a5e69e62cd9ccfa1ecc42de2db28c 100644
--- a/sammy/src/ntg/mntg0.f
+++ b/sammy/src/ntg/mntg0.f
@@ -6,21 +6,16 @@ C ***   Purpose is to calculate integral quantities sigma(thermal),
 C ***      Maxwellian average (at thermal temperature), Westcott's g-
 C ***      factor, and resonance integral
 C
-      use oops_common_m
       use brdd_common_m, only : Weights
-      use fixedi_m
-      use ifwrit_m
+      use fixedi_m, only : Kywywy, Nnniso, Numiso, Nvpall
+      use ifwrit_m, only : Kplotu, Ksolve, Nfissl
       use exploc_common_m
-      use samxxx_common_m
       use array_sizes_common_m
-      use oopsch_common_m
-      use cbro_common_m
-      use lbro_common_m
-      use EndfData_common_m
-      use AllocateFunctions_m
-      use rsl7_m
+      use oopsch_common_m, only : Nowwww, Segmen
+      use EndfData_common_m, only : getNumAuxGridPoints
+      use rsl7_m, only : Set_Kws
       use sammy1_common_m, only : fitOption, Where_To_Next
-      IMPLICIT DOUBLE PRECISION (a-h,o-z)
+      IMPLICIT None
       real(kind=8),allocatable,dimension(:)::A_Iuncnt
       real(kind=8),allocatable,dimension(:)::A_Iconst
       real(kind=8),allocatable,dimension(:)::A_Iflux
@@ -39,6 +34,9 @@ C
       real(kind=8),allocatable,dimension(:)::A_Ix1
       real(kind=8),allocatable,dimension(:)::A_Ix2
       real(kind=8),allocatable,dimension(:)::A_Iemmmq
+      integer::I,Kdatb, Kddddd, Many, N, Nddddd, Nflux, Nnn
+      integer::Numntg, Numntx, Numoff, Numxxx, Nvary, Idimen
+      external Idimen
 C
 C
       WRITE (6,99999)
@@ -51,7 +49,7 @@ C
       CALL Initix
       IF (Kplotu.NE.0) Kplotu = 0
 C
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
       Many = 5
       IF (Nfissl.EQ.1) Many = Many*3 + 5
       IF (Numiso.GT.0) Nnniso = Numiso
diff --git a/sammy/src/orr/morr0.f90 b/sammy/src/orr/morr0.f90
index a7a8e904dfdd07b7ca093d79783b07fb216660c1..a4bec04e1808ea3cc8bf8ba1d644b1213663aa80 100644
--- a/sammy/src/orr/morr0.f90
+++ b/sammy/src/orr/morr0.f90
@@ -7,7 +7,7 @@ module orr_m
 !
 ! *** Purpose -- ORR resolution function calculation
 !
-      use fixedi_m, only : Jwwwww, Kiniso, Kkkiso, Niniso, Ndatmx, Niniso, Numorr, Nnniso
+      use fixedi_m, only : Jwwwww, Kiniso, Kkkiso, Niniso, Niniso, Numorr, Nnniso
       use ifwrit_m, only : Jjjdop, Kplotu
       use fixedr_m, only : Dist
       use exploc_common_m
@@ -16,7 +16,7 @@ module orr_m
       use brdd_common_m, only : Kdatb, Weights
       use cbro_common_m, only : Segnam
       use lbro_common_m, only : Debug
-      use EndfData_common_m, only : setAuxGridOffset
+      use EndfData_common_m, only : getNumAuxGridPoints
       use orr1_m
       use rsl7_m
 
@@ -39,7 +39,7 @@ module orr_m
       Kkkiso = 1
       Kiniso = 1
       IF (Kplotu.NE.0) Kplotu = 0
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
 !
 ! *** GUESSTIMATE SIZE OF ARRAY NEEDED FOR SAMORR
       N = Idimen (0, 0, '0, 0')
diff --git a/sammy/src/rpi/mrpi0.f90 b/sammy/src/rpi/mrpi0.f90
index 9a09db92d3322e90c24152ec392cfeea27e8aea8..5a6df2d72e47f4b138d77ddc1e0b57434e7b973e 100644
--- a/sammy/src/rpi/mrpi0.f90
+++ b/sammy/src/rpi/mrpi0.f90
@@ -6,7 +6,7 @@ module rpi_m
 !
       SUBROUTINE Samrpi_0
 !
-      use fixedi_m, only : Jwwwww, Medrpi, Mmmrpi, Ndatmx, Niniso
+      use fixedi_m, only : Jwwwww, Medrpi, Mmmrpi, Niniso
       use ifwrit_m, only : Jjjdop, Kplotu
       use exploc_common_m
       use array_sizes_common_m
@@ -14,7 +14,7 @@ module rpi_m
       use brdd_common_m, only : Kdatb, Weights
       use cbro_common_m, only : Segnam
       use lbro_common_m, only : Debug
-      use EndfData_common_m, only : setAuxGridOffset
+      use EndfData_common_m, only : getNumAuxGridPoints
       use AllocateFunctions_m
       use rpi1_m
       use rsl7_m
@@ -35,7 +35,7 @@ module rpi_m
       IF (Kplotu.NE.0) Kplotu = 0
 !
       Niniso = 1
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
 !
 ! *** Guesstimate size of array needed for Samrpi
       CALL Estrpi (Kdatb)
diff --git a/sammy/src/rsl/mrsl0.f90 b/sammy/src/rsl/mrsl0.f90
index bc6b2ffa07e3762943bba2e776fe5ecc43c352f9..a8d06666189657e8433c62cf8b8f974f4ad7be19 100644
--- a/sammy/src/rsl/mrsl0.f90
+++ b/sammy/src/rsl/mrsl0.f90
@@ -5,8 +5,8 @@ module rsl_m
 !
       SUBROUTINE Samrsl_0
 !
-      use fixedi_m, only : Jwwwww, K2reso, Kiniso, Kkkdex,          &
-                           Ndatmx, Niniso, Nnniso, Nudwhi, numcro,  &
+      use fixedi_m, only : Jwwwww, K2reso, Kiniso, Kkkdex,  &
+                           Niniso, Nnniso, Nudwhi, numcro,  &
                            Numorr, Numrpi, Kkkiso
       use ifwrit_m, only : ktzero, Jjjdop, Kplotu
       use exploc_common_m
@@ -15,7 +15,7 @@ module rsl_m
       use brdd_common_m, only : Kdatb, Weights
       use cbro_common_m, only : Segnam
       use lbro_common_m, only : Debug
-      use EndfData_common_m, only : expData, setAuxGridOffset
+      use EndfData_common_m, only : expData, getNumAuxGridPoints
       use rsl1_m
       use rsl7_m
       use SammyGridAccess_M
@@ -35,7 +35,7 @@ module rsl_m
       IF (Kplotu.NE.0) Kplotu = 0
       Niniso = Nnniso
       Kiniso = Kkkiso
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
 !
 ! *** GUESSTIMATE SIZE OF ARRAY NEEDED FOR SAMRSL
       CALL Estrsl (Kdatb)
diff --git a/sammy/src/rsl/mrsl1.f90 b/sammy/src/rsl/mrsl1.f90
index 0dc96cc8d19ce2591320ef52991fe6798ac4badb..583498358e777b906ba344dce617bda4ee876851 100644
--- a/sammy/src/rsl/mrsl1.f90
+++ b/sammy/src/rsl/mrsl1.f90
@@ -17,7 +17,7 @@ module rsl1_m
 ! ***            derivatives
 !
       use fixedi_m, only : Nnnsig, Ndaxxx, Ndbxxx, K2reso, Ndasig,   &
-                           Ndatmx, Ndbsig, Nnniso, Numbgf, Numnbk
+                           Ndbsig, Nnniso, Numbgf, Numnbk
       use ifwrit_m, only : Jjjdop, Kdebug, Kjdele, Kjdell, Ksolve, Ndat
       use fixedr_m
       use broad_common_m, only : Bo2, Co2, Dell00, Deltae,Dell00, Dele00, Dele11, Dele22, Dell11, deltal
@@ -30,7 +30,7 @@ module rsl1_m
       use rsl3_m, only : Intrp
       use rsl6_m, only : Kount_Points
       use SammyGridAccess_M
-      use EndfData_common_m, only : expData, getAuxGridOffset
+      use EndfData_common_m, only : expData, getAuxGridOffset, setAuxGridRowMax
 !
       type(SammyGridAccess)::auxGrid, grid
       real(kind=8):: Bcf(*), Cf2(*), Parnbk(*),                           &
@@ -178,7 +178,7 @@ module rsl1_m
 ! *** End of experimental-energy loop on J
    61 CONTINUE
 !
-      Ndatmx = Kkkkkk
+      call setAuxGridRowMax(Kkkkkk)
       IF (K2reso.EQ.1) THEN
          Kkkmin = Kkkmin - 1
          Iw = 0
diff --git a/sammy/src/salmon/SammyGridAccess.cpp b/sammy/src/salmon/SammyGridAccess.cpp
index ddb9b1f5d22cd62a395b5093dde52015879fec8c..d60bb719edce92a8d5ef4281abbd9ff4a5777f6f 100644
--- a/sammy/src/salmon/SammyGridAccess.cpp
+++ b/sammy/src/salmon/SammyGridAccess.cpp
@@ -35,7 +35,6 @@ namespace sammy {
        int ll = grid->getLength();
        ll /= numcro;
 
-
        if( useOffsets) {
            int jj = grid->getRowMax();
            if(jj > 0) ll = jj + 1;
diff --git a/sammy/src/ssm/mssm00.f90 b/sammy/src/ssm/mssm00.f90
index 6e274c1176edc55d62e92c68f3d29da5420f4b76..527a8268aa31346840198dae2675ff3cb03e0e6f 100644
--- a/sammy/src/ssm/mssm00.f90
+++ b/sammy/src/ssm/mssm00.f90
@@ -14,16 +14,16 @@ module ssm_m
 ! (tr039|tr119|tr085|tr066|tr171|tr160|tr060|tr118|tr057|tr064|
 !  tr090|tr052|tr078|tr076|tr095|tr188|tr046|tr099|tr189|tr045)
 !
-      use oops_common_m
-      use fixedi_m
-      use ifwrit_m
-      use exploc_common_m
-      use array_sizes_common_m
-      use oopsch_common_m
+      use fixedi_m, only : Jtheta, Jwwwww, K2reso, Kiniso, Kkkdex, Kkkiso, Kkkrsl, &
+                           Ktheta, Niniso, Nnnsig, Ntheta, Nudwhi, Numcro, &
+                           Numder, Numorr, Numrpi, Nnniso
+      use ifwrit_m, only : Jjjdop
+      use exploc_common_m, only  : I_Ixciso
+      use oopsch_common_m, only : Nowwww, Segmen
       use logic_ssm_common_m
-      use cbro_common_m
-      use lbro_common_m
-      use MultScatPars_common_m
+      use cbro_common_m, only : Segnam
+      use lbro_common_m, only : Debug, Yresol
+      use MultScatPars_common_m, only : multScat
       use ssm_1_m
       use ssm_2_m
       use rsl7_m
@@ -59,7 +59,8 @@ module ssm_m
       CALL Set_Logic_Ssm
 
 !
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
+
 ! *** Read first portion of file holding edge-effects, if needed
       CALL Qqqxxx (Delthe)
       CALL Estss1 (Nx, Mx)
diff --git a/sammy/src/ssm/mssm22.f90 b/sammy/src/ssm/mssm22.f90
index 717e38bdae352a1abecc8f6bd81128b223610a55..89d3eb5a2f590f25478f5934dbd6619f208778aa 100644
--- a/sammy/src/ssm/mssm22.f90
+++ b/sammy/src/ssm/mssm22.f90
@@ -87,7 +87,7 @@ ELSE
    CALL Reorder_Energy (A_Iwsigx , A_Iwdasi , &
                         A_Iwdbsi , A_Ith , Kdatmn, Kdatmx, Kkkdat)
 END IF
-Ndatmx = Kkkdat
+call setAuxGridRowMax(Kkkdat)
 call setAuxGridOffset(nauxSt)
 !
 IF (Kwssms.EQ.1) CLOSE (UNIT=15)
diff --git a/sammy/src/udr/mudr0.f b/sammy/src/udr/mudr0.f
index 4d5abb568cc70d80a879bb56428c8bafeebbf57b..a2c007bd0afc671856a54c00df3684d1e6086d96 100644
--- a/sammy/src/udr/mudr0.f
+++ b/sammy/src/udr/mudr0.f
@@ -5,7 +5,7 @@ C
       SUBROUTINE Samudr_0
 C
       use oops_common_m, only : Msize
-      use fixedi_m, only : Jwwwww, Kiniso, Kkkiso, Ndatmx,
+      use fixedi_m, only : Jwwwww, Kiniso, Kkkiso,
      *                     Niniso, Nudmax, Nudtim, Nudwhi, Numudr,
      *                     Nnniso
       use ifwrit_m, only : Jjjdop, Kplotu
@@ -15,7 +15,7 @@ C
       use brdd_common_m, only : Kdatb
       use cbro_common_m, only : Segnam
       use lbro_common_m, only : Debug
-      use EndfData_common_m, only : setAuxGridOffset
+      use EndfData_common_m, only : getNumAuxGridPoints
       use AllocateFunctions_m
       use rsl7_m
       IMPLICIT None
@@ -45,7 +45,7 @@ C
       Kkkiso = 1
       Kiniso = 1
       IF (Kplotu.NE.0) Kplotu = 0
-      Kdatb = Ndatmx
+      Kdatb = getNumAuxGridPoints()
 C
 C *** GUESSTIMATE SIZE OF ARRAY NEEDED FOR Samudr
       CALL Estudr (I_Inud_T , Kdatb, Msize)
diff --git a/sammy/src/xct/mxct0.f90 b/sammy/src/xct/mxct0.f90
index 066576ef92cb5e5ac1c5fec470e05aefe3e2c2b2..b98933e52e35a039e00a2e6ff5e379287b026634 100644
--- a/sammy/src/xct/mxct0.f90
+++ b/sammy/src/xct/mxct0.f90
@@ -41,6 +41,7 @@ module xct_m
       call auxGrid%setParameters(numcro, ktzero)
       call auxGrid%setToAuxGrid(expData)
       call setAuxGridOffset(1)
+      call setAuxGridRowMax(0)
       numElAux = auxGrid%getNumEnergies(expData)
 
       CALL Initil
@@ -538,7 +539,6 @@ module xct_m
 ! and the test is no longer meaningful
       I = Idimen (0  ,  0, '          0     ,  0')
 !
-      Ndatmx = numElAux
       RETURN
       END
 !