1 subroutine da_setup_background_errors(grid, be)
3 !---------------------------------------------------------------------------
4 ! Purpose: Define and allocate components of background errors.
6 !---------------------------------------------------------------------------
10 type (domain), intent(in) :: grid
11 ! type (xb_type), intent(in) :: xb ! First guess structure.
12 type (be_type), intent(out) :: be ! Back. errors structure.
14 integer :: num_cv_3d_basic, num_cv_3d_extra, num_cv_2d
16 if (trace_use) call da_trace_entry("da_setup_background_errors")
19 be % ne = ensdim_alpha ! Size of ensemble.
21 if (be % ne > 0) then ! Calculation to preserve total variance.
22 if ( je_factor > 1.0 ) then
23 jb_factor = je_factor / ( je_factor - 1.0 )
26 write(6,*) 'Full ensemble mode: deactivating Jb control variable'
42 sigma_alpha = alpha_std_dev
43 write(6,'(a,4f15.5)')' jb_factor, je_factor, alpha_std_dev, sigma_alpha = ', &
44 jb_factor, je_factor, alpha_std_dev, sigma_alpha
52 if ( cv_options /= 3 ) then
53 if ( cloud_cv_options >= 2 ) then
57 num_cv_3d_extra = num_cv_3d_extra + 1
61 ! + 2 is for alpha_cv and num_ens
62 be % ncv_mz = num_cv_3d_basic + num_cv_3d_extra + num_cv_2d + 2
63 allocate ( be%cv_mz(1:be%ncv_mz) )
64 be%cv_mz(:) = 0 ! initialize
81 if (num_chem >= PARAM_FIRST_SCALAR) then
82 allocate (be%cv%sizechemic (num_chem) )
88 call da_setup_be_global(be)
89 else if(fg_format == fg_format_wrf_arw_regional) then
90 if ( (cv_options == 5) .or. (cv_options == 6) .or. (cv_options == 7) ) then
91 call da_setup_be_regional (grid%xb, be, grid)
92 else if(cv_options == 3 ) then
93 call da_setup_be_ncep_gfs (grid, be)
95 write(unit=message(1),fmt='(A,I4)') &
96 'Invalid CV option chosen: cv_options = ', cv_options
97 call da_error(__FILE__,__LINE__,message(1:1))
99 else if(fg_format == fg_format_wrf_nmm_regional ) then
100 !rizvi TBD call da_setup_be_regional (grid%xb, be)
101 call da_setup_be_nmm_regional (grid%xb, be)
115 be % cv % size11i = 0
117 call da_setup_cv (be)
119 if (trace_use) call da_trace_exit("da_setup_background_errors")
121 end subroutine da_setup_background_errors