make_ungriddedDims Function

public function make_ungriddedDims(info, key, rc) result(ungridded_dims)

Arguments

Type IntentOptional Attributes Name
type(ESMF_Info), intent(in) :: info
character(len=*), intent(in), optional :: key
integer, intent(out), optional :: rc

Return Value type(UngriddedDims)


Calls

proc~~make_ungriddeddims~~CallsGraph proc~make_ungriddeddims make_ungriddedDims ESMF_InfoCreate ESMF_InfoCreate proc~make_ungriddeddims->ESMF_InfoCreate ESMF_InfoDestroy ESMF_InfoDestroy proc~make_ungriddeddims->ESMF_InfoDestroy interface~mapl_infoget MAPL_InfoGet proc~make_ungriddeddims->interface~mapl_infoget proc~make_dim_key make_dim_key proc~make_ungriddeddims->proc~make_dim_key proc~make_ungriddeddim make_ungriddedDim proc~make_ungriddeddims->proc~make_ungriddeddim proc~mapl_return MAPL_Return proc~make_ungriddeddims->proc~mapl_return proc~mapl_verify MAPL_Verify proc~make_ungriddeddims->proc~mapl_verify proc~make_dim_key->proc~mapl_return interface~mapl_assert MAPL_Assert proc~make_dim_key->interface~mapl_assert proc~make_ungriddeddim->interface~mapl_infoget proc~make_ungriddeddim->proc~mapl_return proc~make_ungriddeddim->proc~mapl_verify at at proc~mapl_return->at insert insert proc~mapl_return->insert proc~mapl_throw_exception MAPL_throw_exception proc~mapl_return->proc~mapl_throw_exception proc~mapl_verify->proc~mapl_throw_exception

Called by

proc~~make_ungriddeddims~~CalledByGraph proc~make_ungriddeddims make_ungriddedDims proc~test_make_ungridded_dims test_make_ungridded_dims proc~test_make_ungridded_dims->proc~make_ungriddeddims

Source Code

   function make_ungriddedDims(info, key, rc) result(ungridded_dims)
      type(UngriddedDims) :: ungridded_dims
      type(ESMF_Info), intent(in) :: info
      character(*), optional, intent(in) :: key
      integer, optional, intent(out) :: rc

      integer :: status
      integer :: num_ungridded_dims
      integer :: i
      type(ESMF_Info) :: dim_info
      character(:), allocatable :: dim_key
      type(UngriddedDim), allocatable :: dim_specs(:)
      character(:), allocatable :: full_key

      ungridded_dims = UngriddedDims()
      full_key = KEY_NUM_UNGRIDDED_DIMS
      if (present(key)) then
         full_key = key // full_key
      end if

      call MAPL_InfoGet(info, key=full_key, value=num_ungridded_dims, _RC)
      allocate(dim_specs(num_ungridded_dims))

      do i = 1, num_ungridded_dims
         dim_key = make_dim_key(i, _RC)
         if (present(key)) then
            dim_key = key // dim_key
         end if
         dim_info = ESMF_InfoCreate(info, key=dim_key, _RC)
         dim_specs(i) = make_ungriddedDim(dim_info, _RC)
         call ESMF_InfoDestroy(dim_info, _RC)
      end do

      ungridded_dims = UngriddedDims(dim_specs)

      _RETURN(_SUCCESS)
   end function make_ungriddedDims