Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / da / da_radiance / da_radiance.f90
blobcb1aa20d6bd2c8d5a041a0f732bf43f6ae6cd67a
1 module da_radiance
3 !---------------------------------------------------------------------------
4 ! Purpose: module for radiance data assimilation.
5 !---------------------------------------------------------------------------
7 #if defined(HDF5)
8 use hdf5
9 #endif
11 #if defined(RTTOV) || defined(CRTM)
13 use module_domain, only : xb_type, domain
14 #ifdef DM_PARALLEL
15 use module_dm, only : ntasks_x, ntasks_y
16 #endif
17 use module_radiance, only : satinfo, &
18 i_kind,r_kind, r_double, &
19 one, zero, three,deg2rad,rad2deg, &
20 q2ppmv, &
21 init_constants_derived, &
22 rttov_platform_name, rttov_inst_name, crtm_sensor_name ! names used by both RTTOV and CRTM
23 #ifdef RTTOV
24 use module_radiance, only : coefs, rttov_coefs, rttov_profile, rttov_radiance, &
25 rttov_transmission,errorstatus_success,gas_id_watervapour,rttov_emissivity
26 #endif
27 #ifdef CRTM
28 use module_radiance, only : crtm_channelinfo_type, crtm_platform_name, crtm_init, &
29 CRTM_Planck_Radiance, CRTM_Planck_Temperature
30 #endif
32 #ifdef DM_PARALLEL
33 ! use mpi, only : mpi_integer, mpi_status_size, mpi_min, mpi_max, mpi_minloc, &
34 ! mpi_2double_precision
35 #endif
37 use da_control, only : max_ob_levels,missing_r, &
38 v_interp_p, v_interp_h, trace_use_dull, &
39 missing, max_error_uv, max_error_t, rootproc, &
40 max_error_p,max_error_q, radiance, &
41 max_stheight_diff,missing_data,max_error_bq,max_error_slp, &
42 max_error_bt, max_error_buv, rtminit_platform,rtminit_satid, &
43 rtminit_nsensor,rtminit_sensor,filename_len,read_biascoef,analysis_date, &
44 time_window_max,time_window_min,print_detail_obs,use_hsbobs,use_msuobs, &
45 use_amsubobs,use_eos_amsuaobs,use_amsuaobs,use_hirs2obs,rtm_option, &
46 rtm_option_rttov,rtm_option_crtm,use_airsobs,use_kma1dvar,use_hirs3obs, &
47 use_ssmisobs,use_iasiobs,use_seviriobs,use_filtered_rad,print_detail_rad,stderr, mw_emis_sea, &
48 rtminit_print, rttov_scatt,comm,root,ierr,biasprep, qc_rad, num_procs, &
49 tovs_min_transfer,use_error_factor_rad,num_fgat_time,stdout,trace_use, &
50 qc_good, qc_bad,myproc,biascorr,thinning,thinning_mesh, &
51 rad_monitoring, monitor_on, kts, kte, kms, kme, calc_weightfunc, &
52 use_mwtsobs, use_mwhsobs, use_mwhs2obs, use_atmsobs, use_amsr2obs, use_ahiobs,use_gmiobs, &
53 use_hirs4obs, use_mhsobs,bufr_year, bufr_month,bufr_day,bufr_hour, &
54 bufr_minute, bufr_second,bufr_solzen, bufr_station_height, &
55 bufr_landsea_mask,bufr_solazi,tovs_end, max_tovs_input, bufr_satzen, nchan_mhs, &
56 nchan_msu, nchan_amsua,nchan_hirs2, nchan_hirs3, nchan_hirs4, nchan_airs, &
57 bufr_lon, bufr_satellite_id, bufr_ifov,nchan_amsub, tovs_start, bufr_lat, &
58 use_pseudo_rad, pseudo_rad_platid,pseudo_rad_satid, pseudo_rad_senid, &
59 pseudo_rad_ichan, pseudo_rad_inv, pseudo_rad_lat,pseudo_rad_lon, &
60 pseudo_rad_err, use_simulated_rad,use_rttov_kmatrix, use_crtm_kmatrix , &
61 use_rad,crtm_cloud, DT_cloud_model, global, use_varbc, freeze_varbc, &
62 airs_warmest_fov, time_slots, interp_option, ids, ide, jds, jde, &
63 ips, ipe, jps, jpe, simulated_rad_ngrid, obs_qc_pointer, use_blacklist_rad, use_satcv, &
64 use_goesabiobs, abi_superob_halfwidth, &
65 var4d, var4d_bin, &
66 use_goesimgobs, pi, earth_radius, satellite_height,use_clddet_zz, ahi_superob_halfwidth, ahi_apply_clrsky_bias
68 #ifdef CRTM
69 use da_crtm, only : da_crtm_init, da_get_innov_vector_crtm
70 #endif
71 use da_define_structures, only : maxmin_type, iv_type, y_type, jo_type, j_type, &
72 bad_data_type, x_type, number_type, bad_data_type, &
73 airsr_type,info_type, model_loc_type, varbc_info_type, varbc_type,clddet_geoir_type, superob_type
74 use da_interpolation, only : da_to_zk, da_to_zk_new
75 use da_tools_serial, only : da_get_unit, da_free_unit
76 use da_par_util1, only : da_proc_sum_int,da_proc_sum_ints
77 #ifdef DM_PARALLEL
78 use da_par_util, only : da_proc_stats_combine, true_mpi_real
79 #else
80 use da_par_util, only : da_proc_stats_combine
81 #endif
82 use da_physics, only : da_sfc_pre, da_transform_xtopsfc, &
83 da_transform_xtopsfc_adj,da_tpq_to_slp_lin,da_tpq_to_slp_adj
84 use da_radiance1, only : num_tovs_before,num_tovs_after,tovs_copy_count, &
85 tovs_send_pe, tovs_recv_pe, tovs_send_start, tovs_send_count, &
86 tovs_recv_start,con_vars_type,aux_vars_type, datalink_type,da_qc_amsub, &
87 da_qc_amsua,da_biascorr, da_detsurtyp,da_biasprep, &
88 da_qc_rad, da_cld_eff_radius, da_read_biascoef
89 use da_reporting, only : da_message, da_warning, message, da_error
90 #ifdef RTTOV
91 use da_rttov, only : da_rttov_init, da_get_innov_vector_rttov
92 #endif
93 use da_statistics, only : da_stats_calculate
94 use da_tools, only : da_residual, da_obs_sfc_correction, &
95 da_llxy, da_llxy_new, da_togrid_new, da_get_julian_time, da_get_time_slots, &
96 da_xyll, map_info, da_llxy_1d
97 use da_tracing, only : da_trace_entry, da_trace_exit, da_trace, &
98 da_trace_int_sort
99 use da_varbc, only : da_varbc_direct,da_varbc_coldstart,da_varbc_precond, &
100 da_varbc_pred
101 use da_wrf_interfaces, only : wrf_dm_bcast_real
102 use gsi_thinning, only : r999,r360,rlat_min,rlat_max,rlon_min,rlon_max, &
103 dlat_grid,dlon_grid,thinning_grid, &
104 makegrids,map2grids, &
105 destroygrids
106 use mod_clddet_geoir, only: qc_SDob,qc_RTCT,qc_rtmt,qc_cwvt,qc_tit, &
107 find_std,calc_rtmt,calc_correlation
109 implicit none
111 include 'netcdf.inc'
113 #ifdef DM_PARALLEL
114 include 'mpif.h'
115 #endif
117 contains
119 #include "da_calculate_grady_rad.inc"
120 #include "da_read_filtered_rad.inc"
121 #include "da_read_simulated_rad.inc"
122 #include "da_write_filtered_rad.inc"
123 #include "da_read_obs_bufrtovs.inc"
124 #include "da_read_obs_fy3.inc"
125 #include "da_read_obs_hdf5mwhs2.inc"
126 #include "da_read_obs_bufratms.inc"
127 #include "ATMS_Spatial_Average.inc"
128 #include "da_read_obs_bufrairs.inc"
129 #include "da_read_obs_bufrssmis.inc"
130 #include "da_read_obs_bufriasi.inc"
131 #include "da_read_obs_bufrseviri.inc"
132 #include "da_read_obs_hdf5amsr2.inc"
133 #include "da_read_obs_hdf5ahi.inc"
134 #include "da_read_obs_netcdf4ahi_geocat.inc"
135 #include "da_read_obs_netcdf4ahi_jaxa.inc"
136 #include "da_read_obs_ncgoesimg.inc"
137 #include "da_read_obs_ncgoesabi.inc"
138 #include "da_get_sat_angles.inc"
139 #include "da_get_sat_angles_1d.inc"
140 #include "da_get_solar_angles.inc"
141 #include "da_get_solar_angles_1d.inc"
142 #include "da_read_obs_hdf5gmi.inc"
143 #include "da_get_satzen.inc"
144 #include "da_allocate_rad_iv.inc"
145 #include "da_initialize_rad_iv.inc"
146 #include "da_read_kma1dvar.inc"
147 #include "da_sort_rad.inc"
148 #include "da_setup_radiance_structures.inc"
149 #include "da_radiance_init.inc"
150 #include "da_get_innov_vector_radiance.inc"
151 #include "da_read_pseudo_rad.inc"
152 #include "da_blacklist_rad.inc"
153 #include "da_deallocate_radiance.inc"
155 #endif
157 end module da_radiance