AbstractColumn.F90 Source File


This file depends on

sourcefile~~abstractcolumn.f90~~EfferentGraph sourcefile~abstractcolumn.f90 AbstractColumn.F90 sourcefile~abstractmeternode.f90 AbstractMeterNode.F90 sourcefile~abstractcolumn.f90->sourcefile~abstractmeternode.f90 sourcefile~distributedmeter.f90 DistributedMeter.F90 sourcefile~abstractcolumn.f90->sourcefile~distributedmeter.f90 sourcefile~abstractmeter.f90 AbstractMeter.F90 sourcefile~abstractmeternode.f90->sourcefile~abstractmeter.f90 sourcefile~abstractgauge.f90 AbstractGauge.F90 sourcefile~distributedmeter.f90->sourcefile~abstractgauge.f90 sourcefile~distributedmeter.f90->sourcefile~abstractmeter.f90 sourcefile~advancedmeter.f90 AdvancedMeter.F90 sourcefile~distributedmeter.f90->sourcefile~advancedmeter.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~distributedmeter.f90->sourcefile~errorhandling.f90 sourcefile~abstractgauge.f90->sourcefile~abstractmeter.f90 sourcefile~abstractmeter.f90->sourcefile~errorhandling.f90 sourcefile~advancedmeter.f90->sourcefile~abstractgauge.f90 sourcefile~advancedmeter.f90->sourcefile~abstractmeter.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90

Files dependent on this one

sourcefile~~abstractcolumn.f90~~AfferentGraph sourcefile~abstractcolumn.f90 AbstractColumn.F90 sourcefile~columnvector.f90 ColumnVector.F90 sourcefile~columnvector.f90->sourcefile~abstractcolumn.f90 sourcefile~exclusivecolumn.f90 ExclusiveColumn.F90 sourcefile~exclusivecolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~formattedtextcolumn.f90 FormattedTextColumn.F90 sourcefile~formattedtextcolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~inclusivecolumn.f90 InclusiveColumn.F90 sourcefile~inclusivecolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~mapl_profiler.f90~2 MAPL_Profiler.F90 sourcefile~mapl_profiler.f90~2->sourcefile~abstractcolumn.f90 sourcefile~memorytextcolumn.f90 MemoryTextColumn.F90 sourcefile~memorytextcolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~numcyclescolumn.f90 NumCyclesColumn.F90 sourcefile~numcyclescolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~percentagecolumn.f90 PercentageColumn.F90 sourcefile~percentagecolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~separatorcolumn.f90 SeparatorColumn.F90 sourcefile~separatorcolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~simplecolumn.f90 SimpleColumn.F90 sourcefile~simplecolumn.f90->sourcefile~abstractcolumn.f90 sourcefile~stddevcolumn.f90 StdDevColumn.F90 sourcefile~stddevcolumn.f90->sourcefile~abstractcolumn.f90

Source Code

module MAPL_AbstractColumn
   use GFTL_UnlimitedVector
   use MAPL_AbstractMeterNode
   use MAPL_DistributedMeter
   implicit none
   private

   public :: AbstractColumn

   type, abstract :: AbstractColumn
      private
   contains
      procedure(i_get_rows), deferred :: get_rows
      procedure, nopass :: fill_row_real64_stats
      procedure, nopass :: fill_row_integer_stats
      generic :: fill_row => fill_row_real64_stats, fill_row_integer_stats
   end type AbstractColumn


   abstract interface

      function i_get_rows(this, node) result(rows)
         import AbstractColumn
         import AbstractMeterNode
         import UnlimitedVector
         ! Some columns return reals, others return integers
         type(UnlimitedVector) :: rows
         class(AbstractColumn), intent(in) :: this
         class(AbstractMeterNode), target, intent(in) :: node

      end function i_get_rows

   end interface


contains


   ! These probably belong somewhere else.
   subroutine fill_row_real64_stats(stats, option, row)
      type(DistributedReal64), intent(in) :: stats
      character(*), intent(in) :: option
      class(*), allocatable, intent(out) :: row

      select case (option)
      case ('MAX')
         allocate(row, source=stats%max)
      case ('MAX_PE')
         allocate(row, source=stats%max_pe)
      case ('MIN')
         allocate(row, source=stats%min)
      case ('MIN_PE')
         allocate(row, source=stats%min_pe)
      case ('MEAN')
         allocate(row, source=stats%total / stats%num_pes)
      case ('TOTAL')
         allocate(row, source=stats%total)
      case default
         print*,__FILE__,__LINE__,'ERROR: unsupported option '//option
      end select

   end subroutine fill_row_real64_stats

   subroutine fill_row_integer_stats(stats, option, row)
      type(DistributedInteger), intent(in) :: stats
      character(*), intent(in) :: option
      class(*), allocatable, intent(out) :: row

      select case (option)
      case ('MAX')
         allocate(row, source=stats%max)
      case ('MAX_PE')
         allocate(row, source=stats%max_pe)
      case ('MIN')
         allocate(row, source=stats%min)
      case ('MIN_PE')
         allocate(row, source=stats%min_pe)
      case ('MEAN')
         allocate(row, source=stats%total / stats%num_pes)
      case ('TOTAL')
         allocate(row, source=stats%total)
      case default
         print*,__FILE__,__LINE__,'ERROR: unsupported option '//option
      end select

   end subroutine fill_row_integer_stats


end module MAPL_AbstractColumn