All you've got is a sequence of assignments with a loop thrown in for fun. I guess you understand that statement such as
lhs = rhs
evaluates rhs
and assigns the result to the variable lhs
.
The line
101 do iperm = 1, 3
starts a do
loop. The 101
is a statement label, it's used later. The loop comprises all the statements from that line to the line enddo
. The loop will be executed 3 times (once for each of the integers in the sequence starting at 1
and ending at 3
). The loop control variable iperm
is assigned these values in turn. The loop is a little unusual in that the loop variable is not used inside the loop. The statement
omega = omega + s * a1 (i) * a2 (j) * a3 (k)
updates the value of omega
. The term a1(i)
(the space in your original is immaterial) means the i-th element of array a1
. et cetera
When the line
if (s.lt.0.d0) goto 101
is executed if s
is less than 0
control goes bak to the line labelled 101
.
Finally, the term alat**3
calculates the cube of alat
.
So now get a piece of paper and figure out what value omega
gets.