addList Subroutine

public subroutine addList(name, count, vName, attInt, attChar, attReal, iList, rList, cList)

addList – put user defined attribute into a list.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name
integer, intent(in) :: count
character(len=*), intent(in), optional :: vName
integer, intent(in), optional :: attInt(*)
character(len=MLEN), intent(in), optional :: attChar
real, intent(in), optional :: attReal(*)
type(iNode), optional, pointer :: iList

int list

type(rNode), optional, pointer :: rList

real list

type(cNode), optional, pointer :: cList

char list


Called by

proc~~addlist~~CalledByGraph proc~addlist addList proc~esmf_cfioset ESMF_CFIOSet proc~esmf_cfioset->proc~addlist proc~esmf_cfiovarinfoset ESMF_CFIOVarInfoSet proc~esmf_cfiovarinfoset->proc~addlist none~find~33 CFIOCollection%find none~find~33->proc~esmf_cfioset proc~esmf_cfiofileopen ESMF_CFIOFileOpen none~find~33->proc~esmf_cfiofileopen proc~esmf_cfiofilecreate ESMF_CFIOFileCreate proc~esmf_cfiofilecreate->proc~esmf_cfioset proc~esmf_cfiosdffilecreate ESMF_CFIOSdfFileCreate proc~esmf_cfiofilecreate->proc~esmf_cfiosdffilecreate proc~esmf_cfiofileopen->proc~esmf_cfioset proc~esmf_cfiosdffilecreate->proc~esmf_cfioset proc~mapl_cfiocreatewrite MAPL_CFIOCreatewrite proc~mapl_cfiocreatewrite->proc~esmf_cfioset proc~mapl_cfiocreatewrite->proc~esmf_cfiofilecreate program~test test program~test->proc~esmf_cfioset program~test->proc~esmf_cfiofileopen program~test~10 test program~test~10->proc~esmf_cfioset program~test~10->proc~esmf_cfiofileopen program~test~11 test program~test~11->proc~esmf_cfioset program~test~11->proc~esmf_cfiovarinfoset program~test~11->proc~esmf_cfiofilecreate program~test~12 test program~test~12->proc~esmf_cfioset program~test~12->proc~esmf_cfiovarinfoset program~test~12->proc~esmf_cfiofilecreate program~test~14 test program~test~14->proc~esmf_cfioset program~test~14->proc~esmf_cfiovarinfoset program~test~14->proc~esmf_cfiofilecreate program~test~2 test program~test~2->proc~esmf_cfioset program~test~2->proc~esmf_cfiofilecreate program~test~2->proc~esmf_cfiofileopen program~test~3 test program~test~3->proc~esmf_cfioset program~test~3->proc~esmf_cfiovarinfoset program~test~3->proc~esmf_cfiofilecreate program~test~4 test program~test~4->proc~esmf_cfioset program~test~4->proc~esmf_cfiofileopen program~test~5 test program~test~5->proc~esmf_cfioset program~test~5->proc~esmf_cfiovarinfoset program~test~5->proc~esmf_cfiofilecreate program~test~7 test program~test~7->proc~esmf_cfioset program~test~7->proc~esmf_cfiovarinfoset program~test~7->proc~esmf_cfiofilecreate program~test~8 test program~test~8->proc~esmf_cfioset program~test~8->proc~esmf_cfiovarinfoset program~test~8->proc~esmf_cfiofilecreate program~test~9 test program~test~9->proc~esmf_cfioset program~test~9->proc~esmf_cfiovarinfoset program~test~9->proc~esmf_cfiofilecreate proc~mapl_cfiocreatefromfile MAPL_CFIOCreateFromFile proc~mapl_cfiocreatefromfile->none~find~33 proc~mapl_cfioopenwrite MAPL_CFIOOpenWrite proc~mapl_cfioopenwrite->proc~esmf_cfiofileopen proc~mapl_cfioreadbundleread MAPL_CFIOReadBundleRead proc~mapl_cfioreadbundleread->none~find~33 program~test~6 test program~test~6->proc~esmf_cfiofilecreate

Source Code

        subroutine addList(name, count, vName, attInt, attChar, attReal, &
                           iList, rList, cList)
!
! !INPUT PARAMETERS:
!
           character(len=*), intent(in) :: name
           integer, intent(in) :: count
           character(len=*), intent(in), OPTIONAL :: vName
           integer, intent(in), OPTIONAL :: attInt(*)
           real, intent(in), OPTIONAL :: attReal(*)
           character(len=MLEN), intent(in), OPTIONAL :: attChar
!
! !OUTPUT PARAMETERS:
!
           type(iNode), pointer, OPTIONAL :: iList  !! int list
           type(rNode), pointer, OPTIONAL :: rList  !! real list
           type(cNode), pointer, OPTIONAL :: cList  !! char list
!
!------------------------------------------------------------------------------
           type(iNode), pointer :: p, q
           type(rNode), pointer :: rp, rq
           type(cNode), pointer :: cp, cq
           integer :: i

!          put int attribute into an integer list
           if ( present(attInt) .and. present(iList)) then
              if ( .not. associated(iList) ) then
                 allocate(iList)
                 iList%count = count
                 iList%name = name
                 if (present(vName)) iList%vName = vName
                 allocate(iList%intData(count))
                 do i =1, count
                    iList%intData(i) = attInt(i)
                 end do
                 iList%next => null()
              else
                 q => iList
                 p => iList%next
                 do while ( associated(p) )
                     q => p
                     p => p%next
                 end do

                 allocate(p)
                 p%count = count
                 p%name = name
                 if (present(vName)) p%vName = vName
                 allocate(p%intData(count))
                 do i =1, p%count
                    p%intData(i) = attInt(i)
                 end do

                 q%next => p
              end if
           end if

!          put real attribute into a real list
           if ( present(attReal) .and. present(rList)) then
              if ( .not. associated(rList) ) then
                 allocate(rList)
                 rList%count = count
                 rList%name = name
                 if (present(vName)) rList%vName = vName
                 allocate(rList%realData(count))
                 do i =1, count
                    rList%realData(i) = attReal(i)
                 end do
                 rList%next => null()
              else
                 rq => rList
                 rp => rList%next
                 do while ( associated(rp) )
                     rq => rp
                     rp => rp%next
                 end do

                 allocate(rp)
                 rp%count = count
                 rp%name = name
                 if (present(vName)) rp%vName = vName
                 allocate(rp%RealData(count))
                 do i =1, rp%count
                    rp%realData(i) = attReal(i)
                 end do

                 rq%next => rp
              end if
           end if

!          put char attribute into a char list
           if ( present(attChar) .and. present(cList)) then
              if ( .not. associated(cList) ) then
                 allocate(cList)
                 cList%count = count
                 cList%name = name
                 if (present(vName)) cList%vName = vName
                 cList%charData = attChar(1:count)
                 cList%next => null()
              else
                 cq => cList
                 cp => cList%next
                 do while ( associated(cp) )
                     cq => cp
                     cp => cp%next
                 end do

                 allocate(cp)
                 cp%count = count
                 cp%name = name
                 if (present(vName)) cp%vName = vName
                 cp%charData = attChar(1:count)

                 cq%next => cp
              end if
           end if

        end subroutine addList