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