anchor.diff:    CHARACTER(LEN=length) :: int2str
     CHARACTER(LEN=2)      :: string
   
  -  !WRITE(UNIT=int2str,FMT='(I0)')i
  -
  -  !DO WHILE(LEN_TRIM(ADJUSTL(int2str)) < length)
  -  !  int2str = '0'//TRIM(ADJUSTL(int2str))
  -  !ENDDO
  -
     WRITE(UNIT=string,FMT='(I2)')length
     WRITE(UNIT=int2str,FMT='(I'//string//'.'//string//')')i
   
  
positive.code: PUBLIC :: c_strftime
  PUBLIC :: c_strptime
  PUBLIC :: date2num
  PUBLIC :: daysInMonth
  PUBLIC :: daysInYear
  PUBLIC :: isLeapYear
  
negative.code: 
  
  
  PURE FUNCTION datetimeRange(d0,d1,t)
  !======================================================================>
  !
  ! Given start and end datetime instances d0 and d1, and time increment
  ! as timedelta instance t, returns an array of datetime instances.
  ! The number of elements is the number of whole time increments 
  ! contained between datetimes d0 and d1.
  !
  !======================================================================>
  
    ! ARGUMENTS:
    TYPE(datetime), INTENT(IN) :: d0
    TYPE(datetime), INTENT(IN) :: d1
    TYPE(timedelta),INTENT(IN) :: t
  
    REAL(KIND=real_dp) :: datenum0,datenum1,increment
  
    TYPE(datetime),DIMENSION(:),ALLOCATABLE :: datetimeRange
  
    INTEGER :: n,nm
  
    datenum0 = date2num(d0)
    datenum1 = date2num(d1)
  
    increment = t % total_seconds() * s2d
  
    nm = FLOOR((datenum1-datenum0)/increment)+1
  
    ALLOCATE(datetimeRange(nm))
  
    DO n = 1,nm
      datetimeRange(n) = num2date(datenum0 + (n-1)*increment)
    ENDDO
  
  ENDFUNCTION datetimeRange
  !======================================================================>
  
  
  
  PURE ELEMENTAL INTEGER FUNCTION daysInMonth(month,year)
  !======================================================================>
  !
  