Read the epoch info from a config file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(config_file), | intent(inout) | :: | f | |||
integer, | intent(out) | :: | epoch_mode |
1 : calendar date was specified, 2: ephemeris time was specified |
||
integer, | intent(out) | :: | year |
only output if found (epoch_mode=1) |
||
integer, | intent(out) | :: | month |
only output if found (epoch_mode=1) |
||
integer, | intent(out) | :: | day |
only output if found (epoch_mode=1) |
||
integer, | intent(out) | :: | hour |
only output if found (epoch_mode=1) |
||
integer, | intent(out) | :: | minute |
only output if found (epoch_mode=1) |
||
real(kind=wp), | intent(out) | :: | sec |
only output if found (epoch_mode=1) |
||
real(kind=wp), | intent(out) | :: | et |
the ephemeris time [always output] |
subroutine read_epoch(f, epoch_mode, year, month, day, hour, minute, sec, et) type(config_file),intent(inout) :: f integer,intent(out) :: year, month, day, hour, minute !! only output if found (epoch_mode=1) real(wp),intent(out) :: sec !! only output if found (epoch_mode=1) integer,intent(out) :: epoch_mode !! 1 : calendar date was specified, 2: ephemeris time was specified real(wp),intent(out) :: et !! the ephemeris time [always output] logical :: found, found_et logical,dimension(6) :: found_calendar ! can specify either calendar date or et: call f%get('year', year , found_calendar(1) ) call f%get('month', month , found_calendar(2) ) call f%get('day', day , found_calendar(3) ) call f%get('hour', hour , found_calendar(4) ) call f%get('minute', minute , found_calendar(5) ) call f%get('sec', sec , found_calendar(6) ) call f%get('et_ref', et , found_et ) found = all(found_calendar) .or. found_et ! at least one if (found) found = .not. (all(found_calendar) .and. found_et) ! only one if (.not. found) error stop 'error: just specify epoch as year,month,day,hour,minute,sec or et_ref' if (found_et) then epoch_mode = 2 ! ephemeris time was specified else epoch_mode = 1 ! calendar date was specified end if if (epoch_mode==1) then ! have to convert to et [see update_epoch] et = jd_to_et(julian_date(year,& month,& day,& hour,& minute,& sec)) end if end subroutine read_epoch