get_level_info Function

function get_level_info(bundle, rc) result(kmvar)

Arguments

Type IntentOptional Attributes Name
type(ESMF_FieldBundle), intent(in) :: bundle
integer, intent(out), optional :: rc

Return Value integer, allocatable, (:)


Calls

proc~~get_level_info~~CallsGraph proc~get_level_info get_level_info esmf_fieldbundleget esmf_fieldbundleget proc~get_level_info->esmf_fieldbundleget esmf_fieldget esmf_fieldget proc~get_level_info->esmf_fieldget interface~mapl_assert MAPL_Assert proc~get_level_info->interface~mapl_assert proc~mapl_abort MAPL_abort proc~get_level_info->proc~mapl_abort proc~mapl_verify MAPL_Verify proc~get_level_info->proc~mapl_verify mpi_abort mpi_abort proc~mapl_abort->mpi_abort proc~mapl_throw_exception MAPL_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Called by

proc~~get_level_info~~CalledByGraph proc~get_level_info get_level_info program~time_ave time_ave program~time_ave->proc~get_level_info

Source Code

   function get_level_info(bundle,rc) result(kmvar)
      integer, allocatable :: kmvar(:)
      type(ESMF_FieldBundle), intent(in) :: bundle
      integer, optional, intent(out) :: rc

      integer :: status
      character(len=ESMF_MAXSTR), allocatable :: field_list(:)
      type(ESMF_Field) :: field
      integer :: rank,i,num_fields,lb(1),ub(1)
      call ESMF_FieldBundleGet(bundle,fieldCount=num_fields,_RC)
      allocate(field_list(num_fields))
      allocate(kmvar(num_fields))
      call ESMF_FieldBundleGet(bundle,fieldNameList=field_list,_RC)
      do i=1,num_fields
         call ESMF_FieldBundleGet(bundle,field_list(i),field=field,_RC)
         call ESMF_FieldGet(field,rank=rank,_RC)
         if (rank==2) then
            kmvar(i)=0
         else if (rank==3) then
            call ESMF_FieldGet(field,ungriddedLBound=lb,ungriddedUBound=ub,_RC)
            kmvar(i)=ub(1)-lb(1)+1
         else
            _FAIL("Unsupported rank")
         end if
      end do
      if (present(rc)) then
         RC=_SUCCESS
      end if
   end function get_level_info