get_units Function

function get_units(bundle, rc) result(units)

Arguments

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

Return Value character(len=ESMF_MAXSTR), allocatable, (:)


Calls

proc~~get_units~2~~CallsGraph proc~get_units~2 get_units ESMF_AttributeGet ESMF_AttributeGet proc~get_units~2->ESMF_AttributeGet esmf_fieldbundleget esmf_fieldbundleget proc~get_units~2->esmf_fieldbundleget proc~mapl_abort MAPL_abort proc~get_units~2->proc~mapl_abort proc~mapl_verify MAPL_Verify proc~get_units~2->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_units~2~~CalledByGraph proc~get_units~2 get_units program~time_ave time_ave program~time_ave->proc~get_units~2

Source Code

   function get_units(bundle,rc) result(units)
      character(len=ESMF_MAXSTR), allocatable :: units(:)
      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 :: i,num_fields

      call ESMF_FieldBundleGet(bundle,fieldCount=num_fields,_RC)
      allocate(field_list(num_fields))
      allocate(units(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_AttributeGet(field,name='UNITS',value=units(i),_RC)
      enddo
      if (present(rc)) then
         RC=_SUCCESS
      end if
   end function get_units