test_vm_time Subroutine

public subroutine test_vm_time()

Arguments

None

Source Code

      subroutine test_vm_time
! This subroutine tests VM time methods

      call date_and_time(values=time_values)
      init_sec = time_values(7)
      !=============================
      !EX_UTest
      delay_interval=5
      write(failMsg, *) "Did not return ESMF_SUCCESS"
      write(name, *) "VM Time 5 Second Delay Test"
      call ESMF_VMWtimeDelay(delay=delay_interval, rc=rc)
      call ESMF_Test((rc.eq.ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
      
      !------------------------------------------------------------------------
      !EX_UTest
      call date_and_time(values=time_values)
      end_sec = time_values(7)
      write(failMsg, *) "Wrong delay time"
      write(name, *) "Verify delay was 5 or 6 Seconds Test"
      delay_time = end_sec - init_sec
      print *, "init_sec =", init_sec
      print *, "end_sec =", end_sec
      print *, "delay_time =", delay_time
      ! if init_sec > end_sec add 60 to the difference.
      if (delay_time.lt.0) delay_time=delay_time + 60
      print *, "delay_time =", delay_time
      call ESMF_Test((delay_time.eq.5.or.delay_time.eq.6), name, failMsg, result, ESMF_SRCLINE)
      
      !------------------------------------------------------------------------
      !EX_UTest
      write(failMsg, *) "Did not return ESMF_SUCCESS"
      write(name, *) "VM Time Prec. Test"
      call ESMF_VMWtimePrec(prec=vm_prec, rc=rc)
      call ESMF_Test((rc.eq.ESMF_SUCCESS), name, failMsg, result, ESMF_SRCLINE)
      print *, "vm_prec = ", vm_prec

      !------------------------------------------------------------------------
      !EX_UTest
      write(failMsg, *) "Value not between 0 and 1."
      write(name, *) "VM Time Prec. Value Test"
      call ESMF_Test(((vm_prec.gt.0).and.(vm_prec.lt.1)), name, failMsg, result, ESMF_SRCLINE)

      end subroutine test_vm_time