anchor.diff:  !-----------------------------------------------------------------------------------------------------------
   subroutine view_panair(t)
       type(plane_t) :: t
  -    real,allocatable,dimension(:,:) :: af_points
  -    character(100) :: filename
  -    integer :: i,iwing,af_datasize
  +    real, allocatable, dimension(:,:) :: af_points
  +    character(100) :: filename, upper_network, lower_network
  +    integer :: i, iwing, af_datasize, symmetric
       integer :: ierror = 0
   
       do i=1,size(airfoils)
           call af_create_geom_from_file(airfoils(i),DB_Airfoil)
       end do
   
  +    ! Open the file
  +    write(filename, *) trim(adjustl(t%master_filename))//'_view.panair'
  +    open(unit = 10, File = filename, action = 'write', iostat = ierror)
  +
  +    ! Determine symmetry
  +    symmetric = 1
  +    do iwing = 1, t%nrealwings
  +        if(t%wings(iwing)%orig_side .eq. 'right' .or. t%wings(iwing)%orig_side .eq. 'left') then
  +            symmetric = 0
  +        end if
  +    end do
  +
  +    ! Write Header information
  +    call view_write_panair_header(t, symmetric)
  +
       do iwing=1,t%nrealwings !real wings
  +        ! If symmetric, only write out the right wings
  +        if(symmetric .eq. 1 .and. t%wings(iwing)%side .ne. 'right') then
  +            cycle
  +        end if
  +        write(*,*) symmetric, t%wings(iwing)%side
  +
  +        ! Allocate space for the points on an airfoil
           af_datasize = t%wings(iwing)%airfoils(1)%p%geom%datasize
  +        allocate(af_points(af_datasize,3))
  +
           do i=1, t%wings(iwing)%nairfoils
               if(t%wings(iwing)%airfoils(i)%p%geom%datasize .ne. af_datasize) then
                   write(*,*) 'All airfoils for wing ',t%wings(iwing)%name,' must have same number of nodes.'
  
positive.code: end subroutine view_write_panair_points
  
  
  subroutine view_write_panair_wake()
      write(10, "(A)") "$TRAILING matchw=0"
      write(10, "(A)") "=kn"
      write(10, "(I0)") 1
      write(10, "(A, T11, A)") "=kt", "matchw"
      write(10, "(I0, T11, I0)") 18, 0
      write(10, "(A, T11, A, T21, A, T31, A)") "=inat", "insd", "xwake", "twake"
      write(10, "(A, T11, I0, T21, I0, T31, I0, T71, A)") "upper", 1, 10, 0, "wake"
  end subroutine
  
  
  
negative.code:             end if
          end do
  
          ! Write the network header information
          call view_write_panair_network_header(t%wings(iwing)%ID)
  
          ! Write the upper network
          write(upper_network, '(A, I0)') 'upper_', t%wings(iwing)%ID
          call view_write_panair_network(t%wings(iwing), af_datasize, af_points, trim(adjustl(upper_network)), af_datasize, af_datasize / 2 + 1)
  
          ! Write the lower network
          write(lower_network, '(A, I0)') 'lower_', t%wings(iwing)%ID
          call view_write_panair_network(t%wings(iwing), af_datasize, af_points, trim(adjustl(lower_network)), af_datasize / 2 + 1, 1)
  
          ! Attach a wake to the trailing edge of the upper network
          call view_write_panair_wake(trim(adjustl(upper_network)))
          deallocate(af_points)
      end do
  
      write(10, "(A)") "$END"
      close(10)
  
  end subroutine view_panair
  
  
  subroutine view_write_panair_header(plane, symmetric)
      type(plane_t), intent(in) :: plane
      integer, intent(in) :: symmetric
  
      write(10, '(A)') '$TITLE'
      write(10, '(A)') plane%name
      write(10, '(A)') 'Generated by MachUp'
      write(10, '(A)') '$DATACHECK'
      write(10, '(A)') '=ndtchk'
      write(10, '(I0)') 0
      write(10, '(A)') '$SYMMETRIC'
      write(10, '(A, T11, A)') '=xzpln', 'xypln'
      write(10, '(I0, T11, I0)') symmetric, 0
      write(10, '(A)') '$MACH NUMBER'
      write(10, '(A)') '=amach'
      write(10, '(F10.6)') 0.0
      write(10, '(A)') '$CASES'
      write(10, '(A)') '=nacase'
      write(10, '(I0)') 1
      write(10, '(A)') '$ANGLES OF ATTACK'
      write(10, '(A)') '=alpc'
      write(10, '(F10.6)') 0.0
      write(10, '(A)') '=alpha(0)'
      write(10, '(F10.6)') plane%alpha * 180.0 / pi
      write(10, '(A)') '$YAW ANGLE'
      write(10, '(A)') '=betc'
      write(10, '(F10.6)') 0.0
      write(10, '(A)') '=beta(0)'
      write(10, '(F10.6)') plane%beta * 180.0 / pi
      write(10, '(A)') '$REFERENCE DATA'
      write(10, '(A, T11, A, T21, A)') '=xref', 'yref', 'zref'
      write(10, '(3F10.6)') 0.0, 0.0, 0.0
      write(10, '(A, T11, A, T21, A, T31, A)') '=sref', 'bref', 'cref', 'dref'
      write(10, '(4F10.6)') plane%Sr, plane%lat_r, plane%long_r, plane%lat_r
      write(10, '(A)') '$PRINTOUT CONTROL'
      write(10, '(A, T11, A, T21, A, T31, A, T41, A, T51, A)') '=isings', 'igeomp', 'isingp', 'icontp', 'ibconp', 'iedgep'
      write(10, '(I0, T11, I0, T21, I0, T31, I0, T41, I0, T51, I0)') 0, 0, 0, 0, 0, 0
      write(10, '(A, T11, A, T21, A, T31, A, T41, A)') '=ipraic', 'nexdgn', 'ioutpr', 'ifmcpr', 'icostp'
      write(10, '(I0, T11, I0, T21, I0, T31, I0, T41, I0)') 0, 0, 1, 0, 0
  end subroutine view_write_panair_header
  
  
  subroutine view_write_panair_network_header(iwing)
      integer, intent(in) :: iwing
  
      ! Write header info
      write(10, "(A, I0)") "$POINTS for wing ", iwing
      write(10, "(A)") "=kn"  ! Number of networks in $POINTS block
      write(10, "(F10.6)") 2.0  ! Must be a floating-point value...
      write(10, "(A)") "=kt"  ! Boundary condition (1 = solid surface)
      write(10, "(I0)") 1
  
  end subroutine view_write_panair_network_header
  
  
  subroutine view_write_panair_network(wi, af_datasize, af_points, network, istart, iend)
  