1 subroutine da_setup_testfield(grid)
3 !----------------------------------------------------------------------------
4 ! Purpose: produce test increment field based on grid%xb field.
6 ! Method: pass through x=uv transfom to ensure satisfies boundary conditions
7 !----------------------------------------------------------------------------
11 type (domain), intent(inout) :: grid
15 if (trace_use) call da_trace_entry("da_setup_testfield")
17 !-------------------------------------------------------------------------
19 !-------------------------------------------------------------------------
21 write(unit=stdout, fmt='(/a/)') &
22 'Starting da_setup_testfield ...'
24 !-------------------------------------------------------------------------
25 ! [2.0]: set up test increment field structure:
26 !-------------------------------------------------------------------------
28 ! [2.1] test wind, temperature, pressure, humidity and cloud parameters
30 call da_set_tst_trnsf_fld(grid, grid%xa%u, grid%xb%u, typical_u_rms)
31 call da_set_tst_trnsf_fld(grid, grid%xa%v, grid%xb%v, typical_v_rms)
32 call da_set_tst_trnsf_fld(grid, grid%xa%w, grid%xb%w, typical_w_rms)
33 call da_set_tst_trnsf_fld(grid, grid%xa%t, grid%xb%t, typical_t_rms)
34 call da_set_tst_trnsf_fld(grid, grid%xa%p, grid%xb%p, typical_p_rms)
35 call da_set_tst_trnsf_fld(grid, grid%xa%q, grid%xb%q, typical_q_rms)
36 if ( ( use_rad .and. crtm_cloud ) .or. use_radar_rf .or. use_radar_rhv ) then
37 call da_set_tst_trnsf_fld(grid, grid%xa%qcw, grid%xb%qcw, typical_qcw_rms)
38 call da_set_tst_trnsf_fld(grid, grid%xa%qrn, grid%xb%qrn, typical_qrn_rms)
39 call da_set_tst_trnsf_fld(grid, grid%xa%qci, grid%xb%qci, typical_qci_rms)
40 call da_set_tst_trnsf_fld(grid, grid%xa%qsn, grid%xb%qsn, typical_qsn_rms)
41 call da_set_tst_trnsf_fld(grid, grid%xa%qgr, grid%xb%qgr, typical_qgr_rms)
44 ! [2.5] get test density increment from linearised ideal gas law:
46 call da_pt_to_rho_lin(grid)
48 grid%xa%psfc(grid%xp%its:grid%xp%ite, grid%xp%jts:grid%xp%jte) = &
49 grid%xa%p (grid%xp%its:grid%xp%ite, grid%xp%jts:grid%xp%jte, grid%xp%kts)
51 if (print_detail_testing) then
52 write(unit=stdout, fmt='(2a,4x,a,i8)') &
53 'file:', __FILE__, 'line:', __LINE__
55 write(unit=stdout, fmt=*) 'grid%xp%its, grid%xp%ite, grid%xp%jts, grid%xp%jte) =', &
56 grid%xp%its, grid%xp%ite, grid%xp%jts, grid%xp%jte
58 do j=grid%xp%jts, grid%xp%jte
59 do i=grid%xp%its, grid%xp%ite
61 write(unit=stdout, fmt='(2(a,i4),a,f14.6)') &
62 'grid%xa%psfc(', i, ',', j, ') =', grid%xa%psfc(i, j)
69 if ((fg_format==fg_format_wrf_arw_regional .or. &
70 fg_format==fg_format_wrf_arw_global ) .and. ide == ipe ) then
75 if ((fg_format==fg_format_wrf_arw_regional .or. &
76 fg_format==fg_format_wrf_arw_global ) .and. jde == jpe ) then
83 #include "HALO_XA.inc"
88 if ((fg_format==fg_format_wrf_arw_regional .or. &
89 fg_format==fg_format_wrf_arw_global ) .and. ide == ipe ) then
94 if ((fg_format==fg_format_wrf_arw_regional .or. &
95 fg_format==fg_format_wrf_arw_global ) .and. jde == jpe ) then
101 if (sfc_assi_options == 2) then
103 #include "HALO_SFC_XA.inc"
108 if (use_ssmt1obs .or. use_ssmt2obs .or. use_gpspwobs .or. &
109 use_ssmitbobs .or. use_ssmiretrievalobs) then
111 ! Now do something for PW
112 call da_transform_xtotpw(grid)
116 call da_transform_xtogpsref_lin(grid)
118 if (use_ssmt1obs .or. use_ssmt2obs .or. use_ssmitbobs .or. use_ssmiretrievalobs) then
119 call da_transform_xtoseasfcwind_lin(grid)
123 #include "HALO_SSMI_XA.inc"
127 write(unit=stdout, fmt='(/a/)') 'End of da_setup_testfield.'
129 if (trace_use) call da_trace_exit("da_setup_testfield")
131 end subroutine da_setup_testfield