Ticket #163: ropp_io_types.f90

File ropp_io_types.f90, 35.2 KB (added by Huw Lewis, 16 years ago)

updated ropp_io_types.f90 file

Line 
1! $Id: ropp_io_types.f90 1834 2008-10-13 16:05:55Z frhl $
2
3module ropp_io_types
4
5!****m* Modules/ropp_io_types *
6!
7! NAME
8! ropp_io_types - Type declarations for the ROPP IO library.
9!
10! SYNOPSIS
11! use ropp_io
12!
13! DESCRIPTION
14! This Fortran module supports the ROPP input / output library and provides
15! derived data types used by the ropp_io library. It must be loaded for all
16! applications using the ropp_io library / package. Note that loading the
17! ropp_io module includes the ropp_io_types module
18!
19! SEE ALSO
20! ropp_io_types
21! ropp_io_init
22! ropp_io_free
23! ropp_io_read
24! ropp_io_write
25!
26! AUTHOR
27! Met Office, Exeter, UK.
28! Any comments on this software should be given via the GRAS SAF
29! Helpdesk at http://www.grassaf.org
30!
31! COPYRIGHT
32! (c) EUMETSAT. All rights reserved.
33! For further details please refer to the file COPYRIGHT
34! which you should have received as part of this distribution.
35!
36!****
37
38!-------------------------------------------------------------------------------
39! 1. Other modules
40!-------------------------------------------------------------------------------
41
42 use typesizes, wp => EightByteReal
43
44!-------------------------------------------------------------------------------
45! 2. Useful variables
46!-------------------------------------------------------------------------------
47
48!****ip* Initialisation/ThisFmtVer
49!
50! NAME
51! ThisFmtVer - Parameter describing the current implemented ROPP
52! data format version (NOT the current software
53! version of ROPP).
54!
55! NOTES
56! This parameter is an internal parameter to the ropp_io library and not
57! intended to be used by users. Update the value only if the (text) file
58! format specification changes (see Ref).
59!
60! REFERENCE
61! ROPP Interface File Format. SAF/GRAS/METO/FMT/ROPP/001
62!
63! SOURCE
64!
65 character (len=*), parameter :: ThisFmtVer = "ROPP I/O V1.1"
66!
67!****
68
69!****ip* Initialisation/ropp_io_ncopensep
70!
71! NAME
72! ropp_io_ncopensep - Internal global variable keeping track if netCDF data
73! files have been opened separately (as opposed to
74! be opened from ropp_io_read() or ropp_io_write()).
75!
76! NOTES
77! This variable is an internal variable to the ropp_io library and not
78! intended to be used by users.
79!
80! SOURCE
81!
82 logical :: ropp_io_ncopensep = .false.
83!
84!****
85
86!-------------------------------------------------------------------------------
87! 3. Missing Data Flag Value
88!-------------------------------------------------------------------------------
89
90!****ip* Initialisation/ropp_io_mdfv
91!
92! NAME
93! ropp_io_mdfv - Internal global 'Missing Data Flag/Test Value(s)'
94!
95! NOTES
96! These parametres are used to indicate/test a 'missing' (invalid)
97! data value.
98! ropp_io_mdfv should be used to set invalid data for most
99! ROPP parametres, but a single universal value is not suitable for
100! all; some - e.g. (X,Y,Z) coordinate vectors - are set to zero.
101! For others, parameter-specific values may be more appropriate.
102! ropp_io_zero can be used to set parametres to zero.
103! ropp_io_mdtv can used for testing for invalid parameter values;
104! anything less than this value can be assumed to be set 'missing',
105! though again, some parametres may have specific values to test for.
106! ropp_zdtv can be used to test for (almost) zero, e.g.
107! if ( abs(value) < ropp_io_zdtv ) then ...
108! ! value can be considered to be zero
109! The values for ropp_io_mdfv and ropp_mdtv here may be changed
110! in the future when the text files are finally dead and formatting
111! limitations ceases to be an issue.
112!
113! SOURCE
114!
115 real(wp), parameter :: ropp_io_mdfv = -9999.9_wp
116 real(wp), parameter :: ropp_io_zero = 0.0_wp
117
118 real(wp), parameter :: ropp_io_mdtv = -9999.0_wp
119 real(wp), parameter :: ropp_io_zdtv = 1e-10_wp
120!
121!****
122
123!-------------------------------------------------------------------------------
124! 4. PCD flags
125!-------------------------------------------------------------------------------
126
127!****p* Initialisation/PCD_parametres
128!
129! NAME
130! PCD parametres - Parametres for setting and testing the Product Confidence
131! Data (PCD) element of the ROprof structure.
132!
133! SOURCE
134!
135 integer, parameter :: PCD_summary = 0 ! Nominal / non-nominal quality
136 integer, parameter :: PCD_offline = 1 ! NRT / offline product
137 integer, parameter :: PCD_rising = 2 ! Setting / rising occultation
138 integer, parameter :: PCD_phase = 3 ! Phase processing nominal / non-nominal
139 integer, parameter :: PCD_bangle = 4 ! Bending angle proc. nominal / non-nominal
140 integer, parameter :: PCD_refrac = 5 ! Refractivity proc. nominal / non-nominal
141 integer, parameter :: PCD_met = 6 ! Meteorological. proc. nominal / non-nominal
142 integer, parameter :: PCD_open_loop = 7 ! Open Loop data used no / yes
143 integer, parameter :: PCD_reflections = 8 ! Surface reflections detected no / yes
144 integer, parameter :: PCD_l2_signal = 9 ! L2 GPS signal used L2P / L2C
145 integer, parameter :: PCD_reserved_11 = 10 ! Reserved
146 integer, parameter :: PCD_reserved_12 = 11 ! Reserved
147 integer, parameter :: PCD_reserved_13 = 12 ! Reserved
148 integer, parameter :: PCD_bg = 13 ! Background profile nominal / non-nominal
149 integer, parameter :: PCD_occultation = 14 ! Occultation / background profile
150 integer, parameter :: PCD_missing = 15 ! PCD missing
151!
152!****
153
154!-------------------------------------------------------------------------------
155! 4. Date and time
156!-------------------------------------------------------------------------------
157
158!****d* Datatypes/DT7units
159!
160! NAME
161! DT7units - A sub-structure of the DT7type structure, defining units.
162!
163! SOURCE
164!
165 type DT7units
166 character(len = 64) :: year = "years"
167 character(len = 64) :: month = "months"
168 character(len = 64) :: day = "days"
169 character(len = 64) :: hour = "hours"
170 character(len = 64) :: minute = "minutes"
171 character(len = 64) :: second = "seconds"
172 character(len = 64) :: msec = "milliseconds"
173 end type DT7units
174!
175!****
176
177!****d* Datatypes/DT7range
178!
179! NAME
180! DT7range - A sub-structure of the DT7type structure, setting valid ranges.
181!
182! SOURCE
183!
184 type DT7range
185 integer, dimension(2) :: year = (/1995, 2099/)
186 integer, dimension(2) :: month = (/ 01, 12/)
187 integer, dimension(2) :: day = (/ 01, 31/)
188 integer, dimension(2) :: hour = (/ 00, 23/)
189 integer, dimension(2) :: minute = (/ 00, 59/)
190 integer, dimension(2) :: second = (/ 00, 59/)
191 integer, dimension(2) :: msec = (/ 00, 999/)
192 end type DT7range
193!
194!****
195
196!****d* Datatypes/DT7type
197!
198! NAME
199! DT7types - A sub-structure of the ROprofs structure for date information.
200!
201! SOURCE
202!
203 type DT7type
204 integer :: year = 9999
205 integer :: month = 99
206 integer :: day = 99
207 integer :: hour = 99
208 integer :: minute = 99
209 integer :: second = 99
210 integer :: msec = 999
211 type(DT7units) :: units
212 type(DT7range) :: range
213 end type DT7type
214!
215!****
216
217!-------------------------------------------------------------------------------
218! 5. Georeferencing of the profile
219!-------------------------------------------------------------------------------
220
221!****d* Datatypes/GEOunits
222!
223! NAME
224! GEOunits - A sub-structure of the GEOtype structure, setting units.
225!
226! SOURCE
227!
228 type GEOunits
229 character(len = 64) :: time_offset = "seconds"
230 character(len = 64) :: lat = "degrees_north"
231 character(len = 64) :: lon = "degrees_east"
232 character(len = 64) :: roc = "metres"
233 character(len = 64) :: r_coc = "metres"
234 character(len = 64) :: azimuth = "degrees_T"
235 character(len = 64) :: undulation = "metres"
236 end type GEOunits
237!
238!****
239
240!****d* Datatypes/GEOrange
241!
242! NAME
243! GEOrange - A sub-structure of the GEOtype structure, setting valid ranges.
244!
245! SOURCE
246!
247 type GEOrange
248 real(wp), dimension(2) :: time_offset = (/0.0_wp, 239.999_wp/)
249 real(wp), dimension(2) :: lat = (/ -90.0_wp, 90.0_wp/)
250 real(wp), dimension(2) :: lon = (/-180.0_wp, 180.0_wp/)
251 real(wp), dimension(2) :: roc = (/ 6.2e6_wp, 6.6e6_wp/)
252 real(wp), dimension(2) :: r_coc = (/-5.0e4_wp, 5.0e4_wp/)
253 real(wp), dimension(2) :: azimuth = (/ 0.0_wp, 360.0_wp/)
254 real(wp), dimension(2) :: undulation = (/-150.0_wp, 150.0_wp/)
255 end type GEOrange
256!
257!****
258
259!****d* Datatypes/GEOref
260!
261! NAME
262! GEOref - A sub-structure of the GEOtype structure, defining the reference frame
263! for the centre of curvature.
264!
265! SOURCE
266!
267 type GEOref
268 character(len = 3) :: r_coc = 'ECF'
269 end type GEOref
270!
271!****
272
273!****d* Datatypes/GEOtype
274!
275! NAME
276! GEOtype - A sub-structure of the ROprof structure, describing the georeferencing
277! a given profile.
278!
279! SOURCE
280!
281 type GEOtype
282 real(wp) :: time_offset = ropp_io_zero ! Time since start (s)
283 real(wp) :: lat = ropp_io_mdfv ! Latitude (deg)
284 real(wp) :: lon = ropp_io_mdfv ! Longitude (deg)
285 real(wp) :: roc = ropp_io_mdfv ! RoC value (m)
286 real(wp), dimension(3) :: r_coc = ropp_io_zero ! RoC offset X,Y,Z vector (m)
287 real(wp) :: azimuth = ropp_io_mdfv ! GNSS->LEO line of sight angle (degT)
288 real(wp) :: undulation = ropp_io_mdfv ! Geoid undulation (EGM96-WGS84) (m)
289 type(GEOunits) :: units
290 type(GEOrange) :: range
291 type(GEOref) :: reference_frame
292 end type GEOtype
293!
294!****
295
296!-------------------------------------------------------------------------------
297! 6. Background meta data
298!-------------------------------------------------------------------------------
299
300!****d* Datatypes/BGunits
301!
302! NAME
303! BGunits - A sub-structure of the BGtype structure, defining units.
304!
305! SOURCE
306!
307 type BGunits
308 character(len = 64) :: year = "years"
309 character(len = 64) :: month = "months"
310 character(len = 64) :: day = "days"
311 character(len = 64) :: hour = "hours"
312 character(len = 64) :: minute = "minutes"
313 character(len = 64) :: fcPeriod = "hours"
314 end type BGunits
315!
316!****
317
318!****d* Datatypes/BGrange
319!
320! NAME
321! BGrange - A sub-structure of the BGtype structure, setting valid ranges.
322!
323! SOURCE
324!
325 type BGrange
326 integer, dimension(2) :: year = (/1995, 2099/)
327 integer, dimension(2) :: month = (/ 01, 12/)
328 integer, dimension(2) :: day = (/ 01, 31/)
329 integer, dimension(2) :: hour = (/ 00, 23/)
330 integer, dimension(2) :: minute = (/ 00, 59/)
331 real(wp), dimension(2) :: fcperiod = (/ 00.0_wp, 24.0_wp/)
332 end type BGrange
333!
334!****
335
336!****d* Datatypes/BGtype
337!
338! NAME
339! BGunits - A sub-structure of the ROprof structure, describing background (as used
340! in the retrieval) meta data.
341!
342! SOURCE
343!
344 type BGtype
345 character(len = 20) :: source = 'NONE' ! Source of b/g profile
346 integer :: year = 9999 ! VT year of b/g
347 integer :: month = 99 ! VT month of b/g
348 integer :: day = 99 ! VT day of b/g
349 integer :: hour = 99 ! VT hour of b/g
350 integer :: minute = 99 ! VT minute of b/g
351 real(wp) :: fcperiod = 999.9 ! F/c period (hrs)
352 type(BGunits) :: units
353 type(BGrange) :: range
354 end type BGtype
355!
356!****
357
358!-------------------------------------------------------------------------------
359! 7. Level 1a - Orbits, phases and amplitudes
360!-------------------------------------------------------------------------------
361
362!****d* Datatypes/L1aunits
363!
364! NAME
365! L1aunits - A sub-structure of the L1atype structure, defining units.
366!
367! SOURCE
368!
369 type L1aunits
370 character(len = 64) :: dtime = "seconds"
371 character(len = 64) :: snr = "volt / volt"
372 character(len = 64) :: phase = "metres"
373 character(len = 64) :: r_gns = "metres"
374 character(len = 64) :: v_gns = "metres / seconds"
375 character(len = 64) :: r_leo = "metres"
376 character(len = 64) :: v_leo = "metres / seconds"
377 character(len = 64) :: phase_qual = "percent"
378 end type L1aunits
379!
380!****
381
382!****d* Datatypes/L1arange
383!
384! NAME
385! L1arange - A sub-structure of the L1atype structure, setting valid ranges.
386!
387! SOURCE
388!
389 type L1arange
390 real(wp), dimension(2) :: dtime = (/ 0.0_wp, 239.999_wp/)
391 real(wp), dimension(2) :: snr = (/ 0.0_wp, 2000.0_wp/)
392 real(wp), dimension(2) :: phase = (/-9999.0_wp, 10000.0_wp/)
393 real(wp), dimension(2) :: r_gns = (/-43.0e6_wp, 43.0e6_wp/)
394 real(wp), dimension(2) :: v_gns = (/ -1.0e4_wp, 1.0e4_wp/)
395 real(wp), dimension(2) :: r_leo = (/-10.0e6_wp, 10.0e6_wp/)
396 real(wp), dimension(2) :: v_leo = (/ -1.0e4_wp, 1.0e4_wp/)
397 real(wp), dimension(2) :: phase_qual = (/ 0.0_wp, 100.0_wp/)
398 end type L1arange
399!
400!****
401
402!****d* Datatypes/L1aref
403!
404! NAME
405! L1aref - A sub-structure of the L1atype structure, defining the reference frame
406! for POD data.
407!
408! SOURCE
409!
410 type L1aref
411 character(len = 3) :: r_gns = "ECF"
412 character(len = 3) :: v_gns = "ECI"
413 character(len = 3) :: r_leo = "ECF"
414 character(len = 3) :: v_leo = "ECI"
415 end type L1aref
416!
417!****
418
419!****d* Datatypes/L1atype
420!
421! NAME
422! L1atype - A sub-structure of the ROprof structure, containing amplitude, phase and
423! POD data.
424!
425! SOURCE
426!
427 type L1atype
428 integer :: Npoints = 0 ! No. of samples in L1a profile
429 real(wp), dimension(:), pointer :: dtime => null() ! Time since start (s)
430 real(wp), dimension(:), pointer :: snr_L1ca => null() ! Signal-to-noise ratio - L1 (V/V)
431 real(wp), dimension(:), pointer :: snr_L1p => null() ! Signal-to-noise ratio - L1 (V/V)
432 real(wp), dimension(:), pointer :: snr_L2p => null() ! Signal-to-noise ratio - L1 (V/V)
433 real(wp), dimension(:), pointer :: phase_L1 => null() ! Excess phase - L1 (m)
434 real(wp), dimension(:), pointer :: phase_L2 => null() ! Excess phase - L2 (m)
435 real(wp), dimension(:,:), pointer :: r_gns => null() ! GNSS position (m)
436 real(wp), dimension(:,:), pointer :: v_gns => null() ! GNSS velocity (m/s)
437 real(wp), dimension(:,:), pointer :: r_leo => null() ! LEO position (m)
438 real(wp), dimension(:,:), pointer :: v_leo => null() ! LEO velocity (m/s)
439 real(wp), dimension(:), pointer :: phase_qual => null() ! Quality value (%)
440 type(L1aunits) :: units
441 type(L1arange) :: range
442 type(L1aref) :: reference_frame
443 end type L1atype
444!
445!****
446
447!-------------------------------------------------------------------------------
448! 8. Level 1b - Bending angles and impact parametres
449!-------------------------------------------------------------------------------
450
451!****d* Datatypes/L1bunits
452!
453! NAME
454! L1bunits - A sub-structure of the L1btype structure, defining units.
455!
456! SOURCE
457!
458 type L1bunits
459 character(len = 64) :: lat_tp = "degrees_north"
460 character(len = 64) :: lon_tp = "degrees_east"
461 character(len = 64) :: azimuth_tp = "degrees"
462 character(len = 64) :: impact = "metres"
463 character(len = 64) :: bangle = "radians"
464 character(len = 64) :: bangle_sigma = "radians"
465 character(len = 64) :: bangle_qual = "percent"
466 end type L1bunits
467!
468!****
469
470!****d* Datatypes/L1brange
471!
472! NAME
473! L1brange - A sub-structure of the L1btype structure, setting valid ranges.
474!
475! SOURCE
476!
477 type L1brange
478 real(wp), dimension(2) :: lat_tp = (/ -90.0_wp, 90.0_wp/)
479 real(wp), dimension(2) :: lon_tp = (/-180.0_wp, 180.0_wp/)
480 real(wp), dimension(2) :: azimuth_tp = (/ 0.0_wp, 360.0_wp/)
481 real(wp), dimension(2) :: impact = (/ 6.2e6_wp, 6.6e6_wp/)
482 real(wp), dimension(2) :: bangle = (/ -0.001_wp, 0.1_wp/)
483 real(wp), dimension(2) :: bangle_sigma = (/ 0.0_wp, 0.01_wp/)
484 real(wp), dimension(2) :: bangle_qual = (/ 0.0_wp, 100.0_wp/)
485 end type L1brange
486!
487!****
488
489!****d* Datatypes/L1bType
490!
491! NAME
492! L1btype - A sub-structure of the ROprof structure, containing bending angle and
493! impact parameter data.
494!
495! SOURCE
496!
497 type L1btype
498 integer :: Npoints = 0 ! No. of samples in L1b profile
499 real(wp), dimension(:), pointer :: lat_tp => null() ! Latitude (deg)
500 real(wp), dimension(:), pointer :: lon_tp => null() ! Longitude (deg)
501 real(wp), dimension(:), pointer :: azimuth_tp => null() ! GNSS->LEO line of sight angle (degT)
502 real(wp), dimension(:), pointer :: impact_L1 => null() ! Impact param - L1 (m)
503 real(wp), dimension(:), pointer :: impact_L2 => null() ! Impact param - L2 (m)
504 real(wp), dimension(:), pointer :: impact => null() ! Impact param - corr (m)
505 real(wp), dimension(:), pointer :: impact_Opt => null() ! Impact param - opt (m)
506 real(wp), dimension(:), pointer :: bangle_L1 => null() ! Bending angle - L1 (rad)
507 real(wp), dimension(:), pointer :: bangle_L2 => null() ! Bending angle - L2 (rad)
508 real(wp), dimension(:), pointer :: bangle => null() ! Bending angle - corr (rad)
509 real(wp), dimension(:), pointer :: bangle_Opt => null() ! Bending angle - opt (rad)
510 real(wp), dimension(:), pointer :: bangle_L1_sigma => null() ! Error in BA - L1 (rad)
511 real(wp), dimension(:), pointer :: bangle_L2_sigma => null() ! Error in BA - L2 (rad)
512 real(wp), dimension(:), pointer :: bangle_sigma => null() ! Error in BA - corr (rad)
513 real(wp), dimension(:), pointer :: bangle_Opt_sigma => null() ! Error in BA - opt (rad)
514 real(wp), dimension(:), pointer :: bangle_L1_qual => null() ! Quality values - L1 (%)
515 real(wp), dimension(:), pointer :: bangle_L2_qual => null() ! Quality values - L2 (%)
516 real(wp), dimension(:), pointer :: bangle_qual => null() ! Quality values - corr (%)
517 real(wp), dimension(:), pointer :: bangle_Opt_qual => null() ! Quality values - opt (%)
518 type(L1bunits) :: units
519 type(L1brange) :: range
520 end type L1btype
521!
522!****
523
524!-------------------------------------------------------------------------------
525! 9. Level 2a - Refractivity
526!-------------------------------------------------------------------------------
527
528!****d* Datatypes/L2aunits
529!
530! NAME
531! L2aunits - A sub-structure of the L2atype structure, defining units.
532!
533! SOURCE
534!
535 type L2aunits
536 character(len = 64) :: alt_refrac = "metres"
537 character(len = 64) :: geop_refrac = "geopotential metres"
538 character(len = 64) :: refrac = "N-units"
539 character(len = 64) :: refrac_sigma = "N-units"
540 character(len = 64) :: refrac_qual = "percent"
541 end type L2aunits
542!
543!****
544
545!****d* Datatypes/L2arange
546!
547! NAME
548! L2arange - A sub-structure of the L2atype structure, setting valid ranges.
549!
550! SOURCE
551!
552 type L2arange
553 real(wp), dimension(2) :: alt_refrac = (/-1.0e3_wp, 1.0e5_wp/)
554 real(wp), dimension(2) :: geop_refrac = (/-1.0e3_wp, 1.0e5_wp/)
555 real(wp), dimension(2) :: refrac = (/ 0.0_wp, 500.0_wp/)
556 real(wp), dimension(2) :: refrac_sigma = (/ 0.0_wp, 10.0_wp/)
557 real(wp), dimension(2) :: refrac_qual = (/ 0.0_wp, 100.0_wp/)
558 end type L2arange
559!
560!****
561
562!****d* Datatypes/L2atype
563!
564! NAME
565! L2atype - A sub-structure of the ROprof structure, containing refractivity, altitude
566! and geopotential height data.
567!
568! SOURCE
569!
570 type L2atype
571 integer :: Npoints = 0 ! No. of samples in L2a profile
572 real(wp), dimension(:), pointer :: alt_refrac => null() ! Geometric height (m)
573 real(wp), dimension(:), pointer :: geop_refrac => null() ! Geopotential height (m)
574 real(wp), dimension(:), pointer :: refrac => null() ! Refractivity (N-units)
575 real(wp), dimension(:), pointer :: refrac_sigma => null() ! Est. error in refractivity (N-units)
576 real(wp), dimension(:), pointer :: refrac_qual => null() ! Quality value (%)
577 type(L2aunits) :: units
578 type(L2arange) :: range
579 end type L2atype
580!
581!****
582
583!-------------------------------------------------------------------------------
584! 10. Level 2b - Meteorological quantities
585!-------------------------------------------------------------------------------
586
587!****d* Datatypes/L2bunits
588!
589! NAME
590! L2bunits - A sub-structure of the L2btype structure, defining units.
591!
592! SOURCE
593!
594 type L2bunits
595 character(len = 64) :: geop = "geopotential metres"
596 character(len = 64) :: geop_sigma = "geopotential metres"
597 character(len = 64) :: press = "hPa"
598 character(len = 64) :: press_sigma = "hPa"
599 character(len = 64) :: temp = "kelvin"
600 character(len = 64) :: temp_sigma = "kelvin"
601 character(len = 64) :: shum = "gram / kilogram"
602 character(len = 64) :: shum_sigma = "gram / kilogram"
603 character(len = 64) :: meteo_qual = "percent"
604 end type L2bunits
605!
606!****
607
608!****d* Datatypes/L2brange
609!
610! NAME
611! L2brange - A sub-structure of the L2btype structure, setting valid ranges.
612!
613! SOURCE
614!
615 type L2brange
616 real(wp), dimension(2) :: geop = (/ -1.0e3_wp, 1.0e5_wp/)
617 real(wp), dimension(2) :: geop_sigma = (/ 0.0_wp, 500.0_wp/)
618 real(wp), dimension(2) :: press = (/ 0.01_wp, 1100.0_wp/)
619 real(wp), dimension(2) :: press_sigma = (/ 0.0_wp, 5.0_wp/)
620 real(wp), dimension(2) :: temp = (/150.0_wp, 350.0_wp/)
621 real(wp), dimension(2) :: temp_sigma = (/ 0.0_wp, 5.0_wp/)
622 real(wp), dimension(2) :: shum = (/ 0.0_wp, 50.0_wp/)
623 real(wp), dimension(2) :: shum_sigma = (/ 0.0_wp, 5.0_wp/)
624 real(wp), dimension(2) :: meteo_qual = (/ 0.0_wp, 100.0_wp/)
625 end type L2brange
626!
627!****
628
629!****d* Datatypes/L2btype
630!
631! NAME
632! L2btype - A sub-structure of the ROprof structure, containing meteorological (i.e.
633! temperature, pressure, (specific) humidity and geopotential height data.
634!
635! SOURCE
636!
637 type L2btype
638 integer :: Npoints = 0 ! No. of samples in L2b profile
639 real(wp), dimension(:), pointer :: geop => null() ! Geopotential height (m)
640 real(wp), dimension(:), pointer :: geop_sigma => null() ! Est. Error in geopotential height (m)
641 real(wp), dimension(:), pointer :: press => null() ! Pressure (hPa)
642 real(wp), dimension(:), pointer :: press_sigma => null() ! Est. Error in pressure (hPa)
643 real(wp), dimension(:), pointer :: temp => null() ! Temperature (K)
644 real(wp), dimension(:), pointer :: temp_sigma => null() ! Est. error in temperature (K)
645 real(wp), dimension(:), pointer :: shum => null() ! Specific humidity (g/Kg)
646 real(wp), dimension(:), pointer :: shum_sigma => null() ! Est. error in SH (g/Kg)
647 real(wp), dimension(:), pointer :: meteo_qual => null() ! Quality value (%)
648 type(L2bunits) :: units
649 type(L2brange) :: range
650 end type L2btype
651!
652!****
653
654!-------------------------------------------------------------------------------
655! 11. Level 2c - Meteorological surface quantities
656!-------------------------------------------------------------------------------
657
658!****d* Datatypes/L2cunits
659!
660! NAME
661! L2cunits - A sub-structure of the L2ctype structure, defining units.
662!
663! SOURCE
664!
665 type L2cunits
666 character(len = 64) :: geop_sfc = "geopotential metres"
667 character(len = 64) :: press_sfc = "hPa"
668 character(len = 64) :: press_sfc_sigma = "hPa"
669 character(len = 64) :: press_sfc_qual = "percent"
670 end type L2cunits
671!
672!****
673
674!****d* Datatypes/L2crange
675!
676! NAME
677! L2crange - A sub-structure of the L2ctype structure, setting valid ranges.
678!
679! SOURCE
680!
681 type L2crange
682 real(wp), dimension(2) :: geop_sfc = (/ -1.0e3_wp, 1.0e4_wp/)
683 real(wp), dimension(2) :: press_sfc = (/250.0_wp, 1100.0_wp/)
684 real(wp), dimension(2) :: press_sfc_sigma = (/ 0.0_wp, 5.0_wp/)
685 real(wp), dimension(2) :: press_sfc_qual = (/ 0.0_wp, 100.0_wp/)
686 end type L2crange
687!
688!****
689
690!****d* Datatypes/L2ctype
691!
692! NAME
693! L2ctype - A sub-structure of the ROprof structure, containing meteorological
694! surface pressure.
695!
696! SOURCE
697!
698 type L2ctype
699 integer :: Npoints = 0 ! No. of samples in profile (0 or 1)
700 real(wp) :: geop_sfc = ropp_io_mdfv ! Geopotential height of surface (m)
701 real(wp) :: press_sfc = ropp_io_mdfv ! Surface pressure (hPa)
702 real(wp) :: press_sfc_sigma = ropp_io_mdfv ! Est. error in surface pressure (hPa)
703 real(wp) :: press_sfc_qual = ropp_io_mdfv ! Quality value for L2b+c (%)
704 type(L2cunits) :: units
705 type(L2crange) :: range
706 end type L2ctype
707!
708!****
709
710!-------------------------------------------------------------------------------
711! 12. Level 2d - Meteorological model level coefficients
712!-------------------------------------------------------------------------------
713
714!****d* Datatypes/L2dunits
715!
716! NAME
717! L2dunits - A sub-structure of the L2dtype structure, defining units.
718!
719! SOURCE
720!
721 type L2dunits
722 character(len = 40) :: level_coeff_a = 'hPa'
723 character(len = 40) :: level_coeff_b = ''
724 end type L2dunits
725!
726!****
727
728!****d* Datatypes/L2drange
729!
730! NAME
731! L2drange - A sub-structure of the L2dtype structure, setting valid ranges.
732!
733! SOURCE
734!
735 type L2drange
736 real(wp), dimension(2) :: level_coeff_a = (/ 0.0_wp, 2000.0_wp/)
737 real(wp), dimension(2) :: level_coeff_b = (/ 0.0_wp, 2.0_wp/)
738 end type L2drange
739!
740!****
741
742!****d* Datatypes/L2dtype
743!
744! NAME
745! L2dtype - A sub-structure of the ROprof structure, containing the defining
746! coefficients for vertical hybrid or eta-type level structures.
747!
748! SOURCE
749!
750 type L2dtype
751 integer :: Npoints = 0
752 character(len = 64) :: level_type = "UNKNOWN"
753 real(wp), dimension(:), pointer :: level_coeff_a => null() ! Model level coefficients
754 real(wp), dimension(:), pointer :: level_coeff_b => null()
755 type(L2dunits) :: units
756 type(L2drange) :: range
757 end type L2dtype
758!
759!****
760
761!-------------------------------------------------------------------------------
762! 13. Variable lists
763!-------------------------------------------------------------------------------
764
765!****id* Datatypes/VlisttypeD0d
766!
767! NAME
768! VlisttypeD0d - Variable list for scalar double precision variables.
769!
770! NOTES
771! This parameter is an internal parameter to the ropp_io library and not
772! intended to be used by users.
773!
774! SOURCE
775!
776 type VlisttypeD0d
777 character(len = 1024) :: name = ""
778 character(len = 1024) :: long_name = ""
779 character(len = 1024) :: units = ""
780 real(wp), dimension(2) :: range = (/ ropp_io_mdfv, &
781 ropp_io_mdfv /)
782 real(wp) :: data
783 type(VlisttypeD0d), pointer :: next => null()
784 end type VlisttypeD0d
785!
786!****
787
788!****id* Datatypes/VlisttypeD1d
789!
790! NAME
791! VlisttypeD1d - Variable list for one-dimensional double precision
792! variables.
793!
794! NOTES
795! This parameter is an internal parameter to the ropp_io library and not
796! intended to be used by users.
797!
798! SOURCE
799!
800 type VlisttypeD1d
801 character(len = 1024) :: name = ""
802 character(len = 1024) :: long_name = ""
803 character(len = 1024) :: units = ""
804 real(wp), dimension(2) :: range = (/ ropp_io_mdfv, &
805 ropp_io_mdfv /)
806 real(wp), dimension(:), pointer :: data
807 type(VlisttypeD1d), pointer :: next => null()
808 end type VlisttypeD1d
809!
810!****
811
812!****id* Datatypes/VlisttypeD2d
813!
814! NAME
815! VlisttypeD2d - Variable list for two-dimensional double precision
816! variables.
817!
818! NOTES
819! This parameter is an internal parameter to the ropp_io library and not
820! intended to be used by users.
821!
822! SOURCE
823!
824 type VlisttypeD2d
825 character(len = 1024) :: name = ""
826 character(len = 1024) :: long_name = ""
827 character(len = 1024) :: units = ""
828 real(wp), dimension(2) :: range = (/ ropp_io_mdfv, &
829 ropp_io_mdfv /)
830 real(wp), dimension(:,:), pointer :: data
831 type(VlisttypeD2d), pointer :: next => null()
832 end type VlisttypeD2d
833!
834!****
835
836!****id* Datatypes/Vlisttype
837!
838! NAME
839! Vlisttype - Variable list for additional variables variables.
840!
841! NOTES
842! This parameter is an internal parameter to the ropp_io library and not
843! intended to be used by users.
844!
845! SOURCE
846!
847 type Vlisttype
848 type(VlisttypeD0d), pointer :: VlistD0d => null()
849 type(VlisttypeD1d), pointer :: VlistD1d => null()
850 type(VlisttypeD2d), pointer :: VlistD2d => null()
851 end type Vlisttype
852!
853!****
854
855!-------------------------------------------------------------------------------
856! 14. RO profile
857!-------------------------------------------------------------------------------
858
859!****d* Datatypes/ROunits
860!
861! NAME
862! ROunits - A sub-structure of the ROprof structure, defining (top-level) units.
863!
864! SOURCE
865!
866 type ROunits
867 character(len = 64) :: pcd = "bits"
868 character(len = 64) :: overall_qual = "percent"
869 end type ROunits
870!
871!****
872
873!****d* Datatypes/ROrange
874!
875! NAME
876! ROrange - A sub-structure of the ROprof structure, defining (top level) ranges.
877!
878! SOURCE
879!
880 type ROrange
881 integer, dimension(2) :: pcd = (/ 0, 32767 /)
882 real(wp), dimension(2) :: overall_qual = (/ 0.0_wp, 100.0_wp /)
883 end type ROrange
884!
885!****
886
887!****d* Datatypes/ROprof
888!
889! NAME
890! ROprof - Radio Occultation data (profile) data type.
891!
892! SYNOPSIS
893! use ropp_io_types
894! ...
895! type(ROprof) :: ro_data
896!
897! NOTES
898! The ROprof structure is composed out of several other structures; see the user guide
899! for a breakdown of the actual element names.
900!
901! SEE ALSO
902! DT7type
903! GEOtype
904! BGtype
905! L1atype
906! L1btype
907! L2atype
908! L2btype
909! L2ctype
910! L2dtype
911! ROunits
912!
913! SOURCE
914!
915 type ROprof
916 character(len = 21) :: FmtVersion = "UNKNOWN" ! File format version ID
917 character(len = 40) :: occ_id = "UNKNOWN" ! Occultation ID
918 character(len = 4) :: leo_id = "UNKN" ! LEO identifier
919 character(len = 4) :: gns_id = "U999" ! GNSS identifier
920 character(len = 4) :: stn_id = "UNKN" ! GSN station identifier
921 character(len = 40) :: processing_centre = "UNKNOWN" ! Processing centre
922 character(len = 40) :: pod_method = "UNKNOWN" ! POD processing method
923 character(len = 40) :: phase_method = "UNKNOWN" ! Excess phase processing method
924 character(len = 40) :: bangle_method = "UNKNOWN" ! Bending angle processing method
925 character(len = 40) :: refrac_method = "UNKNOWN" ! Refractivity processing method
926 character(len = 40) :: meteo_method = "UNKNOWN" ! Meteorological processing method
927 character(len = 80) :: thin_method = "UNKNOWN" ! Profile thinning method
928 character(len = 40) :: software_version = "UNKNOWN" ! Software version ID
929 type(DT7type) :: DTocc ! Date/time of occultation
930 type(DT7type) :: DTpro ! Date/time of processing
931 integer :: PCD = 65535 ! Product quality flags
932 real(wp) :: overall_qual = ropp_io_mdfv ! Overall quality value
933 type(GEOtype) :: georef ! Georeferencing of the profile
934 type(BGtype) :: bg ! Background meta-data
935 type(L1atype) :: Lev1a ! Level 1a data
936 type(L1btype) :: Lev1b ! Level 1b data
937 type(L2atype) :: Lev2a ! Level 2a data
938 type(L2btype) :: Lev2b ! Level 2b data
939 type(L2ctype) :: Lev2c ! Level 2c data
940 type(L2dtype) :: Lev2d ! Level 2d data
941 type(ROunits) :: units ! Parameter unit names
942 type(ROrange) :: range ! Parameter ranges
943 type(Vlisttype) :: vlist ! Additional variables
944 end type ROprof
945
946!****
947
948!-------------------------------------------------------------------------------
949! 15. Error correlation / covariance matrix
950!-------------------------------------------------------------------------------
951
952!****d* Datatypes/ROcorcov
953!
954! NAME
955! ROcorcov - Error correlation or covariance data type.
956!
957! SYNOPSIS
958! use ropp_io_types
959! ...
960! type(ROcorcov) :: covar
961!
962! NOTES
963! The ROcorcov structure contains an error correlation or covariance matrix
964! (the latter will be splitted into an error correlation matrix and an array
965! of diagonal standard deviations). The error correlation matrix is stored in
966! Lapack's packed format for positive definite matrices, i.e. as a 1d array.
967!
968! As an additional element, the structure may also contain a latitude range
969! pair which is intended to specify within which latitude band the error
970! covariance is applicable.
971!
972! SEE ALSO
973!
974! SOURCE
975!
976 type ROcorcov
977 character(len = 13) :: FmtVersion = "UNKNOWN" ! File format version ID
978 character(len = 40) :: processing_centre = "UNKNOWN" ! Processing centre
979
980 real(wp) :: lat_min = -90.0_wp
981 real(wp) :: lat_max = 90.0_wp
982 real(wp), dimension(:), pointer :: sigma => null()
983 real(wp), dimension(:), pointer :: corr => null()
984 end type ROcorcov
985!
986!****
987
988end module ropp_io_types