You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ lfortran --show-wat a.f90 warning: Function with no body --> a.f90:73:9 - 76:23 |73 | subroutine show_img(n, m, A) bind(c) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...... |76 | end subroutine | ...^^^^^^^^^^^^^^^^^^^^^^^ show_imgwarning: WASM: Calls to C subroutine are not yet supported --> a.f90:73:9 - 76:23 |73 | subroutine show_img(n, m, A) bind(c) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...... |76 | end subroutine | ...^^^^^^^^^^^^^^^^^^^^^^^ Function: calls show_imgNote: if any of the above error or warning messages are not clear or are lackingcontext please report it to us (we consider that a bug that needs to be fixed).(module (type (;0;) (func (param i32) (result))) (type (;1;) (func (param i64) (result))) (type (;2;) (func (param f32) (result))) (type (;3;) (func (param f64) (result))) (type (;4;) (func (param i32 i32) (result))) (type (;5;) (func (param) (result))) (type (;6;) (func (param i32) (result))) (import "js" "print_i32" (func (;0;) (type 0))) (import "js" "print_i64" (func (;1;) (type 1))) (import "js" "print_f32" (func (;2;) (type 2))) (import "js" "print_f64" (func (;3;) (type 3))) (import "js" "print_str" (func (;4;) (type 4))) (import "js" "flush_buf" (func (;5;) (type 5))) (import "js" "set_exit_code" (func (;6;) (type 6))) (import "js" "memory" (memory (;0;) 100 100)))
where a.f90 is the code from the current dev.lfortran.org:
program mandelbrot
implicit noneinteger , parameter:: rk =8integer , parameter:: i_max =600integer , parameter:: j_max =450integer , parameter:: n_max =100real (rk), parameter:: x_centre =-0.5_rkreal (rk), parameter:: y_centre =0.0_rkreal (rk), parameter:: width =4.0_rkreal (rk), parameter:: height =3.0_rkreal (rk), parameter:: dx_di = width / i_max
real (rk), parameter:: dy_dj =-height / j_max
real (rk), parameter:: x_offset = x_centre -0.5_rk* (i_max +1) * dx_di
real (rk), parameter:: y_offset = y_centre -0.5_rk* (j_max +1) * dy_dj
integer:: image(i_max, j_max)
integer:: image_t(j_max, i_max)
integer:: i
integer:: j
integer:: n
real (rk) :: x
real (rk) :: y
real (rk) :: x_0
real (rk) :: y_0
real (rk) :: x_sqr
real (rk) :: y_sqr
do j =1, j_max
y_0 = y_offset + dy_dj * j
do i =1, i_max
x_0 = x_offset + dx_di * i
x =0.0_rk
y =0.0_rk
n =0do
x_sqr = x **2
y_sqr = y **2if (x_sqr + y_sqr > 4.0_rk) then
image(i,j) =255
exit
end ifif (n == n_max) then
image(i,j) =0
exit
end if
y = y_0 +2.0_rk* x * y
x = x_0 + x_sqr - y_sqr
n = n +1end doend doend do
! print'(a)', 'P2'
! print'(i0, 1x, i0)', i_max, j_max
! print'(i0)', 255
! do j =1, 3
! do i =1, 3
! print'(i0)', image(i,j)
! end do
! end dodo i =1, i_max
do j =1, j_max
image_t(j, i) = image(i, j)
end doend doprint*, "The result is as follows:"call show_img(j_max, i_max, image_t)
print*, "Thank you! Hope you had fun!"
interface
subroutineshow_img(n, m, A) bind(c)
integer, intent(in) :: n, m
integer, intent(in) :: A(n,m)
endsubroutine
end interface
end program mandelbrot
The text was updated successfully, but these errors were encountered:
Original issue: https://gitlab.com/lfortran/lfortran/-/issues/771
I would do the following:
where
a.f90
is the code from the current dev.lfortran.org:The text was updated successfully, but these errors were encountered: