Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6709761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:55:14+00:00 2026-05-26T07:55:14+00:00

*I am trying to group set of data according some condition using FORTRAN code.

  • 0

*I am trying to group set of data according some condition using FORTRAN code.
The code is as below.

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:

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T07:55:14+00:00Added an answer on May 26, 2026 at 7:55 am

    Fortran 90 has six relational operators: <, <=, >, >=, ==, /=
    Each of these six relational operators takes two expressions, compares their values, and yields .TRUE. or .FALSE.
    Thus, a > b < c is wrong, because a < b is LOGICAL and c is REAL.

    Rewrite your test as:

    if  ( (0 > dihedral(i) .and. dihedral(i) < 120) .or. (-120 > dihedral(i) .and. dihedral(i) < 0) )  then
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to group a set of data based on the range of an
I'm trying to reorder/group a set of results using SQL. I have a few
I'm trying to extract a set of data from some (large) text files. Basically,
I am trying to zip a group of binary data (result set returned from
I'm trying to set the group type for a new Active Directory Entry via
I am trying to group a data collection and send it to the View
Using Regex in .Net I will have a set of data that comes in
I trying to make method to alter table. I've build data.db Created new group
I have an issue with a query I'm trying to run on some data,
I am trying to perform a query which groups a set of data by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.