MTObsTrack.F90 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. ! First include the set of model-wide compiler flags
  2. #include "tm5.inc"
  3. Module MTObsTrack
  4. !
  5. ! Tropomi NRT NO2 retrieval
  6. !
  7. ! This module defines the structure to store the input retrieval data
  8. !
  9. ! Henk Eskes, Folkert Boersma, Ruud Dirksen, 2000-2012
  10. ! Bram Maasakkers, 2013
  11. ! new separate module created by
  12. ! Mark ter Linden, Henk Eskes, KNMI, sept 2015
  13. !
  14. implicit none
  15. private
  16. public :: TObsTrack, TOrbitParts
  17. public :: ObsTrackAllocate, ObsTrackDeallocate
  18. ! -------------------------------------------------------
  19. ! Maximum number of satellite track parts per file
  20. ! -------------------------------------------------------
  21. integer, parameter :: maxOrbitParts = 15
  22. ! ------------------------------------------------------------------
  23. ! structure containing one track of NO2 and cloud data
  24. ! ------------------------------------------------------------------
  25. !
  26. ! count : total number of observations in this orbit
  27. !
  28. ! orbitNumber : number of the satellite orbit, same for all orbit parts
  29. ! nOrbitParts : number of orbit parts
  30. ! orbitParts : description of the orbit parts
  31. ! nValidPixels : Number of pixels in the orbit part with flag <> error
  32. ! dimScanline : nr of scan lines (typically 1600-1700 for OMI)
  33. ! filename : Name of the file storing the orbit part
  34. ! startTime, endTime, meanTime : Time of first & last pixel, and mean of these two
  35. ! format: (y,m,d,h,m,s)
  36. !
  37. ! dimGroundPixel : nr of across-track viewing angles (60 for OMI)
  38. !
  39. ! subPixelNumber : subset counter (0=East, 1=Nadir, 2=West, 3=Backscan),
  40. ! Used for GOME and SCIAMACHY, not relevant for OMI, tropomi (default = 1)
  41. ! orbitPartIndex : the orbit part this pixel belongs to
  42. ! pixelIndex : pixel number in OMI swath (1-60)
  43. ! scanLineIndex : image or scan line number along the orbit
  44. !
  45. ! pixelFlag : 0 = OK, 1-255: errors, >255 warnings
  46. !
  47. ! latitude : pixel centre latitude (degree N)
  48. ! longitude : pixel centre longitude (degree E)
  49. ! cornerLatitude : pixel latitude ( corners)
  50. ! cornerLongitude : pixel longitude ( corners)
  51. ! viewingZenithAngle : viewing angle (degree)
  52. ! solarZenithAngle : solar zenith angle (degree)
  53. ! viewingAzimuthAngle : azimuth angle (degree)
  54. ! solarAzimuthAngle : solar azimuth angle (degree)
  55. !
  56. ! no2SLC : NO2 slant column (10^15 molecules cm^-2)
  57. ! no2SLCError : DOAS fit error (100*slcsig/slc in %))
  58. ! chiSquareFit : chi^2 resulting from the DOAS fitting
  59. !
  60. ! cloudFraction : cloud fraction (0-1)
  61. ! cloudTopPressure : cloud top pressure (hPa)
  62. ! cloudAlbedo : cloud albedo (normally 0.8)
  63. ! cloudRadianceFraction : fraction of the radiation coming from
  64. ! the cloud-covered part of the pixel
  65. ! scenePressure : In case of snow-ice: effective surface pressure (hPa)
  66. ! sceneAlbedo : In case of snow-ice: effective surface albedo
  67. ! snowIceFlag : snow-ice flags (0: snowFree, 1-100: fraction of sea ice, 101: ice, 103: snow)
  68. ! surfaceAlbedo : surface albedo at 758 nm (0-1)
  69. ! terrainHeight : pixel terrain height (m)
  70. ! terrainPressure : terrain pressure (hPa)
  71. !
  72. type TOrbitParts
  73. integer :: nValidPixels
  74. integer :: dimScanline
  75. integer, dimension(6) :: startTime, endTime, meanTime
  76. character(len=256) :: filename
  77. end type TOrbitParts
  78. type TObsTrack
  79. integer :: count
  80. integer :: dimGroundPixel
  81. integer :: orbitNumber
  82. integer :: nOrbitParts
  83. type(Torbitparts), dimension(maxOrbitParts) :: orbitParts
  84. integer, dimension(:), allocatable :: subPixelNumber
  85. integer, dimension(:), allocatable :: orbitPartIndex
  86. integer, dimension(:), allocatable :: pixelIndex
  87. integer, dimension(:), allocatable :: scanLineIndex
  88. integer, dimension(:), allocatable :: pixelFlag
  89. integer, dimension(:), allocatable :: snowIceFlag
  90. real, dimension(:), allocatable :: latitude
  91. real, dimension(:), allocatable :: longitude
  92. real, dimension(:,:), allocatable :: cornerLatitude
  93. real, dimension(:,:), allocatable :: cornerLongitude
  94. real, dimension(:), allocatable :: viewingZenithAngle
  95. real, dimension(:), allocatable :: solarZenithAngle
  96. real, dimension(:), allocatable :: viewingAzimuthAngle
  97. real, dimension(:), allocatable :: solarAzimuthAngle
  98. real, dimension(:), allocatable :: no2SLC
  99. real, dimension(:), allocatable :: no2SLCError
  100. real, dimension(:), allocatable :: chiSquareFit
  101. real, dimension(:), allocatable :: cloudFraction
  102. real, dimension(:), allocatable :: cloudTopPressure
  103. real, dimension(:), allocatable :: cloudAlbedo
  104. real, dimension(:), allocatable :: sceneAlbedo
  105. real, dimension(:), allocatable :: scenePressure
  106. real, dimension(:), allocatable :: cloudRadianceFraction
  107. real, dimension(:), allocatable :: surfaceAlbedo
  108. real, dimension(:), allocatable :: terrainHeight
  109. real, dimension(:), allocatable :: terrainPressure
  110. end type TObsTrack
  111. contains
  112. subroutine ObsTrackAllocate ( obstrack, n )
  113. implicit none
  114. type(TObsTrack), intent(inout) :: obstrack
  115. integer, intent(in) :: n
  116. allocate(obstrack%subPixelNumber(n))
  117. allocate(obstrack%orbitPartIndex(n))
  118. allocate(obstrack%pixelIndex(n))
  119. allocate(obstrack%scanLineIndex(n))
  120. allocate(obstrack%pixelFlag(n))
  121. allocate(obstrack%snowIceFlag(n))
  122. allocate(obstrack%latitude(n))
  123. allocate(obstrack%longitude(n))
  124. allocate(obstrack%cornerLatitude(4, n))
  125. allocate(obstrack%cornerLongitude(4, n))
  126. allocate(obstrack%viewingZenithAngle(n))
  127. allocate(obstrack%solarZenithAngle(n))
  128. allocate(obstrack%viewingAzimuthAngle(n))
  129. allocate(obstrack%solarAzimuthAngle(n))
  130. allocate(obstrack%no2SLC(n))
  131. allocate(obstrack%no2SLCError(n))
  132. allocate(obstrack%chiSquareFit(n))
  133. allocate(obstrack%cloudFraction(n))
  134. allocate(obstrack%cloudTopPressure(n))
  135. allocate(obstrack%cloudAlbedo(n))
  136. allocate(obstrack%sceneAlbedo(n))
  137. allocate(obstrack%scenePressure(n))
  138. allocate(obstrack%cloudRadianceFraction(n))
  139. allocate(obstrack%surfaceAlbedo(n))
  140. allocate(obstrack%terrainHeight(n))
  141. allocate(obstrack%terrainPressure(n))
  142. end subroutine ObsTrackAllocate
  143. subroutine ObsTrackDeallocate(obstrack)
  144. implicit none
  145. type(TObsTrack), intent(inout) :: obstrack
  146. deallocate(obstrack%subPixelNumber)
  147. deallocate(obstrack%orbitPartIndex)
  148. deallocate(obstrack%pixelIndex)
  149. deallocate(obstrack%scanLineIndex)
  150. deallocate(obstrack%pixelFlag)
  151. deallocate(obstrack%snowIceFlag)
  152. deallocate(obstrack%latitude)
  153. deallocate(obstrack%longitude)
  154. deallocate(obstrack%cornerLatitude)
  155. deallocate(obstrack%cornerLongitude)
  156. deallocate(obstrack%viewingZenithAngle)
  157. deallocate(obstrack%solarZenithAngle)
  158. deallocate(obstrack%viewingAzimuthAngle)
  159. deallocate(obstrack%solarAzimuthAngle)
  160. deallocate(obstrack%no2SLC)
  161. deallocate(obstrack%no2SLCError)
  162. deallocate(obstrack%chiSquareFit)
  163. deallocate(obstrack%cloudFraction)
  164. deallocate(obstrack%cloudTopPressure)
  165. deallocate(obstrack%cloudAlbedo)
  166. deallocate(obstrack%sceneAlbedo)
  167. deallocate(obstrack%scenePressure)
  168. deallocate(obstrack%cloudRadianceFraction)
  169. deallocate(obstrack%surfaceAlbedo)
  170. deallocate(obstrack%terrainHeight)
  171. deallocate(obstrack%terrainPressure)
  172. end subroutine ObsTrackDeallocate
  173. end Module MTObsTrack