anchor.diff:       select case(aptype)
        case(-1) ! transition
           write(iunit,1984) name, apeName(aptype), spos, ape(1), ape(2), ape(3), ape(4), ape(5), ape(6), &
  -             ape(7), ape(8), ape(9), ape(10), ape(11)
  -     case(0) ! not an aperture marker
  -        write(iunit,1984) name, apeName(aptype), spos, ape(1), ape(2), ape(3), ape(4), ape(5), ape(6), &
  -             ape(7), ape(8), ape(9), ape(10), ape(11)
  +             atan2_mb(ape(1)*ape(7)+ape(8),ape(1)), atan2_mb(ape(2),(ape(2)-ape(8))/ape(7)), ape(9), ape(10), ape(11)
        case(1) ! Circle
           write(iunit,1984) name, apeName(aptype), spos, ape(1),   zero,   zero,   zero,   zero,   zero, &
                zero,   zero, ape(9), ape(10), ape(11)
  
positive.code:   !-----------------------------------------------------------------------
    ! A.Mereghetti (CERN, BE-ABP-HSS), 2018-03-21
    ! initialise aperture marker to rectellipse
    !-----------------------------------------------------------------------
    implicit none
    integer ix
  
negative.code: !     by P.Garcia Ortega, for the FLUKA Team, and A.Mereghetti
  !     last modified: 08-12-2016
  !     dump all apertures declared in machine
  !-----------------------------------------------------------------------
    use parpro
    use mod_units, only: f_open
  