write_info Subroutine

private impure subroutine write_info(this, verbose, file_name)

Print information about the colormap

Type Bound

table

Arguments

Type IntentOptional Attributes Name
class(table), intent(inout) :: this
integer, intent(in), optional :: verbose
character(len=*), intent(in), optional :: file_name

Called by

proc~~write_info~~CalledByGraph proc~write_info table%write_info proc~write Colormaps_info%write proc~write->proc~write_info

Source Code

   impure subroutine write_info(this, verbose, file_name)
      class(table), intent(inout) :: this
      integer, intent(in), optional :: verbose
      character(*), intent(in), optional :: file_name
      integer :: verbose_, nunit
      character(len=256) :: format_table

      if (present(verbose)) then
         verbose_ = verbose
      else
         verbose_ = 1
      end if

      select case (verbose_)
       case (1)
         if (present(file_name)) then
            write(format_table,&
               '(a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,a,&
            &a)')&
               '(',&
               'a,','a', len_trim(this%name),',',10-len_trim(this%name)+2,'x',',',&
               'a,','a', len_trim(this%family),',',10-len_trim(this%family)+2,'x',',',&
               'a,','a', len_trim(this%gradient),',',18-len_trim(this%gradient)+2,'x',',',&
               'a,','a', len_trim(this%palette),',',12-len_trim(this%palette)+2,'x',',',&
               'a,','I4',',',3,'x',',',&
               'a,','a', len_trim(this%colorbar),',',23-len_trim(this%colorbar)+2,'x',',',&
               'a,','a', len_trim(this%package),',',25-len_trim(this%package)+2,'x',',',&
               'a,','a', len_trim(this%author),',',15-len_trim(this%author)+2,'x',',',&
               'a,','a', len_trim(this%license),',',33-len_trim(this%license)+2,'x',',',&
               'a,','a', max(1, len_trim(this%url)),',',42-max(1, len_trim(this%url))+2,'x',',a',&
               ')'
            open (newunit=nunit, file=trim(file_name), position='append', status='unknown', action='write')
            write (nunit,format_table)&
               '|',this%name,&
               '|',this%family,&
               '|',this%gradient,&
               '|',this%palette,&
               '|',this%levels,&
               '|',this%colorbar,&
               '|',this%package,&
               '|',this%author,&
               '|',this%license,&
               '|',this%url,'|'
            close (nunit)
         else
            write(format_table,&
               '(a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a)')&
               '(',&
               'a', len_trim(this%name),',',10-len_trim(this%name)+2,'x',',',&
               'a', len_trim(this%family),',',10-len_trim(this%family)+2,'x',',',&
               'a', len_trim(this%gradient),',',18-len_trim(this%gradient)+2,'x',',',&
               'a', len_trim(this%palette),',',12-len_trim(this%palette)+2,'x',',',&
               'I4',',',3,'x',',',&
               'a', len_trim(this%colorbar),',',23-len_trim(this%colorbar)+2,'x',',',&
               'a', len_trim(this%package),',',25-len_trim(this%package)+2,'x',',',&
               'a', len_trim(this%author),',',15-len_trim(this%author)+2,'x',',',&
               'a', len_trim(this%license),',',33-len_trim(this%license)+2,'x',',',&
               'a', max(1, len_trim(this%url)),',',42-max(1, len_trim(this%url))+2,'x',&
               ')'
            print (format_table),&
               this%name,&
               this%family,&
               this%gradient,&
               this%palette,&
               this%levels,&
               this%colorbar,&
               this%package,&
               this%author,&
               this%license,&
               this%url
         end if
       case (2)
         if (present(file_name)) then
            open (newunit=nunit, file=trim(file_name), position='append', status = 'unknown', action = 'write')
            write(nunit,'(a)')    ''
            write(nunit,'(a)')    '**********************************************'
            write(nunit,'(a,a)')  'Name    : ', this%name
            write(nunit,'(a,a)')  'Family  : ', this%family
            write(nunit,'(a,a)')  'Gradient: ', this%gradient
            write(nunit,'(a,a)')  'Palette : ', this%palette
            write(nunit,'(a,I4)') 'Levels  : ', this%levels
            write(nunit,'(a,a)')  'Colorbar: ', this%colorbar
            write(nunit,'(a,a)')  'Package : ', this%package
            write(nunit,'(a,a)')  'Author  : ', this%author
            write(nunit,'(a,a)')  'Licence : ', this%license
            write(nunit,'(a,a)')  'URL     : ', this%url
            write(nunit,'(a)')    '**********************************************'
            write(nunit,'(a)')    ''
            close(nunit)
         else
            print'(a)'    ,''
            print'(a)'    ,'**********************************************'
            print'(a,a)'  , 'Name    : ', this%name
            print'(a,a)'  , 'Family  : ', this%family
            print'(a,a)'  , 'Gradient: ', this%gradient
            print'(a,a)'  , 'Palette : ', this%palette
            print'(a,I4)' , 'Levels  : ', this%levels
            print'(a,a)'  , 'Colorbar: ', this%colorbar
            print'(a,a)'  , 'Package : ', this%package
            print'(a,a)'  , 'Author  : ', this%author
            print'(a,a)'  , 'Licence : ', this%license
            print'(a,a)'  , 'URL     : ', this%url
            print'(a)'    , '**********************************************'
            print'(a)'    ,''
         end if
       case (3)
         if (present(file_name)) then
            open (newunit=nunit, file=trim(file_name), position='append', status='unknown', action='write')
            write(nunit,'(a)') this%name
            close(nunit)
         else
            print'(a)',  this%name
         end if
      case (4)
         if (present(file_name)) then
            write(format_table,&
               '(a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,&
            &a,a,a,g0,a,a,&
            &a,a,g0,a,g0,a,a,a,&
            &a)')&
               '(',&
               'a,','a', len_trim(this%name),',',10-len_trim(this%name)+2,'x',',',&
               'a,','a', len_trim(this%family),',',10-len_trim(this%family)+2,'x',',',&
               'a,','a', len_trim(this%gradient),',',18-len_trim(this%gradient)+2,'x',',',&
               'a,','a', len_trim(this%palette),',',12-len_trim(this%palette)+2,'x',',',&
               'a,','I4',',',3,'x',',',&
               'a,','a', len_trim(this%colorbar),',',23-len_trim(this%colorbar)+2,'x',',a',&
               ')'
            open (newunit=nunit, file=trim(file_name), position='append', status='unknown', action='write')
            write (nunit,format_table)&
               '|',this%name,&
               '|',this%family,&
               '|',this%gradient,&
               '|',this%palette,&
               '|',this%levels,&
               '|',this%colorbar,'|'
            close (nunit)
         else
            write(format_table,&
               '(a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a,a,g0,a,a,&
            &a,g0,a,g0,a,a,&
            &a)')&
               '(',&
               'a', len_trim(this%name),',',10-len_trim(this%name)+2,'x',',',&
               'a', len_trim(this%family),',',10-len_trim(this%family)+2,'x',',',&
               'a', len_trim(this%gradient),',',18-len_trim(this%gradient)+2,'x',',',&
               'a', len_trim(this%palette),',',12-len_trim(this%palette)+2,'x',',',&
               'I4',',',3,'x',',',&
               'a', len_trim(this%colorbar),',',23-len_trim(this%colorbar)+2,'x',&
               ')'
            print (format_table),&
               this%name,&
               this%family,&
               this%gradient,&
               this%palette,&
               this%levels,&
               this%colorbar
         end if
      end select
   end subroutine write_info