0

Hi I wrote the following code for the Abaqus which is linked with fortran but this showed me several syntax error and not getting compiled. How can I fix the code so that it compiles?

 if(noel.le.1150.or.noel.ge.1201.and.noel.le.2350.or.noel.ge.2811.and.noel.le.8100.or.noel.ge.8331.and.noel.le.13620.or.noel.ge.14081.and.noel.le.19370.or.noel.ge.19601) 
  then
 ...action>>>
 end if
Sanoop Surendran
  • 3,484
  • 4
  • 28
  • 49
Deba
  • 1
  • 1
  • Other duplicates: http://stackoverflow.com/questions/36133324/continuation-in-gfortran-5-2-0 and http://stackoverflow.com/questions/21789762/doesnt-work-for-long-equation-in-fortran – M. S. B. Aug 27 '16 at 03:27
  • you shouldn't need to do that in Abaqus. make a seperate section with those elements, and use the name of the material whcih is passed into the routine to do your logical tests – will Aug 28 '16 at 22:05

1 Answers1

3

with gfortran (assuming free form), one might use the switch -ffree-line-length-none to enable arbitrarily long input lines, or use "line continuation" as:

PROGRAM test

  INTEGER :: x = 1200

  IF( &
    x .LE. 1150 &
    .OR.  &
    (x .GE. 1201 .AND. x .LE. 2350) &
    .OR. &
    (x .GE. 2811 .AND. x .LE. 8100) &
  ) THEN
    WRITE(*, *) "OK"
  ELSE
    WRITE(*, *) "KO"
  END IF

END PROGRAM
ewcz
  • 12,819
  • 1
  • 25
  • 47