I am trying to group set of data according some condition using FORTRAN code. The code is as below
Code:
gauche = 0.0
trans = 0.0
do i = 1, total_data
!write(*,*) nombor(i), dihedral(i)
if ( (0 > dihedral(i) < 120) .or. (-120 > dihedral(i) < 0) ) then
gauche = gauche + 1
else
trans = trans + 1
endif
end do
write(20,*) "Layer1_seg_total= ",(gauche+trans)," ","gauche_seg= ",gauche,"trans_seg= trans
But when I compile I get error message as below:
Code:
if ((0 > dihedral(i) < 120) .or. (-120 > dihedral(i) < 0)) then
1
Error: Expected a right parenthesis in expression at (1)
population.f90:42.5:
else
1
Error: Unexpected ELSE statement at (1)
population.f90:44.4:
endif
1
Error: Expecting END DO statement at (1)
I can not trace the error. Can anyone suggest the mistake? NOTE: this is not an assignment
Thanks in advance