ddatetoymdhms.h90 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. !!----------------------------------------------------------------------
  2. !! NEMO/OPA 3.3 , NEMO Consortium (2010)
  3. !! $Id: ddatetoymdhms.h90 4990 2014-12-15 16:42:49Z timgraham $
  4. !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
  5. !!----------------------------------------------------------------------
  6. SUBROUTINE ddatetoymdhms( ddate, kyea, kmon, kday, khou, kmin, ksec )
  7. !!----------------------------------------------------------------------
  8. !!
  9. !! *** ROUTINE ddatetoymdhms ***
  10. !!
  11. !! ** Purpose : Convert YYYYMMDD.hhmmss to components
  12. !!
  13. !! ** Method :
  14. !!
  15. !! ** Action :
  16. !!
  17. !! History
  18. !!----------------------------------------------------------------------
  19. !! * Modules used
  20. !! * Arguments
  21. real(wp), INTENT(IN) :: ddate
  22. INTEGER, INTENT(OUT) :: kyea
  23. INTEGER, INTENT(OUT) :: kmon
  24. INTEGER, INTENT(OUT) :: kday
  25. INTEGER, INTENT(OUT) :: khou
  26. INTEGER, INTENT(OUT) :: kmin
  27. INTEGER, INTENT(OUT) :: ksec
  28. !! * Local declarations
  29. INTEGER :: iyymmdd
  30. INTEGER :: ihhmmss
  31. iyymmdd = INT( ddate )
  32. ihhmmss = INT( ( ddate - iyymmdd ) * 1000000 )
  33. kyea = iyymmdd/10000
  34. kmon = iyymmdd / 100 - 100 * kyea
  35. kday = MOD( iyymmdd, 100 )
  36. khou = ihhmmss/10000
  37. kmin = ihhmmss / 100 - 100 * khou
  38. ksec = MOD( ihhmmss, 100 )
  39. END SUBROUTINE ddatetoymdhms