MultPar_SingleLine_Vf Subroutine

public subroutine MultPar_SingleLine_Vf()

Arguments

None

Source Code

subroutine MultPar_SingleLine_Vf
!--------------------------------------------------------------------
!  array of logicals
      character(len=6), parameter :: vf_dataType_0 = 'v_Flag'
      integer, parameter   :: nv_0 = 6
      logical, dimension(nv_0), parameter :: sigVf_0 = &
           (/ .true., .false., .true., .true., .false., .false. /)
      character(ESMF_MAXSTR) :: failMsg
      character(ESMF_MAXSTR) :: name
      integer :: result = 0

      rc = 0

!''''''''''''''''''''''''''''
      !------------------------------------------------------------------------
      !EX_UTest
      ! Non-created Config Find Label Test
      write(failMsg, *) "Did not return ESMF_RC_OBJ_NOT_CREATED"
      write(name, *) "Non-create Config Find Label Test"
      call ESMF_ConfigFindLabel( cf1, 'v-wind_flag:', rc=rc)
      call ESMF_Test((rc.eq.ESMF_RC_OBJ_NOT_CREATED), name, failMsg, result, ESMF_SRCLINE)

      !------------------------------------------------------------------------
      !EX_UTest
      ! Config Find Label Test
      write(failMsg, *) "Did not return ESMF_SUCCESS"
      write(name, *) "Config Find Label Test"
      call ESMF_ConfigFindLabel( cf, 'v-wind_flag:', rc=rc)
      call ESMF_Test((rc.eq.ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
!''''''''''''''''''''''''''''

      counter_total =counter_total + 1
      if (rc == ESMF_SUCCESS) then
         counter_success =counter_success + 1
      else
         print *,'ESMF_ConfigFindLabel failed, label = v-wind_flag:, rc =', rc
         return        
      endif

!''''''''''''''''''''''''''''
      !------------------------------------------------------------------------
      !EX_UTest
      ! Config Get String Test
      write(failMsg, *) "Did not return ESMF_SUCCESS"
      write(name, *) "Config Get String Test"
      call ESMF_ConfigGetAttribute( cf, vf_dataType, rc = rc )
      call ESMF_Test((rc.eq.ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
!''''''''''''''''''''''''''''

      counter_total =counter_total + 1
      if (rc /= ESMF_SUCCESS) then
         print *,'ESMF_ConfigGetAttribute(string) failed, rc =', rc
         return
      endif

      if(vf_dataType ==  vf_dataType_0) then
         counter_success =counter_success + 1
      else
         print *,'ESMF_ConfigGetAttribute(string) ERROR: got  =', vf_dataType, &
              ' should be ', vf_dataType_0
         return
      endif

     !------------------------------------------------------------------------
     !EX_UTest
     ! Config Get Attribute String Verification Test
     write(failMsg, *) "Attribute String values are incorrect"
     write(name, *) "Verify Attribute String Values Test"
     call ESMF_Test((vf_dataType.eq.vf_dataType_0), name, failMsg, result, ESMF_SRCLINE)

!''''''''''''''''''''''''''''

      !------------------------------------------------------------------------
      !EX_UTest
      ! Config Get Int Test
      write(failMsg, *) "Did not return ESMF_SUCCESS"
      write(name, *) "Config Get Int Test"
      call ESMF_ConfigGetAttribute( cf, nv, rc = rc )
      call ESMF_Test((rc.eq.ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
!''''''''''''''''''''''''''''

      counter_total =counter_total + 1
      if (rc /= ESMF_SUCCESS) then
         print *,'ESMF_ConfigGetAttribute(int) failed, rc =', rc
         return
      endif

      if( nv == nv_0 ) then
         counter_success =counter_success + 1
      else
         print *,'ESMF_ConfigGetAttribute(int) ERROR: got  =', nv, &
              ' should be ', nv_0 
         return
      endif

     !------------------------------------------------------------------------
     !EX_UTest
     ! Config Get Attribute Int Verification Test
     write(failMsg, *) "Attribute Int values are incorrect"
     write(name, *) "Verify Attribute Int Values Test"
     call ESMF_Test((nv.eq.nv_0), name, failMsg, result, ESMF_SRCLINE)

!''''''''''''''''''''''''''''

      !------------------------------------------------------------------------
      !EX_UTest
      ! Config Get Logicals Test
      write(failMsg, *) "Did not return ESMF_SUCCESS"
      write(name, *) "Config Get Logicals Test"
      call ESMF_ConfigGetAttribute( cf, sigVf, count=nv_0, rc=rc )
      call ESMF_Test((rc.eq.ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
!''''''''''''''''''''''''''''

      counter_total =counter_total + 1
      if (rc /= ESMF_SUCCESS) then
         print *,'ESMF_ConfigGetAttribute(logicals) failed, rc =', rc
         return
      endif

      if( any(sigVf .neqv. sigVf_0) ) then
         print *,'ESMF_ConfigGetAttribute(logicals) ERROR: got sigVf =', &
                 sigVf(1:nv), ' should be sigVf =', sigVf_0(1:nv) 
         return
      else
        counter_success =counter_success + 1
      endif

     !------------------------------------------------------------------------
     !EX_UTest
     ! Config Get Attribute Logicals Verification Test
     write(failMsg, *) "Attribute Logicals values are incorrect"
     write(name, *) "Verify Attribute Logicals Values Test"
     call ESMF_Test((all(sigVf.eqv.sigVf_0)), name, failMsg, result, &
                     ESMF_SRCLINE)

    end subroutine MultPar_SingleLine_Vf