test_Mapl_Base.pf Source File


This file depends on

sourcefile~~test_mapl_base.pf~~EfferentGraph sourcefile~test_mapl_base.pf test_Mapl_Base.pf sourcefile~base_base.f90 Base_Base.F90 sourcefile~test_mapl_base.pf->sourcefile~base_base.f90 sourcefile~constants.f90 Constants.F90 sourcefile~base_base.f90->sourcefile~constants.f90 sourcefile~keywordenforcer.f90 KeywordEnforcer.F90 sourcefile~base_base.f90->sourcefile~keywordenforcer.f90 sourcefile~mapl_range.f90 MAPL_Range.F90 sourcefile~base_base.f90->sourcefile~mapl_range.f90 sourcefile~maplgrid.f90 MaplGrid.F90 sourcefile~base_base.f90->sourcefile~maplgrid.f90 sourcefile~internalconstants.f90 InternalConstants.F90 sourcefile~constants.f90->sourcefile~internalconstants.f90 sourcefile~mathconstants.f90 MathConstants.F90 sourcefile~constants.f90->sourcefile~mathconstants.f90 sourcefile~physicalconstants.f90 PhysicalConstants.F90 sourcefile~constants.f90->sourcefile~physicalconstants.f90 sourcefile~mapl_exceptionhandling.f90 MAPL_ExceptionHandling.F90 sourcefile~mapl_range.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~maplgrid.f90->sourcefile~constants.f90 sourcefile~maplgrid.f90->sourcefile~keywordenforcer.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~maplgrid.f90->sourcefile~errorhandling.f90 sourcefile~mapl_sort.f90 MAPL_Sort.F90 sourcefile~maplgrid.f90->sourcefile~mapl_sort.f90 sourcefile~pflogger_stub.f90 pflogger_stub.F90 sourcefile~maplgrid.f90->sourcefile~pflogger_stub.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90 sourcefile~mapl_exceptionhandling.f90->sourcefile~errorhandling.f90 sourcefile~mapl_exceptionhandling.f90->sourcefile~mapl_throw.f90 sourcefile~mapl_sort.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~pfl_keywordenforcer.f90 PFL_KeywordEnforcer.F90 sourcefile~pflogger_stub.f90->sourcefile~pfl_keywordenforcer.f90 sourcefile~wraparray.f90 WrapArray.F90 sourcefile~pflogger_stub.f90->sourcefile~wraparray.f90 sourcefile~physicalconstants.f90->sourcefile~mathconstants.f90

Source Code

module test_MAPL_Base
   use pfunit
   use MAPL_BaseMod, only: MAPL_Leap
   use MAPL_BaseMod, only: MAPL_DecomposeDim
   implicit none

contains

   @test
   subroutine test_mapl_leap()
      @assertTrue(mapl_leap(4))
      @assertTrue(mapl_leap(96))
      @assertFalse(mapl_leap(100))
      @assertTrue(mapl_leap(2000))
      @assertFalse(mapl_leap(1900))
      @assertTrue(mapl_leap(2004))
   end subroutine test_mapl_leap
   
@test
   subroutine test_MAPL_decomposeDim_even()
      integer :: NDEs
      integer :: dim_world
      integer, allocatable :: dim(:)

      NDEs = 4
      allocate(dim(0:NDEs-1))
      dim_world = 12
      call MAPL_DecomposeDim(dim_world, dim, NDEs)

      @assertEqual(12/4, dim)

   end subroutine test_MAPL_decomposeDim_even


   @test
   subroutine test_MAPL_decomposeDim_uneven()
      integer :: NDEs
      integer :: dim_world
      integer, allocatable :: dim(:)

      NDEs = 4
      allocate(dim(0:NDEs-1))
      dim_world = 11
      call MAPL_DecomposeDim(dim_world, dim, NDEs)

      @assertEqual(11/4+1, dim(0:2))
      @assertEqual(11/4, dim(3))

   end subroutine test_MAPL_decomposeDim_uneven

   @test
   subroutine test_MAPL_decomposeDim_minDE()
      integer :: NDEs
      integer :: dim_world
      integer, allocatable :: dim(:)

      NDEs = 6
      allocate(dim(0:NDEs-1))
      dim_world = 9
      call MAPL_DecomposeDim(dim_world, dim, NDEs, min_DE_extent=2)

      @assertEqual(3, dim(0))
      @assertEqual(2, dim(1:3))
      @assertEqual(0, dim(4:))

   end subroutine test_MAPL_decomposeDim_minDE


end module test_MAPL_Base