anchor.diff:  ENDFUNCTION num2date
   !======================================================================>
   
  -
  -
  -PURE FUNCTION int2str(i,length)
  -!======================================================================>
  -!
  -! Converts an integer i into a character string of requested length, 
  -! by pre-pending zeros if necessary.
  -!
  -!======================================================================>
  -
  -  ! ARGUMENTS:
  -  INTEGER,INTENT(IN)    :: i,length
  -  CHARACTER(LEN=length) :: int2str
  -
  -  WRITE(UNIT=int2str,FMT='(I0)')i
  -
  -  DO WHILE(LEN_TRIM(ADJUSTL(int2str)) < length)
  -    int2str = '0'//TRIM(ADJUSTL(int2str))
  -  ENDDO
  -
  -ENDFUNCTION int2str
  -!======================================================================>
   
   
   PURE ELEMENTAL TYPE(datetime) FUNCTION tm2date(ctime)
  
positive.code: !======================================================================>
  
  
  
  PURE ELEMENTAL LOGICAL FUNCTION isLeapYear(year)
  !======================================================================>
  
negative.code: 
  ENDFUNCTION tm2date
  !======================================================================>
  
  
  
  !--- PRIVATE PROCEDURES ----------------------------------------------->
  
  PURE FUNCTION int2str(i,length)
  !======================================================================>
  !
  ! Converts an integer i into a character string of requested length, 
  ! by pre-pending zeros if necessary.
  !
  !======================================================================>
  
    ! ARGUMENTS:
    INTEGER,INTENT(IN)    :: i,length
    CHARACTER(LEN=length) :: int2str
  
    WRITE(UNIT=int2str,FMT='(I0)')i
  
    DO WHILE(LEN_TRIM(ADJUSTL(int2str)) < length)
      int2str = '0'//TRIM(ADJUSTL(int2str))
    ENDDO
  
  ENDFUNCTION int2str
  !======================================================================>
  ENDMODULE datetime_module
  