1 | MODULE diaobs |
---|
2 | !!====================================================================== |
---|
3 | !! *** MODULE diaobs *** |
---|
4 | !! Observation diagnostics: Computation of the misfit between data and |
---|
5 | !! their model equivalent |
---|
6 | !!====================================================================== |
---|
7 | |
---|
8 | !!---------------------------------------------------------------------- |
---|
9 | !! dia_obs_init : Reading and prepare observations |
---|
10 | !! dia_obs : Compute model equivalent to observations |
---|
11 | !! dia_obs_wri : Write observational diagnostics |
---|
12 | !! ini_date : Compute the initial date YYYYMMDD.HHMMSS |
---|
13 | !! fin_date : Compute the final date YYYYMMDD.HHMMSS |
---|
14 | !!---------------------------------------------------------------------- |
---|
15 | !! * Modules used |
---|
16 | USE wrk_nemo ! Memory Allocation |
---|
17 | USE par_kind ! Precision variables |
---|
18 | USE in_out_manager ! I/O manager |
---|
19 | USE par_oce |
---|
20 | USE dom_oce ! Ocean space and time domain variables |
---|
21 | USE obs_read_prof ! Reading and allocation of profile obs |
---|
22 | USE obs_read_surf ! Reading and allocation of surface obs |
---|
23 | USE obs_readmdt ! Reading and allocation of MDT for SLA. |
---|
24 | USE obs_readsnowdepth ! Get model snow depth for conversion of freeboard to ice thickness |
---|
25 | USE obs_prep ! Preparation of obs. (grid search etc). |
---|
26 | USE obs_oper ! Observation operators |
---|
27 | USE obs_write ! Writing of observation related diagnostics |
---|
28 | USE obs_grid ! Grid searching |
---|
29 | USE obs_read_altbias ! Bias treatment for altimeter |
---|
30 | USE obs_sstbias ! Bias correction routine for SST |
---|
31 | USE obs_profiles_def ! Profile data definitions |
---|
32 | USE obs_surf_def ! Surface data definitions |
---|
33 | USE obs_types ! Definitions for observation types |
---|
34 | USE mpp_map ! MPP mapping |
---|
35 | USE lib_mpp ! For ctl_warn/stop |
---|
36 | USE tradmp ! For climatological temperature & salinity |
---|
37 | |
---|
38 | IMPLICIT NONE |
---|
39 | |
---|
40 | !! * Routine accessibility |
---|
41 | PRIVATE |
---|
42 | PUBLIC dia_obs_init, & ! Initialize and read observations |
---|
43 | & dia_obs, & ! Compute model equivalent to observations |
---|
44 | & dia_obs_wri, & ! Write model equivalent to observations |
---|
45 | & dia_obs_dealloc ! Deallocate dia_obs data |
---|
46 | |
---|
47 | !! * Module variables |
---|
48 | LOGICAL, PUBLIC :: & |
---|
49 | & lk_diaobs = .TRUE. !: Include this for backwards compatibility at NEMO 3.6. |
---|
50 | LOGICAL :: ln_diaobs !: Logical switch for the obs operator |
---|
51 | LOGICAL :: ln_sstnight !: Logical switch for night mean SST obs |
---|
52 | LOGICAL :: ln_default_fp_indegs !: T=> Default obs footprint size specified in degrees, F=> in metres |
---|
53 | LOGICAL :: ln_sla_fp_indegs !: T=> SLA obs footprint size specified in degrees, F=> in metres |
---|
54 | LOGICAL :: ln_sst_fp_indegs !: T=> SST obs footprint size specified in degrees, F=> in metres |
---|
55 | LOGICAL :: ln_sss_fp_indegs !: T=> SSS obs footprint size specified in degrees, F=> in metres |
---|
56 | LOGICAL :: ln_ssv_fp_indegs !: T=> SSV obs footprint size specified in degrees, F=> in metres |
---|
57 | LOGICAL :: ln_sic_fp_indegs !: T=> SIC obs footprint size specified in degrees, F=> in metres |
---|
58 | LOGICAL :: ln_sit_fp_indegs !: T=> SIT obs footprint size specified in degrees, F=> in metres |
---|
59 | LOGICAL :: ln_fbd_fp_indegs !: T=> SIT obs footprint size specified in degrees, F=> in metres |
---|
60 | LOGICAL :: ln_output_clim !: Logical switch for interpolating and writing T/S climatology |
---|
61 | LOGICAL :: ln_time_mean_sla_bkg !: Logical switch for applying time mean of SLA background to remove tidal signal |
---|
62 | |
---|
63 | REAL(wp) :: rn_default_avglamscl !: Default E/W diameter of observation footprint |
---|
64 | REAL(wp) :: rn_default_avgphiscl !: Default N/S diameter of observation footprint |
---|
65 | REAL(wp) :: rn_sla_avglamscl !: E/W diameter of SLA observation footprint |
---|
66 | REAL(wp) :: rn_sla_avgphiscl !: N/S diameter of SLA observation footprint |
---|
67 | REAL(wp) :: rn_sst_avglamscl !: E/W diameter of SST observation footprint |
---|
68 | REAL(wp) :: rn_sst_avgphiscl !: N/S diameter of SST observation footprint |
---|
69 | REAL(wp) :: rn_sss_avglamscl !: E/W diameter of SSS observation footprint |
---|
70 | REAL(wp) :: rn_sss_avgphiscl !: N/S diameter of SSS observation footprint |
---|
71 | REAL(wp) :: rn_ssv_avglamscl !: E/W diameter of SSV observation footprint |
---|
72 | REAL(wp) :: rn_ssv_avgphiscl !: N/S diameter of SSV observation footprint |
---|
73 | REAL(wp) :: rn_sic_avglamscl !: E/W diameter of SIC observation footprint |
---|
74 | REAL(wp) :: rn_sic_avgphiscl !: N/S diameter of SIC observation footprint |
---|
75 | REAL(wp) :: rn_sit_avglamscl !: E/W diameter of SIT observation footprint |
---|
76 | REAL(wp) :: rn_sit_avgphiscl !: N/S diameter of SIT observation footprint |
---|
77 | REAL(wp) :: rn_fbd_avglamscl !: E/W diameter of FBD observation footprint |
---|
78 | REAL(wp) :: rn_fbd_avgphiscl !: N/S diameter of FBD observation footprint |
---|
79 | REAL(wp), PUBLIC :: & |
---|
80 | & MeanPeriodHours = 24. + (5./6.) !: Meaning period for surface data. |
---|
81 | |
---|
82 | |
---|
83 | INTEGER :: nn_1dint !: Vertical interpolation method |
---|
84 | INTEGER :: nn_2dint_default !: Default horizontal interpolation method |
---|
85 | INTEGER :: nn_2dint_sla !: SLA horizontal interpolation method (-1 = default) |
---|
86 | INTEGER :: nn_2dint_sst !: SST horizontal interpolation method (-1 = default) |
---|
87 | INTEGER :: nn_2dint_sss !: SSS horizontal interpolation method (-1 = default) |
---|
88 | INTEGER :: nn_2dint_ssv !: SSV horizontal interpolation method (-1 = default) |
---|
89 | INTEGER :: nn_2dint_sic !: SIC horizontal interpolation method (-1 = default) |
---|
90 | INTEGER :: nn_2dint_sit !: SIT horizontal interpolation method (-1 = default) |
---|
91 | INTEGER :: nn_2dint_fbd !: FBD horizontal interpolation method (-1 = default) |
---|
92 | |
---|
93 | INTEGER, DIMENSION(imaxavtypes) :: & |
---|
94 | & nn_profdavtypes !: Profile data types representing a daily average |
---|
95 | INTEGER :: nproftypes !: Number of profile obs types |
---|
96 | INTEGER :: nsurftypes !: Number of surface obs types |
---|
97 | INTEGER, DIMENSION(:), ALLOCATABLE :: & |
---|
98 | & nvarsprof, & !: Number of profile variables |
---|
99 | & nvarssurf !: Number of surface variables |
---|
100 | INTEGER, DIMENSION(:), ALLOCATABLE :: & |
---|
101 | & nextrprof, & !: Number of profile extra variables |
---|
102 | & nextrsurf !: Number of surface extra variables |
---|
103 | INTEGER, DIMENSION(:), ALLOCATABLE :: & |
---|
104 | & n2dintsurf !: Interpolation option for surface variables |
---|
105 | REAL(wp), DIMENSION(:), ALLOCATABLE :: & |
---|
106 | & ravglamscl, & !: E/W diameter of averaging footprint for surface variables |
---|
107 | & ravgphiscl !: N/S diameter of averaging footprint for surface variables |
---|
108 | LOGICAL, DIMENSION(:), ALLOCATABLE :: & |
---|
109 | & lfpindegs, & !: T=> surface obs footprint size specified in degrees, F=> in metres |
---|
110 | & llnightav !: Logical for calculating night-time averages |
---|
111 | |
---|
112 | TYPE(obs_surf), PUBLIC, POINTER, DIMENSION(:) :: & |
---|
113 | & surfdata, & !: Initial surface data |
---|
114 | & surfdataqc !: Surface data after quality control |
---|
115 | TYPE(obs_prof), PUBLIC, POINTER, DIMENSION(:) :: & |
---|
116 | & profdata, & !: Initial profile data |
---|
117 | & profdataqc !: Profile data after quality control |
---|
118 | |
---|
119 | CHARACTER(len=8), PUBLIC, DIMENSION(:), ALLOCATABLE :: & |
---|
120 | & cobstypesprof, & !: Profile obs types |
---|
121 | & cobstypessurf !: Surface obs types |
---|
122 | |
---|
123 | !!---------------------------------------------------------------------- |
---|
124 | !! NEMO/OPA 3.3 , NEMO Consortium (2010) |
---|
125 | !! $Id$ |
---|
126 | !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt) |
---|
127 | !!---------------------------------------------------------------------- |
---|
128 | |
---|
129 | !! * Substitutions |
---|
130 | # include "domzgr_substitute.h90" |
---|
131 | CONTAINS |
---|
132 | |
---|
133 | SUBROUTINE dia_obs_init |
---|
134 | !!---------------------------------------------------------------------- |
---|
135 | !! *** ROUTINE dia_obs_init *** |
---|
136 | !! |
---|
137 | !! ** Purpose : Initialize and read observations |
---|
138 | !! |
---|
139 | !! ** Method : Read the namelist and call reading routines |
---|
140 | !! |
---|
141 | !! ** Action : Read the namelist and call reading routines |
---|
142 | !! |
---|
143 | !! History : |
---|
144 | !! ! 06-03 (K. Mogensen) Original code |
---|
145 | !! ! 06-05 (A. Weaver) Reformatted |
---|
146 | !! ! 06-10 (A. Weaver) Cleaning and add controls |
---|
147 | !! ! 07-03 (K. Mogensen) General handling of profiles |
---|
148 | !! ! 14-08 (J.While) Incorporated SST bias correction |
---|
149 | !! ! 15-02 (M. Martin) Simplification of namelist and code |
---|
150 | !!---------------------------------------------------------------------- |
---|
151 | #if defined key_cice |
---|
152 | USE sbc_oce, ONLY : & ! CICE variables |
---|
153 | & thick_s ! snow depth for freeboard conversion |
---|
154 | #endif |
---|
155 | |
---|
156 | IMPLICIT NONE |
---|
157 | |
---|
158 | !! * Local declarations |
---|
159 | INTEGER, PARAMETER :: & |
---|
160 | & jpmaxnfiles = 1000 ! Maximum number of files for each obs type |
---|
161 | INTEGER, DIMENSION(:), ALLOCATABLE :: & |
---|
162 | & ifilesprof, & ! Number of profile files |
---|
163 | & ifilessurf ! Number of surface files |
---|
164 | INTEGER :: ios ! Local integer output status for namelist read |
---|
165 | INTEGER :: jtype ! Counter for obs types |
---|
166 | INTEGER :: jvar ! Counter for variables |
---|
167 | INTEGER :: jfile ! Counter for files |
---|
168 | INTEGER :: jnumsstbias ! Number of SST bias files to read and apply |
---|
169 | INTEGER :: n2dint_type ! Local version of nn_2dint* |
---|
170 | |
---|
171 | CHARACTER(len=128), DIMENSION(jpmaxnfiles) :: & |
---|
172 | & cn_profbfiles, & ! T/S profile input filenames |
---|
173 | & cn_sstfbfiles, & ! Sea surface temperature input filenames |
---|
174 | & cn_slafbfiles, & ! Sea level anomaly input filenames |
---|
175 | & cn_sicfbfiles, & ! Seaice concentration input filenames |
---|
176 | & cn_sitfbfiles, & ! Seaice thickness input filenames |
---|
177 | & cn_fbdfbfiles, & ! Seaice freeboard input filenames |
---|
178 | & cn_velfbfiles, & ! Velocity profile input filenames |
---|
179 | & cn_sssfbfiles, & ! Sea surface salinity input filenames |
---|
180 | & cn_ssvfbfiles, & ! Sea surface velocity input filenames |
---|
181 | & cn_slchltotfbfiles, & ! Surface total log10(chlorophyll) input filenames |
---|
182 | & cn_slchldiafbfiles, & ! Surface diatom log10(chlorophyll) input filenames |
---|
183 | & cn_slchlnonfbfiles, & ! Surface non-diatom log10(chlorophyll) input filenames |
---|
184 | & cn_slchldinfbfiles, & ! Surface dinoflagellate log10(chlorophyll) input filenames |
---|
185 | & cn_slchlmicfbfiles, & ! Surface microphytoplankton log10(chlorophyll) input filenames |
---|
186 | & cn_slchlnanfbfiles, & ! Surface nanophytoplankton log10(chlorophyll) input filenames |
---|
187 | & cn_slchlpicfbfiles, & ! Surface picophytoplankton log10(chlorophyll) input filenames |
---|
188 | & cn_schltotfbfiles, & ! Surface total chlorophyll input filenames |
---|
189 | & cn_slphytotfbfiles, & ! Surface total log10(phytoplankton carbon) input filenames |
---|
190 | & cn_slphydiafbfiles, & ! Surface diatom log10(phytoplankton carbon) input filenames |
---|
191 | & cn_slphynonfbfiles, & ! Surface non-diatom log10(phytoplankton carbon) input filenames |
---|
192 | & cn_sspmfbfiles, & ! Surface suspended particulate matter input filenames |
---|
193 | & cn_skd490fbfiles, & ! Surface Kd490 input filenames |
---|
194 | & cn_sfco2fbfiles, & ! Surface fugacity of carbon dioxide input filenames |
---|
195 | & cn_spco2fbfiles, & ! Surface partial pressure of carbon dioxide input filenames |
---|
196 | & cn_plchltotfbfiles, & ! Profile total log10(chlorophyll) input filenames |
---|
197 | & cn_pchltotfbfiles, & ! Profile total chlorophyll input filenames |
---|
198 | & cn_pno3fbfiles, & ! Profile nitrate input filenames |
---|
199 | & cn_psi4fbfiles, & ! Profile silicate input filenames |
---|
200 | & cn_ppo4fbfiles, & ! Profile phosphate input filenames |
---|
201 | & cn_pdicfbfiles, & ! Profile dissolved inorganic carbon input filenames |
---|
202 | & cn_palkfbfiles, & ! Profile alkalinity input filenames |
---|
203 | & cn_pphfbfiles, & ! Profile pH input filenames |
---|
204 | & cn_po2fbfiles, & ! Profile dissolved oxygen input filenames |
---|
205 | & cn_sstbiasfiles ! SST bias input filenames |
---|
206 | |
---|
207 | CHARACTER(LEN=128) :: & |
---|
208 | & cn_altbiasfile ! Altimeter bias input filename |
---|
209 | |
---|
210 | |
---|
211 | LOGICAL :: ln_seaicetypes = .FALSE. ! Logical switch indicating data type is sea ice |
---|
212 | LOGICAL :: ln_t3d ! Logical switch for temperature profiles |
---|
213 | LOGICAL :: ln_s3d ! Logical switch for salinity profiles |
---|
214 | LOGICAL :: ln_sla ! Logical switch for sea level anomalies |
---|
215 | LOGICAL :: ln_sst ! Logical switch for sea surface temperature |
---|
216 | LOGICAL :: ln_sic ! Logical switch for sea ice concentration |
---|
217 | LOGICAL :: ln_sit ! Logical switch for sea ice thickness |
---|
218 | LOGICAL :: ln_fbd ! Logical switch for sea ice freeboard |
---|
219 | LOGICAL :: ln_sss ! Logical switch for sea surface salinity obs |
---|
220 | LOGICAL :: ln_ssv ! Logical switch for sea surface velocity obs |
---|
221 | LOGICAL :: ln_vel3d ! Logical switch for velocity (u,v) obs |
---|
222 | LOGICAL :: ln_slchltot ! Logical switch for surface total log10(chlorophyll) obs |
---|
223 | LOGICAL :: ln_slchldia ! Logical switch for surface diatom log10(chlorophyll) obs |
---|
224 | LOGICAL :: ln_slchlnon ! Logical switch for surface non-diatom log10(chlorophyll) obs |
---|
225 | LOGICAL :: ln_slchldin ! Logical switch for surface dinoflagellate log10(chlorophyll) obs |
---|
226 | LOGICAL :: ln_slchlmic ! Logical switch for surface microphytoplankton log10(chlorophyll) obs |
---|
227 | LOGICAL :: ln_slchlnan ! Logical switch for surface nanophytoplankton log10(chlorophyll) obs |
---|
228 | LOGICAL :: ln_slchlpic ! Logical switch for surface picophytoplankton log10(chlorophyll) obs |
---|
229 | LOGICAL :: ln_schltot ! Logical switch for surface total chlorophyll obs |
---|
230 | LOGICAL :: ln_slphytot ! Logical switch for surface total log10(phytoplankton carbon) obs |
---|
231 | LOGICAL :: ln_slphydia ! Logical switch for surface diatom log10(phytoplankton carbon) obs |
---|
232 | LOGICAL :: ln_slphynon ! Logical switch for surface non-diatom log10(phytoplankton carbon) obs |
---|
233 | LOGICAL :: ln_sspm ! Logical switch for surface suspended particulate matter obs |
---|
234 | LOGICAL :: ln_skd490 ! Logical switch for surface Kd490 |
---|
235 | LOGICAL :: ln_sfco2 ! Logical switch for surface fugacity of carbon dioxide obs |
---|
236 | LOGICAL :: ln_spco2 ! Logical switch for surface partial pressure of carbon dioxide obs |
---|
237 | LOGICAL :: ln_plchltot ! Logical switch for profile total log10(chlorophyll) obs |
---|
238 | LOGICAL :: ln_pchltot ! Logical switch for profile total chlorophyll obs |
---|
239 | LOGICAL :: ln_pno3 ! Logical switch for profile nitrate obs |
---|
240 | LOGICAL :: ln_psi4 ! Logical switch for profile silicate obs |
---|
241 | LOGICAL :: ln_ppo4 ! Logical switch for profile phosphate obs |
---|
242 | LOGICAL :: ln_pdic ! Logical switch for profile dissolved inorganic carbon obs |
---|
243 | LOGICAL :: ln_palk ! Logical switch for profile alkalinity obs |
---|
244 | LOGICAL :: ln_pph ! Logical switch for profile pH obs |
---|
245 | LOGICAL :: ln_po2 ! Logical switch for profile dissolved oxygen obs |
---|
246 | LOGICAL :: ln_nea ! Logical switch to remove obs near land |
---|
247 | LOGICAL :: ln_altbias ! Logical switch for altimeter bias |
---|
248 | LOGICAL :: ln_sstbias ! Logical switch for bias correction of SST |
---|
249 | LOGICAL :: ln_ignmis ! Logical switch for ignoring missing files |
---|
250 | LOGICAL :: ln_s_at_t ! Logical switch to compute model S at T obs |
---|
251 | LOGICAL :: ln_bound_reject ! Logical switch for rejecting obs near the boundary |
---|
252 | |
---|
253 | REAL(dp) :: rn_dobsini ! Obs window start date YYYYMMDD.HHMMSS |
---|
254 | REAL(dp) :: rn_dobsend ! Obs window end date YYYYMMDD.HHMMSS |
---|
255 | |
---|
256 | REAL(wp) :: ztype_avglamscl ! Local version of rn_*_avglamscl |
---|
257 | REAL(wp) :: ztype_avgphiscl ! Local version of rn_*_avgphiscl |
---|
258 | |
---|
259 | CHARACTER(len=128), DIMENSION(:,:), ALLOCATABLE :: & |
---|
260 | & clproffiles, & ! Profile filenames |
---|
261 | & clsurffiles ! Surface filenames |
---|
262 | CHARACTER(len=8), DIMENSION(:), ALLOCATABLE :: clvars ! Expected variable names |
---|
263 | |
---|
264 | LOGICAL, DIMENSION(:), ALLOCATABLE :: llvar ! Logical for profile variable read |
---|
265 | LOGICAL :: ltype_fp_indegs ! Local version of ln_*_fp_indegs |
---|
266 | LOGICAL :: ltype_night ! Local version of ln_sstnight (false for other variables) |
---|
267 | LOGICAL :: ltype_clim ! Local version of ln_output_clim |
---|
268 | |
---|
269 | REAL(wp), POINTER, DIMENSION(:,:,:) :: & |
---|
270 | & zglam ! Model longitudes for profile variables |
---|
271 | REAL(wp), POINTER, DIMENSION(:,:,:) :: & |
---|
272 | & zgphi ! Model latitudes for profile variables |
---|
273 | REAL(wp), POINTER, DIMENSION(:,:,:,:) :: & |
---|
274 | & zmask ! Model land/sea mask associated with variables |
---|
275 | REAL(wp), POINTER, DIMENSION(:,:,:) :: & |
---|
276 | & zmask_surf ! Surface model land/sea mask associated with variables |
---|
277 | |
---|
278 | |
---|
279 | NAMELIST/namobs/ln_diaobs, ln_t3d, ln_s3d, ln_sla, & |
---|
280 | & ln_sst, ln_sic, ln_sit, ln_fbd, & |
---|
281 | & ln_sss, ln_ssv, ln_vel3d, & |
---|
282 | & ln_slchltot, ln_slchldia, ln_slchlnon, & |
---|
283 | & ln_slchldin, ln_slchlmic, ln_slchlnan, & |
---|
284 | & ln_slchlpic, ln_schltot, & |
---|
285 | & ln_slphytot, ln_slphydia, ln_slphynon, & |
---|
286 | & ln_sspm, ln_sfco2, ln_spco2, & |
---|
287 | & ln_skd490, & |
---|
288 | & ln_plchltot, ln_pchltot, ln_pno3, & |
---|
289 | & ln_psi4, ln_ppo4, ln_pdic, & |
---|
290 | & ln_palk, ln_pph, ln_po2, & |
---|
291 | & ln_altbias, ln_sstbias, ln_nea, & |
---|
292 | & ln_grid_global, ln_grid_search_lookup, & |
---|
293 | & ln_ignmis, ln_s_at_t, ln_bound_reject, & |
---|
294 | & ln_sstnight, ln_output_clim, & |
---|
295 | & ln_time_mean_sla_bkg, ln_default_fp_indegs, & |
---|
296 | & ln_sla_fp_indegs, ln_sst_fp_indegs, & |
---|
297 | & ln_sss_fp_indegs, ln_ssv_fp_indegs, & |
---|
298 | & ln_sic_fp_indegs, ln_sit_fp_indegs, & |
---|
299 | & ln_fbd_fp_indegs, & |
---|
300 | & cn_profbfiles, cn_slafbfiles, & |
---|
301 | & cn_sstfbfiles, cn_sicfbfiles, & |
---|
302 | & cn_sitfbfiles, cn_fbdfbfiles, & |
---|
303 | & cn_velfbfiles, cn_sssfbfiles, cn_ssvfbfiles, & |
---|
304 | & cn_slchltotfbfiles, cn_slchldiafbfiles, & |
---|
305 | & cn_slchlnonfbfiles, cn_slchldinfbfiles, & |
---|
306 | & cn_slchlmicfbfiles, cn_slchlnanfbfiles, & |
---|
307 | & cn_slchlpicfbfiles, cn_schltotfbfiles, & |
---|
308 | & cn_slphytotfbfiles, cn_slphydiafbfiles, & |
---|
309 | & cn_slphynonfbfiles, cn_sspmfbfiles, & |
---|
310 | & cn_skd490fbfiles, & |
---|
311 | & cn_sfco2fbfiles, cn_spco2fbfiles, & |
---|
312 | & cn_plchltotfbfiles, cn_pchltotfbfiles, & |
---|
313 | & cn_pno3fbfiles, cn_psi4fbfiles, cn_ppo4fbfiles, & |
---|
314 | & cn_pdicfbfiles, cn_palkfbfiles, cn_pphfbfiles, & |
---|
315 | & cn_po2fbfiles, & |
---|
316 | & cn_sstbiasfiles, cn_altbiasfile, & |
---|
317 | & cn_gridsearchfile, rn_gridsearchres, & |
---|
318 | & rn_dobsini, rn_dobsend, & |
---|
319 | & rn_default_avglamscl, rn_default_avgphiscl, & |
---|
320 | & rn_sla_avglamscl, rn_sla_avgphiscl, & |
---|
321 | & rn_sst_avglamscl, rn_sst_avgphiscl, & |
---|
322 | & rn_sss_avglamscl, rn_sss_avgphiscl, & |
---|
323 | & rn_ssv_avglamscl, rn_ssv_avgphiscl, & |
---|
324 | & rn_sic_avglamscl, rn_sic_avgphiscl, & |
---|
325 | & rn_sit_avglamscl, rn_sit_avgphiscl, & |
---|
326 | & rn_fbd_avglamscl, rn_fbd_avgphiscl, & |
---|
327 | & nn_1dint, nn_2dint_default, & |
---|
328 | & nn_2dint_sla, nn_2dint_sst, & |
---|
329 | & nn_2dint_sss, nn_2dint_ssv, & |
---|
330 | & nn_2dint_sic, nn_2dint_sit, & |
---|
331 | & nn_2dint_fbd, & |
---|
332 | & nn_msshc, rn_mdtcorr, rn_mdtcutoff, & |
---|
333 | & nn_profdavtypes |
---|
334 | |
---|
335 | !----------------------------------------------------------------------- |
---|
336 | ! Read namelist parameters |
---|
337 | !----------------------------------------------------------------------- |
---|
338 | |
---|
339 | ! Some namelist arrays need initialising |
---|
340 | cn_profbfiles(:) = '' |
---|
341 | cn_slafbfiles(:) = '' |
---|
342 | cn_sstfbfiles(:) = '' |
---|
343 | cn_sicfbfiles(:) = '' |
---|
344 | cn_sitfbfiles(:) = '' |
---|
345 | cn_fbdfbfiles(:) = '' |
---|
346 | cn_velfbfiles(:) = '' |
---|
347 | cn_sssfbfiles(:) = '' |
---|
348 | cn_ssvfbfiles(:) = '' |
---|
349 | cn_slchltotfbfiles(:) = '' |
---|
350 | cn_slchldiafbfiles(:) = '' |
---|
351 | cn_slchlnonfbfiles(:) = '' |
---|
352 | cn_slchldinfbfiles(:) = '' |
---|
353 | cn_slchlmicfbfiles(:) = '' |
---|
354 | cn_slchlnanfbfiles(:) = '' |
---|
355 | cn_slchlpicfbfiles(:) = '' |
---|
356 | cn_schltotfbfiles(:) = '' |
---|
357 | cn_slphytotfbfiles(:) = '' |
---|
358 | cn_slphydiafbfiles(:) = '' |
---|
359 | cn_slphynonfbfiles(:) = '' |
---|
360 | cn_sspmfbfiles(:) = '' |
---|
361 | cn_skd490fbfiles(:) = '' |
---|
362 | cn_sfco2fbfiles(:) = '' |
---|
363 | cn_spco2fbfiles(:) = '' |
---|
364 | cn_plchltotfbfiles(:) = '' |
---|
365 | cn_pchltotfbfiles(:) = '' |
---|
366 | cn_pno3fbfiles(:) = '' |
---|
367 | cn_psi4fbfiles(:) = '' |
---|
368 | cn_ppo4fbfiles(:) = '' |
---|
369 | cn_pdicfbfiles(:) = '' |
---|
370 | cn_palkfbfiles(:) = '' |
---|
371 | cn_pphfbfiles(:) = '' |
---|
372 | cn_po2fbfiles(:) = '' |
---|
373 | cn_sstbiasfiles(:) = '' |
---|
374 | nn_profdavtypes(:) = -1 |
---|
375 | |
---|
376 | CALL ini_date( rn_dobsini ) |
---|
377 | CALL fin_date( rn_dobsend ) |
---|
378 | |
---|
379 | ! Read namelist namobs : control observation diagnostics |
---|
380 | REWIND( numnam_ref ) ! Namelist namobs in reference namelist |
---|
381 | READ ( numnam_ref, namobs, IOSTAT = ios, ERR = 901) |
---|
382 | 901 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namobs in reference namelist', lwp ) |
---|
383 | |
---|
384 | REWIND( numnam_cfg ) ! Namelist namobs in configuration namelist |
---|
385 | READ ( numnam_cfg, namobs, IOSTAT = ios, ERR = 902 ) |
---|
386 | 902 IF( ios /= 0 ) CALL ctl_nam ( ios , 'namobs in configuration namelist', lwp ) |
---|
387 | IF(lwm) WRITE ( numond, namobs ) |
---|
388 | |
---|
389 | lk_diaobs = .FALSE. |
---|
390 | #if defined key_diaobs |
---|
391 | IF ( ln_diaobs ) lk_diaobs = .TRUE. |
---|
392 | #endif |
---|
393 | |
---|
394 | IF ( .NOT. lk_diaobs ) THEN |
---|
395 | IF(lwp) WRITE(numout,cform_war) |
---|
396 | IF(lwp) WRITE(numout,*)' ln_diaobs is set to false or key_diaobs is not set, so not calling dia_obs' |
---|
397 | RETURN |
---|
398 | ENDIF |
---|
399 | |
---|
400 | IF(lwp) THEN |
---|
401 | WRITE(numout,*) |
---|
402 | WRITE(numout,*) 'dia_obs_init : Observation diagnostic initialization' |
---|
403 | WRITE(numout,*) '~~~~~~~~~~~~' |
---|
404 | WRITE(numout,*) ' Namelist namobs : set observation diagnostic parameters' |
---|
405 | WRITE(numout,*) ' Logical switch for T profile observations ln_t3d = ', ln_t3d |
---|
406 | WRITE(numout,*) ' Logical switch for S profile observations ln_s3d = ', ln_s3d |
---|
407 | WRITE(numout,*) ' Logical switch for SLA observations ln_sla = ', ln_sla |
---|
408 | WRITE(numout,*) ' Logical switch for SST observations ln_sst = ', ln_sst |
---|
409 | WRITE(numout,*) ' Logical switch for SIC observations ln_sic = ', ln_sic |
---|
410 | WRITE(numout,*) ' Logical switch for SIT observations ln_sit = ', ln_sit |
---|
411 | WRITE(numout,*) ' Logical switch for FBD observations ln_fbd = ', ln_fbd |
---|
412 | WRITE(numout,*) ' Logical switch for velocity observations ln_vel3d = ', ln_vel3d |
---|
413 | WRITE(numout,*) ' Logical switch for SSS observations ln_sss = ', ln_sss |
---|
414 | WRITE(numout,*) ' Logical switch for SSV observations ln_ssv = ', ln_ssv |
---|
415 | WRITE(numout,*) ' Logical switch for surface total logchl obs ln_slchltot = ', ln_slchltot |
---|
416 | WRITE(numout,*) ' Logical switch for surface diatom logchl obs ln_slchldia = ', ln_slchldia |
---|
417 | WRITE(numout,*) ' Logical switch for surface non-diatom logchl obs ln_slchlnon = ', ln_slchlnon |
---|
418 | WRITE(numout,*) ' Logical switch for surface dino logchl obs ln_slchldin = ', ln_slchldin |
---|
419 | WRITE(numout,*) ' Logical switch for surface micro logchl obs ln_slchlmic = ', ln_slchlmic |
---|
420 | WRITE(numout,*) ' Logical switch for surface nano logchl obs ln_slchlnan = ', ln_slchlnan |
---|
421 | WRITE(numout,*) ' Logical switch for surface pico logchl obs ln_slchlpic = ', ln_slchlpic |
---|
422 | WRITE(numout,*) ' Logical switch for surface total chl obs ln_schltot = ', ln_schltot |
---|
423 | WRITE(numout,*) ' Logical switch for surface total log(phyC) obs ln_slphytot = ', ln_slphytot |
---|
424 | WRITE(numout,*) ' Logical switch for surface diatom log(phyC) obs ln_slphydia = ', ln_slphydia |
---|
425 | WRITE(numout,*) ' Logical switch for surface non-diatom log(phyC) obs ln_slphynon = ', ln_slphynon |
---|
426 | WRITE(numout,*) ' Logical switch for surface SPM observations ln_sspm = ', ln_sspm |
---|
427 | WRITE(numout,*) ' Logical switch for surface Kd490 observations ln_skd490 = ', ln_skd490 |
---|
428 | WRITE(numout,*) ' Logical switch for surface fCO2 observations ln_sfco2 = ', ln_sfco2 |
---|
429 | WRITE(numout,*) ' Logical switch for surface pCO2 observations ln_spco2 = ', ln_spco2 |
---|
430 | WRITE(numout,*) ' Logical switch for profile total logchl obs ln_plchltot = ', ln_plchltot |
---|
431 | WRITE(numout,*) ' Logical switch for profile total chl obs ln_pchltot = ', ln_pchltot |
---|
432 | WRITE(numout,*) ' Logical switch for profile nitrate obs ln_pno3 = ', ln_pno3 |
---|
433 | WRITE(numout,*) ' Logical switch for profile silicate obs ln_psi4 = ', ln_psi4 |
---|
434 | WRITE(numout,*) ' Logical switch for profile phosphate obs ln_ppo4 = ', ln_ppo4 |
---|
435 | WRITE(numout,*) ' Logical switch for profile DIC obs ln_pdic = ', ln_pdic |
---|
436 | WRITE(numout,*) ' Logical switch for profile alkalinity obs ln_palk = ', ln_palk |
---|
437 | WRITE(numout,*) ' Logical switch for profile pH obs ln_pph = ', ln_pph |
---|
438 | WRITE(numout,*) ' Logical switch for profile oxygen obs ln_po2 = ', ln_po2 |
---|
439 | WRITE(numout,*) ' Global distribution of observations ln_grid_global = ', ln_grid_global |
---|
440 | WRITE(numout,*) ' Logical switch for obs grid search lookup ln_grid_search_lookup = ', ln_grid_search_lookup |
---|
441 | IF (ln_grid_search_lookup) & |
---|
442 | WRITE(numout,*) ' Grid search lookup file header cn_gridsearchfile = ', cn_gridsearchfile |
---|
443 | WRITE(numout,*) ' Initial date in window YYYYMMDD.HHMMSS rn_dobsini = ', rn_dobsini |
---|
444 | WRITE(numout,*) ' Final date in window YYYYMMDD.HHMMSS rn_dobsend = ', rn_dobsend |
---|
445 | WRITE(numout,*) ' Type of vertical interpolation method nn_1dint = ', nn_1dint |
---|
446 | WRITE(numout,*) ' Default horizontal interpolation method nn_2dint_default = ', nn_2dint_default |
---|
447 | WRITE(numout,*) ' Type of horizontal interpolation method for SLA nn_2dint_sla = ', nn_2dint_sla |
---|
448 | WRITE(numout,*) ' Type of horizontal interpolation method for SST nn_2dint_sst = ', nn_2dint_sst |
---|
449 | WRITE(numout,*) ' Type of horizontal interpolation method for SSS nn_2dint_sss = ', nn_2dint_sss |
---|
450 | WRITE(numout,*) ' Type of horizontal interpolation method for SSV nn_2dint_ssv = ', nn_2dint_ssv |
---|
451 | WRITE(numout,*) ' Type of horizontal interpolation method for SIC nn_2dint_sic = ', nn_2dint_sic |
---|
452 | WRITE(numout,*) ' Type of horizontal interpolation method for SIT nn_2dint_sit = ', nn_2dint_sit |
---|
453 | WRITE(numout,*) ' Type of horizontal interpolation method for FBD nn_2dint_fbd = ', nn_2dint_fbd |
---|
454 | WRITE(numout,*) ' Default E/W diameter of obs footprint rn_default_avglamscl = ', rn_default_avglamscl |
---|
455 | WRITE(numout,*) ' Default N/S diameter of obs footprint rn_default_avgphiscl = ', rn_default_avgphiscl |
---|
456 | WRITE(numout,*) ' Default obs footprint in deg [T] or m [F] ln_default_fp_indegs = ', ln_default_fp_indegs |
---|
457 | WRITE(numout,*) ' SLA E/W diameter of obs footprint rn_sla_avglamscl = ', rn_sla_avglamscl |
---|
458 | WRITE(numout,*) ' SLA N/S diameter of obs footprint rn_sla_avgphiscl = ', rn_sla_avgphiscl |
---|
459 | WRITE(numout,*) ' SLA obs footprint in deg [T] or m [F] ln_sla_fp_indegs = ', ln_sla_fp_indegs |
---|
460 | WRITE(numout,*) ' SST E/W diameter of obs footprint rn_sst_avglamscl = ', rn_sst_avglamscl |
---|
461 | WRITE(numout,*) ' SST N/S diameter of obs footprint rn_sst_avgphiscl = ', rn_sst_avgphiscl |
---|
462 | WRITE(numout,*) ' SST obs footprint in deg [T] or m [F] ln_sst_fp_indegs = ', ln_sst_fp_indegs |
---|
463 | WRITE(numout,*) ' SIC E/W diameter of obs footprint rn_sic_avglamscl = ', rn_sic_avglamscl |
---|
464 | WRITE(numout,*) ' SIC N/S diameter of obs footprint rn_sic_avgphiscl = ', rn_sic_avgphiscl |
---|
465 | WRITE(numout,*) ' SIC obs footprint in deg [T] or m [F] ln_sic_fp_indegs = ', ln_sic_fp_indegs |
---|
466 | WRITE(numout,*) ' SIT E/W diameter of obs footprint rn_sit_avglamscl = ', rn_sit_avglamscl |
---|
467 | WRITE(numout,*) ' SIT N/S diameter of obs footprint rn_sit_avgphiscl = ', rn_sit_avgphiscl |
---|
468 | WRITE(numout,*) ' SIT obs footprint in deg [T] or m [F] ln_sit_fp_indegs = ', ln_sit_fp_indegs |
---|
469 | WRITE(numout,*) ' FBD E/W diameter of obs footprint rn_fbd_avglamscl = ', rn_fbd_avglamscl |
---|
470 | WRITE(numout,*) ' FBD N/S diameter of obs footprint rn_fbd_avgphiscl = ', rn_fbd_avgphiscl |
---|
471 | WRITE(numout,*) ' FBD obs footprint in deg [T] or m [F] ln_fbd_fp_indegs = ', ln_fbd_fp_indegs |
---|
472 | WRITE(numout,*) ' Rejection of observations near land switch ln_nea = ', ln_nea |
---|
473 | WRITE(numout,*) ' Rejection of obs near open bdys ln_bound_reject = ', ln_bound_reject |
---|
474 | WRITE(numout,*) ' MSSH correction scheme nn_msshc = ', nn_msshc |
---|
475 | WRITE(numout,*) ' MDT correction rn_mdtcorr = ', rn_mdtcorr |
---|
476 | WRITE(numout,*) ' MDT cutoff for computed correction rn_mdtcutoff = ', rn_mdtcutoff |
---|
477 | WRITE(numout,*) ' Logical switch for alt bias ln_altbias = ', ln_altbias |
---|
478 | WRITE(numout,*) ' Logical switch for sst bias ln_sstbias = ', ln_sstbias |
---|
479 | WRITE(numout,*) ' Logical switch for ignoring missing files ln_ignmis = ', ln_ignmis |
---|
480 | WRITE(numout,*) ' Daily average types nn_profdavtypes = ', nn_profdavtypes |
---|
481 | WRITE(numout,*) ' Logical switch for night-time SST obs ln_sstnight = ', ln_sstnight |
---|
482 | WRITE(numout,*) ' Logical switch for writing climat. at obs points ln_output_clim = ', ln_output_clim |
---|
483 | WRITE(numout,*) ' Logical switch for time-mean of SLA ln_time_mean_sla_bkg = ', ln_time_mean_sla_bkg |
---|
484 | ENDIF |
---|
485 | !----------------------------------------------------------------------- |
---|
486 | ! Set up list of observation types to be used |
---|
487 | ! and the files associated with each type |
---|
488 | !----------------------------------------------------------------------- |
---|
489 | |
---|
490 | nproftypes = COUNT( (/ln_t3d .OR. ln_s3d, ln_vel3d, ln_plchltot, & |
---|
491 | & ln_pchltot, ln_pno3, ln_psi4, ln_ppo4, & |
---|
492 | & ln_pdic, ln_palk, ln_pph, ln_po2 /) ) |
---|
493 | nsurftypes = COUNT( (/ln_sla, ln_sst, ln_sic, ln_sit, ln_fbd, & |
---|
494 | & ln_sss, ln_ssv, & |
---|
495 | & ln_slchltot, ln_slchldia, ln_slchlnon, ln_slchldin, & |
---|
496 | & ln_slchlmic, ln_slchlnan, ln_slchlpic, ln_schltot, & |
---|
497 | & ln_slphytot, ln_slphydia, ln_slphynon, ln_sspm, & |
---|
498 | & ln_skd490, ln_sfco2, ln_spco2 /) ) |
---|
499 | |
---|
500 | IF ( nproftypes == 0 .AND. nsurftypes == 0 ) THEN |
---|
501 | IF(lwp) WRITE(numout,cform_war) |
---|
502 | IF(lwp) WRITE(numout,*) ' ln_diaobs is set to true, but all obs operator logical flags', & |
---|
503 | & ' are set to .FALSE. so turning off calls to dia_obs' |
---|
504 | nwarn = nwarn + 1 |
---|
505 | lk_diaobs = .FALSE. |
---|
506 | RETURN |
---|
507 | ENDIF |
---|
508 | |
---|
509 | IF ( ln_output_clim .AND. ( .NOT. ln_tradmp ) ) THEN |
---|
510 | IF(lwp) WRITE(numout,cform_war) |
---|
511 | IF(lwp) WRITE(numout,*) ' ln_output_clim is true, but ln_tradmp is false', & |
---|
512 | & ' so climatological T/S not available and will not be output' |
---|
513 | nwarn = nwarn + 1 |
---|
514 | ln_output_clim = .FALSE. |
---|
515 | ENDIF |
---|
516 | |
---|
517 | |
---|
518 | IF(lwp) WRITE(numout,*) ' Number of profile obs types: ',nproftypes |
---|
519 | IF ( nproftypes > 0 ) THEN |
---|
520 | |
---|
521 | ALLOCATE( cobstypesprof(nproftypes) ) |
---|
522 | ALLOCATE( ifilesprof(nproftypes) ) |
---|
523 | ALLOCATE( clproffiles(nproftypes,jpmaxnfiles) ) |
---|
524 | |
---|
525 | jtype = 0 |
---|
526 | IF (ln_t3d .OR. ln_s3d) THEN |
---|
527 | jtype = jtype + 1 |
---|
528 | cobstypesprof(jtype) = 'prof' |
---|
529 | clproffiles(jtype,:) = cn_profbfiles |
---|
530 | ENDIF |
---|
531 | IF (ln_vel3d) THEN |
---|
532 | jtype = jtype + 1 |
---|
533 | cobstypesprof(jtype) = 'vel' |
---|
534 | clproffiles(jtype,:) = cn_velfbfiles |
---|
535 | ENDIF |
---|
536 | IF (ln_plchltot) THEN |
---|
537 | jtype = jtype + 1 |
---|
538 | cobstypesprof(jtype) = 'plchltot' |
---|
539 | clproffiles(jtype,:) = cn_plchltotfbfiles |
---|
540 | ENDIF |
---|
541 | IF (ln_pchltot) THEN |
---|
542 | jtype = jtype + 1 |
---|
543 | cobstypesprof(jtype) = 'pchltot' |
---|
544 | clproffiles(jtype,:) = cn_pchltotfbfiles |
---|
545 | ENDIF |
---|
546 | IF (ln_pno3) THEN |
---|
547 | jtype = jtype + 1 |
---|
548 | cobstypesprof(jtype) = 'pno3' |
---|
549 | clproffiles(jtype,:) = cn_pno3fbfiles |
---|
550 | ENDIF |
---|
551 | IF (ln_psi4) THEN |
---|
552 | jtype = jtype + 1 |
---|
553 | cobstypesprof(jtype) = 'psi4' |
---|
554 | clproffiles(jtype,:) = cn_psi4fbfiles |
---|
555 | ENDIF |
---|
556 | IF (ln_ppo4) THEN |
---|
557 | jtype = jtype + 1 |
---|
558 | cobstypesprof(jtype) = 'ppo4' |
---|
559 | clproffiles(jtype,:) = cn_ppo4fbfiles |
---|
560 | ENDIF |
---|
561 | IF (ln_pdic) THEN |
---|
562 | jtype = jtype + 1 |
---|
563 | cobstypesprof(jtype) = 'pdic' |
---|
564 | clproffiles(jtype,:) = cn_pdicfbfiles |
---|
565 | ENDIF |
---|
566 | IF (ln_palk) THEN |
---|
567 | jtype = jtype + 1 |
---|
568 | cobstypesprof(jtype) = 'palk' |
---|
569 | clproffiles(jtype,:) = cn_palkfbfiles |
---|
570 | ENDIF |
---|
571 | IF (ln_pph) THEN |
---|
572 | jtype = jtype + 1 |
---|
573 | cobstypesprof(jtype) = 'pph' |
---|
574 | clproffiles(jtype,:) = cn_pphfbfiles |
---|
575 | ENDIF |
---|
576 | IF (ln_po2) THEN |
---|
577 | jtype = jtype + 1 |
---|
578 | cobstypesprof(jtype) = 'po2' |
---|
579 | clproffiles(jtype,:) = cn_po2fbfiles |
---|
580 | ENDIF |
---|
581 | |
---|
582 | CALL obs_settypefiles( nproftypes, jpmaxnfiles, ifilesprof, cobstypesprof, clproffiles ) |
---|
583 | |
---|
584 | ENDIF |
---|
585 | |
---|
586 | IF(lwp) WRITE(numout,*)' Number of surface obs types: ',nsurftypes |
---|
587 | IF ( nsurftypes > 0 ) THEN |
---|
588 | |
---|
589 | ALLOCATE( cobstypessurf(nsurftypes) ) |
---|
590 | ALLOCATE( ifilessurf(nsurftypes) ) |
---|
591 | ALLOCATE( clsurffiles(nsurftypes, jpmaxnfiles) ) |
---|
592 | ALLOCATE(n2dintsurf(nsurftypes)) |
---|
593 | ALLOCATE(ravglamscl(nsurftypes)) |
---|
594 | ALLOCATE(ravgphiscl(nsurftypes)) |
---|
595 | ALLOCATE(lfpindegs(nsurftypes)) |
---|
596 | ALLOCATE(llnightav(nsurftypes)) |
---|
597 | |
---|
598 | jtype = 0 |
---|
599 | IF (ln_sla) THEN |
---|
600 | jtype = jtype + 1 |
---|
601 | cobstypessurf(jtype) = 'sla' |
---|
602 | clsurffiles(jtype,:) = cn_slafbfiles |
---|
603 | ENDIF |
---|
604 | IF (ln_sst) THEN |
---|
605 | jtype = jtype + 1 |
---|
606 | cobstypessurf(jtype) = 'sst' |
---|
607 | clsurffiles(jtype,:) = cn_sstfbfiles |
---|
608 | ENDIF |
---|
609 | IF (ln_sic) THEN |
---|
610 | jtype = jtype + 1 |
---|
611 | cobstypessurf(jtype) = 'sic' |
---|
612 | clsurffiles(jtype,:) = cn_sicfbfiles |
---|
613 | ENDIF |
---|
614 | IF (ln_sit) THEN |
---|
615 | jtype = jtype + 1 |
---|
616 | cobstypessurf(jtype) = 'sit' |
---|
617 | clsurffiles(jtype,:) = cn_sitfbfiles |
---|
618 | ENDIF |
---|
619 | IF (ln_fbd) THEN |
---|
620 | jtype = jtype + 1 |
---|
621 | cobstypessurf(jtype) = 'fbd' |
---|
622 | clsurffiles(jtype,:) = cn_fbdfbfiles |
---|
623 | ENDIF |
---|
624 | IF (ln_sss) THEN |
---|
625 | jtype = jtype + 1 |
---|
626 | cobstypessurf(jtype) = 'sss' |
---|
627 | clsurffiles(jtype,:) = cn_sssfbfiles |
---|
628 | ENDIF |
---|
629 | IF (ln_ssv) THEN |
---|
630 | jtype = jtype + 1 |
---|
631 | cobstypessurf(jtype) = 'ssv' |
---|
632 | clsurffiles(jtype,:) = cn_ssvfbfiles |
---|
633 | ENDIF |
---|
634 | IF (ln_slchltot) THEN |
---|
635 | jtype = jtype + 1 |
---|
636 | cobstypessurf(jtype) = 'slchltot' |
---|
637 | clsurffiles(jtype,:) = cn_slchltotfbfiles |
---|
638 | ENDIF |
---|
639 | IF (ln_slchldia) THEN |
---|
640 | jtype = jtype + 1 |
---|
641 | cobstypessurf(jtype) = 'slchldia' |
---|
642 | clsurffiles(jtype,:) = cn_slchldiafbfiles |
---|
643 | ENDIF |
---|
644 | IF (ln_slchlnon) THEN |
---|
645 | jtype = jtype + 1 |
---|
646 | cobstypessurf(jtype) = 'slchlnon' |
---|
647 | clsurffiles(jtype,:) = cn_slchlnonfbfiles |
---|
648 | ENDIF |
---|
649 | IF (ln_slchldin) THEN |
---|
650 | jtype = jtype + 1 |
---|
651 | cobstypessurf(jtype) = 'slchldin' |
---|
652 | clsurffiles(jtype,:) = cn_slchldinfbfiles |
---|
653 | ENDIF |
---|
654 | IF (ln_slchlmic) THEN |
---|
655 | jtype = jtype + 1 |
---|
656 | cobstypessurf(jtype) = 'slchlmic' |
---|
657 | clsurffiles(jtype,:) = cn_slchlmicfbfiles |
---|
658 | ENDIF |
---|
659 | IF (ln_slchlnan) THEN |
---|
660 | jtype = jtype + 1 |
---|
661 | cobstypessurf(jtype) = 'slchlnan' |
---|
662 | clsurffiles(jtype,:) = cn_slchlnanfbfiles |
---|
663 | ENDIF |
---|
664 | IF (ln_slchlpic) THEN |
---|
665 | jtype = jtype + 1 |
---|
666 | cobstypessurf(jtype) = 'slchlpic' |
---|
667 | clsurffiles(jtype,:) = cn_slchlpicfbfiles |
---|
668 | ENDIF |
---|
669 | IF (ln_schltot) THEN |
---|
670 | jtype = jtype + 1 |
---|
671 | cobstypessurf(jtype) = 'schltot' |
---|
672 | clsurffiles(jtype,:) = cn_schltotfbfiles |
---|
673 | ENDIF |
---|
674 | IF (ln_slphytot) THEN |
---|
675 | jtype = jtype + 1 |
---|
676 | cobstypessurf(jtype) = 'slphytot' |
---|
677 | clsurffiles(jtype,:) = cn_slphytotfbfiles |
---|
678 | ENDIF |
---|
679 | IF (ln_slphydia) THEN |
---|
680 | jtype = jtype + 1 |
---|
681 | cobstypessurf(jtype) = 'slphydia' |
---|
682 | clsurffiles(jtype,:) = cn_slphydiafbfiles |
---|
683 | ENDIF |
---|
684 | IF (ln_slphynon) THEN |
---|
685 | jtype = jtype + 1 |
---|
686 | cobstypessurf(jtype) = 'slphynon' |
---|
687 | clsurffiles(jtype,:) = cn_slphynonfbfiles |
---|
688 | ENDIF |
---|
689 | IF (ln_sspm) THEN |
---|
690 | jtype = jtype + 1 |
---|
691 | cobstypessurf(jtype) = 'sspm' |
---|
692 | clsurffiles(jtype,:) = cn_sspmfbfiles |
---|
693 | ENDIF |
---|
694 | IF (ln_skd490) THEN |
---|
695 | jtype = jtype + 1 |
---|
696 | cobstypessurf(jtype) = 'skd490' |
---|
697 | clsurffiles(jtype,:) = cn_skd490fbfiles |
---|
698 | ENDIF |
---|
699 | IF (ln_sfco2) THEN |
---|
700 | jtype = jtype + 1 |
---|
701 | cobstypessurf(jtype) = 'sfco2' |
---|
702 | clsurffiles(jtype,:) = cn_sfco2fbfiles |
---|
703 | ENDIF |
---|
704 | IF (ln_spco2) THEN |
---|
705 | jtype = jtype + 1 |
---|
706 | cobstypessurf(jtype) = 'spco2' |
---|
707 | clsurffiles(jtype,:) = cn_spco2fbfiles |
---|
708 | ENDIF |
---|
709 | |
---|
710 | CALL obs_settypefiles( nsurftypes, jpmaxnfiles, ifilessurf, cobstypessurf, clsurffiles ) |
---|
711 | |
---|
712 | DO jtype = 1, nsurftypes |
---|
713 | |
---|
714 | IF ( TRIM(cobstypessurf(jtype)) == 'sla' ) THEN |
---|
715 | IF ( nn_2dint_sla == -1 ) THEN |
---|
716 | n2dint_type = nn_2dint_default |
---|
717 | ELSE |
---|
718 | n2dint_type = nn_2dint_sla |
---|
719 | ENDIF |
---|
720 | ztype_avglamscl = rn_sla_avglamscl |
---|
721 | ztype_avgphiscl = rn_sla_avgphiscl |
---|
722 | ltype_fp_indegs = ln_sla_fp_indegs |
---|
723 | ltype_night = .FALSE. |
---|
724 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sst' ) THEN |
---|
725 | IF ( nn_2dint_sst == -1 ) THEN |
---|
726 | n2dint_type = nn_2dint_default |
---|
727 | ELSE |
---|
728 | n2dint_type = nn_2dint_sst |
---|
729 | ENDIF |
---|
730 | ztype_avglamscl = rn_sst_avglamscl |
---|
731 | ztype_avgphiscl = rn_sst_avgphiscl |
---|
732 | ltype_fp_indegs = ln_sst_fp_indegs |
---|
733 | ltype_night = ln_sstnight |
---|
734 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sic' ) THEN |
---|
735 | IF ( nn_2dint_sic == -1 ) THEN |
---|
736 | n2dint_type = nn_2dint_default |
---|
737 | ELSE |
---|
738 | n2dint_type = nn_2dint_sic |
---|
739 | ENDIF |
---|
740 | ztype_avglamscl = rn_sic_avglamscl |
---|
741 | ztype_avgphiscl = rn_sic_avgphiscl |
---|
742 | ltype_fp_indegs = ln_sic_fp_indegs |
---|
743 | ltype_night = .FALSE. |
---|
744 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sit' ) THEN |
---|
745 | IF ( nn_2dint_sit == -1 ) THEN |
---|
746 | n2dint_type = nn_2dint_default |
---|
747 | ELSE |
---|
748 | n2dint_type = nn_2dint_sit |
---|
749 | ENDIF |
---|
750 | ztype_avglamscl = rn_sit_avglamscl |
---|
751 | ztype_avgphiscl = rn_sit_avgphiscl |
---|
752 | ltype_fp_indegs = ln_sit_fp_indegs |
---|
753 | ltype_night = .FALSE. |
---|
754 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'fbd' ) THEN |
---|
755 | IF ( nn_2dint_fbd == -1 ) THEN |
---|
756 | n2dint_type = nn_2dint_default |
---|
757 | ELSE |
---|
758 | n2dint_type = nn_2dint_fbd |
---|
759 | ENDIF |
---|
760 | ztype_avglamscl = rn_fbd_avglamscl |
---|
761 | ztype_avgphiscl = rn_fbd_avgphiscl |
---|
762 | ltype_fp_indegs = ln_fbd_fp_indegs |
---|
763 | ltype_night = .FALSE. |
---|
764 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sss' ) THEN |
---|
765 | IF ( nn_2dint_sss == -1 ) THEN |
---|
766 | n2dint_type = nn_2dint_default |
---|
767 | ELSE |
---|
768 | n2dint_type = nn_2dint_sss |
---|
769 | ENDIF |
---|
770 | ztype_avglamscl = rn_sss_avglamscl |
---|
771 | ztype_avgphiscl = rn_sss_avgphiscl |
---|
772 | ltype_fp_indegs = ln_sss_fp_indegs |
---|
773 | ltype_night = .FALSE. |
---|
774 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'ssv' ) THEN |
---|
775 | IF ( nn_2dint_ssv == -1 ) THEN |
---|
776 | n2dint_type = nn_2dint_default |
---|
777 | ELSE |
---|
778 | n2dint_type = nn_2dint_ssv |
---|
779 | ENDIF |
---|
780 | ztype_avglamscl = rn_ssv_avglamscl |
---|
781 | ztype_avgphiscl = rn_ssv_avgphiscl |
---|
782 | ltype_fp_indegs = ln_ssv_fp_indegs |
---|
783 | ltype_night = .FALSE. |
---|
784 | ELSE |
---|
785 | n2dint_type = nn_2dint_default |
---|
786 | ztype_avglamscl = rn_default_avglamscl |
---|
787 | ztype_avgphiscl = rn_default_avgphiscl |
---|
788 | ltype_fp_indegs = ln_default_fp_indegs |
---|
789 | ltype_night = .FALSE. |
---|
790 | ENDIF |
---|
791 | |
---|
792 | CALL obs_setinterpopts( nsurftypes, jtype, TRIM(cobstypessurf(jtype)), & |
---|
793 | & nn_2dint_default, n2dint_type, & |
---|
794 | & ztype_avglamscl, ztype_avgphiscl, & |
---|
795 | & ltype_fp_indegs, ltype_night, & |
---|
796 | & n2dintsurf, ravglamscl, ravgphiscl, & |
---|
797 | & lfpindegs, llnightav ) |
---|
798 | |
---|
799 | END DO |
---|
800 | |
---|
801 | ENDIF |
---|
802 | |
---|
803 | IF(lwp) WRITE(numout,*) '~~~~~~~~~~~~' |
---|
804 | |
---|
805 | |
---|
806 | !----------------------------------------------------------------------- |
---|
807 | ! Obs operator parameter checking and initialisations |
---|
808 | !----------------------------------------------------------------------- |
---|
809 | |
---|
810 | IF ( ln_vel3d .AND. ( .NOT. ln_grid_global ) ) THEN |
---|
811 | CALL ctl_stop( 'Velocity data only works with ln_grid_global=.true.' ) |
---|
812 | RETURN |
---|
813 | ENDIF |
---|
814 | |
---|
815 | IF ( ( nn_1dint < 0 ) .OR. ( nn_1dint > 1 ) ) THEN |
---|
816 | CALL ctl_stop(' Choice of vertical (1D) interpolation method', & |
---|
817 | & ' is not available') |
---|
818 | ENDIF |
---|
819 | |
---|
820 | IF ( ( nn_2dint_default < 0 ) .OR. ( nn_2dint_default > 6 ) ) THEN |
---|
821 | CALL ctl_stop(' Choice of default horizontal (2D) interpolation method', & |
---|
822 | & ' is not available') |
---|
823 | ENDIF |
---|
824 | |
---|
825 | CALL obs_typ_init |
---|
826 | |
---|
827 | CALL mppmap_init |
---|
828 | |
---|
829 | CALL obs_grid_setup( ) |
---|
830 | |
---|
831 | !----------------------------------------------------------------------- |
---|
832 | ! Depending on switches read the various observation types |
---|
833 | !----------------------------------------------------------------------- |
---|
834 | |
---|
835 | IF ( nproftypes > 0 ) THEN |
---|
836 | |
---|
837 | ALLOCATE(profdata(nproftypes)) |
---|
838 | ALLOCATE(profdataqc(nproftypes)) |
---|
839 | ALLOCATE(nvarsprof(nproftypes)) |
---|
840 | ALLOCATE(nextrprof(nproftypes)) |
---|
841 | |
---|
842 | DO jtype = 1, nproftypes |
---|
843 | |
---|
844 | ltype_clim = .FALSE. |
---|
845 | |
---|
846 | IF ( TRIM(cobstypesprof(jtype)) == 'prof' ) THEN |
---|
847 | nvarsprof(jtype) = 2 |
---|
848 | nextrprof(jtype) = 1 |
---|
849 | IF ( ln_output_clim ) ltype_clim = .TRUE. |
---|
850 | ALLOCATE(llvar(nvarsprof(jtype))) |
---|
851 | ALLOCATE(clvars(nvarsprof(jtype))) |
---|
852 | CALL wrk_alloc( jpi, jpj, nvarsprof(jtype), zglam ) |
---|
853 | CALL wrk_alloc( jpi, jpj, nvarsprof(jtype), zgphi ) |
---|
854 | CALL wrk_alloc( jpi, jpj, jpk, nvarsprof(jtype), zmask ) |
---|
855 | llvar(1) = ln_t3d |
---|
856 | llvar(2) = ln_s3d |
---|
857 | clvars(1) = 'POTM' |
---|
858 | clvars(2) = 'PSAL' |
---|
859 | zglam(:,:,1) = glamt(:,:) |
---|
860 | zglam(:,:,2) = glamt(:,:) |
---|
861 | zgphi(:,:,1) = gphit(:,:) |
---|
862 | zgphi(:,:,2) = gphit(:,:) |
---|
863 | zmask(:,:,:,1) = tmask(:,:,:) |
---|
864 | zmask(:,:,:,2) = tmask(:,:,:) |
---|
865 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'vel' ) THEN |
---|
866 | nvarsprof(jtype) = 2 |
---|
867 | nextrprof(jtype) = 2 |
---|
868 | ALLOCATE(llvar(nvarsprof(jtype))) |
---|
869 | ALLOCATE(clvars(nvarsprof(jtype))) |
---|
870 | CALL wrk_alloc( jpi, jpj, nvarsprof(jtype), zglam ) |
---|
871 | CALL wrk_alloc( jpi, jpj, nvarsprof(jtype), zgphi ) |
---|
872 | CALL wrk_alloc( jpi, jpj, jpk, nvarsprof(jtype), zmask ) |
---|
873 | llvar(1) = ln_vel3d |
---|
874 | llvar(2) = ln_vel3d |
---|
875 | clvars(1) = 'UVEL' |
---|
876 | clvars(2) = 'VVEL' |
---|
877 | zglam(:,:,1) = glamu(:,:) |
---|
878 | zglam(:,:,2) = glamv(:,:) |
---|
879 | zgphi(:,:,1) = gphiu(:,:) |
---|
880 | zgphi(:,:,2) = gphiv(:,:) |
---|
881 | zmask(:,:,:,1) = umask(:,:,:) |
---|
882 | zmask(:,:,:,2) = vmask(:,:,:) |
---|
883 | ELSE |
---|
884 | nvarsprof(jtype) = 1 |
---|
885 | nextrprof(jtype) = 0 |
---|
886 | ALLOCATE(llvar(nvarsprof(jtype))) |
---|
887 | ALLOCATE(clvars(nvarsprof(jtype))) |
---|
888 | CALL wrk_alloc( jpi, jpj, nvarsprof(jtype), zglam ) |
---|
889 | CALL wrk_alloc( jpi, jpj, nvarsprof(jtype), zgphi ) |
---|
890 | CALL wrk_alloc( jpi, jpj, jpk, nvarsprof(jtype), zmask ) |
---|
891 | llvar(1) = .TRUE. |
---|
892 | zglam(:,:,1) = glamt(:,:) |
---|
893 | zgphi(:,:,1) = gphit(:,:) |
---|
894 | zmask(:,:,:,1) = tmask(:,:,:) |
---|
895 | IF ( TRIM(cobstypesprof(jtype)) == 'plchltot' ) THEN |
---|
896 | clvars(1) = 'PLCHLTOT' |
---|
897 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'pchltot' ) THEN |
---|
898 | clvars(1) = 'PCHLTOT' |
---|
899 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'pno3' ) THEN |
---|
900 | clvars(1) = 'PNO3' |
---|
901 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'psi4' ) THEN |
---|
902 | clvars(1) = 'PSI4' |
---|
903 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'ppo4' ) THEN |
---|
904 | clvars(1) = 'PPO4' |
---|
905 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'pdic' ) THEN |
---|
906 | clvars(1) = 'PDIC' |
---|
907 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'palk' ) THEN |
---|
908 | clvars(1) = 'PALK' |
---|
909 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'pph' ) THEN |
---|
910 | clvars(1) = 'PPH' |
---|
911 | ELSE IF ( TRIM(cobstypesprof(jtype)) == 'po2' ) THEN |
---|
912 | clvars(1) = 'PO2' |
---|
913 | ENDIF |
---|
914 | ENDIF |
---|
915 | |
---|
916 | !Read in profile or profile obs types |
---|
917 | CALL obs_rea_prof( profdata(jtype), ifilesprof(jtype), & |
---|
918 | & clproffiles(jtype,1:ifilesprof(jtype)), & |
---|
919 | & nvarsprof(jtype), nextrprof(jtype), nitend-nit000+2, & |
---|
920 | & rn_dobsini, rn_dobsend, llvar, & |
---|
921 | & ln_ignmis, ln_s_at_t, .FALSE., ltype_clim, clvars, & |
---|
922 | & kdailyavtypes = nn_profdavtypes ) |
---|
923 | |
---|
924 | DO jvar = 1, nvarsprof(jtype) |
---|
925 | CALL obs_prof_staend( profdata(jtype), jvar ) |
---|
926 | END DO |
---|
927 | |
---|
928 | CALL obs_pre_prof( profdata(jtype), profdataqc(jtype), & |
---|
929 | & llvar, & |
---|
930 | & jpi, jpj, jpk, & |
---|
931 | & zmask, zglam, zgphi, & |
---|
932 | & ln_nea, ln_bound_reject, & |
---|
933 | & kdailyavtypes = nn_profdavtypes ) |
---|
934 | |
---|
935 | DEALLOCATE( llvar, clvars ) |
---|
936 | CALL wrk_dealloc( jpi, jpj, nvarsprof(jtype), zglam ) |
---|
937 | CALL wrk_dealloc( jpi, jpj, nvarsprof(jtype), zgphi ) |
---|
938 | CALL wrk_dealloc( jpi, jpj, jpk, nvarsprof(jtype), zmask ) |
---|
939 | |
---|
940 | END DO |
---|
941 | |
---|
942 | DEALLOCATE( ifilesprof, clproffiles ) |
---|
943 | |
---|
944 | ENDIF |
---|
945 | |
---|
946 | IF ( nsurftypes > 0 ) THEN |
---|
947 | |
---|
948 | ALLOCATE(surfdata(nsurftypes)) |
---|
949 | ALLOCATE(surfdataqc(nsurftypes)) |
---|
950 | ALLOCATE(nvarssurf(nsurftypes)) |
---|
951 | ALLOCATE(nextrsurf(nsurftypes)) |
---|
952 | |
---|
953 | DO jtype = 1, nsurftypes |
---|
954 | |
---|
955 | ltype_clim = .FALSE. |
---|
956 | IF ( ln_output_clim .AND. & |
---|
957 | & ( ( TRIM(cobstypessurf(jtype)) == 'sst' ) .OR. & |
---|
958 | & ( TRIM(cobstypessurf(jtype)) == 'sss' ) ) ) & |
---|
959 | & ltype_clim = .TRUE. |
---|
960 | |
---|
961 | IF ( (TRIM(cobstypessurf(jtype)) == 'sla') .OR. & |
---|
962 | & (TRIM(cobstypessurf(jtype)) == 'sit') .OR. & |
---|
963 | & (TRIM(cobstypessurf(jtype)) == 'fbd') ) THEN |
---|
964 | nvarssurf(jtype) = 1 |
---|
965 | nextrsurf(jtype) = 2 |
---|
966 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'ssv' ) THEN |
---|
967 | nvarssurf(jtype) = 2 |
---|
968 | nextrsurf(jtype) = 0 |
---|
969 | ELSE |
---|
970 | nvarssurf(jtype) = 1 |
---|
971 | nextrsurf(jtype) = 0 |
---|
972 | ENDIF |
---|
973 | |
---|
974 | ALLOCATE( clvars( nvarssurf(jtype) ) ) |
---|
975 | CALL wrk_alloc( jpi, jpj, nvarssurf(jtype), zglam ) |
---|
976 | CALL wrk_alloc( jpi, jpj, nvarssurf(jtype), zgphi ) |
---|
977 | CALL wrk_alloc( jpi, jpj, nvarssurf(jtype), zmask_surf ) |
---|
978 | |
---|
979 | IF ( TRIM(cobstypessurf(jtype)) == 'ssv' ) THEN |
---|
980 | zglam(:,:,1) = glamu(:,:) |
---|
981 | zglam(:,:,2) = glamv(:,:) |
---|
982 | zgphi(:,:,1) = gphiu(:,:) |
---|
983 | zgphi(:,:,2) = gphiv(:,:) |
---|
984 | zmask_surf(:,:,1) = umask(:,:,1) |
---|
985 | zmask_surf(:,:,2) = vmask(:,:,1) |
---|
986 | ELSE |
---|
987 | DO jvar = 1, nvarssurf(jtype) |
---|
988 | zglam(:,:,jvar) = glamt(:,:) |
---|
989 | zgphi(:,:,jvar) = gphit(:,:) |
---|
990 | zmask_surf(:,:,jvar) = tmask(:,:,1) |
---|
991 | END DO |
---|
992 | ENDIF |
---|
993 | |
---|
994 | IF ( TRIM(cobstypessurf(jtype)) == 'sla' ) THEN |
---|
995 | clvars(1) = 'SLA' |
---|
996 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sst' ) THEN |
---|
997 | clvars(1) = 'SST' |
---|
998 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sic' ) THEN |
---|
999 | clvars(1) = 'ICECONC' |
---|
1000 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'fbd' ) THEN |
---|
1001 | clvars(1) = 'FBD' |
---|
1002 | ln_seaicetypes = .TRUE. |
---|
1003 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sit' ) THEN |
---|
1004 | clvars(1) = 'SIT' |
---|
1005 | ln_seaicetypes = .TRUE. |
---|
1006 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sss' ) THEN |
---|
1007 | clvars(1) = 'SSS' |
---|
1008 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'ssv' ) THEN |
---|
1009 | clvars(1) = 'UVEL' |
---|
1010 | clvars(2) = 'VVEL' |
---|
1011 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slchltot' ) THEN |
---|
1012 | clvars(1) = 'SLCHLTOT' |
---|
1013 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slchldia' ) THEN |
---|
1014 | clvars(1) = 'SLCHLDIA' |
---|
1015 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slchlnon' ) THEN |
---|
1016 | clvars(1) = 'SLCHLNON' |
---|
1017 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slchldin' ) THEN |
---|
1018 | clvars(1) = 'SLCHLDIN' |
---|
1019 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slchlmic' ) THEN |
---|
1020 | clvars(1) = 'SLCHLMIC' |
---|
1021 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slchlnan' ) THEN |
---|
1022 | clvars(1) = 'SLCHLNAN' |
---|
1023 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slchlpic' ) THEN |
---|
1024 | clvars(1) = 'SLCHLPIC' |
---|
1025 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'schltot' ) THEN |
---|
1026 | clvars(1) = 'SCHLTOT' |
---|
1027 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slphytot' ) THEN |
---|
1028 | clvars(1) = 'SLPHYTOT' |
---|
1029 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slphydia' ) THEN |
---|
1030 | clvars(1) = 'SLPHYDIA' |
---|
1031 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'slphynon' ) THEN |
---|
1032 | clvars(1) = 'SLPHYNON' |
---|
1033 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sspm' ) THEN |
---|
1034 | clvars(1) = 'SSPM' |
---|
1035 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'skd490' ) THEN |
---|
1036 | clvars(1) = 'SKD490' |
---|
1037 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'sfco2' ) THEN |
---|
1038 | clvars(1) = 'SFCO2' |
---|
1039 | ELSE IF ( TRIM(cobstypessurf(jtype)) == 'spco2' ) THEN |
---|
1040 | clvars(1) = 'SPCO2' |
---|
1041 | ENDIF |
---|
1042 | |
---|
1043 | !Read in surface obs types |
---|
1044 | CALL obs_rea_surf( surfdata(jtype), ifilessurf(jtype), & |
---|
1045 | & clsurffiles(jtype,1:ifilessurf(jtype)), & |
---|
1046 | & nvarssurf(jtype), nextrsurf(jtype), nitend-nit000+2, & |
---|
1047 | & rn_dobsini, rn_dobsend, MeanPeriodHours, ln_ignmis, .FALSE., & |
---|
1048 | & llnightav(jtype), ltype_clim, ln_time_mean_sla_bkg, clvars ) |
---|
1049 | |
---|
1050 | CALL obs_pre_surf( surfdata(jtype), surfdataqc(jtype), & |
---|
1051 | & jpi, jpj, & |
---|
1052 | & zmask_surf, zglam, zgphi, & |
---|
1053 | & ln_nea, ln_bound_reject, ln_seaicetypes ) |
---|
1054 | |
---|
1055 | IF ( TRIM(cobstypessurf(jtype)) == 'sla' ) THEN |
---|
1056 | CALL obs_rea_mdt( surfdataqc(jtype), n2dintsurf(jtype) ) |
---|
1057 | IF ( ln_altbias ) & |
---|
1058 | & CALL obs_rea_altbias ( surfdataqc(jtype), n2dintsurf(jtype), cn_altbiasfile ) |
---|
1059 | ENDIF |
---|
1060 | |
---|
1061 | #if defined key_cice |
---|
1062 | IF ( TRIM(cobstypessurf(jtype)) == 'fbd' ) THEN |
---|
1063 | CALL obs_rea_snowdepth( surfdataqc(jtype), n2dintsurf(jtype), thick_s(:,:) ) |
---|
1064 | ENDIF |
---|
1065 | #endif |
---|
1066 | |
---|
1067 | IF ( TRIM(cobstypessurf(jtype)) == 'sst' .AND. ln_sstbias ) THEN |
---|
1068 | jnumsstbias = 0 |
---|
1069 | DO jfile = 1, jpmaxnfiles |
---|
1070 | IF ( TRIM(cn_sstbiasfiles(jfile)) /= '' ) & |
---|
1071 | & jnumsstbias = jnumsstbias + 1 |
---|
1072 | END DO |
---|
1073 | IF ( jnumsstbias == 0 ) THEN |
---|
1074 | CALL ctl_stop("ln_sstbias set but no bias files to read in") |
---|
1075 | ENDIF |
---|
1076 | |
---|
1077 | CALL obs_app_sstbias( surfdataqc(jtype), n2dintsurf(jtype), & |
---|
1078 | & jnumsstbias, cn_sstbiasfiles(1:jnumsstbias) ) |
---|
1079 | |
---|
1080 | ENDIF |
---|
1081 | |
---|
1082 | DEALLOCATE( clvars ) |
---|
1083 | CALL wrk_dealloc( jpi, jpj, nvarssurf(jtype), zglam ) |
---|
1084 | CALL wrk_dealloc( jpi, jpj, nvarssurf(jtype), zgphi ) |
---|
1085 | CALL wrk_dealloc( jpi, jpj, nvarssurf(jtype), zmask_surf ) |
---|
1086 | |
---|
1087 | END DO |
---|
1088 | |
---|
1089 | DEALLOCATE( ifilessurf, clsurffiles ) |
---|
1090 | |
---|
1091 | ENDIF |
---|
1092 | |
---|
1093 | END SUBROUTINE dia_obs_init |
---|
1094 | |
---|
1095 | SUBROUTINE dia_obs( kstp ) |
---|
1096 | !!---------------------------------------------------------------------- |
---|
1097 | !! *** ROUTINE dia_obs *** |
---|
1098 | !! |
---|
1099 | !! ** Purpose : Call the observation operators on each time step |
---|
1100 | !! |
---|
1101 | !! ** Method : Call the observation operators on each time step to |
---|
1102 | !! compute the model equivalent of the following data: |
---|
1103 | !! - Profile data, currently T/S or U/V |
---|
1104 | !! - Surface data, currently SST, SLA or sea-ice concentration. |
---|
1105 | !! |
---|
1106 | !! ** Action : |
---|
1107 | !! |
---|
1108 | !! History : |
---|
1109 | !! ! 06-03 (K. Mogensen) Original code |
---|
1110 | !! ! 06-05 (K. Mogensen) Reformatted |
---|
1111 | !! ! 06-10 (A. Weaver) Cleaning |
---|
1112 | !! ! 07-03 (K. Mogensen) General handling of profiles |
---|
1113 | !! ! 07-04 (G. Smith) Generalized surface operators |
---|
1114 | !! ! 08-10 (M. Valdivieso) obs operator for velocity profiles |
---|
1115 | !! ! 15-08 (M. Martin) Combined surface/profile routines. |
---|
1116 | !!---------------------------------------------------------------------- |
---|
1117 | !! * Modules used |
---|
1118 | USE phycst, ONLY : & ! Physical constants |
---|
1119 | #if defined key_fabm |
---|
1120 | & rt0, & |
---|
1121 | #endif |
---|
1122 | & rday |
---|
1123 | USE oce, ONLY : & ! Ocean dynamics and tracers variables |
---|
1124 | & tsn, & |
---|
1125 | & un, & |
---|
1126 | & vn, & |
---|
1127 | & sshn |
---|
1128 | #if defined key_lim3 |
---|
1129 | USE ice, ONLY : & ! LIM3 Ice model variables |
---|
1130 | & frld |
---|
1131 | #endif |
---|
1132 | #if defined key_lim2 |
---|
1133 | USE ice_2, ONLY : & ! LIM2 Ice model variables |
---|
1134 | & frld |
---|
1135 | #endif |
---|
1136 | #if defined key_cice |
---|
1137 | USE sbc_oce, ONLY : & ! CICE variables |
---|
1138 | & fr_i, & ! ice fraction |
---|
1139 | & thick_i ! ice thickness |
---|
1140 | #endif |
---|
1141 | #if defined key_top |
---|
1142 | USE trc, ONLY : & ! Biogeochemical state variables |
---|
1143 | & trn |
---|
1144 | #endif |
---|
1145 | #if defined key_hadocc |
---|
1146 | USE par_hadocc ! HadOCC parameters |
---|
1147 | USE trc, ONLY : & |
---|
1148 | & HADOCC_CHL, & |
---|
1149 | & HADOCC_FCO2, & |
---|
1150 | & HADOCC_PCO2, & |
---|
1151 | & HADOCC_FILL_FLT |
---|
1152 | USE had_bgc_const, ONLY: c2n_p |
---|
1153 | #elif defined key_medusa |
---|
1154 | USE par_medusa ! MEDUSA parameters |
---|
1155 | USE sms_medusa, ONLY: & |
---|
1156 | & xthetapn, & |
---|
1157 | & xthetapd |
---|
1158 | #if defined key_roam |
---|
1159 | USE sms_medusa, ONLY: & |
---|
1160 | & f2_pco2w, & |
---|
1161 | & f2_fco2w, & |
---|
1162 | & f3_pH |
---|
1163 | #endif |
---|
1164 | #elif defined key_fabm |
---|
1165 | USE par_fabm ! FABM parameters |
---|
1166 | #endif |
---|
1167 | #if defined key_spm |
---|
1168 | USE par_spm, ONLY: & ! Sediment parameters |
---|
1169 | & jp_spm |
---|
1170 | #endif |
---|
1171 | |
---|
1172 | IMPLICIT NONE |
---|
1173 | |
---|
1174 | !! * Arguments |
---|
1175 | INTEGER, INTENT(IN) :: kstp ! Current timestep |
---|
1176 | !! * Local declarations |
---|
1177 | INTEGER :: idaystp ! Number of timesteps per day |
---|
1178 | INTEGER :: imeanstp ! Number of timesteps for sla averaging |
---|
1179 | INTEGER :: jtype ! Data loop variable |
---|
1180 | INTEGER :: jvar ! Variable number |
---|
1181 | INTEGER :: ji, jj, jk ! Loop counters |
---|
1182 | REAL(wp) :: tiny ! small number |
---|
1183 | REAL(wp), POINTER, DIMENSION(:,:,:,:) :: & |
---|
1184 | & zprofvar, & ! Model values for variables in a prof ob |
---|
1185 | & zprofclim ! Climatology values for variables in a prof ob |
---|
1186 | REAL(wp), POINTER, DIMENSION(:,:,:,:) :: & |
---|
1187 | & zprofmask ! Mask associated with zprofvar |
---|
1188 | REAL(wp), POINTER, DIMENSION(:,:,:) :: & |
---|
1189 | & zsurfvar, & ! Model values equivalent to surface ob. |
---|
1190 | & zsurfclim, & ! Climatology values for variables in a surface ob. |
---|
1191 | & zsurfmask ! Mask associated with surface variable |
---|
1192 | REAL(wp), POINTER, DIMENSION(:,:,:) :: & |
---|
1193 | & zglam, & ! Model longitudes |
---|
1194 | & zgphi ! Model latitudes |
---|
1195 | LOGICAL :: llog10 ! Perform log10 transform of variable |
---|
1196 | #if defined key_fabm |
---|
1197 | REAL(wp), POINTER, DIMENSION(:,:,:) :: & |
---|
1198 | & fabm_3d ! 3D variable from FABM |
---|
1199 | #endif |
---|
1200 | |
---|
1201 | IF(lwp) THEN |
---|
1202 | WRITE(numout,*) |
---|
1203 | WRITE(numout,*) 'dia_obs : Call the observation operators', kstp |
---|
1204 | WRITE(numout,*) '~~~~~~~' |
---|
1205 | CALL FLUSH(numout) |
---|
1206 | ENDIF |
---|
1207 | |
---|
1208 | idaystp = NINT( rday / rdt ) |
---|
1209 | |
---|
1210 | !----------------------------------------------------------------------- |
---|
1211 | ! Call the profile and surface observation operators |
---|
1212 | !----------------------------------------------------------------------- |
---|
1213 | |
---|
1214 | IF ( nproftypes > 0 ) THEN |
---|
1215 | |
---|
1216 | DO jtype = 1, nproftypes |
---|
1217 | |
---|
1218 | ! Allocate local work arrays |
---|
1219 | CALL wrk_alloc( jpi, jpj, jpk, profdataqc(jtype)%nvar, zprofvar ) |
---|
1220 | CALL wrk_alloc( jpi, jpj, jpk, profdataqc(jtype)%nvar, zprofmask ) |
---|
1221 | CALL wrk_alloc( jpi, jpj, profdataqc(jtype)%nvar, zglam ) |
---|
1222 | CALL wrk_alloc( jpi, jpj, profdataqc(jtype)%nvar, zgphi ) |
---|
1223 | CALL wrk_alloc( jpi, jpj, jpk, profdataqc(jtype)%nvar, zprofclim ) |
---|
1224 | |
---|
1225 | ! Defaults which might change |
---|
1226 | DO jvar = 1, profdataqc(jtype)%nvar |
---|
1227 | zprofmask(:,:,:,jvar) = tmask(:,:,:) |
---|
1228 | zglam(:,:,jvar) = glamt(:,:) |
---|
1229 | zgphi(:,:,jvar) = gphit(:,:) |
---|
1230 | zprofclim(:,:,:,jvar) = 0._wp |
---|
1231 | END DO |
---|
1232 | |
---|
1233 | SELECT CASE ( TRIM(cobstypesprof(jtype)) ) |
---|
1234 | |
---|
1235 | CASE('prof') |
---|
1236 | zprofvar(:,:,:,1) = tsn(:,:,:,jp_tem) |
---|
1237 | zprofvar(:,:,:,2) = tsn(:,:,:,jp_sal) |
---|
1238 | IF ( ln_output_clim ) THEN |
---|
1239 | zprofclim(:,:,:,1) = tclim(:,:,:) |
---|
1240 | zprofclim(:,:,:,2) = sclim(:,:,:) |
---|
1241 | ENDIF |
---|
1242 | |
---|
1243 | CASE('vel') |
---|
1244 | zprofvar(:,:,:,1) = un(:,:,:) |
---|
1245 | zprofvar(:,:,:,2) = vn(:,:,:) |
---|
1246 | zprofmask(:,:,:,1) = umask(:,:,:) |
---|
1247 | zprofmask(:,:,:,2) = vmask(:,:,:) |
---|
1248 | zglam(:,:,1) = glamu(:,:) |
---|
1249 | zglam(:,:,2) = glamv(:,:) |
---|
1250 | zgphi(:,:,1) = gphiu(:,:) |
---|
1251 | zgphi(:,:,2) = gphiv(:,:) |
---|
1252 | |
---|
1253 | CASE('plchltot') |
---|
1254 | #if defined key_hadocc |
---|
1255 | ! Chlorophyll from HadOCC |
---|
1256 | zprofvar(:,:,:,1) = HADOCC_CHL(:,:,:) |
---|
1257 | #elif defined key_medusa |
---|
1258 | ! Add non-diatom and diatom chlorophyll from MEDUSA |
---|
1259 | zprofvar(:,:,:,1) = trn(:,:,:,jpchn) + trn(:,:,:,jpchd) |
---|
1260 | #elif defined key_fabm |
---|
1261 | ! Add all chlorophyll groups from ERSEM |
---|
1262 | zprofvar(:,:,:,1) = trn(:,:,:,jp_fabm_m1+jp_fabm_chl1) + trn(:,:,:,jp_fabm_m1+jp_fabm_chl2) + & |
---|
1263 | & trn(:,:,:,jp_fabm_m1+jp_fabm_chl3) + trn(:,:,:,jp_fabm_m1+jp_fabm_chl4) |
---|
1264 | #else |
---|
1265 | CALL ctl_stop( ' Trying to run plchltot observation operator', & |
---|
1266 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1267 | #endif |
---|
1268 | ! Take the log10 where we can, otherwise exclude |
---|
1269 | tiny = 1.0e-20 |
---|
1270 | WHERE(zprofvar(:,:,:,:) > tiny .AND. zprofvar(:,:,:,:) /= obfillflt ) |
---|
1271 | zprofvar(:,:,:,:) = LOG10(zprofvar(:,:,:,:)) |
---|
1272 | ELSEWHERE |
---|
1273 | zprofvar(:,:,:,:) = obfillflt |
---|
1274 | zprofmask(:,:,:,:) = 0 |
---|
1275 | END WHERE |
---|
1276 | ! Mask out model below any excluded values, |
---|
1277 | ! to avoid interpolation issues |
---|
1278 | DO jvar = 1, profdataqc(jtype)%nvar |
---|
1279 | DO jj = 1, jpj |
---|
1280 | DO ji = 1, jpi |
---|
1281 | depth_loop: DO jk = 1, jpk |
---|
1282 | IF ( zprofmask(ji,jj,jk,jvar) == 0 ) THEN |
---|
1283 | zprofmask(ji,jj,jk:jpk,jvar) = 0 |
---|
1284 | EXIT depth_loop |
---|
1285 | ENDIF |
---|
1286 | END DO depth_loop |
---|
1287 | END DO |
---|
1288 | END DO |
---|
1289 | END DO |
---|
1290 | |
---|
1291 | CASE('pchltot') |
---|
1292 | #if defined key_hadocc |
---|
1293 | ! Chlorophyll from HadOCC |
---|
1294 | zprofvar(:,:,:,1) = HADOCC_CHL(:,:,:) |
---|
1295 | #elif defined key_medusa |
---|
1296 | ! Add non-diatom and diatom chlorophyll from MEDUSA |
---|
1297 | zprofvar(:,:,:,1) = trn(:,:,:,jpchn) + trn(:,:,:,jpchd) |
---|
1298 | #elif defined key_fabm |
---|
1299 | ! Add all chlorophyll groups from ERSEM |
---|
1300 | zprofvar(:,:,:,1) = trn(:,:,:,jp_fabm_m1+jp_fabm_chl1) + trn(:,:,:,jp_fabm_m1+jp_fabm_chl2) + & |
---|
1301 | & trn(:,:,:,jp_fabm_m1+jp_fabm_chl3) + trn(:,:,:,jp_fabm_m1+jp_fabm_chl4) |
---|
1302 | #else |
---|
1303 | CALL ctl_stop( ' Trying to run pchltot observation operator', & |
---|
1304 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1305 | #endif |
---|
1306 | |
---|
1307 | CASE('pno3') |
---|
1308 | #if defined key_hadocc |
---|
1309 | ! Dissolved inorganic nitrogen from HadOCC |
---|
1310 | zprofvar(:,:,:,1) = trn(:,:,:,jp_had_nut) |
---|
1311 | #elif defined key_medusa |
---|
1312 | ! Dissolved inorganic nitrogen from MEDUSA |
---|
1313 | zprofvar(:,:,:,1) = trn(:,:,:,jpdin) |
---|
1314 | #elif defined key_fabm |
---|
1315 | ! Nitrate from ERSEM |
---|
1316 | zprofvar(:,:,:,1) = trn(:,:,:,jp_fabm_m1+jp_fabm_n3n) |
---|
1317 | #else |
---|
1318 | CALL ctl_stop( ' Trying to run pno3 observation operator', & |
---|
1319 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1320 | #endif |
---|
1321 | |
---|
1322 | CASE('psi4') |
---|
1323 | #if defined key_hadocc |
---|
1324 | CALL ctl_stop( ' Trying to run psi4 observation operator', & |
---|
1325 | & ' but HadOCC does not simulate silicate' ) |
---|
1326 | #elif defined key_medusa |
---|
1327 | ! Silicate from MEDUSA |
---|
1328 | zprofvar(:,:,:,1) = trn(:,:,:,jpsil) |
---|
1329 | #elif defined key_fabm |
---|
1330 | ! Silicate from ERSEM |
---|
1331 | zprofvar(:,:,:,1) = trn(:,:,:,jp_fabm_m1+jp_fabm_n5s) |
---|
1332 | #else |
---|
1333 | CALL ctl_stop( ' Trying to run psi4 observation operator', & |
---|
1334 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1335 | #endif |
---|
1336 | |
---|
1337 | CASE('ppo4') |
---|
1338 | #if defined key_hadocc |
---|
1339 | CALL ctl_stop( ' Trying to run ppo4 observation operator', & |
---|
1340 | & ' but HadOCC does not simulate phosphate' ) |
---|
1341 | #elif defined key_medusa |
---|
1342 | CALL ctl_stop( ' Trying to run ppo4 observation operator', & |
---|
1343 | & ' but MEDUSA does not simulate phosphate' ) |
---|
1344 | #elif defined key_fabm |
---|
1345 | ! Phosphate from ERSEM |
---|
1346 | zprofvar(:,:,:,1) = trn(:,:,:,jp_fabm_m1+jp_fabm_n1p) |
---|
1347 | #else |
---|
1348 | CALL ctl_stop( ' Trying to run ppo4 observation operator', & |
---|
1349 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1350 | #endif |
---|
1351 | |
---|
1352 | CASE('pdic') |
---|
1353 | #if defined key_hadocc |
---|
1354 | ! Dissolved inorganic carbon from HadOCC |
---|
1355 | zprofvar(:,:,:,1) = trn(:,:,:,jp_had_dic) |
---|
1356 | #elif defined key_medusa |
---|
1357 | ! Dissolved inorganic carbon from MEDUSA |
---|
1358 | zprofvar(:,:,:,1) = trn(:,:,:,jpdic) |
---|
1359 | #elif defined key_fabm |
---|
1360 | ! Dissolved inorganic carbon from ERSEM |
---|
1361 | zprofvar(:,:,:,1) = trn(:,:,:,jp_fabm_m1+jp_fabm_o3c) |
---|
1362 | #else |
---|
1363 | CALL ctl_stop( ' Trying to run pdic observation operator', & |
---|
1364 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1365 | #endif |
---|
1366 | |
---|
1367 | CASE('palk') |
---|
1368 | #if defined key_hadocc |
---|
1369 | ! Alkalinity from HadOCC |
---|
1370 | zprofvar(:,:,:,1) = trn(:,:,:,jp_had_alk) |
---|
1371 | #elif defined key_medusa |
---|
1372 | ! Alkalinity from MEDUSA |
---|
1373 | zprofvar(:,:,:,1) = trn(:,:,:,jpalk) |
---|
1374 | #elif defined key_fabm |
---|
1375 | ! Alkalinity from ERSEM |
---|
1376 | zprofvar(:,:,:,1) = model%get_interior_diagnostic_data(jp_fabm_o3ta) |
---|
1377 | #else |
---|
1378 | CALL ctl_stop( ' Trying to run palk observation operator', & |
---|
1379 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1380 | #endif |
---|
1381 | |
---|
1382 | CASE('pph') |
---|
1383 | #if defined key_hadocc |
---|
1384 | CALL ctl_stop( ' Trying to run pph observation operator', & |
---|
1385 | & ' but HadOCC has no pH diagnostic defined' ) |
---|
1386 | #elif defined key_medusa && defined key_roam |
---|
1387 | ! pH from MEDUSA |
---|
1388 | zprofvar(:,:,:,1) = f3_pH(:,:,:) |
---|
1389 | #elif defined key_fabm |
---|
1390 | ! pH from ERSEM |
---|
1391 | zprofvar(:,:,:,1) = model%get_interior_diagnostic_data(jp_fabm_o3ph) |
---|
1392 | #else |
---|
1393 | CALL ctl_stop( ' Trying to run pph observation operator', & |
---|
1394 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1395 | #endif |
---|
1396 | |
---|
1397 | CASE('po2') |
---|
1398 | #if defined key_hadocc |
---|
1399 | CALL ctl_stop( ' Trying to run po2 observation operator', & |
---|
1400 | & ' but HadOCC does not simulate oxygen' ) |
---|
1401 | #elif defined key_medusa |
---|
1402 | ! Oxygen from MEDUSA |
---|
1403 | zprofvar(:,:,:,1) = trn(:,:,:,jpoxy) |
---|
1404 | #elif defined key_fabm |
---|
1405 | ! Oxygen from ERSEM |
---|
1406 | zprofvar(:,:,:,1) = trn(:,:,:,jp_fabm_m1+jp_fabm_o2o) |
---|
1407 | #else |
---|
1408 | CALL ctl_stop( ' Trying to run po2 observation operator', & |
---|
1409 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1410 | #endif |
---|
1411 | |
---|
1412 | CASE DEFAULT |
---|
1413 | CALL ctl_stop( 'Unknown profile observation type '//TRIM(cobstypesprof(jtype))//' in dia_obs' ) |
---|
1414 | |
---|
1415 | END SELECT |
---|
1416 | |
---|
1417 | DO jvar = 1, profdataqc(jtype)%nvar |
---|
1418 | CALL obs_prof_opt( profdataqc(jtype), kstp, jpi, jpj, jpk, & |
---|
1419 | & nit000, idaystp, jvar, & |
---|
1420 | & zprofvar(:,:,:,jvar), & |
---|
1421 | & zprofclim(:,:,:,jvar), & |
---|
1422 | & fsdept(:,:,:), fsdepw(:,:,:), & |
---|
1423 | & zprofmask(:,:,:,jvar), & |
---|
1424 | & zglam(:,:,jvar), zgphi(:,:,jvar), & |
---|
1425 | & nn_1dint, nn_2dint_default, & |
---|
1426 | & kdailyavtypes = nn_profdavtypes ) |
---|
1427 | END DO |
---|
1428 | |
---|
1429 | CALL wrk_dealloc( jpi, jpj, jpk, profdataqc(jtype)%nvar, zprofvar ) |
---|
1430 | CALL wrk_dealloc( jpi, jpj, jpk, profdataqc(jtype)%nvar, zprofmask ) |
---|
1431 | CALL wrk_dealloc( jpi, jpj, profdataqc(jtype)%nvar, zglam ) |
---|
1432 | CALL wrk_dealloc( jpi, jpj, profdataqc(jtype)%nvar, zgphi ) |
---|
1433 | CALL wrk_dealloc( jpi, jpj, jpk, profdataqc(jtype)%nvar, zprofclim ) |
---|
1434 | |
---|
1435 | END DO |
---|
1436 | |
---|
1437 | ENDIF |
---|
1438 | |
---|
1439 | IF ( nsurftypes > 0 ) THEN |
---|
1440 | |
---|
1441 | #if defined key_fabm |
---|
1442 | CALL wrk_alloc( jpi, jpj, jpk, fabm_3d ) |
---|
1443 | #endif |
---|
1444 | |
---|
1445 | DO jtype = 1, nsurftypes |
---|
1446 | |
---|
1447 | !Allocate local work arrays |
---|
1448 | CALL wrk_alloc( jpi, jpj, surfdataqc(jtype)%nvar, zsurfvar ) |
---|
1449 | CALL wrk_alloc( jpi, jpj, surfdataqc(jtype)%nvar, zsurfclim ) |
---|
1450 | CALL wrk_alloc( jpi, jpj, surfdataqc(jtype)%nvar, zsurfmask ) |
---|
1451 | CALL wrk_alloc( jpi, jpj, surfdataqc(jtype)%nvar, zglam ) |
---|
1452 | CALL wrk_alloc( jpi, jpj, surfdataqc(jtype)%nvar, zgphi ) |
---|
1453 | |
---|
1454 | !Defaults which might be changed |
---|
1455 | DO jvar = 1, surfdataqc(jtype)%nvar |
---|
1456 | zsurfmask(:,:,jvar) = tmask(:,:,1) |
---|
1457 | zsurfclim(:,:,jvar) = 0._wp |
---|
1458 | zglam(:,:,jvar) = glamt(:,:) |
---|
1459 | zgphi(:,:,jvar) = gphit(:,:) |
---|
1460 | END DO |
---|
1461 | llog10 = .FALSE. |
---|
1462 | |
---|
1463 | SELECT CASE ( TRIM(cobstypessurf(jtype)) ) |
---|
1464 | CASE('sst') |
---|
1465 | zsurfvar(:,:,1) = tsn(:,:,1,jp_tem) |
---|
1466 | IF ( ln_output_clim ) zsurfclim(:,:,1) = tclim(:,:,1) |
---|
1467 | CASE('sla') |
---|
1468 | zsurfvar(:,:,1) = sshn(:,:) |
---|
1469 | CASE('sss') |
---|
1470 | zsurfvar(:,:,1) = tsn(:,:,1,jp_sal) |
---|
1471 | IF ( ln_output_clim ) zsurfclim(:,:,1) = sclim(:,:,1) |
---|
1472 | CASE('ssv') |
---|
1473 | zsurfvar(:,:,1) = un(:,:,1) |
---|
1474 | zsurfvar(:,:,2) = vn(:,:,1) |
---|
1475 | zsurfmask(:,:,1) = umask(:,:,1) |
---|
1476 | zsurfmask(:,:,2) = vmask(:,:,1) |
---|
1477 | zglam(:,:,1) = glamu(:,:) |
---|
1478 | zglam(:,:,2) = glamv(:,:) |
---|
1479 | zgphi(:,:,1) = gphiu(:,:) |
---|
1480 | zgphi(:,:,2) = gphiv(:,:) |
---|
1481 | CASE('sic') |
---|
1482 | IF ( kstp == 0 ) THEN |
---|
1483 | IF ( lwp .AND. surfdataqc(jtype)%nsstpmpp(1) > 0 ) THEN |
---|
1484 | CALL ctl_warn( 'Sea-ice not initialised on zeroth '// & |
---|
1485 | & 'time-step but some obs are valid then.' ) |
---|
1486 | WRITE(numout,*)surfdataqc(jtype)%nsstpmpp(1), & |
---|
1487 | & ' sea-ice concentration obs will be missed' |
---|
1488 | ENDIF |
---|
1489 | ELSE |
---|
1490 | #if defined key_cice |
---|
1491 | zsurfvar(:,:,1) = fr_i(:,:) |
---|
1492 | #elif defined key_lim2 || defined key_lim3 |
---|
1493 | zsurfvar(:,:,1) = 1._wp - frld(:,:) |
---|
1494 | #else |
---|
1495 | CALL ctl_stop( ' Trying to run sea-ice concentration observation operator', & |
---|
1496 | & ' but no sea-ice model appears to have been defined' ) |
---|
1497 | #endif |
---|
1498 | ENDIF |
---|
1499 | |
---|
1500 | CASE('sit') |
---|
1501 | IF ( kstp == 0 ) THEN |
---|
1502 | IF ( lwp .AND. surfdataqc(jtype)%nsstpmpp(1) > 0 ) THEN |
---|
1503 | CALL ctl_warn( 'Sea-ice not initialised on zeroth '// & |
---|
1504 | & 'time-step but some obs are valid then.' ) |
---|
1505 | WRITE(numout,*)surfdataqc(jtype)%nsstpmpp(1), & |
---|
1506 | & ' sea-ice thickness obs will be missed and QC flag set to 4' |
---|
1507 | ENDIF |
---|
1508 | ELSE |
---|
1509 | #if defined key_cice |
---|
1510 | zsurfvar(:,:,1) = thick_i(:,:) |
---|
1511 | #elif defined key_lim2 || defined key_lim3 |
---|
1512 | CALL ctl_stop( ' No sea-ice thickness observation operator defined for LIM model' ) |
---|
1513 | #else |
---|
1514 | CALL ctl_stop( ' Trying to run sea-ice thickness observation operator', & |
---|
1515 | & ' but no sea-ice model appears to have been defined' ) |
---|
1516 | #endif |
---|
1517 | ENDIF |
---|
1518 | |
---|
1519 | CASE('fbd') |
---|
1520 | IF ( kstp == 0 ) THEN |
---|
1521 | IF ( lwp .AND. surfdataqc(jtype)%nsstpmpp(1) > 0 ) THEN |
---|
1522 | CALL ctl_warn( 'Sea-ice not initialised on zeroth '// & |
---|
1523 | & 'time-step but some obs are valid then.' ) |
---|
1524 | WRITE(numout,*)surfdataqc(jtype)%nsstpmpp(1), & |
---|
1525 | & ' sea-ice freeboard obs will be missed and QC flag set to 4' |
---|
1526 | ENDIF |
---|
1527 | ELSE |
---|
1528 | #if defined key_cice |
---|
1529 | zsurfvar(:,:) = thick_i(:,:) |
---|
1530 | #elif defined key_lim2 || defined key_lim3 |
---|
1531 | CALL ctl_stop( ' No sea-ice freeboard observation operator defined for LIM model' ) |
---|
1532 | #else |
---|
1533 | CALL ctl_stop( ' Trying to run sea-ice freeboard observation operator', & |
---|
1534 | & ' but no sea-ice model appears to have been defined' ) |
---|
1535 | #endif |
---|
1536 | ENDIF |
---|
1537 | |
---|
1538 | CASE('slchltot') |
---|
1539 | #if defined key_hadocc |
---|
1540 | ! Surface chlorophyll from HadOCC |
---|
1541 | zsurfvar(:,:,1) = HADOCC_CHL(:,:,1) |
---|
1542 | #elif defined key_medusa |
---|
1543 | ! Add non-diatom and diatom surface chlorophyll from MEDUSA |
---|
1544 | zsurfvar(:,:,1) = trn(:,:,1,jpchn) + trn(:,:,1,jpchd) |
---|
1545 | #elif defined key_fabm |
---|
1546 | ! Add all surface chlorophyll groups from ERSEM |
---|
1547 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_chl1) + trn(:,:,1,jp_fabm_m1+jp_fabm_chl2) + & |
---|
1548 | & trn(:,:,1,jp_fabm_m1+jp_fabm_chl3) + trn(:,:,1,jp_fabm_m1+jp_fabm_chl4) |
---|
1549 | #else |
---|
1550 | CALL ctl_stop( ' Trying to run slchltot observation operator', & |
---|
1551 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1552 | #endif |
---|
1553 | llog10 = .TRUE. |
---|
1554 | |
---|
1555 | CASE('slchldia') |
---|
1556 | #if defined key_hadocc |
---|
1557 | CALL ctl_stop( ' Trying to run slchldia observation operator', & |
---|
1558 | & ' but HadOCC does not explicitly simulate diatoms' ) |
---|
1559 | #elif defined key_medusa |
---|
1560 | ! Diatom surface chlorophyll from MEDUSA |
---|
1561 | zsurfvar(:,:,1) = trn(:,:,1,jpchd) |
---|
1562 | #elif defined key_fabm |
---|
1563 | ! Diatom surface chlorophyll from ERSEM |
---|
1564 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_chl1) |
---|
1565 | #else |
---|
1566 | CALL ctl_stop( ' Trying to run slchldia observation operator', & |
---|
1567 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1568 | #endif |
---|
1569 | llog10 = .TRUE. |
---|
1570 | |
---|
1571 | CASE('slchlnon') |
---|
1572 | #if defined key_hadocc |
---|
1573 | CALL ctl_stop( ' Trying to run slchlnon observation operator', & |
---|
1574 | & ' but HadOCC does not explicitly simulate non-diatoms' ) |
---|
1575 | #elif defined key_medusa |
---|
1576 | ! Non-diatom surface chlorophyll from MEDUSA |
---|
1577 | zsurfvar(:,:,1) = trn(:,:,1,jpchn) |
---|
1578 | #elif defined key_fabm |
---|
1579 | ! Add all non-diatom surface chlorophyll groups from ERSEM |
---|
1580 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_chl2) + & |
---|
1581 | & trn(:,:,1,jp_fabm_m1+jp_fabm_chl3) + trn(:,:,1,jp_fabm_m1+jp_fabm_chl4) |
---|
1582 | #else |
---|
1583 | CALL ctl_stop( ' Trying to run slchlnon observation operator', & |
---|
1584 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1585 | #endif |
---|
1586 | llog10 = .TRUE. |
---|
1587 | |
---|
1588 | CASE('slchldin') |
---|
1589 | #if defined key_hadocc |
---|
1590 | CALL ctl_stop( ' Trying to run slchldin observation operator', & |
---|
1591 | & ' but HadOCC does not explicitly simulate dinoflagellates' ) |
---|
1592 | #elif defined key_medusa |
---|
1593 | CALL ctl_stop( ' Trying to run slchldin observation operator', & |
---|
1594 | & ' but MEDUSA does not explicitly simulate dinoflagellates' ) |
---|
1595 | #elif defined key_fabm |
---|
1596 | ! Dinoflagellate surface chlorophyll from ERSEM |
---|
1597 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_chl4) |
---|
1598 | #else |
---|
1599 | CALL ctl_stop( ' Trying to run slchldin observation operator', & |
---|
1600 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1601 | #endif |
---|
1602 | llog10 = .TRUE. |
---|
1603 | |
---|
1604 | CASE('slchlmic') |
---|
1605 | #if defined key_hadocc |
---|
1606 | CALL ctl_stop( ' Trying to run slchlmic observation operator', & |
---|
1607 | & ' but HadOCC does not explicitly simulate microphytoplankton' ) |
---|
1608 | #elif defined key_medusa |
---|
1609 | CALL ctl_stop( ' Trying to run slchlmic observation operator', & |
---|
1610 | & ' but MEDUSA does not explicitly simulate microphytoplankton' ) |
---|
1611 | #elif defined key_fabm |
---|
1612 | ! Add diatom and dinoflagellate surface chlorophyll from ERSEM |
---|
1613 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_chl1) + trn(:,:,1,jp_fabm_m1+jp_fabm_chl4) |
---|
1614 | #else |
---|
1615 | CALL ctl_stop( ' Trying to run slchlmic observation operator', & |
---|
1616 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1617 | #endif |
---|
1618 | llog10 = .TRUE. |
---|
1619 | |
---|
1620 | CASE('slchlnan') |
---|
1621 | #if defined key_hadocc |
---|
1622 | CALL ctl_stop( ' Trying to run slchlnan observation operator', & |
---|
1623 | & ' but HadOCC does not explicitly simulate nanophytoplankton' ) |
---|
1624 | #elif defined key_medusa |
---|
1625 | CALL ctl_stop( ' Trying to run slchlnan observation operator', & |
---|
1626 | & ' but MEDUSA does not explicitly simulate nanophytoplankton' ) |
---|
1627 | #elif defined key_fabm |
---|
1628 | ! Nanophytoplankton surface chlorophyll from ERSEM |
---|
1629 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_chl2) |
---|
1630 | #else |
---|
1631 | CALL ctl_stop( ' Trying to run slchlnan observation operator', & |
---|
1632 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1633 | #endif |
---|
1634 | llog10 = .TRUE. |
---|
1635 | |
---|
1636 | CASE('slchlpic') |
---|
1637 | #if defined key_hadocc |
---|
1638 | CALL ctl_stop( ' Trying to run slchlpic observation operator', & |
---|
1639 | & ' but HadOCC does not explicitly simulate picophytoplankton' ) |
---|
1640 | #elif defined key_medusa |
---|
1641 | CALL ctl_stop( ' Trying to run slchlpic observation operator', & |
---|
1642 | & ' but MEDUSA does not explicitly simulate picophytoplankton' ) |
---|
1643 | #elif defined key_fabm |
---|
1644 | ! Picophytoplankton surface chlorophyll from ERSEM |
---|
1645 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_chl3) |
---|
1646 | #else |
---|
1647 | CALL ctl_stop( ' Trying to run slchlpic observation operator', & |
---|
1648 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1649 | #endif |
---|
1650 | llog10 = .TRUE. |
---|
1651 | |
---|
1652 | CASE('schltot') |
---|
1653 | #if defined key_hadocc |
---|
1654 | ! Surface chlorophyll from HadOCC |
---|
1655 | zsurfvar(:,:,1) = HADOCC_CHL(:,:,1) |
---|
1656 | #elif defined key_medusa |
---|
1657 | ! Add non-diatom and diatom surface chlorophyll from MEDUSA |
---|
1658 | zsurfvar(:,:,1) = trn(:,:,1,jpchn) + trn(:,:,1,jpchd) |
---|
1659 | #elif defined key_fabm |
---|
1660 | ! Add all surface chlorophyll groups from ERSEM |
---|
1661 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_chl1) + trn(:,:,1,jp_fabm_m1+jp_fabm_chl2) + & |
---|
1662 | & trn(:,:,1,jp_fabm_m1+jp_fabm_chl3) + trn(:,:,1,jp_fabm_m1+jp_fabm_chl4) |
---|
1663 | #else |
---|
1664 | CALL ctl_stop( ' Trying to run schltot observation operator', & |
---|
1665 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1666 | #endif |
---|
1667 | |
---|
1668 | CASE('slphytot') |
---|
1669 | #if defined key_hadocc |
---|
1670 | ! Surface phytoplankton nitrogen from HadOCC multiplied by C:N ratio |
---|
1671 | zsurfvar(:,:,1) = trn(:,:,1,jp_had_phy) * c2n_p |
---|
1672 | #elif defined key_medusa |
---|
1673 | ! Add non-diatom and diatom surface phytoplankton nitrogen from MEDUSA |
---|
1674 | ! multiplied by C:N ratio for each |
---|
1675 | zsurfvar(:,:,1) = (trn(:,:,1,jpphn) * xthetapn) + (trn(:,:,1,jpphd) * xthetapd) |
---|
1676 | #elif defined key_fabm |
---|
1677 | ! Add all surface phytoplankton carbon groups from ERSEM |
---|
1678 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_p1c) + trn(:,:,1,jp_fabm_m1+jp_fabm_p2c) + & |
---|
1679 | & trn(:,:,1,jp_fabm_m1+jp_fabm_p3c) + trn(:,:,1,jp_fabm_m1+jp_fabm_p4c) |
---|
1680 | #else |
---|
1681 | CALL ctl_stop( ' Trying to run slphytot observation operator', & |
---|
1682 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1683 | #endif |
---|
1684 | llog10 = .TRUE. |
---|
1685 | |
---|
1686 | CASE('slphydia') |
---|
1687 | #if defined key_hadocc |
---|
1688 | CALL ctl_stop( ' Trying to run slphydia observation operator', & |
---|
1689 | & ' but HadOCC does not explicitly simulate diatoms' ) |
---|
1690 | #elif defined key_medusa |
---|
1691 | ! Diatom surface phytoplankton nitrogen from MEDUSA multiplied by C:N ratio |
---|
1692 | zsurfvar(:,:,1) = trn(:,:,1,jpphd) * xthetapd |
---|
1693 | #elif defined key_fabm |
---|
1694 | ! Diatom surface phytoplankton carbon from ERSEM |
---|
1695 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_p1c) |
---|
1696 | #else |
---|
1697 | CALL ctl_stop( ' Trying to run slphydia observation operator', & |
---|
1698 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1699 | #endif |
---|
1700 | llog10 = .TRUE. |
---|
1701 | |
---|
1702 | CASE('slphynon') |
---|
1703 | #if defined key_hadocc |
---|
1704 | CALL ctl_stop( ' Trying to run slphynon observation operator', & |
---|
1705 | & ' but HadOCC does not explicitly simulate non-diatoms' ) |
---|
1706 | #elif defined key_medusa |
---|
1707 | ! Non-diatom surface phytoplankton nitrogen from MEDUSA multiplied by C:N ratio |
---|
1708 | zsurfvar(:,:,1) = trn(:,:,1,jpphn) * xthetapn |
---|
1709 | #elif defined key_fabm |
---|
1710 | ! Add all non-diatom surface phytoplankton carbon groups from ERSEM |
---|
1711 | zsurfvar(:,:,1) = trn(:,:,1,jp_fabm_m1+jp_fabm_p2c) + & |
---|
1712 | & trn(:,:,1,jp_fabm_m1+jp_fabm_p3c) + trn(:,:,1,jp_fabm_m1+jp_fabm_p4c) |
---|
1713 | #else |
---|
1714 | CALL ctl_stop( ' Trying to run slphynon observation operator', & |
---|
1715 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1716 | #endif |
---|
1717 | llog10 = .TRUE. |
---|
1718 | |
---|
1719 | CASE('sspm') |
---|
1720 | #if defined key_spm |
---|
1721 | zsurfvar(:,:,1) = 0.0 |
---|
1722 | DO jn = 1, jp_spm |
---|
1723 | zsurfvar(:,:,1) = zsurfvar(:,:,1) + trn(:,:,1,jn) ! sum SPM sizes |
---|
1724 | END DO |
---|
1725 | #else |
---|
1726 | CALL ctl_stop( ' Trying to run sspm observation operator', & |
---|
1727 | & ' but no spm model appears to have been defined' ) |
---|
1728 | #endif |
---|
1729 | |
---|
1730 | CASE('skd490') |
---|
1731 | #if defined key_hadocc |
---|
1732 | CALL ctl_stop( ' Trying to run skd490 observation operator', & |
---|
1733 | & ' but HadOCC does not explicitly simulate Kd490' ) |
---|
1734 | #elif defined key_medusa |
---|
1735 | CALL ctl_stop( ' Trying to run skd490 observation operator', & |
---|
1736 | & ' but MEDUSA does not explicitly simulate Kd490' ) |
---|
1737 | #elif defined key_fabm |
---|
1738 | ! light_Kd_band3 diagnostic variable if using spectral optical model |
---|
1739 | ! light_xEPS diagnostic variable if using standard ERSEM light model |
---|
1740 | IF ( jp_fabm_kd490 /= -1 ) THEN |
---|
1741 | fabm_3d(:,:,:) = model%get_interior_diagnostic_data(jp_fabm_kd490) |
---|
1742 | ELSEIF ( jp_fabm_xeps /= -1 ) THEN |
---|
1743 | fabm_3d(:,:,:) = model%get_interior_diagnostic_data(jp_fabm_xeps) |
---|
1744 | ELSE |
---|
1745 | CALL ctl_stop( ' Trying to run skd490 observation operator', & |
---|
1746 | & ' but cannot access Kd490 from ERSEM' ) |
---|
1747 | ENDIF |
---|
1748 | zsurfvar(:,:,1) = fabm_3d(:,:,1) |
---|
1749 | #else |
---|
1750 | CALL ctl_stop( ' Trying to run skd490 observation operator', & |
---|
1751 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1752 | #endif |
---|
1753 | |
---|
1754 | CASE('sfco2') |
---|
1755 | #if defined key_hadocc |
---|
1756 | zsurfvar(:,:,1) = HADOCC_FCO2(:,:) ! fCO2 from HadOCC |
---|
1757 | IF ( ( MINVAL( HADOCC_FCO2 ) == HADOCC_FILL_FLT ) .AND. & |
---|
1758 | & ( MAXVAL( HADOCC_FCO2 ) == HADOCC_FILL_FLT ) ) THEN |
---|
1759 | zsurfvar(:,:) = obfillflt |
---|
1760 | zsurfmask(:,:,1) = 0 |
---|
1761 | CALL ctl_warn( ' HadOCC fCO2 values masked out for observation operator', & |
---|
1762 | & ' as HADOCC_FCO2(:,:) == HADOCC_FILL_FLT' ) |
---|
1763 | ENDIF |
---|
1764 | #elif defined key_medusa && defined key_roam |
---|
1765 | zsurfvar(:,:,1) = f2_fco2w(:,:) |
---|
1766 | #elif defined key_fabm |
---|
1767 | ! First, get pCO2 from FABM |
---|
1768 | fabm_3d(:,:,:) = model%get_interior_diagnostic_data(jp_fabm_o3pc) |
---|
1769 | zsurfvar(:,:,1) = fabm_3d(:,:,1) |
---|
1770 | ! Now, convert pCO2 to fCO2, based on SST in K. This follows the standard methodology of: |
---|
1771 | ! Pierrot et al. (2009), Recommendations for autonomous underway pCO2 measuring systems |
---|
1772 | ! and data reduction routines, Deep-Sea Research II, 56: 512-522. |
---|
1773 | ! and |
---|
1774 | ! Weiss (1974), Carbon dioxide in water and seawater: the solubility of a non-ideal gas, |
---|
1775 | ! Marine Chemistry, 2: 203-215. |
---|
1776 | ! In the implementation below, atmospheric pressure has been assumed to be 1 atm and so |
---|
1777 | ! not explicitly included - atmospheric pressure is not necessarily available so this is |
---|
1778 | ! the best assumption. |
---|
1779 | ! Further, the (1-xCO2)^2 term has been neglected. This is common practice |
---|
1780 | ! (see e.g. Zeebe and Wolf-Gladrow (2001), CO2 in Seawater: Equilibrium, Kinetics, Isotopes) |
---|
1781 | ! because xCO2 in atm is ~0, and so this term will only affect the result to the 3rd decimal |
---|
1782 | ! place for typical values, and xCO2 would need to be approximated from pCO2 anyway. |
---|
1783 | zsurfvar(:,:,1) = zsurfvar(:,:,1) * EXP((-1636.75 + & |
---|
1784 | & 12.0408 * (tsn(:,:,1,jp_tem)+rt0) - & |
---|
1785 | & 0.0327957 * (tsn(:,:,1,jp_tem)+rt0)*(tsn(:,:,1,jp_tem)+rt0) + & |
---|
1786 | & 0.0000316528 * (tsn(:,:,1,jp_tem)+rt0)*(tsn(:,:,1,jp_tem)+rt0)*(tsn(:,:,1,jp_tem)+rt0) + & |
---|
1787 | & 2.0 * (57.7 - 0.118 * (tsn(:,:,1,jp_tem)+rt0))) / & |
---|
1788 | & (82.0578 * (tsn(:,:,1,jp_tem)+rt0))) |
---|
1789 | #else |
---|
1790 | CALL ctl_stop( ' Trying to run sfco2 observation operator', & |
---|
1791 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1792 | #endif |
---|
1793 | |
---|
1794 | CASE('spco2') |
---|
1795 | #if defined key_hadocc |
---|
1796 | zsurfvar(:,:,1) = HADOCC_PCO2(:,:) ! pCO2 from HadOCC |
---|
1797 | IF ( ( MINVAL( HADOCC_PCO2 ) == HADOCC_FILL_FLT ) .AND. & |
---|
1798 | & ( MAXVAL( HADOCC_PCO2 ) == HADOCC_FILL_FLT ) ) THEN |
---|
1799 | zsurfvar(:,:,1) = obfillflt |
---|
1800 | zsurfmask(:,:,1) = 0 |
---|
1801 | CALL ctl_warn( ' HadOCC pCO2 values masked out for observation operator', & |
---|
1802 | & ' as HADOCC_PCO2(:,:) == HADOCC_FILL_FLT' ) |
---|
1803 | ENDIF |
---|
1804 | #elif defined key_medusa && defined key_roam |
---|
1805 | zsurfvar(:,:,1) = f2_pco2w(:,:) |
---|
1806 | #elif defined key_fabm |
---|
1807 | fabm_3d(:,:,:) = model%get_interior_diagnostic_data(jp_fabm_o3pc) |
---|
1808 | zsurfvar(:,:,1) = fabm_3d(:,:,1) |
---|
1809 | #else |
---|
1810 | CALL ctl_stop( ' Trying to run spco2 observation operator', & |
---|
1811 | & ' but no biogeochemical model appears to have been defined' ) |
---|
1812 | #endif |
---|
1813 | |
---|
1814 | CASE DEFAULT |
---|
1815 | |
---|
1816 | CALL ctl_stop( 'Unknown surface observation type '//TRIM(cobstypessurf(jtype))//' in dia_obs' ) |
---|
1817 | |
---|
1818 | END SELECT |
---|
1819 | |
---|
1820 | IF ( llog10 ) THEN |
---|
1821 | ! Take the log10 where we can, otherwise exclude |
---|
1822 | tiny = 1.0e-20 |
---|
1823 | WHERE(zsurfvar(:,:,1) > tiny .AND. zsurfvar(:,:,1) /= obfillflt ) |
---|
1824 | zsurfvar(:,:,1) = LOG10(zsurfvar(:,:,1)) |
---|
1825 | ELSEWHERE |
---|
1826 | zsurfvar(:,:,1) = obfillflt |
---|
1827 | zsurfmask(:,:,1) = 0 |
---|
1828 | END WHERE |
---|
1829 | ENDIF |
---|
1830 | |
---|
1831 | DO jvar = 1, surfdataqc(jtype)%nvar |
---|
1832 | |
---|
1833 | IF ( TRIM(cobstypessurf(jtype)) == 'sla' .AND. & |
---|
1834 | & ln_time_mean_sla_bkg ) THEN |
---|
1835 | !Number of time-steps in meaning period |
---|
1836 | imeanstp = NINT( ( MeanPeriodHours * 60. * 60. ) / rdt ) |
---|
1837 | CALL obs_surf_opt( surfdataqc(jtype), kstp, jpi, jpj, & |
---|
1838 | & nit000, idaystp, jvar, & |
---|
1839 | & zsurfvar(:,:,jvar), & |
---|
1840 | & zsurfclim(:,:,jvar), & |
---|
1841 | & zsurfmask(:,:,jvar), & |
---|
1842 | & zglam(:,:,jvar), zgphi(:,:,jvar), & |
---|
1843 | & n2dintsurf(jtype), llnightav(jtype), & |
---|
1844 | & ravglamscl(jtype), ravgphiscl(jtype), & |
---|
1845 | & lfpindegs(jtype), kmeanstp = imeanstp ) |
---|
1846 | |
---|
1847 | ELSE |
---|
1848 | CALL obs_surf_opt( surfdataqc(jtype), kstp, jpi, jpj, & |
---|
1849 | & nit000, idaystp, jvar, & |
---|
1850 | & zsurfvar(:,:,jvar), & |
---|
1851 | & zsurfclim(:,:,jvar), & |
---|
1852 | & zsurfmask(:,:,jvar), & |
---|
1853 | & zglam(:,:,jvar), zgphi(:,:,jvar), & |
---|
1854 | & n2dintsurf(jtype), llnightav(jtype), & |
---|
1855 | & ravglamscl(jtype), ravgphiscl(jtype), & |
---|
1856 | & lfpindegs(jtype) ) |
---|
1857 | ENDIF |
---|
1858 | |
---|
1859 | END DO |
---|
1860 | |
---|
1861 | CALL wrk_dealloc( jpi, jpj, surfdataqc(jtype)%nvar, zsurfvar ) |
---|
1862 | CALL wrk_dealloc( jpi, jpj, surfdataqc(jtype)%nvar, zsurfclim ) |
---|
1863 | CALL wrk_dealloc( jpi, jpj, surfdataqc(jtype)%nvar, zsurfmask ) |
---|
1864 | CALL wrk_dealloc( jpi, jpj, surfdataqc(jtype)%nvar, zglam ) |
---|
1865 | CALL wrk_dealloc( jpi, jpj, surfdataqc(jtype)%nvar, zgphi ) |
---|
1866 | |
---|
1867 | END DO |
---|
1868 | #if defined key_fabm |
---|
1869 | CALL wrk_dealloc( jpi, jpj, jpk, fabm_3d ) |
---|
1870 | #endif |
---|
1871 | |
---|
1872 | ENDIF |
---|
1873 | |
---|
1874 | END SUBROUTINE dia_obs |
---|
1875 | |
---|
1876 | SUBROUTINE dia_obs_wri |
---|
1877 | !!---------------------------------------------------------------------- |
---|
1878 | !! *** ROUTINE dia_obs_wri *** |
---|
1879 | !! |
---|
1880 | !! ** Purpose : Call observation diagnostic output routines |
---|
1881 | !! |
---|
1882 | !! ** Method : Call observation diagnostic output routines |
---|
1883 | !! |
---|
1884 | !! ** Action : |
---|
1885 | !! |
---|
1886 | !! History : |
---|
1887 | !! ! 06-03 (K. Mogensen) Original code |
---|
1888 | !! ! 06-05 (K. Mogensen) Reformatted |
---|
1889 | !! ! 06-10 (A. Weaver) Cleaning |
---|
1890 | !! ! 07-03 (K. Mogensen) General handling of profiles |
---|
1891 | !! ! 08-09 (M. Valdivieso) Velocity component (U,V) profiles |
---|
1892 | !! ! 15-08 (M. Martin) Combined writing for prof and surf types |
---|
1893 | !!---------------------------------------------------------------------- |
---|
1894 | !! * Modules used |
---|
1895 | USE obs_rot_vel ! Rotation of velocities |
---|
1896 | |
---|
1897 | IMPLICIT NONE |
---|
1898 | |
---|
1899 | !! * Local declarations |
---|
1900 | INTEGER :: jtype ! Data set loop variable |
---|
1901 | INTEGER :: jo, jvar, jk |
---|
1902 | REAL(wp), DIMENSION(:), ALLOCATABLE :: & |
---|
1903 | & zu, & |
---|
1904 | & zv |
---|
1905 | |
---|
1906 | !----------------------------------------------------------------------- |
---|
1907 | ! Depending on switches call various observation output routines |
---|
1908 | !----------------------------------------------------------------------- |
---|
1909 | |
---|
1910 | IF ( nproftypes > 0 ) THEN |
---|
1911 | |
---|
1912 | DO jtype = 1, nproftypes |
---|
1913 | |
---|
1914 | IF ( TRIM(cobstypesprof(jtype)) == 'vel' ) THEN |
---|
1915 | |
---|
1916 | ! For velocity data, rotate the model velocities to N/S, E/W |
---|
1917 | ! using the compressed data structure. |
---|
1918 | ALLOCATE( & |
---|
1919 | & zu(profdataqc(jtype)%nvprot(1)), & |
---|
1920 | & zv(profdataqc(jtype)%nvprot(2)) & |
---|
1921 | & ) |
---|
1922 | |
---|
1923 | CALL obs_rotvel_pro( profdataqc(jtype), nn_2dint_default, zu, zv ) |
---|
1924 | |
---|
1925 | DO jo = 1, profdataqc(jtype)%nprof |
---|
1926 | DO jvar = 1, 2 |
---|
1927 | DO jk = profdataqc(jtype)%npvsta(jo,jvar), profdataqc(jtype)%npvend(jo,jvar) |
---|
1928 | |
---|
1929 | IF ( jvar == 1 ) THEN |
---|
1930 | profdataqc(jtype)%var(jvar)%vmod(jk) = zu(jk) |
---|
1931 | ELSE |
---|
1932 | profdataqc(jtype)%var(jvar)%vmod(jk) = zv(jk) |
---|
1933 | ENDIF |
---|
1934 | |
---|
1935 | END DO |
---|
1936 | END DO |
---|
1937 | END DO |
---|
1938 | |
---|
1939 | DEALLOCATE( zu ) |
---|
1940 | DEALLOCATE( zv ) |
---|
1941 | |
---|
1942 | END IF |
---|
1943 | |
---|
1944 | CALL obs_prof_decompress( profdataqc(jtype), & |
---|
1945 | & profdata(jtype), .TRUE., numout ) |
---|
1946 | |
---|
1947 | CALL obs_wri_prof( profdata(jtype) ) |
---|
1948 | |
---|
1949 | END DO |
---|
1950 | |
---|
1951 | ENDIF |
---|
1952 | |
---|
1953 | IF ( nsurftypes > 0 ) THEN |
---|
1954 | |
---|
1955 | DO jtype = 1, nsurftypes |
---|
1956 | |
---|
1957 | IF ( TRIM(cobstypessurf(jtype)) == 'vel' ) THEN |
---|
1958 | |
---|
1959 | ! For velocity data, rotate the model velocities to N/S, E/W |
---|
1960 | ! using the compressed data structure. |
---|
1961 | ALLOCATE( & |
---|
1962 | & zu(surfdataqc(jtype)%nsurf), & |
---|
1963 | & zv(surfdataqc(jtype)%nsurf) & |
---|
1964 | & ) |
---|
1965 | |
---|
1966 | CALL obs_rotvel_surf( surfdataqc(jtype), nn_2dint_default, zu, zv ) |
---|
1967 | |
---|
1968 | DO jo = 1, surfdataqc(jtype)%nsurf |
---|
1969 | surfdataqc(jtype)%rmod(jo,1) = zu(jo) |
---|
1970 | surfdataqc(jtype)%rmod(jo,2) = zv(jo) |
---|
1971 | END DO |
---|
1972 | |
---|
1973 | DEALLOCATE( zu ) |
---|
1974 | DEALLOCATE( zv ) |
---|
1975 | |
---|
1976 | END IF |
---|
1977 | |
---|
1978 | |
---|
1979 | CALL obs_surf_decompress( surfdataqc(jtype), & |
---|
1980 | & surfdata(jtype), .TRUE., numout ) |
---|
1981 | |
---|
1982 | CALL obs_wri_surf( surfdata(jtype) ) |
---|
1983 | |
---|
1984 | END DO |
---|
1985 | |
---|
1986 | ENDIF |
---|
1987 | |
---|
1988 | END SUBROUTINE dia_obs_wri |
---|
1989 | |
---|
1990 | SUBROUTINE dia_obs_dealloc |
---|
1991 | IMPLICIT NONE |
---|
1992 | !!---------------------------------------------------------------------- |
---|
1993 | !! *** ROUTINE dia_obs_dealloc *** |
---|
1994 | !! |
---|
1995 | !! ** Purpose : To deallocate data to enable the obs_oper online loop. |
---|
1996 | !! Specifically: dia_obs_init --> dia_obs --> dia_obs_wri |
---|
1997 | !! |
---|
1998 | !! ** Method : Clean up various arrays left behind by the obs_oper. |
---|
1999 | !! |
---|
2000 | !! ** Action : |
---|
2001 | !! |
---|
2002 | !!---------------------------------------------------------------------- |
---|
2003 | ! obs_grid deallocation |
---|
2004 | CALL obs_grid_deallocate |
---|
2005 | |
---|
2006 | ! diaobs deallocation |
---|
2007 | IF ( nproftypes > 0 ) & |
---|
2008 | & DEALLOCATE( cobstypesprof, profdata, profdataqc, nvarsprof, nextrprof ) |
---|
2009 | |
---|
2010 | IF ( nsurftypes > 0 ) & |
---|
2011 | & DEALLOCATE( cobstypessurf, surfdata, surfdataqc, nvarssurf, nextrsurf, & |
---|
2012 | & n2dintsurf, ravglamscl, ravgphiscl, lfpindegs, llnightav ) |
---|
2013 | |
---|
2014 | END SUBROUTINE dia_obs_dealloc |
---|
2015 | |
---|
2016 | SUBROUTINE ini_date( ddobsini ) |
---|
2017 | !!---------------------------------------------------------------------- |
---|
2018 | !! *** ROUTINE ini_date *** |
---|
2019 | !! |
---|
2020 | !! ** Purpose : Get initial date in double precision YYYYMMDD.HHMMSS format |
---|
2021 | !! |
---|
2022 | !! ** Method : Get initial date in double precision YYYYMMDD.HHMMSS format |
---|
2023 | !! |
---|
2024 | !! ** Action : Get initial date in double precision YYYYMMDD.HHMMSS format |
---|
2025 | !! |
---|
2026 | !! History : |
---|
2027 | !! ! 06-03 (K. Mogensen) Original code |
---|
2028 | !! ! 06-05 (K. Mogensen) Reformatted |
---|
2029 | !! ! 06-10 (A. Weaver) Cleaning |
---|
2030 | !! ! 06-10 (G. Smith) Calculates initial date the same as method for final date |
---|
2031 | !! ! 10-05 (D. Lea) Update to month length calculation for NEMO vn3.2 |
---|
2032 | !!---------------------------------------------------------------------- |
---|
2033 | USE phycst, ONLY : & ! Physical constants |
---|
2034 | & rday |
---|
2035 | USE dom_oce, ONLY : & ! Ocean space and time domain variables |
---|
2036 | & rdt |
---|
2037 | |
---|
2038 | IMPLICIT NONE |
---|
2039 | |
---|
2040 | !! * Arguments |
---|
2041 | REAL(dp), INTENT(OUT) :: ddobsini ! Initial date in YYYYMMDD.HHMMSS |
---|
2042 | |
---|
2043 | !! * Local declarations |
---|
2044 | INTEGER :: iyea ! date - (year, month, day, hour, minute) |
---|
2045 | INTEGER :: imon |
---|
2046 | INTEGER :: iday |
---|
2047 | INTEGER :: ihou |
---|
2048 | INTEGER :: imin |
---|
2049 | INTEGER :: imday ! Number of days in month. |
---|
2050 | INTEGER, DIMENSION(12) :: & |
---|
2051 | & imonth_len ! Length in days of the months of the current year |
---|
2052 | REAL(wp) :: zdayfrc ! Fraction of day |
---|
2053 | |
---|
2054 | !---------------------------------------------------------------------- |
---|
2055 | ! Initial date initialization (year, month, day, hour, minute) |
---|
2056 | ! (This assumes that the initial date is for 00z)) |
---|
2057 | !---------------------------------------------------------------------- |
---|
2058 | iyea = ndate0 / 10000 |
---|
2059 | imon = ( ndate0 - iyea * 10000 ) / 100 |
---|
2060 | iday = ndate0 - iyea * 10000 - imon * 100 |
---|
2061 | ihou = 0 |
---|
2062 | imin = 0 |
---|
2063 | |
---|
2064 | !---------------------------------------------------------------------- |
---|
2065 | ! Compute number of days + number of hours + min since initial time |
---|
2066 | !---------------------------------------------------------------------- |
---|
2067 | iday = iday + ( nit000 -1 ) * rdt / rday |
---|
2068 | zdayfrc = ( nit000 -1 ) * rdt / rday |
---|
2069 | zdayfrc = zdayfrc - aint(zdayfrc) |
---|
2070 | ihou = int( zdayfrc * 24 ) |
---|
2071 | imin = int( (zdayfrc * 24 - ihou) * 60 ) |
---|
2072 | |
---|
2073 | !----------------------------------------------------------------------- |
---|
2074 | ! Convert number of days (iday) into a real date |
---|
2075 | !---------------------------------------------------------------------- |
---|
2076 | |
---|
2077 | CALL calc_month_len( iyea, imonth_len ) |
---|
2078 | |
---|
2079 | DO WHILE ( iday > imonth_len(imon) ) |
---|
2080 | iday = iday - imonth_len(imon) |
---|
2081 | imon = imon + 1 |
---|
2082 | IF ( imon > 12 ) THEN |
---|
2083 | imon = 1 |
---|
2084 | iyea = iyea + 1 |
---|
2085 | CALL calc_month_len( iyea, imonth_len ) ! update month lengths |
---|
2086 | ENDIF |
---|
2087 | END DO |
---|
2088 | |
---|
2089 | !---------------------------------------------------------------------- |
---|
2090 | ! Convert it into YYYYMMDD.HHMMSS format. |
---|
2091 | !---------------------------------------------------------------------- |
---|
2092 | ddobsini = iyea * 10000_dp + imon * 100_dp + & |
---|
2093 | & iday + ihou * 0.01_dp + imin * 0.0001_dp |
---|
2094 | |
---|
2095 | |
---|
2096 | END SUBROUTINE ini_date |
---|
2097 | |
---|
2098 | SUBROUTINE fin_date( ddobsfin ) |
---|
2099 | !!---------------------------------------------------------------------- |
---|
2100 | !! *** ROUTINE fin_date *** |
---|
2101 | !! |
---|
2102 | !! ** Purpose : Get final date in double precision YYYYMMDD.HHMMSS format |
---|
2103 | !! |
---|
2104 | !! ** Method : Get final date in double precision YYYYMMDD.HHMMSS format |
---|
2105 | !! |
---|
2106 | !! ** Action : Get final date in double precision YYYYMMDD.HHMMSS format |
---|
2107 | !! |
---|
2108 | !! History : |
---|
2109 | !! ! 06-03 (K. Mogensen) Original code |
---|
2110 | !! ! 06-05 (K. Mogensen) Reformatted |
---|
2111 | !! ! 06-10 (A. Weaver) Cleaning |
---|
2112 | !! ! 10-05 (D. Lea) Update to month length calculation for NEMO vn3.2 |
---|
2113 | !!---------------------------------------------------------------------- |
---|
2114 | USE phycst, ONLY : & ! Physical constants |
---|
2115 | & rday |
---|
2116 | USE dom_oce, ONLY : & ! Ocean space and time domain variables |
---|
2117 | & rdt |
---|
2118 | |
---|
2119 | IMPLICIT NONE |
---|
2120 | |
---|
2121 | !! * Arguments |
---|
2122 | REAL(dp), INTENT(OUT) :: ddobsfin ! Final date in YYYYMMDD.HHMMSS |
---|
2123 | |
---|
2124 | !! * Local declarations |
---|
2125 | INTEGER :: iyea ! date - (year, month, day, hour, minute) |
---|
2126 | INTEGER :: imon |
---|
2127 | INTEGER :: iday |
---|
2128 | INTEGER :: ihou |
---|
2129 | INTEGER :: imin |
---|
2130 | INTEGER :: imday ! Number of days in month. |
---|
2131 | INTEGER, DIMENSION(12) :: & |
---|
2132 | & imonth_len ! Length in days of the months of the current year |
---|
2133 | REAL(wp) :: zdayfrc ! Fraction of day |
---|
2134 | |
---|
2135 | !----------------------------------------------------------------------- |
---|
2136 | ! Initial date initialization (year, month, day, hour, minute) |
---|
2137 | ! (This assumes that the initial date is for 00z) |
---|
2138 | !----------------------------------------------------------------------- |
---|
2139 | iyea = ndate0 / 10000 |
---|
2140 | imon = ( ndate0 - iyea * 10000 ) / 100 |
---|
2141 | iday = ndate0 - iyea * 10000 - imon * 100 |
---|
2142 | ihou = 0 |
---|
2143 | imin = 0 |
---|
2144 | |
---|
2145 | !----------------------------------------------------------------------- |
---|
2146 | ! Compute number of days + number of hours + min since initial time |
---|
2147 | !----------------------------------------------------------------------- |
---|
2148 | iday = iday + nitend * rdt / rday |
---|
2149 | zdayfrc = nitend * rdt / rday |
---|
2150 | zdayfrc = zdayfrc - AINT( zdayfrc ) |
---|
2151 | ihou = INT( zdayfrc * 24 ) |
---|
2152 | imin = INT( ( zdayfrc * 24 - ihou ) * 60 ) |
---|
2153 | |
---|
2154 | !----------------------------------------------------------------------- |
---|
2155 | ! Convert number of days (iday) into a real date |
---|
2156 | !---------------------------------------------------------------------- |
---|
2157 | |
---|
2158 | CALL calc_month_len( iyea, imonth_len ) |
---|
2159 | |
---|
2160 | DO WHILE ( iday > imonth_len(imon) ) |
---|
2161 | iday = iday - imonth_len(imon) |
---|
2162 | imon = imon + 1 |
---|
2163 | IF ( imon > 12 ) THEN |
---|
2164 | imon = 1 |
---|
2165 | iyea = iyea + 1 |
---|
2166 | CALL calc_month_len( iyea, imonth_len ) ! update month lengths |
---|
2167 | ENDIF |
---|
2168 | END DO |
---|
2169 | |
---|
2170 | !----------------------------------------------------------------------- |
---|
2171 | ! Convert it into YYYYMMDD.HHMMSS format |
---|
2172 | !----------------------------------------------------------------------- |
---|
2173 | ddobsfin = iyea * 10000_dp + imon * 100_dp + iday & |
---|
2174 | & + ihou * 0.01_dp + imin * 0.0001_dp |
---|
2175 | |
---|
2176 | END SUBROUTINE fin_date |
---|
2177 | |
---|
2178 | SUBROUTINE obs_settypefiles( ntypes, jpmaxnfiles, ifiles, cobstypes, cfiles ) |
---|
2179 | |
---|
2180 | INTEGER, INTENT(IN) :: ntypes ! Total number of obs types |
---|
2181 | INTEGER, INTENT(IN) :: jpmaxnfiles ! Maximum number of files allowed for each type |
---|
2182 | INTEGER, DIMENSION(ntypes), INTENT(OUT) :: & |
---|
2183 | & ifiles ! Out number of files for each type |
---|
2184 | CHARACTER(len=8), DIMENSION(ntypes), INTENT(IN) :: & |
---|
2185 | & cobstypes ! List of obs types |
---|
2186 | CHARACTER(len=128), DIMENSION(ntypes, jpmaxnfiles), INTENT(IN) :: & |
---|
2187 | & cfiles ! List of files for all types |
---|
2188 | |
---|
2189 | !Local variables |
---|
2190 | INTEGER :: jfile |
---|
2191 | INTEGER :: jtype |
---|
2192 | |
---|
2193 | DO jtype = 1, ntypes |
---|
2194 | |
---|
2195 | ifiles(jtype) = 0 |
---|
2196 | DO jfile = 1, jpmaxnfiles |
---|
2197 | IF ( trim(cfiles(jtype,jfile)) /= '' ) & |
---|
2198 | ifiles(jtype) = ifiles(jtype) + 1 |
---|
2199 | END DO |
---|
2200 | |
---|
2201 | IF ( ifiles(jtype) == 0 ) THEN |
---|
2202 | CALL ctl_stop( 'Logical for observation type '//TRIM(cobstypes(jtype))// & |
---|
2203 | & ' set to true but no files available to read' ) |
---|
2204 | ENDIF |
---|
2205 | |
---|
2206 | IF(lwp) THEN |
---|
2207 | WRITE(numout,*) ' '//cobstypes(jtype)//' input observation file names:' |
---|
2208 | DO jfile = 1, ifiles(jtype) |
---|
2209 | WRITE(numout,*) ' '//TRIM(cfiles(jtype,jfile)) |
---|
2210 | END DO |
---|
2211 | ENDIF |
---|
2212 | |
---|
2213 | END DO |
---|
2214 | |
---|
2215 | END SUBROUTINE obs_settypefiles |
---|
2216 | |
---|
2217 | SUBROUTINE obs_setinterpopts( ntypes, jtype, ctypein, & |
---|
2218 | & n2dint_default, n2dint_type, & |
---|
2219 | & ravglamscl_type, ravgphiscl_type, & |
---|
2220 | & lfp_indegs_type, lavnight_type, & |
---|
2221 | & n2dint, ravglamscl, ravgphiscl, & |
---|
2222 | & lfpindegs, lavnight ) |
---|
2223 | |
---|
2224 | INTEGER, INTENT(IN) :: ntypes ! Total number of obs types |
---|
2225 | INTEGER, INTENT(IN) :: jtype ! Index of the current type of obs |
---|
2226 | INTEGER, INTENT(IN) :: n2dint_default ! Default option for interpolation type |
---|
2227 | INTEGER, INTENT(IN) :: n2dint_type ! Option for interpolation type |
---|
2228 | REAL(wp), INTENT(IN) :: & |
---|
2229 | & ravglamscl_type, & !E/W diameter of obs footprint for this type |
---|
2230 | & ravgphiscl_type !N/S diameter of obs footprint for this type |
---|
2231 | LOGICAL, INTENT(IN) :: lfp_indegs_type !T=> footprint in degrees, F=> in metres |
---|
2232 | LOGICAL, INTENT(IN) :: lavnight_type !T=> obs represent night time average |
---|
2233 | CHARACTER(len=8), INTENT(IN) :: ctypein |
---|
2234 | |
---|
2235 | INTEGER, DIMENSION(ntypes), INTENT(INOUT) :: & |
---|
2236 | & n2dint |
---|
2237 | REAL(wp), DIMENSION(ntypes), INTENT(INOUT) :: & |
---|
2238 | & ravglamscl, ravgphiscl |
---|
2239 | LOGICAL, DIMENSION(ntypes), INTENT(INOUT) :: & |
---|
2240 | & lfpindegs, lavnight |
---|
2241 | |
---|
2242 | lavnight(jtype) = lavnight_type |
---|
2243 | |
---|
2244 | IF ( (n2dint_type >= 0) .AND. (n2dint_type <= 6) ) THEN |
---|
2245 | n2dint(jtype) = n2dint_type |
---|
2246 | ELSE IF ( n2dint_type == -1 ) THEN |
---|
2247 | n2dint(jtype) = n2dint_default |
---|
2248 | ELSE |
---|
2249 | CALL ctl_stop(' Choice of '//TRIM(ctypein)//' horizontal (2D) interpolation method', & |
---|
2250 | & ' is not available') |
---|
2251 | ENDIF |
---|
2252 | |
---|
2253 | ! For averaging observation footprints set options for size of footprint |
---|
2254 | IF ( (n2dint(jtype) > 4) .AND. (n2dint(jtype) <= 6) ) THEN |
---|
2255 | IF ( ravglamscl_type > 0._wp ) THEN |
---|
2256 | ravglamscl(jtype) = ravglamscl_type |
---|
2257 | ELSE |
---|
2258 | CALL ctl_stop( 'Incorrect value set for averaging footprint '// & |
---|
2259 | 'scale (ravglamscl) for observation type '//TRIM(ctypein) ) |
---|
2260 | ENDIF |
---|
2261 | |
---|
2262 | IF ( ravgphiscl_type > 0._wp ) THEN |
---|
2263 | ravgphiscl(jtype) = ravgphiscl_type |
---|
2264 | ELSE |
---|
2265 | CALL ctl_stop( 'Incorrect value set for averaging footprint '// & |
---|
2266 | 'scale (ravgphiscl) for observation type '//TRIM(ctypein) ) |
---|
2267 | ENDIF |
---|
2268 | |
---|
2269 | lfpindegs(jtype) = lfp_indegs_type |
---|
2270 | |
---|
2271 | ENDIF |
---|
2272 | |
---|
2273 | ! Write out info |
---|
2274 | IF(lwp) THEN |
---|
2275 | IF ( n2dint(jtype) <= 4 ) THEN |
---|
2276 | WRITE(numout,*) ' '//TRIM(ctypein)// & |
---|
2277 | & ' model counterparts will be interpolated horizontally' |
---|
2278 | ELSE IF ( n2dint(jtype) <= 6 ) THEN |
---|
2279 | WRITE(numout,*) ' '//TRIM(ctypein)// & |
---|
2280 | & ' model counterparts will be averaged horizontally' |
---|
2281 | WRITE(numout,*) ' '//' with E/W scale: ',ravglamscl(jtype) |
---|
2282 | WRITE(numout,*) ' '//' with N/S scale: ',ravgphiscl(jtype) |
---|
2283 | IF ( lfpindegs(jtype) ) THEN |
---|
2284 | WRITE(numout,*) ' '//' (in degrees)' |
---|
2285 | ELSE |
---|
2286 | WRITE(numout,*) ' '//' (in metres)' |
---|
2287 | ENDIF |
---|
2288 | ENDIF |
---|
2289 | ENDIF |
---|
2290 | |
---|
2291 | END SUBROUTINE obs_setinterpopts |
---|
2292 | |
---|
2293 | END MODULE diaobs |
---|