anchor.diff:  
   end subroutine choldc
   
  -!***************************************************************************************************
  +!*******************************************************************************
   
   subroutine cholsl(a,n,np,p,b,x)
     
  
positive.code:     integer(4)                  :: l, ish, i, j, Rpt(0:2)
      real(4)                     :: glon, glat, alt, lonspace, latspace, lat0
      real(8)                     :: rhospace
      real(8)                     :: norm1, norm2, cosmplat, sinmplat, cosmplon, sinmplon
      real(8)                     :: thetag, phig, thetaq, phiq, latwgt
      real(8)                     :: xq0, yq0, zq0, xg, yg, zg
      real(8), allocatable        :: altgrid(:), altfn(:,:), shg(:)
      real(8), allocatable        :: Gg(:,:), Gq(:,:), Fg(:), Fq(:), cfdiag(:), coefftemp(:)
      real(8), allocatable        :: Dxq(:), Dyq(:), Dzq(:), Dxg(:), Dyg(:), Dzg(:)
      
      integer(4)                  :: NMAXIGRF
      real(4)                     :: GB(1:255)
      real(4)                     :: A,ALAT,ALON,dum1,dum2,dum3,dum4,dum5
  
      external COFRM, APEX
  
  
negative.code:     
      !WRITE COEFFICIENTS TO OUTPUT FILE
      open(unit=iun, file=trim(datafilein), form='unformatted')
      write(iun) nepoch, nmax, mmax, lmax, nterm
      write(iun) epochgrid, coeff0
      close(iun)
      
      return
  
  end subroutine makeapxsh
  
  !*******************************************************************************
  
  subroutine choldc(a,n,np,p)
    
  