1 subroutine da_read_simulated_rad (iv)
3 !---------------------------------------------------------------------------
4 ! Purpose: Generate simulated radiances for every model grid point and
9 ! HISTORY: 12/12/2008 - Creation Tom Auligne
10 !---------------------------------------------------------------------------
16 type (iv_type), intent (inout) :: iv
18 ! Instrument triplet, follow the convension of RTTOV
19 integer :: platform_id, satellite_id, sensor_id
21 type (datalink_type) :: p
23 logical :: outside, outside_all
24 integer :: i,j,k,nchan,inst, alloc_stat
25 type(info_type) :: info
26 type(model_loc_type) :: loc
28 call da_trace_entry("da_read_simulated_rad")
30 ! Initialize variables
32 platform_id = pseudo_rad_platid
33 satellite_id = pseudo_rad_satid
34 sensor_id = pseudo_rad_senid
35 if (sensor_id == 0) then
37 else if (sensor_id == 1) then
39 else if (sensor_id == 3) then
41 else if (sensor_id == 4) then
43 else if (sensor_id == 15) then
45 else if (sensor_id == 10) then
47 else if (sensor_id == 11) then
51 inst = 1 ! single instrument
53 iv%info(radiance)%ntotal = (ide - ids + 1) * (jde - jds + 1)
54 iv%info(radiance)%nlocal = (min(ipe+simulated_rad_ngrid,ide) - max(ips-simulated_rad_ngrid,ids) + 1) * &
55 (min(jpe+simulated_rad_ngrid,jde) - max(jps-simulated_rad_ngrid,jds) + 1)
56 iv%info(radiance)%ptotal(1) = iv%info(radiance)%ntotal
57 iv%instid(inst)%num_rad = iv%info(radiance)%nlocal
58 iv%instid(inst)%info%nlocal = iv%info(radiance)%nlocal
60 ! 5.0 allocate innovation radiance structure
61 !----------------------------------------------------------------
63 if ( iv%instid(inst)%num_rad > 0 ) then
65 call da_allocate_rad_iv(inst,nchan,iv)
67 ! 6.0 assign sequential structure to innovation structure
68 !-------------------------------------------------------------
70 allocate (p%tb_inv(1:nchan), stat=alloc_stat)
71 if ( alloc_stat /= 0 ) CALL da_error(__FILE__,__LINE__,(/"error allocating"/))
73 p%info%date_char = "0000-00-00_00:00:00"
79 p%tb_inv(1:nchan) = pseudo_rad_inv
86 if ((i<ips-simulated_rad_ngrid).or.(i>ipe+simulated_rad_ngrid).or. &
87 (j<jps-simulated_rad_ngrid).or.(j>jpe+simulated_rad_ngrid)) cycle
89 call da_xyll(map_info, i*1.0, j*1.0, p%info%lat, p%info%lon)
98 call da_initialize_rad_iv (inst, k, iv, p)
102 iv%instid(inst)%tb_error(:,:) = pseudo_rad_err
103 iv%instid(inst)%tb_qc(:,:) = qc_good
108 write(UNIT=stdout,FMT='(a,i3,2x,a,3x,i10)') &
109 'Allocating space for radiance innov structure', &
110 inst, iv%instid(inst)%rttovid_string, iv%instid(inst)%num_rad
112 call da_trace_exit("da_read_simulated_rad")
115 end subroutine da_read_simulated_rad