Combines the source fields with the pressure values. For U and V, if this is on the low boundary then delay dealing with the -1 values as they will be communicated. Equally, for those fields if this is the high boundary then compute the values and send them on to the neighbouring process.
85 type(model_state_type),
target,
intent(inout) :: current_state
87 integer :: k, local_y, local_x, corrected_y, corrected_x
88 logical :: last_x, last_y
90 local_y=current_state%column_local_y
91 local_x=current_state%column_local_x
92 last_y = local_y == current_state%local_grid%local_domain_end_index(y_index)
93 last_x = local_x == current_state%local_grid%local_domain_end_index(x_index)
94 if (last_x .or. last_y)
then
95 corrected_x=local_x-current_state%local_grid%halo_size(x_index)
96 corrected_y=local_y-current_state%local_grid%halo_size(y_index)
98 do k=2,current_state%local_grid%size(z_index)
100 current_state%p%data(k, local_y, local_x)=current_state%p%data(k, local_y, local_x)+&
101 4.0_default_precision*(current_state%global_grid%configuration%vertical%tzc2(k)*&
102 current_state%sw%data(k, local_y, local_x)-&
103 current_state%global_grid%configuration%vertical%tzc1(k)*current_state%sw%data(k-1, local_y, local_x))
106 current_state%p%data(k, local_y, local_x)=current_state%p%data(k, local_y, local_x)+&
107 current_state%global_grid%configuration%horizontal%cx * current_state%su%data(k, local_y, local_x)
110 current_state%p%data(k, local_y, local_x)=current_state%p%data(k, local_y, local_x)+&
111 current_state%global_grid%configuration%horizontal%cy * current_state%sv%data(k, local_y, local_x)
114 if (local_x .gt. 3)
then
115 current_state%p%data(k, local_y, local_x)=current_state%p%data(k, local_y, local_x)-&
116 current_state%global_grid%configuration%horizontal%cx * current_state%su%data(k, local_y, local_x-1)
120 send_buffer_x(k-1, corrected_y)=&
121 current_state%global_grid%configuration%horizontal%cx * current_state%su%data(k, local_y, local_x)
125 if (local_y .gt. 3 .and. local_x .gt. 3)
then
126 current_state%p%data(k, local_y, local_x)=current_state%p%data(k, local_y, local_x)-&
127 current_state%global_grid%configuration%horizontal%cy * current_state%sv%data(k, local_y-1, local_x)
130 send_buffer_y(k-1, corrected_x)=&
131 current_state%global_grid%configuration%horizontal%cy * current_state%sv%data(k, local_y, local_x)