What Could Be Causing Errors in My Fortran Program Compilation?

  • Context: Fortran 
  • Thread starter Thread starter jam_gha
  • Start date Start date
  • Tags Tags
    Errors Fortran
Click For Summary
SUMMARY

The forum discussion addresses compilation errors in a Fortran program shared by a user named Jamshid. The provided code includes several INCLUDE statements and logical conditions, but lacks completeness, making it difficult for others to assist. Key issues highlighted include the necessity of sharing error messages and a complete code snippet for effective troubleshooting. The discussion emphasizes that users must clearly indicate their problems to receive meaningful help.

PREREQUISITES
  • Understanding of Fortran programming language syntax and structure
  • Familiarity with INCLUDE statements in Fortran
  • Knowledge of logical conditions and data initialization in Fortran
  • Ability to interpret and analyze compiler error messages
NEXT STEPS
  • Research best practices for posting code in programming forums
  • Learn about common Fortran compilation errors and their resolutions
  • Explore the use of debugging tools for Fortran, such as GDB
  • Study the significance of code completeness when seeking help online
USEFUL FOR

This discussion is beneficial for Fortran developers, programmers seeking assistance with compilation issues, and anyone looking to improve their code-sharing practices in online forums.

jam_gha
Messages
7
Reaction score
0
Hi there

I compile the following Fortran program but it shows more error it output file.
can you help me.

with Regards,
jamshid

INCLUDE '(SCOHLP)'
INCLUDE '(PAPROP)'
*
*
******LOGICAL LFIRST
******SAVE LFIRST, ZMIN, DELTAZ
******DATA LFIRST /.TRUE./
* Initialization, to be done only at first call
******IF (LFIRST) THEN
*********LFIRST = .FALSE.
* It is always good to write a warning on standard output that a
* user routine has been used
*********WRITE(LUNOUT,*)
*****& "**** Using routine fluscw to get differential yield in z ****"
*********ZMIN = 5.D+00 ! write here the limits of the z range
*********ZMAX = 45.D+00 ! where you want to do the scoring
*********NINTRV = 400.D+00 ! and the number of z intervals
*********DELTAZ = (ZMAX - ZMIN)/DBLE(NINTRV)
******END IF
******FLUSCW = ONEONE
******LSCZER = .FALSE.
* The following applies only to yield detectors (there could be others)
******IF (ISCRNG .EQ. 5) THEN
* find the z interval number
*********INTERV = INT((ZZ - ZMIN)/DELTAZ) + 1
* don't score if detector number is different from interval number
*********LSCZER = JSCRNG .NE. INTERV
* multiply the score by 4pi to get integral result in omega
*********IF (.NOT. LSCZER) FLUSCW = FOUFOU * PIPIPI
******END IF
******RETURN
******END
 
Technology news on Phys.org
When your post includes code (especially Fortran which is column dependent), you can post it in advanced mode (button below message window), select the text of the code and press the code button. The columns will be preserved and it will be easier to understand than forcing spaces with asterisks.

Also, code with include statements automatically means that the source code is incomplete, and your chances of getting help is reduced, unless the problem occurs clearly in the section of code posted.

This brings us to the third point, which is it is up to you to indicate where the problem is. The code you posted is incomplete, so readers cannot compile it to see where the problem is, the error messages have not been posted nor described, so it would not be surprising that you did not get help.

To sum it up, you need to help yourself by posting exactly what is bothering you, and what you expect for help.

Hope that helps.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
9K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 9 ·
Replies
9
Views
10K
Replies
4
Views
8K
  • · Replies 4 ·
Replies
4
Views
17K
  • · Replies 10 ·
Replies
10
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K