MONC
Functions/Subroutines | Variables
viscosity_mod Module Reference

Computes the viscosity dynamics for the U,V,W source terms. More...

Functions/Subroutines

type(component_descriptor_type) function, public viscosity_get_descriptor ()
 Provides the descriptor back to the caller and is used in component registration. More...
 
subroutine field_information_retrieval_callback (current_state, name, field_information)
 Field information retrieval callback, this returns information for a specific components published field. More...
 
subroutine field_value_retrieval_callback (current_state, name, field_value)
 Field value retrieval callback, this returns the value of a specific published field. More...
 
subroutine initialisation_callback (current_state)
 Sets up the stencil_mod (used in interpolation) and allocates data for the flux fields. More...
 
subroutine finalisation_callback (current_state)
 
subroutine timestep_callback (current_state)
 At each timestep will compute the viscosity U,V,W source terms. More...
 
subroutine calculate_viscous_sources (current_state, local_y, local_x, tau12, tau12_ym1, tau12m1, tau11, tau22, tau22_yp1, tau33, tau11p1, tau13, tau13m1, tau23, tau23_ym1)
 Calculates the viscous sources based upon TAU for the U,V and W fields. More...
 
subroutine calculate_tau (current_state, local_y, local_x, zu, zv, zw, tau12, tau12_ym1, tau12m1, tau11, tau22, tau22_yp1, tau33, tau11p1, tau13, tau13m1, tau23, tau23_ym1)
 Calculated TAU which is used in computing the viscous source terms. More...
 
subroutine perform_local_data_copy_for_vis (current_state, halo_depth, involve_corners, source_data)
 Does local data copying for viscosity coefficient variable halo swap. More...
 
subroutine copy_halo_buffer_to_vis (current_state, neighbour_description, dim, target_index, neighbour_location, current_page, source_data)
 Copies the halo buffer to halo location for the viscosity coefficient field. More...
 
subroutine copy_halo_buffer_to_vis_corners (current_state, neighbour_description, corner_loc, x_target_index, y_target_index, neighbour_location, current_page, source_data)
 Copies the corner halo buffer to the viscosity coefficient field corners. More...
 

Variables

real(kind=default_precision), dimension(:), allocatable u_viscosity
 
real(kind=default_precision), dimension(:), allocatable v_viscosity
 
real(kind=default_precision), dimension(:), allocatable w_viscosity
 

Detailed Description

Computes the viscosity dynamics for the U,V,W source terms.

Function/Subroutine Documentation

◆ calculate_tau()

subroutine viscosity_mod::calculate_tau ( type(model_state_type), intent(inout), target  current_state,
integer, intent(in)  local_y,
integer, intent(in)  local_x,
type(prognostic_field_type), intent(inout)  zu,
type(prognostic_field_type), intent(inout)  zv,
type(prognostic_field_type), intent(inout)  zw,
real(kind=default_precision), dimension(:), intent(out)  tau12,
real(kind=default_precision), dimension(:), intent(out)  tau12_ym1,
real(kind=default_precision), dimension(:), intent(out)  tau12m1,
real(kind=default_precision), dimension(:), intent(out)  tau11,
real(kind=default_precision), dimension(:), intent(out)  tau22,
real(kind=default_precision), dimension(:), intent(out)  tau22_yp1,
real(kind=default_precision), dimension(:), intent(out)  tau33,
real(kind=default_precision), dimension(:), intent(out)  tau11p1,
real(kind=default_precision), dimension(:), intent(out)  tau13,
real(kind=default_precision), dimension(:), intent(out)  tau13m1,
real(kind=default_precision), dimension(:), intent(out)  tau23,
real(kind=default_precision), dimension(:), intent(out)  tau23_ym1 
)
private

Calculated TAU which is used in computing the viscous source terms.

Parameters
current_stateThe current model state
local_yLocal Y index
local_xLocal X index

Definition at line 175 of file viscosity.F90.

175  type(model_state_type), target, intent(inout) :: current_state
176  type(prognostic_field_type), intent(inout) :: zu, zv, zw
177  integer, intent(in) :: local_y, local_x
178  real(kind=DEFAULT_PRECISION), dimension(:), intent(out) :: tau12, tau12m1, tau11, tau22, tau22_yp1, tau33, &
179  tau11p1, tau13, tau13m1, tau23, tau23_ym1, tau12_ym1
180 
181  integer :: k
182  real(kind=DEFAULT_PRECISION) :: vistmp, vis12, vis12a, visonp2, visonp2a, vis13, vis23
183 
184  ! Do p levels and w-levels
185  do k=1, current_state%local_grid%size(z_index)
186  if (k .gt. 1) then
187  vistmp=current_state%vis_coefficient%data(k, local_y, local_x)+current_state%vis_coefficient%data(k, local_y+1, local_x)+&
188  current_state%vis_coefficient%data(k-1, local_y, local_x)+current_state%vis_coefficient%data(k-1, local_y+1, local_x)
189  vis12=0.125_default_precision*(vistmp + current_state%vis_coefficient%data(k, local_y, local_x+1)+&
190  current_state%vis_coefficient%data(k, local_y+1, local_x+1)+&
191  current_state%vis_coefficient%data(k-1, local_y, local_x+1)+&
192  current_state%vis_coefficient%data(k-1, local_y+1, local_x+1))
193  tau12(k)=0.0_default_precision
194 #ifdef U_ACTIVE
195  tau12(k)=(zu%data(k, local_y+1, local_x)-zu%data(k, local_y, local_x))*&
196  current_state%global_grid%configuration%horizontal%cy
197 #endif
198 #ifdef V_ACTIVE
199  tau12(k)=tau12(k)+(zv%data(k, local_y, local_x+1)-zv%data(k, local_y, local_x))*&
200  current_state%global_grid%configuration%horizontal%cx
201 #endif
202  tau12(k)=tau12(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12
203 
204  vis12a=0.125_default_precision*(vistmp +current_state%vis_coefficient%data(k, local_y, local_x-1)+&
205  current_state%vis_coefficient%data(k, local_y+1, local_x-1)+&
206  current_state%vis_coefficient%data(k-1, local_y, local_x-1)+&
207  current_state%vis_coefficient%data(k-1, local_y+1, local_x-1))
208  tau12m1(k)=0.0_default_precision
209 #ifdef U_ACTIVE
210  tau12m1(k)=(zu%data(k, local_y+1, local_x-1)-zu%data(k, local_y, local_x-1))*&
211  current_state%global_grid%configuration%horizontal%cy
212 #endif
213 #ifdef V_ACTIVE
214  tau12m1(k)=tau12m1(k)+(zv%data(k, local_y, local_x)-zv%data(k, local_y, local_x-1))*&
215  current_state%global_grid%configuration%horizontal%cx
216 #endif
217  tau12m1(k)=tau12m1(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12a
218 
219  vistmp=current_state%vis_coefficient%data(k, local_y-1, local_x)+current_state%vis_coefficient%data(k, local_y, local_x)+&
220  current_state%vis_coefficient%data(k-1, local_y-1, local_x)+current_state%vis_coefficient%data(k-1, local_y, local_x)
221  vis12=0.125_default_precision*(vistmp + current_state%vis_coefficient%data(k, local_y-1, local_x+1)+&
222  current_state%vis_coefficient%data(k, local_y, local_x+1)+&
223  current_state%vis_coefficient%data(k-1, local_y-1, local_x+1)+&
224  current_state%vis_coefficient%data(k-1, local_y, local_x+1))
225  tau12_ym1(k)=0.0_default_precision
226 #ifdef U_ACTIVE
227  tau12_ym1(k)=(zu%data(k, local_y, local_x)-zu%data(k, local_y-1, local_x))*&
228  current_state%global_grid%configuration%horizontal%cy
229 #endif
230 #ifdef V_ACTIVE
231  tau12_ym1(k)=tau12_ym1(k)+(zv%data(k, local_y-1, local_x+1)-zv%data(k, local_y-1, local_x))*&
232  current_state%global_grid%configuration%horizontal%cx
233 #endif
234  tau12_ym1(k)=tau12_ym1(k)*current_state%global_grid%configuration%vertical%rhon(k)*vis12
235 
236  visonp2=current_state%global_grid%configuration%vertical%rhon(k)*&
237  (current_state%vis_coefficient%data(k, local_y, local_x)+current_state%vis_coefficient%data(k-1, local_y, local_x))
238 #ifdef U_ACTIVE
239  tau11(k)=visonp2*(zu%data(k, local_y, local_x)-zu%data(k, local_y, local_x-1))*&
240  current_state%global_grid%configuration%horizontal%cx
241 #else
242  tau11(k)=0.0_default_precision
243 #endif
244 #ifdef V_ACTIVE
245  tau22(k)=visonp2*(zv%data(k, local_y, local_x)-zv%data(k, local_y-1, local_x))*&
246  current_state%global_grid%configuration%horizontal%cy
247 #else
248  tau22(k)=0.0_default_precision
249 #endif
250 #ifdef W_ACTIVE
251  tau33(k)=visonp2*(zw%data(k, local_y, local_x)-zw%data(k-1, local_y, local_x))*&
252  current_state%global_grid%configuration%vertical%rdz(k)
253 #else
254  tau33(k)=0.0_default_precision
255 #endif
256 
257 #ifdef V_ACTIVE
258  visonp2=current_state%global_grid%configuration%vertical%rhon(k)*&
259  (current_state%vis_coefficient%data(k, local_y+1, local_x)+&
260  current_state%vis_coefficient%data(k-1, local_y+1, local_x))
261  tau22_yp1(k)=visonp2*(zv%data(k, local_y+1, local_x)-zv%data(k, local_y, local_x))*&
262  current_state%global_grid%configuration%horizontal%cy
263 #endif
264 
265 #ifdef U_ACTIVE
266  visonp2a=current_state%global_grid%configuration%vertical%rhon(k)*&
267  (current_state%vis_coefficient%data(k, local_y, local_x+1)+&
268  current_state%vis_coefficient%data(k-1, local_y, local_x+1))
269  tau11p1(k)=visonp2a*(current_state%zu%data(k, local_y, local_x+1)-&
270  zu%data(k, local_y, local_x))*current_state%global_grid%configuration%horizontal%cx
271 #endif
272  else
273  tau12(k)=0.0_default_precision
274  tau12_ym1(k)=0.0_default_precision
275  tau12m1(k)=0.0_default_precision
276  tau11(k)=0.0_default_precision
277  tau22(k)=0.0_default_precision
278  tau22_yp1(k)=0.0_default_precision
279  tau33(k)=0.0_default_precision
280  tau11p1(k)=0.0_default_precision
281  end if
282  if (k .lt. current_state%local_grid%size(z_index)) then
283  vis13=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x)+&
284  current_state%vis_coefficient%data(k, local_y, local_x+1))
285  tau13(k)=0.0_default_precision
286 #ifdef U_ACTIVE
287  tau13(k)=(zu%data(k+1, local_y, local_x)-zu%data(k, local_y, local_x))*&
288  current_state%global_grid%configuration%vertical%rdzn(k+1)
289 #endif
290 #ifdef W_ACTIVE
291  tau13(k)=tau13(k)+(zw%data(k, local_y, local_x+1)-zw%data(k, local_y, local_x))*&
292  current_state%global_grid%configuration%horizontal%cx
293 #endif
294  tau13(k)=tau13(k)*current_state%global_grid%configuration%vertical%rho(k)*vis13
295 
296  vis13=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x-1)+&
297  current_state%vis_coefficient%data(k, local_y, local_x))
298  tau13m1(k)=0.0_default_precision
299 #ifdef U_ACTIVE
300  tau13m1(k)=(zu%data(k+1, local_y, local_x-1)-zu%data(k, local_y, local_x-1))*&
301  current_state%global_grid%configuration%vertical%rdzn(k+1)
302 #endif
303 #ifdef W_ACTIVE
304  tau13m1(k)=tau13m1(k)+(zw%data(k, local_y, local_x)-zw%data(k, local_y, local_x-1))*&
305  current_state%global_grid%configuration%horizontal%cx
306 #endif
307  tau13m1(k)=tau13m1(k)*current_state%global_grid%configuration%vertical%rho(k)*vis13
308 
309  vis23=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y, local_x)+&
310  current_state%vis_coefficient%data(k, local_y+1, local_x))
311  tau23(k)=0.0_default_precision
312 #ifdef W_ACTIVE
313  tau23(k)=(zw%data(k, local_y+1, local_x)-zw%data(k, local_y, local_x))*&
314  current_state%global_grid%configuration%horizontal%cy
315 #endif
316 #ifdef V_ACTIVE
317  tau23(k)=tau23(k)+(zv%data(k+1, local_y, local_x)-zv%data(k, local_y, local_x))*&
318  current_state%global_grid%configuration%vertical%rdzn(k+1)
319 #endif
320  tau23(k)=tau23(k)*current_state%global_grid%configuration%vertical%rho(k)*vis23
321 
322  vis23=0.5_default_precision*(current_state%vis_coefficient%data(k, local_y-1, local_x)+&
323  current_state%vis_coefficient%data(k, local_y, local_x))
324  tau23_ym1(k)=0.0_default_precision
325 #ifdef W_ACTIVE
326  tau23_ym1(k)=(zw%data(k, local_y, local_x)-zw%data(k, local_y-1, local_x))*&
327  current_state%global_grid%configuration%horizontal%cy
328 #endif
329 #ifdef V_ACTIVE
330  tau23_ym1(k)=tau23_ym1(k)+(zv%data(k+1, local_y-1, local_x)-zv%data(k, local_y-1, local_x))*&
331  current_state%global_grid%configuration%vertical%rdzn(k+1)
332 #endif
333  tau23_ym1(k)=tau23_ym1(k)*current_state%global_grid%configuration%vertical%rho(k)*vis23
334  else
335  tau13(k)=0.0_default_precision
336  tau13m1(k)=0.0_default_precision
337  tau23(k)=0.0_default_precision
338  tau23_ym1(k)=0.0_default_precision
339  end if
340  end do
Here is the caller graph for this function:

◆ calculate_viscous_sources()

subroutine viscosity_mod::calculate_viscous_sources ( type(model_state_type), intent(inout), target  current_state,
integer, intent(in)  local_y,
integer, intent(in)  local_x,
real(kind=default_precision), dimension(:), intent(in)  tau12,
real(kind=default_precision), dimension(:), intent(in)  tau12_ym1,
real(kind=default_precision), dimension(:), intent(in)  tau12m1,
real(kind=default_precision), dimension(:), intent(in)  tau11,
real(kind=default_precision), dimension(:), intent(in)  tau22,
real(kind=default_precision), dimension(:), intent(in)  tau22_yp1,
real(kind=default_precision), dimension(:), intent(in)  tau33,
real(kind=default_precision), dimension(:), intent(in)  tau11p1,
real(kind=default_precision), dimension(:), intent(in)  tau13,
real(kind=default_precision), dimension(:), intent(in)  tau13m1,
real(kind=default_precision), dimension(:), intent(in)  tau23,
real(kind=default_precision), dimension(:), intent(in)  tau23_ym1 
)
private

Calculates the viscous sources based upon TAU for the U,V and W fields.

Parameters
current_stateThe current model state
local_yLocal Y index
local_xLocal X index

Definition at line 138 of file viscosity.F90.

138  type(model_state_type), target, intent(inout) :: current_state
139  integer, intent(in) :: local_y, local_x
140  real(kind=DEFAULT_PRECISION), dimension(:), intent(in) :: tau12, tau12_ym1, tau12m1, tau11, tau22, tau22_yp1, tau33, &
141  tau11p1, tau13, tau13m1, tau23, tau23_ym1
142 
143  integer :: k
144 
145  do k=2, current_state%local_grid%size(z_index)
146 #ifdef U_ACTIVE
147  u_viscosity(k)=((tau11p1(k)-tau11(k))*current_state%global_grid%configuration%horizontal%cx+(tau12(k)-tau12_ym1(k))*&
148  current_state%global_grid%configuration%horizontal%cy+(tau13(k)-tau13(k-1))*&
149  current_state%global_grid%configuration%vertical%rdz(k))/current_state%global_grid%configuration%vertical%rhon(k)
150  current_state%su%data(k, local_y, local_x)=current_state%su%data(k, local_y, local_x)+u_viscosity(k)
151 #endif
152 #ifdef V_ACTIVE
153  v_viscosity(k)=((tau12(k)-tau12m1(k))*current_state%global_grid%configuration%horizontal%cx+(tau22_yp1(k)-tau22(k))*&
154  current_state%global_grid%configuration%horizontal%cy+(tau23(k)-tau23(k-1))*&
155  current_state%global_grid%configuration%vertical%rdz(k))/current_state%global_grid%configuration%vertical%rhon(k)
156  current_state%sv%data(k, local_y, local_x)=current_state%sv%data(k, local_y, local_x)+v_viscosity(k)
157 #endif
158  end do
159 #ifdef W_ACTIVE
160  do k=2, current_state%local_grid%size(z_index)-1
161  w_viscosity(k)=((tau13(k)-tau13m1(k))*current_state%global_grid%configuration%horizontal%cx+(tau23(k)-tau23_ym1(k))*&
162  current_state%global_grid%configuration%horizontal%cy+(tau33(k+1)-tau33(k))*&
163  current_state%global_grid%configuration%vertical%rdzn(k+1))/current_state%global_grid%configuration%vertical%rho(k)
164  current_state%sw%data(k, local_y, local_x)=current_state%sw%data(k, local_y, local_x)+w_viscosity(k)
165  end do
166 #endif
Here is the caller graph for this function:

◆ copy_halo_buffer_to_vis()

subroutine viscosity_mod::copy_halo_buffer_to_vis ( type(model_state_type), intent(inout)  current_state,
type(neighbour_description_type), intent(inout)  neighbour_description,
integer, intent(in)  dim,
integer, intent(in)  target_index,
integer, intent(in)  neighbour_location,
integer, dimension(:), intent(inout)  current_page,
type(field_data_wrapper_type), dimension(:), intent(in), optional  source_data 
)
private

Copies the halo buffer to halo location for the viscosity coefficient field.

Parameters
current_stateThe current model state
neighbour_descriptionThe halo swapping description of the neighbour we are accessing the buffer of
dimThe dimension we receive for
target_indexThe target index for the dimension we are receiving for
neighbour_locationThe location in the local neighbour data stores of this neighbour
current_pageThe current, next, halo swap page to read from (all previous have been read and copied already)
source_dataOptional source data which is written into

Definition at line 366 of file viscosity.F90.

366  type(model_state_type), intent(inout) :: current_state
367  integer, intent(in) :: dim, target_index, neighbour_location
368  integer, intent(inout) :: current_page(:)
369  type(neighbour_description_type), intent(inout) :: neighbour_description
370  type(field_data_wrapper_type), dimension(:), intent(in), optional :: source_data
371 
372  call copy_buffer_to_field(current_state%local_grid, neighbour_description%recv_halo_buffer, &
373  current_state%vis_coefficient%data, dim, target_index, current_page(neighbour_location))
374 
375  current_page(neighbour_location)=current_page(neighbour_location)+1
Here is the caller graph for this function:

◆ copy_halo_buffer_to_vis_corners()

subroutine viscosity_mod::copy_halo_buffer_to_vis_corners ( type(model_state_type), intent(inout)  current_state,
type(neighbour_description_type), intent(inout)  neighbour_description,
integer, intent(in)  corner_loc,
integer, intent(in)  x_target_index,
integer, intent(in)  y_target_index,
integer, intent(in)  neighbour_location,
integer, dimension(:), intent(inout)  current_page,
type(field_data_wrapper_type), dimension(:), intent(in), optional  source_data 
)
private

Copies the corner halo buffer to the viscosity coefficient field corners.

Parameters
current_stateThe current model state
neighbour_descriptionThe halo swapping description of the neighbour we are accessing the buffer of
corner_locThe corner location
x_target_indexThe X target index for the dimension we are receiving for
y_target_indexThe Y target index for the dimension we are receiving for
neighbour_locationThe location in the local neighbour data stores of this neighbour
current_pageThe current, next, halo swap page to read from (all previous have been read and copied already)
source_dataOptional source data which is written into

Definition at line 389 of file viscosity.F90.

389  type(model_state_type), intent(inout) :: current_state
390  integer, intent(in) :: corner_loc, x_target_index, y_target_index, neighbour_location
391  integer, intent(inout) :: current_page(:)
392  type(neighbour_description_type), intent(inout) :: neighbour_description
393  type(field_data_wrapper_type), dimension(:), intent(in), optional :: source_data
394 
395  call copy_buffer_to_corner(current_state%local_grid, neighbour_description%recv_corner_buffer, &
396  current_state%vis_coefficient%data, corner_loc, x_target_index, y_target_index, current_page(neighbour_location))
397 
398  current_page(neighbour_location)=current_page(neighbour_location)+1
Here is the caller graph for this function:

◆ field_information_retrieval_callback()

subroutine viscosity_mod::field_information_retrieval_callback ( type(model_state_type), intent(inout), target  current_state,
character(len=*), intent(in)  name,
type(component_field_information_type), intent(out)  field_information 
)
private

Field information retrieval callback, this returns information for a specific components published field.

Parameters
current_stateCurrent model state
nameThe name of the field to retrieve information for
field_informationPopulated with information about the field

Definition at line 48 of file viscosity.F90.

48  type(model_state_type), target, intent(inout) :: current_state
49  character(len=*), intent(in) :: name
50  type(component_field_information_type), intent(out) :: field_information
51 
52  ! Field description is the same regardless of the specific field being retrieved
53  field_information%field_type=component_array_field_type
54  field_information%data_type=component_double_data_type
55  field_information%number_dimensions=1
56  field_information%dimension_sizes(1)=current_state%local_grid%size(z_index)
57  field_information%enabled=.true.
Here is the caller graph for this function:

◆ field_value_retrieval_callback()

subroutine viscosity_mod::field_value_retrieval_callback ( type(model_state_type), intent(inout), target  current_state,
character(len=*), intent(in)  name,
type(component_field_value_type), intent(out)  field_value 
)
private

Field value retrieval callback, this returns the value of a specific published field.

Parameters
current_stateCurrent model state
nameThe name of the field to retrieve the value for
field_valuePopulated with the value of the field

Definition at line 65 of file viscosity.F90.

65  type(model_state_type), target, intent(inout) :: current_state
66  character(len=*), intent(in) :: name
67  type(component_field_value_type), intent(out) :: field_value
68 
69  if (name .eq. "u_viscosity") then
70  allocate(field_value%real_1d_array(size(u_viscosity)), source=u_viscosity)
71  else if (name .eq. "v_viscosity") then
72  allocate(field_value%real_1d_array(size(v_viscosity)), source=v_viscosity)
73  else if (name .eq. "w_viscosity") then
74  allocate(field_value%real_1d_array(size(w_viscosity)), source=w_viscosity)
75  end if
Here is the caller graph for this function:

◆ finalisation_callback()

subroutine viscosity_mod::finalisation_callback ( type(model_state_type), intent(inout), target  current_state)
private

Definition at line 96 of file viscosity.F90.

96  type(model_state_type), target, intent(inout) :: current_state
97 
98  if (allocated(u_viscosity)) deallocate(u_viscosity)
99  if (allocated(v_viscosity)) deallocate(v_viscosity)
100  if (allocated(w_viscosity)) deallocate(w_viscosity)
Here is the caller graph for this function:

◆ initialisation_callback()

subroutine viscosity_mod::initialisation_callback ( type(model_state_type), intent(inout), target  current_state)
private

Sets up the stencil_mod (used in interpolation) and allocates data for the flux fields.

Parameters
current_stateThe current model state_mod

Definition at line 81 of file viscosity.F90.

81  type(model_state_type), target, intent(inout) :: current_state
82 
83  integer :: z_size, y_size, x_size
84 
85  z_size=current_state%local_grid%size(z_index) + current_state%local_grid%halo_size(z_index) * 2
86  y_size=current_state%local_grid%size(y_index) + current_state%local_grid%halo_size(y_index) * 2
87  x_size=current_state%local_grid%size(x_index) + current_state%local_grid%halo_size(x_index) * 2
88  allocate(current_state%vis_coefficient%data(z_size, y_size, x_size))
89 
90  z_size=current_state%global_grid%size(z_index)
91  allocate(u_viscosity(z_size), v_viscosity(z_size), w_viscosity(z_size))
92 
Here is the caller graph for this function:

◆ perform_local_data_copy_for_vis()

subroutine viscosity_mod::perform_local_data_copy_for_vis ( type(model_state_type), intent(inout)  current_state,
integer, intent(in)  halo_depth,
logical, intent(in)  involve_corners,
type(field_data_wrapper_type), dimension(:), intent(in), optional  source_data 
)
private

Does local data copying for viscosity coefficient variable halo swap.

Parameters
current_stateThe current model state_mod
source_dataOptional source data which is written into

Definition at line 347 of file viscosity.F90.

347  type(model_state_type), intent(inout) :: current_state
348  integer, intent(in) :: halo_depth
349  logical, intent(in) :: involve_corners
350  type(field_data_wrapper_type), dimension(:), intent(in), optional :: source_data
351 
352  call perform_local_data_copy_for_field(current_state%vis_coefficient%data, current_state%local_grid, &
353  current_state%parallel%my_rank, halo_depth, involve_corners)
Here is the caller graph for this function:

◆ timestep_callback()

subroutine viscosity_mod::timestep_callback ( type(model_state_type), intent(inout), target  current_state)
private

At each timestep will compute the viscosity U,V,W source terms.

Parameters
current_stateThe current model state

Definition at line 106 of file viscosity.F90.

106  type(model_state_type), target, intent(inout) :: current_state
107 
108  integer :: local_y, local_x, k
109  real(kind=DEFAULT_PRECISION), dimension(current_state%local_grid%size(Z_INDEX)) :: tau12, tau12_ym1, tau12m1, &
110  tau11, tau22, tau22_yp1, tau33, tau23_ym1, tau11p1, tau13, tau13m1, tau23
111 
112  if (.not. current_state%use_viscosity_and_diffusion .or. current_state%halo_column) return
113  if (current_state%viscosity_halo_swap_state%swap_in_progress) then
114  ! If there is a viscosity halo swap in progress then complete it
115  call complete_nonblocking_halo_swap(current_state, current_state%viscosity_halo_swap_state, &
116  perform_local_data_copy_for_vis, copy_halo_buffer_to_vis, copy_halo_buffer_to_vis_corners)
117  end if
118 
119  local_y=current_state%column_local_y
120  local_x=current_state%column_local_x
121  if (current_state%field_stepping == forward_stepping) then
122  call calculate_tau(current_state, local_y, local_x, current_state%u, current_state%v, current_state%w, tau12, tau12_ym1, &
123  tau12m1, tau11, tau22, tau22_yp1, tau33, tau11p1, tau13, tau13m1, tau23, tau23_ym1)
124  else
125  call calculate_tau(current_state, local_y, local_x, current_state%zu, current_state%zv, current_state%zw, tau12, tau12_ym1, &
126  tau12m1, tau11, tau22, tau22_yp1, tau33, tau11p1, tau13, tau13m1, tau23, tau23_ym1)
127  end if
128  call calculate_viscous_sources(current_state, local_y, local_x, tau12, tau12_ym1, tau12m1, tau11, tau22, tau22_yp1, tau33, &
129  tau11p1, tau13, tau13m1, tau23, tau23_ym1)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ viscosity_get_descriptor()

type(component_descriptor_type) function, public viscosity_mod::viscosity_get_descriptor ( )

Provides the descriptor back to the caller and is used in component registration.

Returns
The termination check component descriptor

Definition at line 29 of file viscosity.F90.

29  viscosity_get_descriptor%name="viscosity"
30  viscosity_get_descriptor%version=0.1
31  viscosity_get_descriptor%initialisation=>initialisation_callback
32  viscosity_get_descriptor%timestep=>timestep_callback
33  viscosity_get_descriptor%finalisation=>finalisation_callback
34 
35  viscosity_get_descriptor%field_value_retrieval=>field_value_retrieval_callback
36  viscosity_get_descriptor%field_information_retrieval=>field_information_retrieval_callback
37  allocate(viscosity_get_descriptor%published_fields(3))
38  viscosity_get_descriptor%published_fields(1)="u_viscosity"
39  viscosity_get_descriptor%published_fields(2)="v_viscosity"
40  viscosity_get_descriptor%published_fields(3)="w_viscosity"
Here is the call graph for this function:

Variable Documentation

◆ u_viscosity

real(kind=default_precision), dimension(:), allocatable viscosity_mod::u_viscosity
private

Definition at line 20 of file viscosity.F90.

20  real(kind=DEFAULT_PRECISION), dimension(:), allocatable :: u_viscosity, v_viscosity, w_viscosity

◆ v_viscosity

real(kind=default_precision), dimension(:), allocatable viscosity_mod::v_viscosity
private

Definition at line 20 of file viscosity.F90.

◆ w_viscosity

real(kind=default_precision), dimension(:), allocatable viscosity_mod::w_viscosity
private

Definition at line 20 of file viscosity.F90.