check_quad Subroutine

subroutine check_quad(quad, vname, nvars, aliases, nalias, qloc)

Arguments

Type IntentOptional Attributes Name
character(len=ESMF_MAXSTR) :: quad(2)
character(len=ESMF_MAXSTR) :: vname(nvars)
integer :: nvars
character(len=ESMF_MAXSTR) :: aliases(2,nalias)
integer :: nalias
integer :: qloc(2)

Called by

proc~~check_quad~~CalledByGraph proc~check_quad check_quad program~time_ave time_ave program~time_ave->proc~check_quad

Source Code

   subroutine check_quad ( quad,vname,nvars,aliases,nalias,qloc )
      integer :: nvars, nalias
      character(len=ESMF_MAXSTR)  quad(2), aliases(2,nalias), vname(nvars)
      integer  qloc(2)
      integer  m,n

! Initialize Location of Quadratics
! ---------------------------------
      qloc = 0

! Check Quadratic Name against HDF Variable Names
! -----------------------------------------------
      do n=1,nvars
         if( trim(vname(n)).eq.trim(quad(1)) ) qloc(1) = n
         if( trim(vname(n)).eq.trim(quad(2)) ) qloc(2) = n
      enddo

! Check Quadratic Name against Aliases
! ------------------------------------
      do m=1,nalias
         if( trim(quad(1)).eq.trim(aliases(1,m)) ) then
            do n=1,nvars
               if( trim(vname(n)).eq.trim(quad(1)) .or. &
                     trim(vname(n)).eq.trim(aliases(2,m)) ) then
                  qloc(1) = n
                  exit
               endif
            enddo
         endif
         if( trim(quad(2)).eq.trim(aliases(1,m)) ) then
            do n=1,nvars
               if( trim(vname(n)).eq.trim(quad(2)) .or. &
                     trim(vname(n)).eq.trim(aliases(2,m)) ) then
                  qloc(2) = n
                  exit
               endif
            enddo
         endif
      enddo

   end subroutine check_quad