time_module_test Subroutine

public subroutine time_module_test()

Test routine for the Julian date routines.

Arguments

None

Calls

proc~~time_module_test~~CallsGraph proc~time_module_test time_module::time_module_test interface~julian_date time_module::julian_date proc~time_module_test->interface~julian_date proc~calendar_date_realsec time_module::calendar_date_realsec proc~time_module_test->proc~calendar_date_realsec proc~julian_date_intsec time_module::julian_date_intsec interface~julian_date->proc~julian_date_intsec proc~julian_date_realsec time_module::julian_date_realsec interface~julian_date->proc~julian_date_realsec proc~julian_date_intsec->proc~julian_date_realsec proc~julian_day time_module::julian_day proc~julian_date_realsec->proc~julian_day

Source Code

    subroutine time_module_test()

    implicit none

    real(wp) :: jd, sec
    integer :: year,month,day,hrs,min

    write(*,*) ''
    write(*,*) '---------------'
    write(*,*) ' time_module_test'
    write(*,*) '---------------'
    write(*,*) ''

    ! JD = 2451545.0
    jd = julian_date(2000,1,1,12,0,0)

    call calendar_date_realsec(jd,year,month,day,hrs,min,sec)

    write(*,*) 'jd    ', jd
    write(*,*) 'year  ', year
    write(*,*) 'month ', month
    write(*,*) 'day   ', day
    write(*,*) 'hrs   ', hrs
    write(*,*) 'min   ', min
    write(*,*) 'sec   ', sec

    if (year/=2000)  error stop 'error: incorrect year'
    if (month/=1)    error stop 'error: incorrect month'
    if (day/=1)      error stop 'error: incorrect day'
    if (hrs/=12)     error stop 'error: incorrect hrs'
    if (min/=0)      error stop 'error: incorrect min'
    if (sec/=0.0_wp) error stop 'error: incorrect sec'

    write(*,*) 'PASSED'

    end subroutine time_module_test