anchor.diff:  !     by A.Mereghetti
   !     last modified: 22-03-2018
   !     dump header of aperture marker
  -!     always in main code
   !-----------------------------------------------------------------------
     use mod_settings
     implicit none
  
positive.code:   !-----------------------------------------------------------------------
    ! A.Mereghetti (CERN, BE-ABP-HSS), 2018-03-21
    ! initialise aperture marker to rectangle
    !-----------------------------------------------------------------------
    implicit none
    integer ix
  
negative.code:   !-----------------------------------------------------------------------
    ! A.Mereghetti (CERN, BE-ABP-HSS), 2018-03-21
    ! initialise aperture marker to ellipse
    ! - rectangle 'tangent' to ellypse at axes
    ! - octagon tangent to ellypse (m=-1)
    ! - no offset for racetrack
    !-----------------------------------------------------------------------
    implicit none
    integer ix
    real(kind=fPrec) apex, apey
    call aperture_nul( ix )
    kape(ix)=3
    ape(1,ix)=apex                             ! needed only for interpolation
    ape(2,ix)=apey                             ! needed only for interpolation
    ape(3,ix)=apex                             ! needed only for interpolation
    ape(4,ix)=apey                             ! needed only for interpolation
    ape(7,ix)=-one                             ! needed only for interpolation
    ape(8,ix)=sqrt(ape(3,ix)**2+ape(4,ix)**2)  ! needed only for interpolation
  end subroutine aperture_initEL
  
  
  