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~3~~CallsGraph proc~get_units~3 get_units ESMF_InfoGet ESMF_InfoGet proc~get_units~3->ESMF_InfoGet ESMF_InfoGetFromHost ESMF_InfoGetFromHost proc~get_units~3->ESMF_InfoGetFromHost esmf_fieldbundleget esmf_fieldbundleget proc~get_units~3->esmf_fieldbundleget proc~mapl_abort MAPL_abort proc~get_units~3->proc~mapl_abort proc~mapl_verify MAPL_Verify proc~get_units~3->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~3~~CalledByGraph proc~get_units~3 get_units program~time_ave time_ave program~time_ave->proc~get_units~3

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
      type(ESMF_Info) :: infoh
      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_InfoGetFromHost(field,infoh,_RC)
         call ESMF_InfoGet(infoh,key='UNITS',value=units(i),_RC)
      enddo
      if (present(rc)) then
         RC=_SUCCESS
      end if
   end function get_units