23 subroutine ultflx(y_flow_index, x_flow_index, u, v, w, y_scalar_index, x_scalar_index, zf, &
24 local_grid, grid_config, parallel, kdof, dt, flux_y, flux_z, flux_x, flux_previous_x, rdz, rdzn, dzn, kmin, kmax)
26 integer,
intent(in) ::y_flow_index, x_flow_index, y_scalar_index, x_scalar_index &
40 r6 = 1.0_default_precision/6.0_default_precision
44 local_grid, grid_config, kdof, dt, flux_z, rdz, rdzn, dzn, kmin, kmax)
48 if (y_scalar_index .ne. local_grid%local_domain_end_index(
y_index) .or. parallel%my_coords(
y_index) .ne. &
49 parallel%dim_sizes(
y_index)-1)
then
51 grid_config, kdof, dt, flux_y, rdz, kmin, kmax)
56 flux_x(:) = flux_previous_x(:)
58 local_grid, grid_config, kdof, dt, flux_previous_x, rdz, kmin, kmax)
63 local_grid, grid_config, kdof, dt, flux_z, rdz, rdzn, dzn, kmin, kmax)
64 integer,
intent(in) :: kdof, y_flow_index, x_flow_index, y_scalar_index, x_scalar_index, kmin, kmax
73 zf, grid_config, kdof, dt, flux_z, rdz, rdzn, dzn)
75 local_grid, grid_config, kdof, dt, flux_z, rdz, rdzn, dzn)
77 local_grid, grid_config, kdof, dt, flux_z, rdz, rdzn, dzn)
78 if (kmin .gt. 1) flux_z(2)=0.0_default_precision
82 grid_config, kdof, dt, flux_x, rdz, kmin, kmax)
83 integer,
intent(in) :: y_flow_index, x_flow_index, y_scalar_index, x_scalar_index, kdof, kmin, kmax
91 integer :: k, kp1, kp0
103 kp1=min(k+1,local_grid%size(
z_index))
106 u%data(:, y_flow_index, x_flow_index), zf%data(:, y_scalar_index, x_scalar_index-1), &
107 zf%data(:, y_scalar_index, x_scalar_index+2), zf%data(:, y_scalar_index, x_scalar_index), &
108 zf%data(:, y_scalar_index, x_scalar_index+1))
109 if(abs(fcurvs) .ge. abs(fdels))
then
112 if (u%data(k, y_flow_index, x_flow_index) .gt. 0.0_default_precision)
then
113 sum_cfl_out=0.0_default_precision
115 sum_cfl_out = sum_cfl_out + rdz(k)*(max(0.0_default_precision,&
116 w%data(k, y_flow_index, x_flow_index))+abs(min(0.0_default_precision,w%data(k-1, y_flow_index, x_flow_index))))
119 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cy*(max(0.0_default_precision,&
120 v%data(k, y_flow_index, x_flow_index))+abs(min(0.0_default_precision,v%data(k, y_flow_index-1, x_flow_index))))
123 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cx*(u%data(k, y_flow_index, x_flow_index)+&
124 abs(min(0.0_default_precision,u%data(k, y_flow_index, x_flow_index-1))))
126 sum_cfl_out = sum_cfl_out * dt
128 sum_cfl_out=0.0_default_precision
130 sum_cfl_out = sum_cfl_out + rdz(k)*&
131 (max(0.0_default_precision,w%data(k, y_flow_index, x_flow_index+1))+&
132 abs(min(0.0_default_precision,w%data(k-1, y_flow_index, x_flow_index+1))))
135 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cy*(max(0.0_default_precision,&
136 v%data(k, y_flow_index, x_flow_index+1))+&
137 abs(min(0.0_default_precision,v%data(k, y_flow_index-1, x_flow_index+1))))
140 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cx*(max(0.0_default_precision,&
141 u%data(k, y_flow_index, x_flow_index+1))-u%data(k, y_flow_index, x_flow_index))
143 sum_cfl_out = sum_cfl_out * dt
146 fgt1=0.0_default_precision
149 w%data(:, y_flow_index, x_flow_index+1), dt, advneg, advpos, kdof, kp0, kp1, &
150 zf%data(:, y_scalar_index, x_scalar_index), zf%data(:, y_scalar_index, x_scalar_index+1), rdz)
154 fgt2=0.0_default_precision
157 grid_config%horizontal%cy, dt, fc, zf, y_scalar_index, x_scalar_index, multiplication_factor_one=advpos, &
158 term_data_two=zf, term_data_two_y_index=y_scalar_index, term_data_two_x_index=x_scalar_index+1, &
159 multiplication_factor_two=advneg, data_two=v, data_two_y_index=y_flow_index, data_two_x_index=x_flow_index)
162 flux_x(k) =
calculate_flux_in_x(u%data(k, y_flow_index, x_flow_index), dt, sum_cfl_out, fdels, fd, fc, fu, fgt1, fgt2, &
163 grid_config%horizontal%cx, fcurvs)
169 local_grid, grid_config, kdof, dt, flux_y, rdz, kmin, kmax)
170 integer,
intent(in) :: y_flow_index, x_flow_index, y_scalar_index, x_scalar_index, kdof, kmin, kmax
178 integer :: k, kp1, kp0, jofset, jperiod
190 kp1=min(k+1,local_grid%size(
z_index))
194 advpos, fc, fcurvs, fd, fdels, fu, jofset, jperiod, v, zf)
195 if (abs(fcurvs) .ge. abs(fdels) )
then
198 sum_cfl_out=0.0_default_precision
200 sum_cfl_out = sum_cfl_out + rdz(k)* (max(0.0_default_precision,w%data(k, y_flow_index+jofset, &
201 x_flow_index))+ abs(min(0.0_default_precision,w%data(k-1, y_flow_index+jofset, x_flow_index))))
204 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cy*(max(0.0_default_precision,v%data(&
205 k, y_flow_index+jofset, x_flow_index)) +&
206 abs(min(0.0_default_precision,v%data(k, y_flow_index-1 +jofset+jperiod, x_flow_index))))
209 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cx*(max(0.0_default_precision,u%data(&
210 k, y_flow_index+jofset, x_flow_index)) + &
211 abs(min(0.0_default_precision,u%data(k, y_flow_index+jofset, x_flow_index-1))))
213 sum_cfl_out = sum_cfl_out * dt
215 fgt1=0.0_default_precision
218 x_flow_index), dt, advneg, advpos, kdof, kp0, kp1, &
219 zf%data(:, y_scalar_index+jofset, x_scalar_index), rdz=rdz)
222 fgt2=0.0_default_precision
225 x_flow_index), u%data(:, y_flow_index+1, x_flow_index-1), u%data(:, y_flow_index+1, x_flow_index), &
226 grid_config%horizontal%cx, dt, fc, zf%data(k, y_scalar_index+jofset, x_scalar_index+1), &
227 zf%data(k, y_scalar_index+jofset, x_scalar_index-1), 0)
231 fdels, fd, fc, fu, fgt1, fgt2, grid_config%horizontal%cy, fcurvs)
237 local_grid, grid_config, kdof, dt, flux_z, rdz, rdzn, dzn)
238 integer,
intent(in) :: kdof, y_flow_index, x_flow_index, y_scalar_index, x_scalar_index
259 do k=2,local_grid%size(
z_index)-2
261 advpos, fc, fcurvs, fd, fdels, fu, kofset, w, zf)
263 if(abs(fcurvs) .ge. abs(fdels))
then
266 sum_cfl_out=0.0_default_precision
268 sum_cfl_out=sum_cfl_out+rdz(k+kofset)*(max(0.0_default_precision,w%data(k+kofset, y_flow_index, &
269 x_flow_index))+ abs(min(0.0_default_precision,w%data(k-1+kofset, y_flow_index, x_flow_index))))
272 sum_cfl_out=sum_cfl_out+grid_config%horizontal%cy*(max(0.0_default_precision,&
273 v%data(k+kofset, y_flow_index, x_flow_index))+&
274 abs(min(0.0_default_precision,v%data(k+kofset, y_flow_index-1, x_flow_index))))
277 sum_cfl_out=sum_cfl_out+grid_config%horizontal%cx*(max(0.0_default_precision,&
278 u%data(k+kofset, y_flow_index, x_flow_index))+ &
279 abs(min(0.0_default_precision,u%data(k+kofset, y_flow_index, x_flow_index-1))))
281 sum_cfl_out = sum_cfl_out * dt
284 fgt1=0.0_default_precision
287 dt, fc, zf, y_scalar_index, x_scalar_index, kofset)
290 fgt2=0.0_default_precision
293 x_flow_index), u%data(:, y_flow_index, x_flow_index-1), u%data(:, y_flow_index, &
294 x_flow_index), grid_config%horizontal%cx, dt, fc, zf%data(k+kofset, y_scalar_index, x_scalar_index+1), &
295 zf%data(k+kofset, y_scalar_index, x_scalar_index-1), 1)
297 rdu=rdzn(k) *advpos + rdzn(k+2)*advneg
298 rdc=rdz(k+kdof)*advpos + rdz(k+1+kdof)*advneg
302 dt, sum_cfl_out, rdc, fdels, fd, fc, fu, rdu, fgt1, fgt2, dzn, rdzn)
308 grid_config, kdof, dt, flux_z, rdz, rdzn, dzn)
309 integer,
intent(in) :: y_flow_index, x_flow_index, y_scalar_index, x_scalar_index, kdof
329 if(w%data(k, y_flow_index, x_flow_index) .ge. 0.0_default_precision)
then
330 fu = zf%data(1, y_scalar_index, x_scalar_index)
331 fc = zf%data(k, y_scalar_index, x_scalar_index)
332 fd = zf%data(k+1, y_scalar_index, x_scalar_index)
334 fu = zf%data(k+2, y_scalar_index, x_scalar_index)
335 fc = zf%data(k+1, y_scalar_index, x_scalar_index)
336 fd = zf%data(k, y_scalar_index, x_scalar_index)
338 fcurvs = fd - 2.0_default_precision*fc + fu
340 if(abs(fcurvs) .ge. abs(fdels))
then
343 if(w%data(k, y_flow_index, x_flow_index) .ge. 0.0_default_precision)
then
344 sum_cfl_out=0.0_default_precision
346 sum_cfl_out = sum_cfl_out + w%data(k, y_flow_index, x_flow_index)*rdz(k+kdof)
349 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cy*(max(0.0_default_precision,v%data(k, y_flow_index, x_flow_index))&
350 +abs(min(0.0_default_precision,v%data(k, y_flow_index-1, x_flow_index))))
353 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cx*(max(0.0_default_precision,u%data(k, y_flow_index, x_flow_index))&
354 +abs(min(0.0_default_precision,u%data(k, y_flow_index, x_flow_index-1))))
356 sum_cfl_out = sum_cfl_out * dt
359 fgt1=0.0_default_precision
362 grid_config%horizontal%cy, dt, fc, zf, y_scalar_index, x_scalar_index)
365 fgt2=0.0_default_precision
368 x_flow_index), u%data(:, y_flow_index, x_flow_index-1), u%data(:, y_flow_index, &
369 x_flow_index), grid_config%horizontal%cx, dt, fc, zf%data(k, y_scalar_index, x_scalar_index+1), &
370 zf%data(k, y_scalar_index, x_scalar_index-1), 1)
375 sum_cfl_out=0.0_default_precision
377 sum_cfl_out=sum_cfl_out+rdz(k+1+kdof)*(max(0.0_default_precision,w%data(k+1, y_flow_index, &
378 x_flow_index)) -w%data(k, y_flow_index, x_flow_index))
381 sum_cfl_out=sum_cfl_out+grid_config%horizontal%cy*(max(0.0_default_precision,v%data(k+1, y_flow_index, x_flow_index))&
382 +abs(min(0.0_default_precision,v%data(k+1, y_flow_index-1, x_flow_index))))
385 sum_cfl_out=sum_cfl_out + grid_config%horizontal%cx*(max(0.0_default_precision,u%data(k+1, y_flow_index, x_flow_index))&
386 +abs(min(0.0_default_precision,u%data(k+1, y_flow_index, x_flow_index-1))))
388 sum_cfl_out = sum_cfl_out * dt
391 fgt1=0.0_default_precision
394 grid_config%horizontal%cy, dt, fc, zf, y_scalar_index, x_scalar_index, 1)
397 fgt2=0.0_default_precision
400 x_flow_index), u%data(:, y_flow_index, x_flow_index-1), u%data(:, y_flow_index, &
401 x_flow_index), grid_config%horizontal%cx, dt, fc, zf%data(k+1, y_scalar_index, x_scalar_index+1), &
402 zf%data(k+1, y_scalar_index, x_scalar_index-1), 1)
409 dt, sum_cfl_out, rdc, fdels, fd, fc, fu, rdu, fgt1, fgt2, dzn, rdzn)
414 local_grid, grid_config, kdof, dt, flux_z, rdz, rdzn, dzn)
415 integer,
intent(in) :: y_flow_index, x_flow_index, y_scalar_index, x_scalar_index, kdof
437 if(w%data(k, y_flow_index, x_flow_index) .ge. 0.0_default_precision)
then
438 fu = zf%data(k-1, y_scalar_index, x_scalar_index)
439 fc = zf%data(k, y_scalar_index, x_scalar_index)
440 fd = zf%data(k+1, y_scalar_index, x_scalar_index)
443 fu = 2.0_default_precision*zf%data(k+1, y_scalar_index, x_scalar_index) - zf%data(k, y_scalar_index, x_scalar_index)
444 fc = zf%data(k+1, y_scalar_index, x_scalar_index)
445 fd = zf%data(k, y_scalar_index, x_scalar_index)
447 fcurvs = fd - 2.0_default_precision*fc + fu
449 if(abs(fcurvs) .ge. abs(fdels))
then
452 if(w%data(k, y_flow_index, x_flow_index) .ge. 0.0_default_precision)
then
453 sum_cfl_out=0.0_default_precision
455 sum_cfl_out = sum_cfl_out + rdz(k+kdof)*(w%data(k, y_flow_index, x_flow_index)&
456 +abs(min(0.0_default_precision,w%data(k-1, y_flow_index, x_flow_index))))
459 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cy*(max(0.0_default_precision,v%data(k, y_flow_index, x_flow_index))+&
460 abs(min(0.0_default_precision,v%data(k, y_flow_index-1, x_flow_index))))
463 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cx*(max(0.0_default_precision,u%data(k, y_flow_index, x_flow_index))&
464 +abs(min(0.0_default_precision,u%data(k, y_flow_index, x_flow_index-1))))
466 sum_cfl_out = sum_cfl_out * dt
469 fgt1=0.0_default_precision
472 zf, y_scalar_index, x_scalar_index)
475 fgt2=0.0_default_precision
478 x_flow_index), u%data(:, y_flow_index, x_flow_index-1), u%data(:, y_flow_index, &
479 x_flow_index), grid_config%horizontal%cx, dt, fc, zf%data(k, y_scalar_index, x_scalar_index+1), &
480 zf%data(k, y_scalar_index, x_scalar_index-1), 1)
485 sum_cfl_out=0.0_default_precision
487 sum_cfl_out = sum_cfl_out + (- w%data(k, y_flow_index, x_flow_index)&
488 *rdz(min(local_grid%size(
z_index),k+1+kdof)))
491 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cy*(max(0.0_default_precision,&
492 v%data(k+1, y_flow_index, x_flow_index))+&
493 abs(min(0.0_default_precision,v%data(k+1, y_flow_index-1, x_flow_index))))
496 sum_cfl_out = sum_cfl_out + grid_config%horizontal%cx*(max(0.0_default_precision,&
497 u%data(k+1, y_flow_index, x_flow_index))&
498 +abs(min(0.0_default_precision,u%data(k+1, y_flow_index, x_flow_index-1))))
500 sum_cfl_out = sum_cfl_out * dt
503 fgt1=0.0_default_precision
506 dt, fc, zf, y_scalar_index, x_scalar_index, 1)
509 fgt2=0.0_default_precision
512 x_flow_index), u%data(:, y_flow_index, x_flow_index-1), u%data(:, y_flow_index, &
513 x_flow_index), grid_config%horizontal%cx, dt, fc, zf%data(k+1, y_scalar_index, x_scalar_index+1), &
514 zf%data(k+1, y_scalar_index, x_scalar_index-1), 1)
516 rdu=rdzn(local_grid%size(
z_index))
517 rdc=rdz(min(local_grid%size(
z_index),k+1+kdof))
521 dt, sum_cfl_out, rdc, fdels, fd, fc, fu, rdu, fgt1, fgt2, dzn, rdzn)
525 real(kind=
default_precision)
function calculate_flux_in_w(k, data_value, dt, sum_cfl_out, rdc, fdels, fd, fc, fu, rdu, fgt1, &
527 integer,
intent(in) :: k
529 real(kind=
default_precision),
intent(in) :: dt, sum_cfl_out, rdc, fdels, fd, fc, fu, rdu, fgt1, fgt2
547 cflmod=abs(data_value*rdzn(k+1)*dt)
548 hrcfl=1.0_default_precision/(sum_cfl_out+1.e-30_default_precision)
549 hcfl=0.5_default_precision*cflmod
550 cflcoef=
r6*(1.0_default_precision-cflmod*cflmod)*(dd*dd*rdc)
551 rfdels=1.0_default_precision/(fdels+1.e-30_default_precision)
552 ffs=0.5_default_precision*(fd+fc)-hcfl*(fd-fc)-cflcoef*((fd-fc)*rdd-(fc-fu)*rdu) - fgt1 - fgt2
556 ftemp=max(fncs,min(fnfs,fnrefs,1.0_default_precision))
560 real(kind=
default_precision)
function calculate_flux_in_x(data_value, dt, sum_cfl_out, fdels, fd, fc, fu, fgt1, fgt2, cx, fcurvs)
561 real(kind=
default_precision),
intent(in) :: sum_cfl_out, fdels, fd, fc, fu, fgt1, fgt2, cx, dt, fcurvs
575 cflmod=abs(data_value*cx*dt)
576 hrcfl=1.0_default_precision/(sum_cfl_out+1.e-30_default_precision)
577 hcfl=0.5_default_precision*cflmod
578 cflcoef=
r6*(1.0_default_precision-cflmod*cflmod)
579 rfdels=1.0_default_precision/(fdels+1.e-30_default_precision)
580 ffs=0.5_default_precision*(fd+fc)-hcfl*(fd-fc)-cflcoef*fcurvs - fgt1 - fgt2
584 ftemp=max(fncs,min(fnfs,fnrefs,1.0_default_precision))
588 real(kind=
default_precision)
function calculate_flux_in_y(data_value, dt, sum_cfl_out, fdels, fd, fc, fu, fgt1, fgt2, cy, fcurvs)
589 real(kind=
default_precision),
intent(in) :: dt, sum_cfl_out, fdels, fd, fc, fu, fgt1, fgt2, cy, fcurvs
603 cflmod=abs(data_value*cy*dt)
604 hrcfl=1.0_default_precision/(sum_cfl_out+1.e-30_default_precision)
605 hcfl=0.5_default_precision*cflmod
606 cflcoef=
r6*(1.0_default_precision-cflmod*cflmod)
607 rfdels=1.0_default_precision/(fdels+1.e-30_default_precision)
608 ffs=0.5_default_precision*(fd+fc)-hcfl*(fd-fc)-cflcoef*fcurvs - fgt1 - fgt2
612 ftemp=max(fncs,min(fnfs,fnrefs,1.0_default_precision))
617 flow_field, advection_field_one, advection_field_two, advection_field_three, advection_field_four)
618 integer,
intent(in) :: k
619 real(kind=
default_precision),
intent(in),
dimension(:) :: flow_field, advection_field_one, advection_field_two, &
620 advection_field_three, advection_field_four
621 real(kind=
default_precision),
intent(out) :: advneg, advpos, fc, fcurvs, fd, fdels, fu
626 advpos = 0.5_default_precision+sign_modified
627 advneg = 0.5_default_precision-sign_modified
628 fu = advection_field_one(k)*advpos + advection_field_two(k)*advneg
629 fc = advection_field_three(k)*advpos + advection_field_four(k)*advneg
630 fd = advection_field_four(k)*advpos + advection_field_three(k)*advneg
632 fcurvs = fd - 2.0_default_precision*fc + fu
636 fc, fcurvs, fd, fdels, fu, jofset, jperiod, flow_field, zf)
637 integer,
intent(in) :: y_flow_index, x_flow_index, y_scalar_index, x_scalar_index, k
639 integer,
intent(out) :: jofset, jperiod
640 real(kind=
default_precision),
intent(out) :: advneg, advpos, fc, fcurvs, fd, fdels, fu
644 sign_modified=sign(0.5_default_precision, flow_field%data(k, y_flow_index, x_flow_index))
645 advpos=0.5_default_precision+sign_modified
646 advneg=0.5_default_precision-sign_modified
648 ajeq0=0.5_default_precision-sign(0.5_default_precision, (y_scalar_index-1)-0.5_default_precision)
649 jperiod=merge(0,1, y_scalar_index .gt. 1)
651 fu = zf%data(k, y_scalar_index-1+jperiod, x_scalar_index)*advpos + zf%data(k, y_scalar_index+2, x_scalar_index)*advneg
652 fc = zf%data(k, y_scalar_index, x_scalar_index) *advpos + zf%data(k, y_scalar_index+1, x_scalar_index)*advneg
653 fd = zf%data(k, y_scalar_index+1, x_scalar_index)*advpos + zf%data(k, y_scalar_index, x_scalar_index)*advneg
655 fcurvs = fd - 2.0_default_precision*fc + fu
659 fc, fcurvs, fd, fdels, fu, kofset, flow_field, zf)
660 integer,
intent(in) :: y_flow_index, x_flow_index, y_scalar_index, x_scalar_index, k
662 integer,
intent(out) :: kofset
663 real(kind=
default_precision),
intent(out) :: advneg, advpos, fc, fcurvs, fd, fdels, fu
667 sign_modified=sign(real(.5, kind=
default_precision),flow_field%data(k, y_flow_index, x_flow_index))
668 advpos=0.5_default_precision+sign_modified
669 advneg=0.5_default_precision-sign_modified
671 fu = zf%data(k-1, y_scalar_index, x_scalar_index)*advpos + zf%data(k+2, y_scalar_index, x_scalar_index)*advneg
672 fc = zf%data(k+kofset, y_scalar_index, x_scalar_index)
673 fd = zf%data(k+1, y_scalar_index, x_scalar_index)*advpos + zf%data(k, y_scalar_index, x_scalar_index) *advneg
674 fcurvs = fd - 2.0_default_precision*fc + fu
679 advpos, kdof, kp0, kp1, source_column_one, source_column_two, rdz)
680 integer,
intent(in) :: k, kdof, kp0, kp1
682 real(kind=
default_precision),
intent(in),
dimension(:) :: column_one, column_two, source_column_one
683 real(kind=
default_precision),
intent(in),
dimension(:),
optional :: source_column_two
686 integer :: ksu, ksl, kposwf
689 specific_face=0.125_default_precision*(column_one(k)+column_one(k-1)+column_two(k)+column_two(k-1))
690 kposwf=nint(0.5_default_precision+sign(real(0.5, kind=
default_precision), specific_face))
691 ksu=kp1*(1-kposwf)+(k-1)*kposwf
692 ksl=kp0*(1-kposwf)+k*kposwf
693 temp_src=source_column_one(ksl)-source_column_one(ksu)
694 if (
present(source_column_two)) temp_src = temp_src * advpos+(source_column_two(ksl)-source_column_two(ksu))*advneg
699 cx, dt, fc, source_value_one, source_value_two, kpv)
700 integer,
intent(in) :: k, kpv
703 real(kind=
default_precision),
intent(in),
dimension(:) :: column_one, column_two, column_three, column_four
707 specific_face=0.125_default_precision*(column_one(k)+column_two(k)+column_three(k+kpv)+column_four(k+kpv))
708 posuf=0.5_default_precision+sign(real(.5, kind=
default_precision), specific_face)
713 dt, fc, term_data_one, term_data_one_y_index, term_data_one_x_index, koffset_one, multiplication_factor_one, &
714 term_data_two, term_data_two_y_index, term_data_two_x_index, &
715 koffset_two, multiplication_factor_two, data_two, data_two_y_index, data_two_x_index)
717 integer,
intent(in) :: k, data_y_index, data_x_index, term_data_one_y_index, term_data_one_x_index
718 integer,
intent(in),
optional :: term_data_two_y_index, term_data_two_x_index, data_two_y_index, data_two_x_index
719 integer,
intent(in),
optional :: koffset_one, koffset_two
720 real(kind=
default_precision),
intent(in),
optional :: multiplication_factor_one, multiplication_factor_two
726 integer :: jsu, k_index
730 if (
present(data_two))
then
731 specific_face=0.125_default_precision*(data%data(k, data_y_index, data_x_index)+&
732 data_two%data(k, data_two_y_index, data_two_x_index)+&
733 data%data(k, data_y_index-1, data_x_index)+ data_two%data(k, data_two_y_index-1, data_two_x_index))
735 specific_face=0.125_default_precision*(data%data(k, data_y_index-1, data_x_index)+&
736 data%data(k, data_y_index, data_x_index)+&
737 data%data(k+1, data_y_index-1, data_x_index)+data%data(k+1, data_y_index, data_x_index))
740 if (
present(koffset_one))
then
741 k_index=k+koffset_one
746 jsu=term_data_one_y_index-nint(sign(real(1.0, kind=
default_precision), specific_face))
747 calc_term_one = term_data_one%data(k_index, jsu, term_data_one_x_index)
748 if (
present(multiplication_factor_one)) calc_term_one = calc_term_one * multiplication_factor_one
749 if (
present(term_data_two))
then
750 if (
present(koffset_two))
then
751 k_index=k+koffset_two
755 jsu=term_data_two_y_index-nint(sign(real(1.0, kind=
default_precision), specific_face))
756 calc_term_two = term_data_two%data(k_index, jsu, term_data_two_x_index)
757 if (
present(multiplication_factor_two)) calc_term_two = calc_term_two * multiplication_factor_two
758 calc_term_one = calc_term_one + calc_term_two