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~78 MAPLCollectionVector%begin proc~mapl_dataaddcollection->none~begin~78 none~get~139 MAPLCollectionVectorIterator%get proc~mapl_dataaddcollection->none~get~139 none~next~76 MAPLCollectionVectorIterator%next proc~mapl_dataaddcollection->none~next~76 none~push_back~48 MAPLCollectionVector%push_back proc~mapl_dataaddcollection->none~push_back~48 none~capacity~283 MAPLCollectionVector%capacity none~push_back~48->none~capacity~283 none~resize~96 MAPLCollectionVector%resize none~push_back~48->none~resize~96 none~resize_32~44 MAPLCollectionVector%resize_32 none~resize~96->none~resize_32~44 none~resize_32~44->none~resize~96

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~2 main proc~main~2->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~2

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