Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | Number | |||
integer, | intent(out) | :: | PMonth | |||
integer, | intent(out) | :: | PDay | |||
integer, | intent(in) | :: | LeapYr |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
SUBROUTINE InvJulianDay(Number,PMonth,PDay,LeapYr)
! SUBROUTINE INFORMATION:
! AUTHOR Linda Lawrie
! DATE WRITTEN December 1999
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! This subroutine performs and inverse Julian Day
! calculation, using an input JulianDay and returning
! appropriate Month and Day.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
! na
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! SUBROUTINE ARGUMENT DEFINITIONS:
INTEGER, INTENT(IN) :: Number
INTEGER, INTENT(OUT) :: PMonth
INTEGER, INTENT(OUT) :: PDay
INTEGER, INTENT(IN) :: LeapYr
! SUBROUTINE PARAMETER DEFINITIONS:
INTEGER, PARAMETER, DIMENSION(0:12) :: EndOfMonth=(/0,31,59,90,120,151,181,212,243,273,304,334,365/)
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER WMonth
INTEGER LeapAddPrev
INTEGER LeapAddCur
IF (Number < 0 .or. Number > 366) RETURN
DO WMonth=1,12
IF (WMonth == 1) THEN
LeapAddPrev=0
LeapAddCur=0
ELSEIF (WMonth == 2) THEN
LeapAddPrev=0
LeapAddCur=LeapYr
ELSE
LeapAddPrev=LeapYr
LeapAddCur=LeapYr
ENDIF
IF (Number > (EndOfMonth(WMonth-1)+LeapAddPrev) .and. Number <= (EndOfMonth(WMonth)+LeapAddCur)) EXIT
ENDDO
PMonth=WMonth
PDay=Number-(EndOfMonth(WMonth-1)+LeapAddCur)
RETURN
END SUBROUTINE InvJulianDay