-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: passing array section in subroutine #6324
Comments
If we modify the snippet above (i.e. #6324 (comment)) by using the below diff: diff --git a/test.f90 b/test.f90
index f71fa6c00..9459cff97 100644
--- a/test.f90
+++ b/test.f90
@@ -25,7 +25,11 @@ subroutine readbr (br0_g)
implicit none
real, dimension(nt_g,np_g) :: br0_g
real :: sum0
- call intrp2d (nt_g-2,np_g-2, br0_g(2:ntm1_g,2:npm1_g))
+ real, dimension(:, :), allocatable :: f
+ allocate(f(ntm1_g - 1, npm1_g-1))
+ f = br0_g(2:ntm1_g, 2:npm1_g)
+ call intrp2d (nt_g-2,np_g-2, f)
+ br0_g(2:ntm1_g, 2:npm1_g) = f
sum0=sum(br0_g(2,2:npm1_g))
print *, "sum0: ", sum0
end subroutine we get a correct print with LFortran. |
I'd like to work on this issue. Could you please elaborate a bit about what needs to be done? |
Isn't this the same issue as #6214? |
Yes, I think so. I hadn't seen that issue until I opened this one, we can keep this issue open until we close that issue and then we can test this one also to see if the MRE reported here also works or not. |
Minimal Reproducible Example
For the below fortran program extracted from the POT3D repository:
the output printed by LFortran is:
I checked also for ifx compiler as well, the output produced is the same as that for GFortran compiler: https://godbolt.org/z/bEhPYnjch
The text was updated successfully, but these errors were encountered: