For each none halo cell this will calculate the coriolis terms for su and sv fields.
212 type(model_state_type),
target,
intent(inout) :: current_state
214 integer :: local_y, locaL_x, k, target_x_index, target_y_index
216 local_y=current_state%column_local_y
217 local_x=current_state%column_local_x
218 target_y_index=local_y-current_state%local_grid%halo_size(y_index)
219 target_x_index=local_x-current_state%local_grid%halo_size(x_index)
222 if (current_state%first_timestep_column)
then
223 if (l_tend_pr_tot_u)
then
224 tend_pr_tot_u(:)= 0.0_default_precision
226 if (l_tend_pr_tot_v)
then
227 tend_pr_tot_v(:)= 0.0_default_precision
231 if (current_state%halo_column)
then
232 if (.not. ((current_state%column_local_y == current_state%local_grid%halo_size(y_index) .and. &
233 current_state%column_local_x .le. current_state%local_grid%local_domain_end_index(x_index) .and. &
234 current_state%column_local_x .ge. current_state%local_grid%local_domain_start_index(x_index)-1) .or. &
235 (current_state%column_local_x == current_state%local_grid%halo_size(x_index) .and. &
236 current_state%column_local_y .ge. current_state%local_grid%local_domain_start_index(y_index) &
237 .and. current_state%column_local_y .le. current_state%local_grid%local_domain_end_index(y_index)) ))
return
240 if (mod(current_state%timestep, diagnostic_generation_frequency) == 0 .and. .not. current_state%halo_column)
then
241 call save_precomponent_tendencies(current_state, local_x, local_y, target_x_index, target_y_index)
244 do k=2,current_state%local_grid%size(z_index)
245 #if defined(U_ACTIVE) && defined(V_ACTIVE)
246 current_state%su%data(k, current_state%column_local_y, current_state%column_local_x)=&
247 current_state%su%data(k, current_state%column_local_y, current_state%column_local_x)+fcoriol*&
248 (0.25_default_precision*(current_state%v%data(k, current_state%column_local_y, current_state%column_local_x)+&
249 current_state%v%data(k, current_state%column_local_y, current_state%column_local_x+1)+&
250 current_state%v%data(k, current_state%column_local_y-1, current_state%column_local_x)+&
251 current_state%v%data(k, current_state%column_local_y-1, current_state%column_local_x+1))+current_state%vgal-&
252 geostrophic_wind_y(k))
254 current_state%sv%data(k, current_state%column_local_y, current_state%column_local_x)=&
255 current_state%sv%data(k, current_state%column_local_y, current_state%column_local_x)-fcoriol*&
256 (0.25_default_precision*(current_state%u%data(k, current_state%column_local_y, current_state%column_local_x)+&
257 current_state%u%data(k, current_state%column_local_y, current_state%column_local_x-1)+&
258 current_state%u%data(k, current_state%column_local_y+1, current_state%column_local_x)+&
259 current_state%u%data(k, current_state%column_local_y+1, current_state%column_local_x-1))+current_state%ugal-&
260 geostrophic_wind_x(k))
264 if (mod(current_state%timestep, diagnostic_generation_frequency) == 0 .and. .not. current_state%halo_column)
then
265 call compute_component_tendencies(current_state, local_x, local_y, target_x_index, target_y_index)