Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / da / da_obs_io / da_obs_io.f90
blob7c9760ed1ad20207fab798757fda4022ca4f55e4
1 module da_obs_io
3 use module_domain, only : domain
5 use da_control, only : xmiss, missing_r, fmt_each, fmt_info, trace_use, &
6 fmt_srfc, filtered_obs_unit, num_procs,missing, ierr,comm, rand_unit, &
7 obs_qc_pointer, rootproc, omb_unit,omb_add_noise,use_airepobs, use_lightningobs, &
8 use_airepobs,use_bogusobs,use_gpspwobs,use_gpsztdobs,use_gpsrefobs,use_geoamvobs, &
9 use_metarobs,use_profilerobs,use_pilotobs,use_buoyobs,use_shipsobs,use_rainobs, &
10 use_synopobs,use_soundobs,use_mtgirsobs,use_tamdarobs,use_qscatobs,use_radarobs, &
11 test_transforms, use_ssmiretrievalobs, report_start, &
12 report_end, global, print_detail_obs, stdout, t_kelvin, stderr, &
13 max_ob_levels, missing_data, max_bogus_input, myproc, convert_uv2fd, convert_fd2uv, &
14 fails_error_max,standard_atmosphere,zero_t_td,print_detail_f_obs, &
15 print_detail_radar,use_satemobs,use_polaramvobs,use_ssmt1obs, &
16 use_ssmt2obs, use_airsretobs,convert_fd2uv,anal_type_qcobs,gravity,gas_constant,cp, &
17 filename_len, t0, max_airep_input, max_bogus_input, max_ssmi_rv_input, &
18 max_buoy_input, max_gpsref_input, max_gpspw_input, max_geoamv_input, &
19 max_airsr_input, max_polaramv_input, max_radar_input, &
20 max_profiler_input, max_sound_input, max_mtgirs_input, max_tamdar_input, max_ships_input, &
21 max_satem_input,max_pilot_input, max_metar_input, max_ssmt1_input, &
22 max_synop_input,max_ssmt2_input, max_qscat_input, &
23 obs_names, num_ob_indexes, fm_index, ids,ide, ite, jte, &
24 sound, mtgirs,synop, pilot, satem, geoamv, polaramv, airep, gpspw, gpsref, &
25 tamdar, tamdar_sfc, metar, ships, ssmi_rv, ssmi_tb, ssmt1, ssmt2, qscat, profiler, buoy, bogus, pseudo, &
26 radar, radiance, airsr, sonde_sfc, trace_use_dull, num_fgat_time, time_slots, myproc, lightning, &
27 qmarker_retain, anal_type_verify, top_km_gpsro, bot_km_gpsro, thin_rainobs, &
28 sfc_assi_options, sfc_assi_options_1, sfc_assi_options_2,print_detail_rain,max_rain_input,rain, &
29 pi, ob_format_gpsro, ob_format_ascii, analysis_date, kms,kme, v_interp_h,v_interp_p, &
30 wind_sd,wind_sd_synop,wind_sd_tamdar,wind_sd_mtgirs,wind_sd_profiler,wind_sd_geoamv,wind_sd_polaramv, &
31 wind_sd_airep,wind_sd_sound,wind_sd_metar,wind_sd_ships,wind_sd_qscat,wind_sd_buoy,wind_sd_pilot,wind_stats_sd,&
32 thin_conv, thin_conv_ascii, lsac_nh_step, lsac_nv_step, lsac_nv_start, lsac_print_details, &
33 lsac_use_u, lsac_use_v, lsac_use_t, lsac_use_q, lsac_u_error, lsac_v_error, lsac_t_error, lsac_q_error, &
34 gpsro_drift, max_gpseph_input, use_gpsephobs, gpseph, gpseph_loadbalance, kds, kde, kts, kte, &
35 use_radar_rhv, use_radar_rqv, use_radar_rf, use_radar_rv, multi_inc, &
36 use_lightning_w, use_lightning_div, use_lightning_qv, lightning_min_rh, min_flashrate, &
37 thin_conv_opt, no_thin, thin_single, thin_multi, thin_superob, thin_superob_hv, &
38 thin_mesh_vert_conv, use_satwnd_bufr, uv_error_opt, uv_error_val, error_opt_nml
40 use da_wrf_interfaces, only : wrf_dm_bcast_integer, wrf_dm_bcast_real
42 #if (WRF_CHEM == 1)
43 use da_control, only : chemic_surf, use_chemic_surfobs, chem_cv_options, chemicda_opt
44 use module_state_description, only : num_chemic_surf, param_first_scalar, &
45 num_chem_ic
46 use module_dm, only : wrf_dm_sum_reals
47 use da_define_structures, only : singl_level_type, chemic_surf_type
48 use module_state_description, only : p_chemsi_pm25, p_chemsi_pm10, &
49 p_chemsi_so2, p_chemsi_no2, p_chemsi_o3, p_chemsi_co, &
50 p_chem_ic_p25, p_chem_ic_p10, p_chem_ic_sulf, p_chem_ic_bc1, p_chem_ic_bc2, p_chem_ic_oc1, p_chem_ic_oc2, &
51 p_chem_ic_dust_1, p_chem_ic_dust_2, p_chem_ic_dust_3, p_chem_ic_dust_4, &
52 p_chem_ic_seas_1, p_chem_ic_seas_2, p_chem_ic_seas_3, p_chem_ic_seas_4
53 #endif
55 use da_define_structures, only : iv_type, multi_level_type, multi_level_type_BUFR, &
56 radar_multi_level_type, y_type, field_type, each_level_type, &
57 radar_each_level_type, info_type, model_loc_type,gpsref_type, rain_single_level_type, rain_each_type, &
58 gpseph_type, lightning_each_level_type, lightning_multi_level_type
59 use da_grid_definitions, only : da_ffdduv,da_ffdduv_model,da_ffdduv_diagnose
60 use da_obs, only : da_count_filtered_obs,da_check_missing,da_obs_proc_station, da_set_obs_missing, da_set_3d_obs_missing
61 use da_par_util1, only : da_proc_sum_int
62 use da_physics, only : da_tp_to_qs
63 use da_reporting, only : da_warning, message, da_error
64 use da_tools, only : da_llxy, da_get_julian_time, da_geo2msl1, da_msl2geo1
65 use da_tools_serial, only : da_free_unit, da_get_unit, da_advance_time
66 use da_tracing, only : da_trace_entry, da_trace_exit
68 use module_radiance, only : deg2rad, i_kind
69 use gsi_thinning, only : map2grids, map2grids_conv, cleangrids_conv, thinning_grid, &
70 map2tgrid, thinning_grid_conv
71 #ifdef DM_PARALLEL
72 use da_control, only : root
73 ! use mpi, only : mpi_min
74 use da_par_util, only : true_mpi_real
75 #endif
76 #ifdef BUFR
77 use da_grid_definitions, only : da_earth_2_model_wind
78 #endif
79 use da_reporting, only : message, da_message
80 use da_interpolation, only : da_to_zk
81 use da_netcdf_interface, only : da_get_var_3d_real_cdf, da_get_dims_cdf, &
82 da_get_var_2d_real_cdf
83 use da_gpseph, only: da_gpseph_create_ob, ob_in_mean_h, global_h_mean
85 implicit none
87 #ifdef DM_PARALLEL
88 include 'mpif.h'
89 #endif
91 ! array to hold observation error table
92 ! (300,33,6) ! 300 ob types, 33 levels (rows), 6 variables (columns)
93 real, allocatable :: oetab(:,:,:)
95 contains
97 #include "da_read_obs_ascii.inc"
98 #include "da_scan_obs_ascii.inc"
99 #include "da_read_obs_radar.inc"
100 #include "da_scan_obs_radar.inc"
101 #include "da_read_obs_lightning.inc"
102 #include "da_scan_obs_lightning.inc"
103 #include "da_scan_obs_rain.inc"
104 #include "da_read_obs_rain.inc"
105 #if (WRF_CHEM == 1)
106 #include "da_read_obs_chem_sfc.inc"
107 #include "da_scan_obs_chem_sfc.inc"
108 #include "da_write_obs_chem_sfc.inc"
109 #include "da_final_write_obs_chem_sfc.inc"
110 #include "da_final_write_obs_gas_sfc.inc"
111 #endif
112 #include "da_read_errfac.inc"
113 #include "da_use_obs_errfac.inc"
114 #include "da_write_obs.inc"
115 #include "da_write_iv_for_multi_inc.inc"
116 #include "da_read_iv_for_multi_inc.inc"
117 #include "da_search_obs.inc"
118 #include "da_write_obs_etkf.inc"
119 #include "da_write_filtered_obs.inc"
120 #include "da_write_modified_filtered_obs.inc"
121 #include "da_write_y.inc"
122 #include "da_read_obs_bufr.inc"
123 #include "da_read_obs_bufrgpsro.inc"
124 #include "da_read_obs_bufrgpsro_eph.inc"
125 #include "da_final_write_obs.inc"
126 #include "da_final_write_y.inc"
127 #include "da_read_y_unit.inc"
128 #include "da_read_rand_unit.inc"
129 #include "da_read_omb_tmp.inc"
130 #include "da_write_noise_to_ob.inc"
131 #include "da_final_write_filtered_obs.inc"
132 #include "da_final_write_modified_filtered_obs.inc"
133 #include "da_read_lsac_util.inc"
134 #include "da_read_obs_lsac.inc"
135 #include "da_scan_obs_lsac.inc"
136 #include "da_read_obs_bufr_satwnd.inc"
138 end module da_obs_io