Hi @milancurcic ,
I have been following the tsunami example, and I have reached page 50. However, there is an error when trying to plot
Command terminal:
[agnelo@fedora Lesson 2]$ caf tsunami.f90 -o tsunami
[agnelo@fedora Lesson 2]$ cafrun -n 1 ./tsunami >tsunami_output.txt
[agnelo@fedora Lesson 2]$ python3 plot_height_multipanel.py tsunami_output.txt
File "/home/agnelo/Documents/Modern Fortran lessons/Lesson 2/plot_height_multipanel.py", line 61
<title>tsunami/plot_height_multipanel.py at master · modern-fortran/tsunami · GitHub</title>
^
SyntaxError: invalid character '·' (U+00B7)
[agnelo@fedora Lesson 2]$
The code :
program tsunami
implicit none
integer :: i,n
integer,parameter :: grid_size = 100
integer,parameter :: num_time_steps = 100
real,parameter :: dt = 1. !time step [s]
real,parameter :: dx = 1. !grid spacing [m]
real,parameter :: c = 1. !bacckground flow speed [m/s]
real :: h(grid_size), dh(grid_size)
integer,parameter :: icenter = 25
real,parameter :: decay = 0.02
if(grid_size <= 0) stop 'grid_size must be > 0'
if(dt <= 0) stop 'time dt must be > 0'
if(dx<=0) stop 'grid spacing dx must be > 0'
if(c <= 0) stop 'background flow speed must be > 0'
do concurrent (i = 1:grid_size)
h(i) = exp(-decay * (i-icenter)**2)
end do
time_loop: do n = 1,num_time_steps
dh(1) = h(1) - h(grid_size)
do i=2,grid_size
dh(i)=h(i) - h(i-1)
end do
do i=1,grid_size
h(i)=h(i) - c*dh(i) / dx *dt
end do
print *, n,h
end do time_loop
end program tsunami