1 subroutine da_setup_obs_structures_rain(grid, ob, iv)
3 !---------------------------------------------------------------------------
4 ! Purpose: Define, allocate and read observation structure.
5 !---------------------------------------------------------------------------
9 type (domain) , intent(in) :: grid ! model data
10 type (y_type), intent(out) :: ob ! Observation structure.
11 type (iv_type), intent(inout) :: iv ! O-B structure.
13 character(len=filename_len) :: filename
16 if (trace_use) call da_trace_entry("da_setup_obs_structures_rain")
18 !-------------------------------
19 ! 0.0 Make thinning grids
20 !------------------------------
22 if ( thin_rainobs ) then
23 allocate(thinning_grid(num_ob_indexes,num_fgat_time))
25 call makegrids (rain,thin_mesh_conv(rain), n)
29 !--------------------------------------------------------------------------
31 !--------------------------------------------------------------------------
34 if ( .not. fgat_rain_flags(n) ) cycle
38 ! scan rainfall observation file
39 write(filename(1:9), fmt='(a, i2.2, a)') 'ob', n,'.rain'
40 call da_scan_obs_rain(iv, filename, iv%time)
42 iv%info(rain)%plocal(n) = iv%info(rain)%nlocal
43 iv%info(rain)%ptotal(n) = iv%info(rain)%ntotal
46 !--------------------------------------------------------------------------
47 ! Allocate the ob based on input number of obs:
48 !--------------------------------------------------------------------------
50 call da_allocate_observations_rain (iv)
52 !--------------------------------------------------------------------------
54 !--------------------------------------------------------------------------
57 if ( .not. fgat_rain_flags(n) ) cycle
61 ! read rainfall observation file
62 write(filename(1:9), fmt='(a, i2.2, a)') 'ob', n,'.rain'
63 call da_read_obs_rain(iv, filename, iv%time)
66 if ( thin_rainobs ) then
67 do n = 1, num_fgat_time
68 call destroygrids (rain,n)
70 deallocate(thinning_grid)
73 !--------------------------------------------------------------------------
74 ! [3.0] Calculate innovation vector (O-B) and create (smaller) ob structure:
75 !--------------------------------------------------------------------------
77 call da_fill_obs_structures_rain(iv, ob)
81 if (trace_use) call da_trace_exit("da_setup_obs_structures_rain")
83 end subroutine da_setup_obs_structures_rain