MAPL_IOCountNonDimVars Subroutine

public subroutine MAPL_IOCountNonDimVars(cf, nvars, rc)

Arguments

Type IntentOptional Attributes Name
type(FileMetadata), intent(inout) :: cf
integer, intent(out) :: nvars
integer, intent(out), optional :: rc

Calls

proc~~mapl_iocountnondimvars~~CallsGraph proc~mapl_iocountnondimvars MAPL_IOCountNonDimVars at at proc~mapl_iocountnondimvars->at none~first~177 StringVariableMapIterator%first proc~mapl_iocountnondimvars->none~first~177 none~ftn_begin~25 StringVariableMap%ftn_begin proc~mapl_iocountnondimvars->none~ftn_begin~25 none~ftn_end~25 StringVariableMap%ftn_end proc~mapl_iocountnondimvars->none~ftn_end~25 none~get_dimensions~2 FileMetadata%get_dimensions proc~mapl_iocountnondimvars->none~get_dimensions~2 none~get_variables FileMetadata%get_variables proc~mapl_iocountnondimvars->none~get_variables none~next~82 StringVariableMapIterator%next proc~mapl_iocountnondimvars->none~next~82 proc~mapl_return MAPL_Return proc~mapl_iocountnondimvars->proc~mapl_return proc~mapl_verify MAPL_Verify proc~mapl_iocountnondimvars->proc~mapl_verify none~of~152 StringVariableMapIterator%of none~first~177->none~of~152 to_node to_node none~ftn_end~25->to_node none~get_variables->proc~mapl_return none~next~82->to_node 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

Source Code

  subroutine MAPL_IOCountNonDimVars(cf,nvars,rc)
  type(FileMetadata), intent(inout) :: cf
  integer, intent(out) :: nvars
  integer, intent(out), optional :: rc

  type(StringVariableMap), pointer :: vars
  type(StringVariableMapIterator) :: iter
  type(StringIntegerMap), pointer :: dims
  integer, pointer :: dimsize => null()
  character(len=:), pointer :: name

  integer :: status

  nvars = 0
  dims => cf%get_dimensions()
  vars => cf%get_variables(_RC)
  iter = vars%ftn_begin()
  do while(iter/=vars%ftn_end())
     call iter%next()

     name =>  iter%first()
     dimsize => dims%at(trim(name))
     if (.not.associated(dimsize)) nvars=nvars+1
     if (associated(dimsize)) nullify(dimsize)

  end do

  _RETURN(ESMF_SUCCESS)

  end subroutine MAPL_IOCountNonDimVars