da_wrf_dm_interface.inc

References to this file elsewhere.
1 subroutine da_local_to_global(xp, x, xg, dim)
2 
3    !---------------------------------------------------------------------------
4    ! Purpose: Make xg global-grid array by gathering the subdomain arrays x from
5    !          each processor. The global array xg is stored only on the monitor
6    !          processor (typically, processor 0).
7    !---------------------------------------------------------------------------
8 
9    implicit none
10 
11    type (XPOSE_type), intent(in):: xp                                    ! Domain decomposition vars.
12    real,  intent(in)   :: x (xp%ims:xp%ime,xp%jms:xp%jme,xp%kms:xp%kme)  ! Local-grid input array.
13    real,  intent(out)  :: xg(xp%ids:xp%ide,xp%jds:xp%jde,xp%kds:xp%kde)  ! Global-grid output array.
14    integer, intent(in) :: dim                         ! Number of dimensions (=2 for 2D, =3 for 3D).
15 
16    integer             :: i, j, k
17 
18    if (dim == 2) then
19       do j=xp%jds, xp%jde
20          do i=xp%ids, xp%ide
21             xg(i,j,1) = x(i,j,1)
22          end do
23       end do
24    else if (dim == 3) then
25       do j=xp%jds, xp%jde
26          do k=xp%kds, xp%kde
27             do i=xp%ids, xp%ide
28                xg(i,j,k) = x(i,j,k)
29             end do
30          end do
31       end do
32    else
33       write(unit=message(1),fmt='(A,I5,A)') &
34          "dim=",dim,"must be 2 or 3"
35       call da_error(__FILE__,__LINE__,message(1:1))
36    end if
37 
38 end subroutine da_local_to_global
39 
40 subroutine da_proc_sum_count_obs (count_obs)
41 
42    !---------------------------------------------------------------------------
43    ! Purpose: Do MPI sum operation across processors to get the global sum of
44    !          count_obs. The sum is returned only on the root processor,
45    !          i.e., processor 0. (In this way, we do not have to do all-to-all 
46    !          communication.)
47    !
48    ! IMPORTANT!!!
49    !          The length of sumval and procval arrays are currently 56. This is
50    !          the number of obs types (currently 14) times 4. This length should
51    !          be changed accordingly if more observation types are added.
52    !---------------------------------------------------------------------------
53 
54    type (count_obs_type), intent(inout)     :: count_obs
55 
56 end subroutine da_proc_sum_count_obs
57 
58 subroutine da_proc_stats_combine(proc_ave, proc_err, proc_min, proc_max, &
59                                nobs_min, nobs_max, klev_min, klev_max)
60 
61    !---------------------------------------------------------------------------
62    !  Purpose: Do MPI reduction operations across processors to get the average, 
63    !           rms error, minimum, and maximum values for an observation field.
64    !           These are stored only on the root processor, i.e., processor 0.
65    !           (In this way, we do not have to do all-to-all communication.)
66    !
67    !---------------------------------------------------------------------------
68 
69    real,      intent(inout)      :: proc_ave       ! Processor average.
70    real,      intent(inout)      :: proc_err       ! Processor rms error.
71    real,      intent(inout)      :: proc_min       ! Processor minumum.
72    real,      intent(inout)      :: proc_max       ! Processor maximum.
73    integer,   intent(inout)      :: nobs_min       ! Obs number of minimum.
74    integer,   intent(inout)      :: nobs_max       ! Obs number of maximum.
75    integer,   intent(inout)      :: klev_min       ! Level of minimum.
76    integer,   intent(inout)      :: klev_max       ! Level of maximum.
77 
78 end subroutine da_proc_stats_combine
79 
80 subroutine da_proc_maxmin_combine(n, max, min)
81 
82    !---------------------------------------------------------------------------
83    !  Purpose: Do MPI reduction operations across processors to get the minimum
84    !           and maximum values for an observation field of length n. The
85    !           i, j location of the minimum and maximum, for each n, is also
86    !           communicated.
87    !           The return values are stored only on the root processor, i.e., 
88    !           processor 0.  (In this way, we do not have to do all-to-all 
89    !           communication.)
90    !
91    !---------------------------------------------------------------------------
92 
93    integer,   intent(in)                    :: n       ! Length of input fields.
94    type (maxmin_field_type), intent(inout)  :: max(n)  ! Max values over proc.
95    type (maxmin_field_type), intent(inout)  :: min(n)  ! Min values over proc.
96 
97 end subroutine da_proc_maxmin_combine
98 
99 
100