[UP]


Manual Reference Pages  - dow (3)

NAME

dow(3f) - [M_time:DAY_OF_WEEK] given a date-time array DAT return the day of the week (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Example
Author
License

SYNOPSIS

subroutine dow(values, weekday, day, ierr)

    integer,intent(in) :: values(8)
    integer,intent(out),optional :: weekday
    character(len=*),intent(out),optional :: day
    integer,intent(out),optional :: ierr

DESCRIPTION

Given a date array DAT return the day of the week as a number and a name, Mon=1.

OPTIONS

values "DAT" array (an integer array of the same format as the array returned by the intrinsic DATE_AND_TIME(3f)) describing the date to be used to calculate the day of the week.

RETURNS

weekday
  The numeric day of the week, starting with Monday=1. Optional.
day The name of the day of the week. Optional.
ierr Error code
o [ 0] correct
o [-1] invalid input date
o [-2] neither day nor weekday return values were requested.
If the error code is not returned and an error occurs, the program is stopped.

EXAMPLE

Sample program:

    program demo_dow
    use M_time, only : dow
    implicit none
    integer          :: dat(8)     ! input date array
    integer          :: weekday
    character(len=9) :: day
    integer          :: ierr
      call date_and_time(values=dat)
      call dow(dat, weekday, day, ierr)
      write(*,’(a,i0)’)’weekday=’,weekday
      write(*,’(a,a)’)’day=’,trim(day)
      write(*,’(a,i0)’)’ierr=’,ierr
    end program demo_dow

results:

    weekday=1
    day=Monday
    ierr=0

AUTHOR

John S. Urban, 2015-12-19

LICENSE

Public Domain


dow (3) March 11, 2021
Generated by manServer 1.08 from c57dc25f-9bd6-4148-98e5-e91a43005b8b using man macros.