How Can I Correctly Use the 'dacos' Function in a Fortran Header File?

  • Thread starter paulga
  • Start date
  • Tags
    Fortran
In summary, to use the function "dacos" in a header file, you need to add a declaration for it in the param.h file using the syntax shown above.
  • #1
paulga
1
0
I came across a problem on the project:
my project is comprised of tens of fortran files. There is a param.h header file collecting all the parameters that are used by the program and subroutines. but after I add this line:
parameter(pi = dacos(-1.0d0))
into the param.h
the command "make " always reports errors like:

param.h: In subroutine `stressinit':
param.h:135:
parameter(pi = dacos(-1.0d0))
^
Invalid declaration of or reference to symbol `dacos' at (^) [initially seen at (^)]

How to employ the function "dacos" in a header file?
Thanks a lot.
 
Physics news on Phys.org
  • #2
You need to add a declaration for the dacos() function in the param.h header file. This can be done using the following syntax: double precision function dacos(x) double precision, intent(in) :: x dacos = ... end function dacos
 
  • #3


Hello,

It seems like you are having trouble with using the function "dacos" in your param.h header file. The error message you received indicates that there is an invalid declaration or reference to the symbol "dacos" in your code. This could be due to a few reasons:

1. The function "dacos" is not defined in your code or in any of the Fortran files that you are using. Make sure that you have included the necessary libraries or modules that contain the definition for this function.

2. The function "dacos" is not spelled correctly. Fortran is case sensitive, so make sure that you are using the correct capitalization for the function name.

3. The function "dacos" is not compatible with the data type you are using. Make sure that the input for the function is of the correct data type (in this case, a double precision number).

If none of these suggestions help, it would be helpful to see the specific code in your param.h header file and any associated files in order to provide a more specific solution. I would also recommend consulting with other Fortran experts or checking online resources for further assistance with this issue.

Best of luck with your project.
 

Related to How Can I Correctly Use the 'dacos' Function in a Fortran Header File?

1. What is Fortran (g77)?

Fortran (g77) is a programming language used for scientific and engineering applications. It is designed for complex calculations and has strong support for numerical and mathematical operations. It is often used in fields such as physics, astronomy, and geology.

2. How is Fortran (g77) different from other programming languages?

Fortran (g77) is specifically designed for scientific and engineering applications, making it more efficient and accurate for complex mathematical calculations. It also has a simpler syntax compared to other programming languages, making it easier to learn and use for those in the scientific community.

3. Can I use Fortran (g77) to create graphical user interfaces (GUIs)?

Fortran (g77) is primarily used for numerical and scientific calculations and does not have built-in capabilities for creating GUIs. However, there are third-party libraries and tools that can be used to create GUIs with Fortran (g77).

4. Is Fortran (g77) still relevant in modern computing?

Yes, Fortran (g77) is still widely used in scientific and engineering fields and has been continuously updated to keep up with modern computing advancements. It is known for its reliability, efficiency, and extensive library of mathematical and scientific functions.

5. Can I use Fortran (g77) for web development?

Fortran (g77) is not commonly used for web development as it is not designed for creating web applications or websites. However, it can be used for backend calculations and processing in web applications that require complex mathematical operations.

Similar threads

  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
8
Views
3K
  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
12
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
0
Views
2K
  • Programming and Computer Science
Replies
4
Views
4K
  • Programming and Computer Science
Replies
6
Views
1K
  • Programming and Computer Science
Replies
10
Views
5K
  • Programming and Computer Science
Replies
4
Views
4K
Back
Top