-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
[asr->fortran] implement visit_{FileOpen, FileClose, FileRead} #2686
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good so far!
If you feel you have finished the PR, please mark it as "Ready for Review".
Addressed all your reviews! Thanks, @Thirumalai-Shaktivel!
I think we can also enable some other tests too. For example: generated code
program load_model_program
implicit none
integer(4) :: int_data1
integer(4) :: int_data2
real(4) :: real_data1
real(4) :: real_data2
integer(4), save :: u = 11
open(u, file="file_04_data.dat", form="unformatted")
read(u, *) int_data1, real_data1, int_data2, real_data2
print *, "Data: ", int_data1, real_data1, int_data2, real_data2
if (int_data1 /= 345239) then
error stop
end if
if (abs(real_data1 - 52.910000) > 0.000001) then
error stop
end if
if (int_data2 /= (-345239)) then
error stop
end if
if (abs(real_data2 - (-52.910000)) > 0.000001) then
error stop
end if
end program load_model_program test code
program load_model_program
implicit none
integer :: int_data1, int_data2
real :: real_data1, real_data2
integer :: u = 11
open(u, file="file_04_data.dat", form="unformatted", access="stream")
read(u) int_data1, real_data1, int_data2, real_data2
print *, "Data: ", int_data1, real_data1, int_data2, real_data2
if (int_data1 /= 345239) error stop
if (abs(real_data1 - (52.91)) > 1e-6) error stop
if (int_data2 /= -345239) error stop
if (abs(real_data2 - (-52.91)) > 1e-6) error stop
end program
What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, Thank you!
Thank you! |
@Shaikh-Ubaid, can you review and merge this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I shared a minor comment. This looks good to me! Very valuable contributions! Thanks for this!
Thanks for all your helpful reviews in the PR, @Thirumalai-Shaktivel & @Shaikh-Ubaid! Have addressed all of your reviews! |
TODO