export Subroutine

private impure subroutine export(this, file_name)

Type Bound

format_lut

Arguments

Type IntentOptional Attributes Name
class(format_lut), intent(inout) :: this
character(len=*), intent(in) :: file_name

Calls

proc~~export~~CallsGraph proc~export format_lut%export proc~get_num_colors format_lut%get_num_colors proc~export->proc~get_num_colors

Called by

proc~~export~~CalledByGraph proc~export format_lut%export program~test15 test15 program~test15->proc~export program~test16 test16 program~test16->proc~export

Source Code

   impure subroutine export(this, file_name)
      class(format_lut), intent(inout)    :: this
      character(*),      intent(in)       :: file_name
      integer                             :: nunit, i
      integer, dimension(this%dim_colors) :: buffer
      integer                             :: iostat

      open(newunit=nunit, file=file_name//'.lut', status='replace', action='write', iostat=iostat)
      if (iostat /= 0) error stop 'Error opening the file.'
      do i = 1, this%get_num_colors()
         buffer = this%colors(i,:)
         write(nunit, '(*(I3,1x))') buffer
      end do
      close(nunit)
   end subroutine export