1 | MODULE obs_group_def |
---|
2 | !!===================================================================== |
---|
3 | !! *** MODULE obs_group_def *** |
---|
4 | !! Observation diagnostics: Routines specific to model variables |
---|
5 | !!===================================================================== |
---|
6 | !! History : 4.0 ! 2021-06 (D Ford) Original code |
---|
7 | !!---------------------------------------------------------------------- |
---|
8 | !! obs_group_alloc : allocate observation group types |
---|
9 | !! obs_group_dealloc : deallocate observation group types |
---|
10 | !! obs_group_check : check observation group options |
---|
11 | !!---------------------------------------------------------------------- |
---|
12 | |
---|
13 | !! * Modules used |
---|
14 | USE iom ! In/out manager |
---|
15 | USE par_kind, ONLY : & ! Precision variables |
---|
16 | & wp |
---|
17 | USE obs_surf_def ! Surface data definitions |
---|
18 | USE obs_profiles_def ! Profile data definitions |
---|
19 | USE tradmp, ONLY : & ! Damping to climatology |
---|
20 | & ln_tradmp |
---|
21 | |
---|
22 | IMPLICIT NONE |
---|
23 | |
---|
24 | !! * Routine/type accessibility |
---|
25 | PRIVATE |
---|
26 | |
---|
27 | PUBLIC & |
---|
28 | & obs_group, & |
---|
29 | & obs_group_alloc, & |
---|
30 | & obs_group_dealloc, & |
---|
31 | & obs_group_read, & |
---|
32 | & obs_group_check |
---|
33 | |
---|
34 | !! * Shared Module variables |
---|
35 | INTEGER, PARAMETER :: jpmaxntypes = 1000 ! Maximum number of obs types for each obs group |
---|
36 | INTEGER, PARAMETER :: jpmaxnfiles = 1000 ! Maximum number of files for each obs group |
---|
37 | |
---|
38 | INTEGER, PARAMETER, PUBLIC :: imaxavtypes = 20 !: Max number of daily avgd obs types |
---|
39 | |
---|
40 | ! Expected names for observation types with special behaviours (not needed for all observation types) |
---|
41 | CHARACTER(LEN=8), PUBLIC :: cobsname_uvel = 'UVEL' ! Expected variable name for U velocity (2D or 3D) |
---|
42 | CHARACTER(LEN=8), PUBLIC :: cobsname_vvel = 'VVEL' ! Expected variable name for V velocity (2D or 3D) |
---|
43 | CHARACTER(LEN=8), PUBLIC :: cobsname_sla = 'SLA' ! Expected variable name for sea level anomaly |
---|
44 | CHARACTER(LEN=8), PUBLIC :: cobsname_fbd = 'FBD' ! Expected variable name for sea ice freeboard |
---|
45 | CHARACTER(LEN=8), PUBLIC :: cobsname_t3d = 'POTM' ! Expected variable name for 3D temperature |
---|
46 | CHARACTER(LEN=8), PUBLIC :: cobsname_s3d = 'PSAL' ! Expected variable name for 3D salinity |
---|
47 | CHARACTER(LEN=8), PUBLIC :: cobsname_t2d = 'SST' ! Expected variable name for 2D temperature |
---|
48 | CHARACTER(LEN=8), PUBLIC :: cobsname_s2d = 'SSS' ! Expected variable name for 2D salinity |
---|
49 | |
---|
50 | !! * Type definition for observation groups |
---|
51 | TYPE obs_group |
---|
52 | ! |
---|
53 | CHARACTER(LEN=25) :: cgroupname !: Name of obs group (for stdout) |
---|
54 | CHARACTER(LEN=8), DIMENSION(:), ALLOCATABLE :: cobstypes !: Observation types to read from files |
---|
55 | CHARACTER(LEN=128), DIMENSION(:), ALLOCATABLE :: cobsfiles !: Observation file names |
---|
56 | CHARACTER(LEN=128), DIMENSION(:), ALLOCATABLE :: cobsbiasfiles !: Bias input file names |
---|
57 | CHARACTER(LEN=128) :: cbiasvarname !: Bias variable name in input file |
---|
58 | CHARACTER(LEN=128) :: caltbiasfile !: Altimeter bias input file name |
---|
59 | ! |
---|
60 | INTEGER, DIMENSION(:), ALLOCATABLE :: nprofdavtypes !: Profile data types representing a daily average |
---|
61 | ! |
---|
62 | INTEGER :: nobstypes !: Number of observation types |
---|
63 | INTEGER :: nobsfiles !: Number of observation files |
---|
64 | INTEGER :: nobsbiasfiles !: Number of bias files |
---|
65 | INTEGER :: nbiasvar !: Index of observation type to be bias corrected |
---|
66 | INTEGER :: navtypes !: Number of profile data types representing a daily average |
---|
67 | INTEGER :: nextvars !: Number of extra variables in addition to any in input files |
---|
68 | INTEGER :: naddvars !: Number of additional variables in addition to any in input files |
---|
69 | INTEGER :: n1dint !: Type of vertical interpolation method |
---|
70 | INTEGER :: n2dint !: Type of horizontal interpolation method |
---|
71 | INTEGER :: nmsshc !: MSSH correction scheme |
---|
72 | INTEGER :: nadd_ssh !: Index of additional variable representing SSH |
---|
73 | INTEGER :: next_mdt !: Index of extra variable representing MDT |
---|
74 | INTEGER :: nadd_fbd !: Index of additional variable representing ice freeboard |
---|
75 | INTEGER :: next_snow !: Index of extra variable representing snow thickness |
---|
76 | INTEGER :: nadd_clm !: Index of additional variable representing climatology |
---|
77 | ! |
---|
78 | LOGICAL :: lenabled !: Logical switch for group being processed and not ignored |
---|
79 | LOGICAL :: lsurf !: Logical switch for surface data |
---|
80 | LOGICAL :: lprof !: Logical switch for profile data |
---|
81 | LOGICAL :: lvel !: Logical switch for velocity data |
---|
82 | LOGICAL :: lsla !: Logical switch for SLA data |
---|
83 | LOGICAL :: lfbd !: Logical switch for ice freeboard data |
---|
84 | LOGICAL :: laltbias !: Logical switch for altimeter bias correction |
---|
85 | LOGICAL :: lobsbias !: Logical switch for bias correction |
---|
86 | LOGICAL :: lnea !: Logical switch for rejecting observations near land |
---|
87 | LOGICAL :: lbound_reject !: Logical switch for rejecting obs near the boundary |
---|
88 | LOGICAL :: lignmis !: Logical switch for ignoring missing files |
---|
89 | LOGICAL :: lall_at_all !: Logical switch for computing all model variables at all obs points |
---|
90 | LOGICAL :: lnight !: Logical switch for calculating night-time average |
---|
91 | LOGICAL :: ltime_mean_bkg !: Logical switch for applying time mean of background (e.g. to remove tidal signal) |
---|
92 | LOGICAL :: loutput_clim !: Logical switch for outputting climatological temperature/salinity |
---|
93 | LOGICAL :: lfp_indegs !: Logical: T=> averaging footprint is in degrees, F=> in metres |
---|
94 | ! |
---|
95 | REAL(wp) :: ravglamscl !: E/W diameter of observation footprint (metres/degrees) |
---|
96 | REAL(wp) :: ravgphiscl !: N/S diameter of observation footprint (metres/degrees) |
---|
97 | REAL(wp) :: rmdtcorr !: MDT correction |
---|
98 | REAL(wp) :: rmdtcutoff !: MDT cutoff for computed correction |
---|
99 | REAL(wp) :: rtime_mean_period !: Meaning period if ltime_mean_bkg |
---|
100 | ! |
---|
101 | REAL(wp), POINTER, DIMENSION(:,:,:) :: rglam !: Longitudes |
---|
102 | REAL(wp), POINTER, DIMENSION(:,:,:) :: rgphi !: Latitudes |
---|
103 | REAL(wp), POINTER, DIMENSION(:,:,:,:) :: rmask !: Land/sea masks |
---|
104 | ! |
---|
105 | TYPE(obs_surf) :: ssurfdata !: Initial surface data |
---|
106 | TYPE(obs_surf) :: ssurfdataqc !: Surface data after quality control |
---|
107 | TYPE(obs_prof) :: sprofdata !: Initial profile data |
---|
108 | TYPE(obs_prof) :: sprofdataqc !: Profile data after quality control |
---|
109 | ! |
---|
110 | END TYPE |
---|
111 | |
---|
112 | CONTAINS |
---|
113 | |
---|
114 | SUBROUTINE obs_group_alloc( sdobsgroup ) |
---|
115 | !!---------------------------------------------------------------------- |
---|
116 | !! *** ROUTINE obs_group_alloc *** |
---|
117 | !! |
---|
118 | !! ** Purpose : - Allocate data for observation group types |
---|
119 | !! |
---|
120 | !! ** Method : - Allocate arrays |
---|
121 | !! |
---|
122 | !! ** Action : - Allocate arrays |
---|
123 | !! |
---|
124 | !!---------------------------------------------------------------------- |
---|
125 | !! * Arguments |
---|
126 | TYPE(obs_group), INTENT(INOUT) :: sdobsgroup ! Obs group to be allocated |
---|
127 | !!---------------------------------------------------------------------- |
---|
128 | |
---|
129 | ALLOCATE( sdobsgroup%cobstypes (sdobsgroup%nobstypes ), & |
---|
130 | & sdobsgroup%cobsfiles (sdobsgroup%nobsfiles ), & |
---|
131 | & sdobsgroup%cobsbiasfiles(sdobsgroup%nobsbiasfiles ), & |
---|
132 | & sdobsgroup%nprofdavtypes(sdobsgroup%navtypes ), & |
---|
133 | & sdobsgroup%rglam (jpi,jpj, sdobsgroup%nobstypes), & |
---|
134 | & sdobsgroup%rgphi (jpi,jpj, sdobsgroup%nobstypes), & |
---|
135 | & sdobsgroup%rmask (jpi,jpj,jpk,sdobsgroup%nobstypes) ) |
---|
136 | |
---|
137 | END SUBROUTINE obs_group_alloc |
---|
138 | |
---|
139 | |
---|
140 | SUBROUTINE obs_group_dealloc( sdobsgroup ) |
---|
141 | !!---------------------------------------------------------------------- |
---|
142 | !! *** ROUTINE obs_group_dealloc *** |
---|
143 | !! |
---|
144 | !! ** Purpose : - Deallocate data for observation group types |
---|
145 | !! |
---|
146 | !! ** Method : - Deallocate arrays |
---|
147 | !! |
---|
148 | !! ** Action : - Deallocate arrays |
---|
149 | !! |
---|
150 | !!---------------------------------------------------------------------- |
---|
151 | !! * Arguments |
---|
152 | TYPE(obs_group), INTENT(INOUT) :: sdobsgroup ! Obs group to be deallocated |
---|
153 | !!---------------------------------------------------------------------- |
---|
154 | |
---|
155 | DEALLOCATE( sdobsgroup%cobstypes, & |
---|
156 | & sdobsgroup%cobsfiles, & |
---|
157 | & sdobsgroup%cobsbiasfiles, & |
---|
158 | & sdobsgroup%nprofdavtypes, & |
---|
159 | & sdobsgroup%rglam, & |
---|
160 | & sdobsgroup%rgphi, & |
---|
161 | & sdobsgroup%rmask ) |
---|
162 | |
---|
163 | END SUBROUTINE obs_group_dealloc |
---|
164 | |
---|
165 | |
---|
166 | SUBROUTINE obs_group_read( sdobsgroup ) |
---|
167 | !!---------------------------------------------------------------------- |
---|
168 | !! *** ROUTINE obs_group_read *** |
---|
169 | !! |
---|
170 | !! ** Purpose : - Read namelist for observation group types |
---|
171 | !! |
---|
172 | !! ** Method : - Read namelist |
---|
173 | !! |
---|
174 | !! ** Action : - Read namelist |
---|
175 | !! |
---|
176 | !!---------------------------------------------------------------------- |
---|
177 | !! * Arguments |
---|
178 | TYPE(obs_group), INTENT(INOUT) :: sdobsgroup ! Obs group to be populated |
---|
179 | !! * Local variables |
---|
180 | INTEGER :: ios ! Status for namelist read |
---|
181 | INTEGER :: itype, ifile ! Loop counters |
---|
182 | INTEGER :: jtype, jfile ! Loop counters |
---|
183 | ! |
---|
184 | CHARACTER(LEN=128) :: cn_groupname |
---|
185 | CHARACTER(LEN=8), DIMENSION(jpmaxntypes) :: cn_obstypes |
---|
186 | CHARACTER(LEN=128), DIMENSION(jpmaxnfiles) :: cn_obsfiles |
---|
187 | CHARACTER(LEN=128), DIMENSION(jpmaxnfiles) :: cn_obsbiasfiles |
---|
188 | CHARACTER(LEN=128) :: cn_type_to_biascorrect |
---|
189 | CHARACTER(LEN=128) :: cn_obsbiasfile_varname |
---|
190 | CHARACTER(LEN=128) :: cn_altbiasfile |
---|
191 | INTEGER, DIMENSION(imaxavtypes) :: nn_profdavtypes |
---|
192 | INTEGER :: nn_1dint |
---|
193 | INTEGER :: nn_2dint |
---|
194 | INTEGER :: nn_msshc |
---|
195 | LOGICAL :: ln_enabled |
---|
196 | LOGICAL :: ln_surf |
---|
197 | LOGICAL :: ln_prof |
---|
198 | LOGICAL :: ln_altbias |
---|
199 | LOGICAL :: ln_obsbias |
---|
200 | LOGICAL :: ln_nea |
---|
201 | LOGICAL :: ln_bound_reject |
---|
202 | LOGICAL :: ln_ignmis |
---|
203 | LOGICAL :: ln_all_at_all |
---|
204 | LOGICAL :: ln_night |
---|
205 | LOGICAL :: ln_time_mean_bkg |
---|
206 | LOGICAL :: ln_output_clim |
---|
207 | LOGICAL :: ln_fp_indegs |
---|
208 | REAL(wp) :: rn_avglamscl |
---|
209 | REAL(wp) :: rn_avgphiscl |
---|
210 | REAL(wp) :: rn_mdtcorr |
---|
211 | REAL(wp) :: rn_mdtcutoff |
---|
212 | REAL(wp) :: rn_time_mean_period |
---|
213 | !! |
---|
214 | NAMELIST/namobs_dta/cn_groupname, ln_prof, ln_surf, ln_enabled, & |
---|
215 | & cn_obsfiles, cn_obstypes, ln_nea, ln_bound_reject, & |
---|
216 | & ln_ignmis, nn_2dint, nn_1dint, nn_profdavtypes, & |
---|
217 | & ln_fp_indegs, rn_avglamscl, rn_avgphiscl, ln_obsbias, & |
---|
218 | & cn_obsbiasfiles, cn_type_to_biascorrect, & |
---|
219 | & cn_obsbiasfile_varname, ln_night, ln_time_mean_bkg, & |
---|
220 | & rn_time_mean_period, ln_altbias, cn_altbiasfile, & |
---|
221 | & nn_msshc, rn_mdtcorr, rn_mdtcutoff, ln_all_at_all, & |
---|
222 | & ln_output_clim |
---|
223 | !!---------------------------------------------------------------------- |
---|
224 | |
---|
225 | cn_obstypes(:) = '' |
---|
226 | cn_obsfiles(:) = '' |
---|
227 | cn_obsbiasfiles(:) = '' |
---|
228 | nn_profdavtypes(:) = -1 |
---|
229 | |
---|
230 | ! There is only one namobs_dta block in namelist_ref -> use it for each group so we do a rewind |
---|
231 | REWIND(numnam_ref) |
---|
232 | READ ( numnam_ref, namobs_dta, IOSTAT = ios, ERR = 901) |
---|
233 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namobs_dta in reference namelist' ) |
---|
234 | |
---|
235 | ! Read namobs_dta from namelist_cfg |
---|
236 | ! WARNING: we don't do a rewind here, each group reads its own namobs_dta block one after another |
---|
237 | READ ( numnam_cfg, namobs_dta, IOSTAT = ios, ERR = 902 ) |
---|
238 | 902 IF( ios > 0 ) CALL ctl_nam ( ios , 'namobs_dta in configuration namelist' ) |
---|
239 | IF(lwm) WRITE( numond, namobs_dta ) |
---|
240 | |
---|
241 | sdobsgroup%cgroupname = cn_groupname |
---|
242 | sdobsgroup%lenabled = ln_enabled |
---|
243 | |
---|
244 | IF (sdobsgroup%lenabled) THEN |
---|
245 | sdobsgroup%nobstypes = 0 |
---|
246 | sdobsgroup%nobsfiles = 0 |
---|
247 | sdobsgroup%naddvars = 0 |
---|
248 | sdobsgroup%nextvars = 0 |
---|
249 | sdobsgroup%navtypes = 0 |
---|
250 | sdobsgroup%nobsbiasfiles = 0 |
---|
251 | sdobsgroup%lvel = .false. |
---|
252 | sdobsgroup%lsla = .false. |
---|
253 | sdobsgroup%lfbd = .false. |
---|
254 | sdobsgroup%nadd_ssh = 0 |
---|
255 | sdobsgroup%next_mdt = 0 |
---|
256 | sdobsgroup%nadd_fbd = 0 |
---|
257 | sdobsgroup%next_snow = 0 |
---|
258 | |
---|
259 | DO jtype = 1, jpmaxntypes |
---|
260 | IF ( TRIM(cn_obstypes(jtype)) /= '' ) THEN |
---|
261 | sdobsgroup%nobstypes = sdobsgroup%nobstypes + 1 |
---|
262 | ENDIF |
---|
263 | END DO |
---|
264 | DO jfile = 1, jpmaxnfiles |
---|
265 | IF ( TRIM(cn_obsfiles(jfile)) /= '' ) THEN |
---|
266 | sdobsgroup%nobsfiles = sdobsgroup%nobsfiles + 1 |
---|
267 | ENDIF |
---|
268 | END DO |
---|
269 | DO jtype = 1, imaxavtypes |
---|
270 | IF ( nn_profdavtypes(jtype) /= -1 ) THEN |
---|
271 | sdobsgroup%navtypes = sdobsgroup%navtypes + 1 |
---|
272 | ENDIF |
---|
273 | END DO |
---|
274 | DO jfile = 1, jpmaxnfiles |
---|
275 | IF ( TRIM(cn_obsbiasfiles(jfile)) /= '' ) THEN |
---|
276 | sdobsgroup%nobsbiasfiles = sdobsgroup%nobsbiasfiles + 1 |
---|
277 | ENDIF |
---|
278 | END DO |
---|
279 | |
---|
280 | CALL obs_group_alloc( sdobsgroup ) |
---|
281 | |
---|
282 | itype = 0 |
---|
283 | DO jtype = 1, jpmaxntypes |
---|
284 | IF ( TRIM(cn_obstypes(jtype)) /= '' ) THEN |
---|
285 | itype = itype + 1 |
---|
286 | sdobsgroup%cobstypes(itype) = TRIM(cn_obstypes(jtype)) |
---|
287 | IF ( (TRIM(sdobsgroup%cobstypes(itype)) == cobsname_uvel) .OR. & |
---|
288 | & (TRIM(sdobsgroup%cobstypes(itype)) == cobsname_vvel) ) THEN |
---|
289 | sdobsgroup%lvel = .true. |
---|
290 | ELSEIF ( TRIM(sdobsgroup%cobstypes(itype)) == cobsname_sla ) THEN |
---|
291 | sdobsgroup%lsla = .true. |
---|
292 | ! SSH=additional, MDT=extra |
---|
293 | sdobsgroup%naddvars = sdobsgroup%naddvars + 1 |
---|
294 | sdobsgroup%nextvars = sdobsgroup%nextvars + 1 |
---|
295 | sdobsgroup%nadd_ssh = sdobsgroup%naddvars |
---|
296 | sdobsgroup%next_mdt = sdobsgroup%nextvars |
---|
297 | ELSEIF ( TRIM(sdobsgroup%cobstypes(itype)) == cobsname_fbd ) THEN |
---|
298 | sdobsgroup%lfbd = .true. |
---|
299 | ! freeboard=additional, snow thickness=extra |
---|
300 | sdobsgroup%naddvars = sdobsgroup%naddvars + 1 |
---|
301 | sdobsgroup%nextvars = sdobsgroup%nextvars + 1 |
---|
302 | sdobsgroup%nadd_fbd = sdobsgroup%naddvars |
---|
303 | sdobsgroup%next_snow = sdobsgroup%nextvars |
---|
304 | ENDIF |
---|
305 | ! |
---|
306 | IF ( ln_output_clim .AND. ln_tradmp .AND. (.NOT. sdobsgroup%loutput_clim) ) THEN |
---|
307 | IF ( (TRIM(sdobsgroup%cobstypes(itype)) == cobsname_t3d) .OR. & |
---|
308 | & (TRIM(sdobsgroup%cobstypes(itype)) == cobsname_s3d) .OR. & |
---|
309 | & (TRIM(sdobsgroup%cobstypes(itype)) == cobsname_t2d) .OR. & |
---|
310 | & (TRIM(sdobsgroup%cobstypes(itype)) == cobsname_s2d) ) THEN |
---|
311 | sdobsgroup%loutput_clim = .TRUE. |
---|
312 | sdobsgroup%naddvars = sdobsgroup%naddvars + 1 |
---|
313 | sdobsgroup%nadd_clm = sdobsgroup%naddvars |
---|
314 | ENDIF |
---|
315 | ENDIF |
---|
316 | ! |
---|
317 | IF (TRIM(sdobsgroup%cobstypes(itype)) == cobsname_uvel) THEN |
---|
318 | sdobsgroup%rglam(:,:,itype) = glamu(:,:) |
---|
319 | sdobsgroup%rgphi(:,:,itype) = gphiu(:,:) |
---|
320 | sdobsgroup%rmask(:,:,:,itype) = umask(:,:,:) |
---|
321 | ELSEIF (TRIM(sdobsgroup%cobstypes(itype)) == cobsname_vvel) THEN |
---|
322 | sdobsgroup%rglam(:,:,itype) = glamv(:,:) |
---|
323 | sdobsgroup%rgphi(:,:,itype) = gphiv(:,:) |
---|
324 | sdobsgroup%rmask(:,:,:,itype) = vmask(:,:,:) |
---|
325 | ELSE |
---|
326 | sdobsgroup%rglam(:,:,itype) = glamt(:,:) |
---|
327 | sdobsgroup%rgphi(:,:,itype) = gphit(:,:) |
---|
328 | sdobsgroup%rmask(:,:,:,itype) = tmask(:,:,:) |
---|
329 | ENDIF |
---|
330 | ENDIF |
---|
331 | END DO |
---|
332 | ifile = 0 |
---|
333 | DO jfile = 1, jpmaxnfiles |
---|
334 | IF ( TRIM(cn_obsfiles(jfile)) /= '' ) THEN |
---|
335 | ifile = ifile + 1 |
---|
336 | sdobsgroup%cobsfiles(ifile) = TRIM(cn_obsfiles(jfile)) |
---|
337 | ENDIF |
---|
338 | END DO |
---|
339 | itype = 0 |
---|
340 | DO jtype = 1, imaxavtypes |
---|
341 | IF ( nn_profdavtypes(jtype) /= -1 ) THEN |
---|
342 | itype = itype + 1 |
---|
343 | sdobsgroup%nprofdavtypes(itype) = nn_profdavtypes(jtype) |
---|
344 | ENDIF |
---|
345 | END DO |
---|
346 | ifile = 0 |
---|
347 | DO jfile = 1, jpmaxnfiles |
---|
348 | IF ( TRIM(cn_obsbiasfiles(jfile)) /= '' ) THEN |
---|
349 | ifile = ifile + 1 |
---|
350 | sdobsgroup%cobsbiasfiles(ifile) = cn_obsbiasfiles(jfile) |
---|
351 | ENDIF |
---|
352 | END DO |
---|
353 | IF ( ln_obsbias ) THEN |
---|
354 | sdobsgroup%nbiasvar = -1 |
---|
355 | DO jtype = 1, sdobsgroup%nobstypes |
---|
356 | IF ( TRIM(sdobsgroup%cobstypes(itype)) == TRIM(cn_type_to_biascorrect) ) THEN |
---|
357 | sdobsgroup%nbiasvar = jtype |
---|
358 | EXIT |
---|
359 | ENDIF |
---|
360 | ENDDO |
---|
361 | ENDIF |
---|
362 | |
---|
363 | sdobsgroup%caltbiasfile = cn_altbiasfile |
---|
364 | sdobsgroup%n1dint = nn_1dint |
---|
365 | sdobsgroup%n2dint = nn_2dint |
---|
366 | sdobsgroup%nmsshc = nn_msshc |
---|
367 | sdobsgroup%lsurf = ln_surf |
---|
368 | sdobsgroup%lprof = ln_prof |
---|
369 | sdobsgroup%laltbias = ln_altbias |
---|
370 | sdobsgroup%lobsbias = ln_obsbias |
---|
371 | sdobsgroup%cbiasvarname = cn_obsbiasfile_varname |
---|
372 | sdobsgroup%lnea = ln_nea |
---|
373 | sdobsgroup%lbound_reject = ln_bound_reject |
---|
374 | sdobsgroup%lignmis = ln_ignmis |
---|
375 | sdobsgroup%lall_at_all = ln_all_at_all |
---|
376 | sdobsgroup%lnight = ln_night |
---|
377 | sdobsgroup%ltime_mean_bkg = ln_time_mean_bkg |
---|
378 | sdobsgroup%lfp_indegs = ln_fp_indegs |
---|
379 | sdobsgroup%ravglamscl = rn_avglamscl |
---|
380 | sdobsgroup%ravgphiscl = rn_avgphiscl |
---|
381 | sdobsgroup%rmdtcorr = rn_mdtcorr |
---|
382 | sdobsgroup%rmdtcutoff = rn_mdtcutoff |
---|
383 | sdobsgroup%rtime_mean_period = rn_time_mean_period |
---|
384 | ENDIF |
---|
385 | |
---|
386 | END SUBROUTINE obs_group_read |
---|
387 | |
---|
388 | |
---|
389 | SUBROUTINE obs_group_check( sdobsgroup, kgroup ) |
---|
390 | !!---------------------------------------------------------------------- |
---|
391 | !! *** ROUTINE obs_group_check *** |
---|
392 | !! |
---|
393 | !! ** Purpose : - Error check observation group types |
---|
394 | !! |
---|
395 | !! ** Method : - Check and print options |
---|
396 | !! |
---|
397 | !! ** Action : - Check and print options |
---|
398 | !! |
---|
399 | !!---------------------------------------------------------------------- |
---|
400 | !! * Arguments |
---|
401 | TYPE(obs_group), INTENT(IN) :: sdobsgroup ! Obs group to be checked |
---|
402 | INTEGER, INTENT(IN) :: kgroup ! Number of group being checked |
---|
403 | !! * Local variables |
---|
404 | INTEGER :: jtype, jfile ! Loop counters |
---|
405 | !!---------------------------------------------------------------------- |
---|
406 | |
---|
407 | IF (lwp) THEN |
---|
408 | WRITE(numout,*) |
---|
409 | WRITE(numout,*) 'obs_group_check : Options for group ', kgroup, ', ', TRIM(sdobsgroup%cgroupname) |
---|
410 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
411 | WRITE(numout,*) ' Logical switch for group being enabled ln_enabled = ', sdobsgroup%lenabled |
---|
412 | IF ( .NOT. sdobsgroup%lenabled ) THEN |
---|
413 | WRITE(numout,*) ' Group disabled, will not be used' |
---|
414 | ELSE |
---|
415 | WRITE(numout,*) ' Observation types in group:', sdobsgroup%nobstypes |
---|
416 | DO jtype = 1, sdobsgroup%nobstypes |
---|
417 | WRITE(numout,*) ' ', TRIM(sdobsgroup%cobstypes(jtype)) |
---|
418 | END DO |
---|
419 | WRITE(numout,*) ' Observation files in group:', sdobsgroup%nobsfiles |
---|
420 | DO jfile = 1, sdobsgroup%nobsfiles |
---|
421 | WRITE(numout,*) ' ', TRIM(sdobsgroup%cobsfiles(jfile)) |
---|
422 | END DO |
---|
423 | WRITE(numout,*) ' General settings:' |
---|
424 | WRITE(numout,*) ' Logical switch for surface data ln_surf = ', sdobsgroup%lsurf |
---|
425 | WRITE(numout,*) ' Logical switch for profile data ln_prof = ', sdobsgroup%lprof |
---|
426 | WRITE(numout,*) ' Rejection of observations near land switch ln_nea = ', sdobsgroup%lnea |
---|
427 | WRITE(numout,*) ' Rejection of obs near open bdys ln_bound_reject = ', sdobsgroup%lbound_reject |
---|
428 | WRITE(numout,*) ' Logical switch for ignoring missing files ln_ignmis = ', sdobsgroup%lignmis |
---|
429 | WRITE(numout,*) ' Type of horizontal interpolation method nn_2dint = ', sdobsgroup%n2dint |
---|
430 | IF ( sdobsgroup%n2dint <= 4 ) THEN |
---|
431 | WRITE(numout,*) ' model counterparts will be interpolated horizontally' |
---|
432 | ELSE |
---|
433 | WRITE(numout,*) ' model counterparts will be averaged horizontally' |
---|
434 | ENDIF |
---|
435 | WRITE(numout,*) ' Settings only for surface data, which is ', sdobsgroup%lsurf |
---|
436 | WRITE(numout,*) ' Obs footprint in deg [T] or m [F] ln_fp_indegs = ', sdobsgroup%lfp_indegs |
---|
437 | WRITE(numout,*) ' E/W diameter of obs footprint rn_avglamscl = ', sdobsgroup%ravglamscl |
---|
438 | WRITE(numout,*) ' N/S diameter of obs footprint rn_avgphiscl = ', sdobsgroup%ravgphiscl |
---|
439 | WRITE(numout,*) ' Logical switch for night-time average ln_night = ', sdobsgroup%lnight |
---|
440 | WRITE(numout,*) ' Logical switch for time-mean background ln_time_mean_bkg = ', sdobsgroup%ltime_mean_bkg |
---|
441 | WRITE(numout,*) ' Meaning period (hours) for time-mean bkg rn_time_mean_period = ', sdobsgroup%rtime_mean_period |
---|
442 | WRITE(numout,*) ' Logical switch for bias correction ln_obsbias = ', sdobsgroup%lobsbias |
---|
443 | IF ( sdobsgroup%lobsbias ) THEN |
---|
444 | WRITE(numout,*) ' Observation type to be bias corrected cn_type_to_biascorrect = ', TRIM(sdobsgroup%cobstypes(sdobsgroup%nbiasvar)) |
---|
445 | WRITE(numout,*) ' Bias variable name in bias files cn_obsbiasfile_varname = ', TRIM(sdobsgroup%cbiasvarname) |
---|
446 | WRITE(numout,*) ' Bias files in group:', sdobsgroup%nobsbiasfiles |
---|
447 | DO jfile = 1, sdobsgroup%nobsbiasfiles |
---|
448 | WRITE(numout,*) ' ', TRIM(sdobsgroup%cobsbiasfiles(jfile)) |
---|
449 | END DO |
---|
450 | ENDIF |
---|
451 | WRITE(numout,*) ' Settings only for profile data, which is ', sdobsgroup%lprof |
---|
452 | WRITE(numout,*) ' Type of vertical interpolation method nn_1dint = ', sdobsgroup%n1dint |
---|
453 | WRITE(numout,*) ' Daily average types nn_profdavtypes = ', sdobsgroup%nprofdavtypes |
---|
454 | WRITE(numout,*) ' Logical switch to compute all vars at all pts ln_all_at_all = ', sdobsgroup%lall_at_all |
---|
455 | WRITE(numout,*) ' Settings only for SLA data, which is ', sdobsgroup%lsla |
---|
456 | WRITE(numout,*) ' Logical switch for alt bias ln_altbias = ', sdobsgroup%laltbias |
---|
457 | WRITE(numout,*) ' Alt bias file name cn_altbiasfile = ', TRIM(sdobsgroup%caltbiasfile) |
---|
458 | WRITE(numout,*) ' MSSH correction scheme nn_msshc = ', sdobsgroup%nmsshc |
---|
459 | WRITE(numout,*) ' MDT correction rn_mdtcorr = ', sdobsgroup%rmdtcorr |
---|
460 | WRITE(numout,*) ' MDT cutoff for computed correction rn_mdtcutoff = ', sdobsgroup%rmdtcutoff |
---|
461 | WRITE(numout,*) ' Settings only for temperature/salinity data' |
---|
462 | WRITE(numout,*) ' Logical switch for outputting climatology ln_output_clim = ', sdobsgroup%loutput_clim |
---|
463 | |
---|
464 | IF ( ( sdobsgroup%lsurf .AND. sdobsgroup%lprof ) .OR. & |
---|
465 | & ( .NOT. sdobsgroup%lsurf .AND. .NOT. sdobsgroup%lprof ) ) THEN |
---|
466 | CALL ctl_stop( ' One and only one of ln_surf or ln_prof must be set per observation group' ) |
---|
467 | ENDIF |
---|
468 | |
---|
469 | IF ( sdobsgroup%nobstypes == 0 ) THEN |
---|
470 | CALL ctl_stop( ' No observation types specified for this observation group' ) |
---|
471 | ENDIF |
---|
472 | |
---|
473 | IF ( sdobsgroup%nobsfiles == 0 ) THEN |
---|
474 | CALL ctl_stop( ' No observation files specified for this observation group' ) |
---|
475 | ENDIF |
---|
476 | |
---|
477 | IF ( (sdobsgroup%lobsbias) .AND. (sdobsgroup%nobsbiasfiles == 0) ) THEN |
---|
478 | CALL ctl_stop( ' No bias files specified for this observation group' ) |
---|
479 | ENDIF |
---|
480 | |
---|
481 | IF ( (sdobsgroup%n2dint < 0) .OR. (sdobsgroup%n2dint > 6) ) THEN |
---|
482 | CALL ctl_stop( ' Invalid horizontal interpolation type' ) |
---|
483 | ENDIF |
---|
484 | |
---|
485 | IF( (sdobsgroup%n1dint < 0) .OR. (sdobsgroup%n1dint > 1) ) THEN |
---|
486 | CALL ctl_stop(' Invalid vertical interpolation type') |
---|
487 | ENDIF |
---|
488 | |
---|
489 | IF ( (sdobsgroup%n2dint > 4) .AND. (sdobsgroup%n2dint <= 6) ) THEN |
---|
490 | IF ( sdobsgroup%ravglamscl <= 0._wp ) THEN |
---|
491 | CALL ctl_stop( ' Incorrect value set for averaging footprint scale rn_avglamscl' ) |
---|
492 | ENDIF |
---|
493 | IF ( sdobsgroup%ravgphiscl <= 0._wp ) THEN |
---|
494 | CALL ctl_stop( ' Incorrect value set for averaging footprint scale rn_avgphiscl' ) |
---|
495 | ENDIF |
---|
496 | ENDIF |
---|
497 | |
---|
498 | ! Various other checks of combined options |
---|
499 | |
---|
500 | ENDIF |
---|
501 | |
---|
502 | ENDIF |
---|
503 | |
---|
504 | END SUBROUTINE obs_group_check |
---|
505 | |
---|
506 | END MODULE obs_group_def |
---|