Closed arporter closed 2 years ago
Really we have something like:
do ipt = 1, nqp_pts
grad_theta_v_at_quad(ipt) = grad_theta_v_at_quad(ipt) + theta_v_e(df)*wt_diff_basis(ipt, df, qp1, qp2)
end do
grad_theta_v_at_quad
and theta_v_e
are both active. This should then become:
do idx = 3, 1, -1
theta_v_e(df) = theta_v_e(df) + grad_theta_v_at_quad(idx) * wt_diff_basis(idx,df,qp1,qp2)
enddo
so we actually end up accumulating into theta_v_e(df)
.
Perhaps the easiest solution is to convert all implicit loops into explicit ones first @rupertford? (We can build on the NEMO transformation that does this.)
Yes, I agree @arporter. We should be able to simply add the arrayrange2loop transformation to our internal pre-processing script.
The invalid Fortran that is produced is actually correct if you assume that subexpressions on the rhs can be implicit loops :-)
Created branch 1581_psyad_array_range_to_loop
gets transformed to:
where the first assignment is not valid.