ooo_data.F90 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. MODULE ooo_data
  2. !! =================================================================
  3. !! *** MODULE ooo_data ***
  4. !! =================================================================
  5. USE par_kind, ONLY: lc
  6. IMPLICIT NONE
  7. !! Public data
  8. INTEGER, PARAMETER :: MaxNumFiles = 1000
  9. !! Class 4 file settings
  10. INTEGER :: &
  11. & cl4_fcst_idx(MaxNumFiles), & !: forecast indices
  12. & cl4_match_len, & !: number of match types
  13. & cl4_fcst_len !: number of forecast days
  14. CHARACTER(len=lc) :: &
  15. & cl4_vars(MaxNumFiles), & !: class 4 variables
  16. & cl4_sys, & !: class 4 system
  17. & cl4_cfg, & !: class 4 configuration
  18. & cl4_date, & !: class 4 date
  19. & cl4_vn, & !: class 4 version
  20. & cl4_prefix, & !: class 4 prefix
  21. & cl4_contact, & !: class 4 contact
  22. & cl4_inst !: class 4 institute
  23. REAL :: cl4_modjuld !: model Julian day
  24. REAL :: &
  25. & cl4_leadtime(MaxNumFiles) !: Lead time data
  26. !! Offline obs_oper settings
  27. CHARACTER(len=lc) :: &
  28. & ooo_files(MaxNumFiles) !: model files
  29. INTEGER :: &
  30. & jifile, & !: current file list index
  31. & n_files, & !: number of files
  32. & jimatch, & !: current match
  33. & nn_ooo_idx(MaxNumFiles), & !: time_counter indices
  34. & nn_ooo_freq !: read frequency in time steps
  35. CHARACTER(len=128) :: &
  36. & alt_file !: altimeter file
  37. !! $Id: ooo_data.F90 2355 2015-05-20 07:11:50Z ufla $
  38. CONTAINS
  39. SUBROUTINE ooo_data_init( ld_cl4 )
  40. !!----------------------------------------------------------------------
  41. !! *** SUBROUTINE ooo_data_init ***
  42. !!
  43. !! ** Purpose : To read namelists and initialise offline_oper run.
  44. !!
  45. !!----------------------------------------------------------------------
  46. USE in_out_manager
  47. INTEGER :: &
  48. & jf !: file dummy loop index
  49. LOGICAL :: lmask(MaxNumFiles) !: Logical mask used for counting
  50. LOGICAL, INTENT(IN) :: ld_cl4 !: Logical class 4 on/off
  51. ! Standard offline obs_oper information
  52. NAMELIST/namooo/ooo_files, nn_ooo_idx, nn_ooo_freq
  53. ! Class 4 file specifiers
  54. NAMELIST/namcl4/cl4_vars, cl4_sys, cl4_cfg, cl4_date, cl4_vn, &
  55. & cl4_prefix, cl4_contact, cl4_inst, cl4_leadtime, &
  56. & cl4_fcst_idx, cl4_fcst_len, cl4_match_len
  57. ! Standard offline obs_oper initialisation
  58. jimatch = 0 !: match-up iteration variable
  59. jifile = 1 !: input file iteration variable
  60. n_files = 0 !: number of files to cycle through
  61. ooo_files(:) = '' !: list of files to read in
  62. nn_ooo_idx(:) = 0 !: list of indices inside each file
  63. nn_ooo_freq = -1 !: input frequency in time steps
  64. ! Class 4 initialisation
  65. cl4_leadtime(:) = 0 !: Lead time axis value for each file
  66. cl4_fcst_len = 0 !: Length of the forecast dimension
  67. cl4_match_len = 1 !: Number of match types
  68. cl4_fcst_idx(:) = 0 !: output file forecast index
  69. cl4_vars(:) = '' !: output file variable names
  70. cl4_sys = '' !: output file system
  71. cl4_cfg = '' !: output file configuration
  72. cl4_date = '' !: output file date string
  73. cl4_vn = '' !: output file version
  74. cl4_prefix = 'class4' !: output file prefix
  75. cl4_contact = '' !: output file contact details
  76. cl4_inst = '' !: output file institution
  77. ! Standard offline obs_oper settings
  78. READ(numnam, namooo)
  79. ! Read class 4 output settings
  80. IF (ld_cl4) THEN
  81. READ(numnam, namcl4)
  82. ENDIF
  83. ! count input files
  84. lmask(:) = .FALSE.
  85. WHERE (ooo_files(:) /= '') lmask(:) = .TRUE.
  86. n_files = COUNT(lmask)
  87. !! Initialise sub obs window frequency
  88. IF (nn_ooo_freq == -1) THEN
  89. !! Run length
  90. nn_ooo_freq = nitend - nit000 + 1
  91. ENDIF
  92. !! Print summary of settings
  93. IF(lwp) THEN
  94. WRITE(numout,*)
  95. WRITE(numout,*) 'offline obs_oper : Initialization'
  96. WRITE(numout,*) '~~~~~~~~~~~~~~~~~'
  97. WRITE(numout,*) ' Namelist namooo : set offline obs_oper parameters'
  98. DO jf = 1, n_files
  99. WRITE(numout,'(1X,2A)') ' Input forecast file name forecastfile = ', &
  100. TRIM(ooo_files(jf))
  101. WRITE(numout,*) ' Input forecast file index forecastindex = ', &
  102. nn_ooo_idx(jf)
  103. WRITE(numout,*) ' Output forecast leadtime index leadtimeindex = ', &
  104. cl4_fcst_idx(jf)
  105. WRITE(numout,*) ' Output forecast leadtime value leadtimevalue = ', &
  106. cl4_leadtime(jf)
  107. WRITE(numout,'(1X,2A)') ' Input class 4 variable class 4 parameter = ', &
  108. TRIM(cl4_vars(jf))
  109. END DO
  110. WRITE(numout, '(1X,2A)') ' Input class 4 system class 4 system = ', &
  111. TRIM(cl4_sys)
  112. WRITE(numout, '(1X,2A)') ' Input class 4 config class 4 config = ', &
  113. TRIM(cl4_cfg)
  114. WRITE(numout, '(1X,2A)') ' Input class 4 date class 4 date = ', &
  115. TRIM(cl4_date)
  116. WRITE(numout, '(1X,2A)') ' Input class 4 version class 4 version = ', &
  117. TRIM(cl4_vn)
  118. WRITE(numout, '(1X,2A)') ' Input class 4 prefix class 4 prefix = ', &
  119. TRIM(cl4_prefix)
  120. WRITE(numout, '(1X,2A)') ' Input class 4 contact class 4 contact = ', &
  121. TRIM(cl4_contact)
  122. WRITE(numout, '(1X,2A)') ' Input class 4 institute class 4 institute = ', &
  123. TRIM(cl4_inst)
  124. END IF
  125. END SUBROUTINE ooo_data_init
  126. END MODULE ooo_data