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_stats_combine(proc_ave, proc_err, proc_min, proc_max, &
41 nobs_min, nobs_max, klev_min, klev_max)
42
43 !---------------------------------------------------------------------------
44 ! Purpose: Do MPI reduction operations across processors to get the average,
45 ! rms error, minimum, and maximum values for an observation field.
46 ! These are stored only on the root processor, i.e., processor 0.
47 ! (In this way, we do not have to do all-to-all communication.)
48 !
49 !---------------------------------------------------------------------------
50
51 real, intent(inout) :: proc_ave ! Processor average.
52 real, intent(inout) :: proc_err ! Processor rms error.
53 real, intent(inout) :: proc_min ! Processor minumum.
54 real, intent(inout) :: proc_max ! Processor maximum.
55 integer, intent(inout) :: nobs_min ! Obs number of minimum.
56 integer, intent(inout) :: nobs_max ! Obs number of maximum.
57 integer, intent(inout) :: klev_min ! Level of minimum.
58 integer, intent(inout) :: klev_max ! Level of maximum.
59
60 end subroutine da_proc_stats_combine
61
62 subroutine da_proc_maxmin_combine(n, max, min)
63
64 !---------------------------------------------------------------------------
65 ! Purpose: Do MPI reduction operations across processors to get the minimum
66 ! and maximum values for an observation field of length n. The
67 ! i, j location of the minimum and maximum, for each n, is also
68 ! communicated.
69 ! The return values are stored only on the root processor, i.e.,
70 ! processor 0. (In this way, we do not have to do all-to-all
71 ! communication.)
72 !
73 !---------------------------------------------------------------------------
74
75 integer, intent(in) :: n ! Length of input fields.
76 type (maxmin_field_type), intent(inout) :: max(n) ! Max values over proc.
77 type (maxmin_field_type), intent(inout) :: min(n) ! Min values over proc.
78
79 end subroutine da_proc_maxmin_combine
80
81
82