FieldCondensedArray_private.F90 Source File


This file depends on

sourcefile~~fieldcondensedarray_private.f90~~EfferentGraph sourcefile~fieldcondensedarray_private.f90 FieldCondensedArray_private.F90 sourcefile~mapl_exceptionhandling.f90 MAPL_ExceptionHandling.F90 sourcefile~fieldcondensedarray_private.f90->sourcefile~mapl_exceptionhandling.f90 sourcefile~errorhandling.f90 ErrorHandling.F90 sourcefile~mapl_exceptionhandling.f90->sourcefile~errorhandling.f90 sourcefile~mapl_throw.f90 MAPL_Throw.F90 sourcefile~mapl_exceptionhandling.f90->sourcefile~mapl_throw.f90 sourcefile~errorhandling.f90->sourcefile~mapl_throw.f90

Files dependent on this one

sourcefile~~fieldcondensedarray_private.f90~~AfferentGraph sourcefile~fieldcondensedarray_private.f90 FieldCondensedArray_private.F90 sourcefile~fieldcondensedarray.f90 FieldCondensedArray.F90 sourcefile~fieldcondensedarray.f90->sourcefile~fieldcondensedarray_private.f90 sourcefile~test_fieldcondensedarray_private.pf Test_FieldCondensedArray_private.pf sourcefile~test_fieldcondensedarray_private.pf->sourcefile~fieldcondensedarray_private.f90 sourcefile~fixedlevelsverticalgrid.f90 FixedLevelsVerticalGrid.F90 sourcefile~fixedlevelsverticalgrid.f90->sourcefile~fieldcondensedarray.f90 sourcefile~verticalregridaction.f90 VerticalRegridAction.F90 sourcefile~verticalregridaction.f90->sourcefile~fieldcondensedarray.f90 sourcefile~couplermetacomponent.f90 CouplerMetaComponent.F90 sourcefile~couplermetacomponent.f90->sourcefile~verticalregridaction.f90 sourcefile~genericcoupler.f90 GenericCoupler.F90 sourcefile~genericcoupler.f90->sourcefile~verticalregridaction.f90 sourcefile~genericcoupler.f90->sourcefile~couplermetacomponent.f90 sourcefile~modelverticalgrid.f90 ModelVerticalGrid.F90 sourcefile~modelverticalgrid.f90->sourcefile~fixedlevelsverticalgrid.f90 sourcefile~parse_geometry_spec.f90 parse_geometry_spec.F90 sourcefile~parse_geometry_spec.f90->sourcefile~fixedlevelsverticalgrid.f90 sourcefile~parse_geometry_spec.f90->sourcefile~modelverticalgrid.f90 sourcefile~test_fixedlevelsverticalgrid.pf Test_FixedLevelsVerticalGrid.pf sourcefile~test_fixedlevelsverticalgrid.pf->sourcefile~fixedlevelsverticalgrid.f90 sourcefile~verticalgridaspect.f90 VerticalGridAspect.F90 sourcefile~verticalgridaspect.f90->sourcefile~verticalregridaction.f90 sourcefile~aspectcollection.f90 AspectCollection.F90 sourcefile~aspectcollection.f90->sourcefile~verticalgridaspect.f90 sourcefile~fieldspec.f90 FieldSpec.F90 sourcefile~fieldspec.f90->sourcefile~verticalgridaspect.f90 sourcefile~stateitemextension.f90 StateItemExtension.F90 sourcefile~stateitemextension.f90->sourcefile~genericcoupler.f90 sourcefile~test_modelverticalgrid.pf Test_ModelVerticalGrid.pf sourcefile~test_modelverticalgrid.pf->sourcefile~modelverticalgrid.f90 sourcefile~variablespec.f90 VariableSpec.F90 sourcefile~variablespec.f90->sourcefile~verticalgridaspect.f90

Source Code

#include "MAPL_Generic.h"
module mapl3g_FieldCondensedArray_private

   use MAPL_ExceptionHandling
   implicit none

   private
   public :: get_fptr_shape_private, ARRAY_RANK

   integer, parameter :: ARRAY_RANK = 3

contains

   function get_fptr_shape_private(gridToFieldMap, localElementCount, has_vertical, rc) &
         &result(fptr_shape)
      integer :: fptr_shape(ARRAY_RANK)
      integer, intent(in) :: gridToFieldMap(:)
      integer, intent(in) :: localElementCount(:)
      logical, intent(in) :: has_vertical
      integer, optional, intent(out) :: rc
      integer :: rank, i
      integer, allocatable :: grid_dims(:)
      integer, allocatable :: ungridded_dims(:)
      integer :: horz_size, vert_size, ungridded_size
      integer :: vert_dim
      
      vert_dim = 0
      vert_size = 1

      rank = size(localElementCount)
      grid_dims = pack(gridToFieldMap, gridToFieldMap /= 0)
      _ASSERT(all(grid_dims <= size(grid_dims)), 'MAPL expects geom dims before ungridded.')
      if(has_vertical) vert_dim = 1 
      if(size(grid_dims) > 0) vert_dim = maxval(grid_dims) + vert_dim
      ungridded_dims = pack([(i,i=1,rank)], [(all([vert_dim, grid_dims] /= i), i=1, rank)])
      horz_size = product([(localElementCount(grid_dims(i)), i=1, size(grid_dims))])
      if(has_vertical) vert_size = localElementCount(vert_dim)
      ungridded_size = product([(localElementCount(ungridded_dims(i)), i=1, size(ungridded_dims))])
      fptr_shape = [horz_size, vert_size, ungridded_size]
      _RETURN(_SUCCESS)

   end function get_fptr_shape_private

end module mapl3g_FieldCondensedArray_private