bundle_to_metadata Function

public function bundle_to_metadata(bundle, geom, rc) result(metadata)

Arguments

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

Return Value type(FileMetadata)


Calls

proc~~bundle_to_metadata~~CallsGraph proc~bundle_to_metadata bundle_to_metadata ESMF_TimeSet ESMF_TimeSet proc~bundle_to_metadata->ESMF_TimeSet get_file_metadata get_file_metadata proc~bundle_to_metadata->get_file_metadata none~add_dimension FileMetadata%add_dimension proc~bundle_to_metadata->none~add_dimension none~add_variable~2 FileMetadata%add_variable proc~bundle_to_metadata->none~add_variable~2 proc~add_ungridded_dimensions add_ungridded_dimensions proc~bundle_to_metadata->proc~add_ungridded_dimensions proc~add_variables add_variables proc~bundle_to_metadata->proc~add_variables proc~add_vertical_dimensions add_vertical_dimensions proc~bundle_to_metadata->proc~add_vertical_dimensions proc~create_time_variable create_time_variable proc~bundle_to_metadata->proc~create_time_variable proc~get_mapl_geom get_mapl_geom proc~bundle_to_metadata->proc~get_mapl_geom proc~mapl_return MAPL_Return proc~bundle_to_metadata->proc~mapl_return proc~mapl_verify MAPL_Verify proc~bundle_to_metadata->proc~mapl_verify

Source Code

   function bundle_to_metadata(bundle, geom, rc) result(metadata)
      type(FileMetaData) :: metadata
      type(ESMF_FieldBundle), intent(in) :: bundle
      type(ESMF_Geom), intent(in) :: geom
      integer, optional, intent(out) :: rc

      integer:: status
      type(MaplGeom), pointer :: mapl_geom
      type(Variable) :: time_var
      type(ESMF_Time) :: fake_time

      mapl_geom => get_mapl_geom(geom, _RC)
      metadata = mapl_geom%get_file_metadata()
      ! Add metadata for vertical geom, note could be both center and edge
      call add_vertical_dimensions(bundle, metadata, _RC)
      ! Add metadata for all unique ungridded dimensions the set of fields has
      call add_ungridded_dimensions(bundle, metadata, _RC)

      ! Add time metadata
      call ESMF_TimeSet(fake_time, timeString="1900-04-03T21:00:00", _RC)
      call metadata%add_dimension('time', pFIO_UNLIMITED)
      time_var = create_time_variable(fake_time, _RC)
      call metadata%add_variable('time', time_var, _RC)

      ! Variables
      call add_variables(metadata, bundle, _RC)

      _RETURN(_SUCCESS)
   end function bundle_to_metadata