Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 24 additions & 18 deletions src/simulation/m_weno.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,10 @@ contains

call s_compute_weno_coefficients(1, is1_weno)

@:ALLOCATE(v_rs_weno(is1_weno%beg:is1_weno%end, is2_weno%beg:is2_weno%end, is3_weno%beg:is3_weno%end, 1:sys_size))
! Only MP-WENO and THINC read the packed copy; the reconstruction kernels read v_vf directly
if (mp_weno .or. int_comp > 0) then
@:ALLOCATE(v_rs_weno(is1_weno%beg:is1_weno%end, is2_weno%beg:is2_weno%end, is3_weno%beg:is3_weno%end, 1:sys_size))
end if

! Allocating/Computing WENO Coefficients in y-direction
if (n == 0) return
Expand Down Expand Up @@ -963,7 +966,8 @@ contains
end if
end if

if (weno_order /= 1) then
! The reconstruction kernels read the stencil straight from v_vf; only MP-WENO and THINC still read the packed copy
if (weno_order /= 1 .and. (mp_weno .or. int_comp > 0)) then
call s_pack_weno_input_arr(v_vf)
end if

Expand All @@ -984,9 +988,9 @@ contains

alpha(:) = 0._wp

vp0 = v_rs_weno(${SF('')}$, i)
vm1 = v_rs_weno(${SF(' - 1')}$, i)
vp1 = v_rs_weno(${SF(' + 1')}$, i)
vp0 = v_vf(i)%sf(${SF('')}$)
vm1 = v_vf(i)%sf(${SF(' - 1')}$)
vp1 = v_vf(i)%sf(${SF(' + 1')}$)

dvd(0) = vp1 - vp0
dvd(-1) = vp0 - vm1
Expand Down Expand Up @@ -1077,11 +1081,11 @@ contains

alpha(:) = 0._wp

vp0 = v_rs_weno(${SF('')}$, i)
vm1 = v_rs_weno(${SF(' - 1')}$, i)
vm2 = v_rs_weno(${SF(' - 2')}$, i)
vp1 = v_rs_weno(${SF(' + 1')}$, i)
vp2 = v_rs_weno(${SF(' + 2')}$, i)
vp0 = v_vf(i)%sf(${SF('')}$)
vm1 = v_vf(i)%sf(${SF(' - 1')}$)
vm2 = v_vf(i)%sf(${SF(' - 2')}$)
vp1 = v_vf(i)%sf(${SF(' + 1')}$)
vp2 = v_vf(i)%sf(${SF(' + 2')}$)

dvd(1) = vp2 - vp1
dvd(0) = vp1 - vp0
Expand Down Expand Up @@ -1234,13 +1238,13 @@ contains
do i = 1, v_size
alpha(:) = 0._wp

vp0 = v_rs_weno(${SF('')}$, i)
vm1 = v_rs_weno(${SF(' - 1')}$, i)
vm2 = v_rs_weno(${SF(' - 2')}$, i)
vm3 = v_rs_weno(${SF(' - 3')}$, i)
vp1 = v_rs_weno(${SF(' + 1')}$, i)
vp2 = v_rs_weno(${SF(' + 2')}$, i)
vp3 = v_rs_weno(${SF(' + 3')}$, i)
vp0 = v_vf(i)%sf(${SF('')}$)
vm1 = v_vf(i)%sf(${SF(' - 1')}$)
vm2 = v_vf(i)%sf(${SF(' - 2')}$)
vm3 = v_vf(i)%sf(${SF(' - 3')}$)
vp1 = v_vf(i)%sf(${SF(' + 1')}$)
vp2 = v_vf(i)%sf(${SF(' + 2')}$)
vp3 = v_vf(i)%sf(${SF(' + 3')}$)

if (teno) then
v(-3) = vm3
Expand Down Expand Up @@ -1578,7 +1582,9 @@ contains

! Deallocating the WENO-stencil of the WENO-reconstructed variables

@:DEALLOCATE(v_rs_weno)
if (mp_weno .or. int_comp > 0) then
@:DEALLOCATE(v_rs_weno)
end if

! Deallocating WENO coefficients in x-direction
@:DEALLOCATE(poly_coef_cbL_x, poly_coef_cbR_x)
Expand Down
Loading