MAPL_DataAddCollection Function

public function MAPL_DataAddCollection(template, use_file_coords) result(id)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: template
logical, intent(in), optional :: use_file_coords

Return Value integer


Calls

proc~~mapl_dataaddcollection~~CallsGraph proc~mapl_dataaddcollection MAPL_DataAddCollection none~begin~114 MAPLCollectionVector%begin proc~mapl_dataaddcollection->none~begin~114 none~get~212 MAPLCollectionVectorIterator%get proc~mapl_dataaddcollection->none~get~212 none~next~112 MAPLCollectionVectorIterator%next proc~mapl_dataaddcollection->none~next~112 none~push_back~69 MAPLCollectionVector%push_back proc~mapl_dataaddcollection->none~push_back~69 none~capacity~409 MAPLCollectionVector%capacity none~push_back~69->none~capacity~409 none~resize~138 MAPLCollectionVector%resize none~push_back~69->none~resize~138 none~resize_32~65 MAPLCollectionVector%resize_32 none~resize~138->none~resize_32~65 none~resize_32~65->none~resize~138

Called by

proc~~mapl_dataaddcollection~~CalledByGraph proc~mapl_dataaddcollection MAPL_DataAddCollection proc~mapl_read_bundle MAPL_read_bundle proc~mapl_read_bundle->proc~mapl_dataaddcollection proc~main main proc~main->proc~mapl_read_bundle program~time_ave time_ave program~time_ave->proc~mapl_read_bundle program~ut_regridding ut_ReGridding program~ut_regridding->proc~mapl_read_bundle program~regrid_util Regrid_Util program~regrid_util->proc~main

Source Code

  function MAPL_DataAddCollection(template,use_file_coords) result(id)
     character(len=*), intent(in) :: template
     logical, optional, intent(in) :: use_file_coords
      integer :: n
      logical :: found
      type (MAPLCollectionVectorIterator) :: iter
      type (MAPLDataCollection), pointer :: collection
      type (MAPLDataCollection) :: c
      integer :: id

      iter = Datacollections%begin()
      n = 1

      ! Is it a new collection?
      found = .false.
      do while (iter /= Datacollections%end())
         collection => iter%get()
         if (template == collection%template) then
            found = .true.
            exit
         end if
         n = n + 1
         call iter%next()
      end do

      if (.not. found) then
         c = MAPLDataCollection(template,use_file_coords=use_file_coords)
         call Datacollections%push_back(c)
      end if

      id = n

   end function MAPL_DataAddCollection