- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to use to the fpp preprocessor to achieve the following, however fpp doesnt seem to support the preprocessing of partial words. Is there a work around?
#ifdef DOUBLE_PRE
#define pre_ D0
#else
#define pre_ E0
#endif
...
myrealvar = 10.0pre_
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Larry R. wrote:
I want to use to the fpp preprocessor to achieve the following, ..
Larry,
Depending on what all needs you have for the preprecessor, you may wish to consider an alternative based on Intel Fortran compiler directive syntax which I find more flexible:
MODULE MyKinds USE, INTRINSIC :: ISO_FORTRAN_ENV, ONLY : I4 => INT32, SP => REAL32, DP => REAL64, QP => REAL128 IMPLICIT NONE !DEC$ IF DEFINED (SINGLE) INTEGER(I4), PARAMETER :: WP = SP !DEC$ IF DEFINED (DOUBLE) INTEGER(I4), PARAMETER :: WP = DP !DEC$ IF DEFINED (QUAD) INTEGER(I4), PARAMETER :: WP = QP !DEC$ ELSE INTEGER(I4), PARAMETER :: WP = SP !.. Default !DEC$ ENDIF END MODULE MyKinds PROGRAM p USE MyKinds, ONLY : WP REAL(WP) :: x x = 1E3_wp PRINT *, " x = ", x STOP END PROGRAM p
Link Copied
- « Previous
-
- 1
- 2
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not sure I understand your question, Jim. If y is private in the module you're using, it's not accessible. If you have a rename, x is the local symbol and y is not defined. You can certainly make x private, but that affects only USErs of the module with the private declaration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
module m3 ... contains subroutine sub use M2, x => x use M2 use M2, y => x ...
My section, "Just because you can, doesn't mean you should." on Fortran just became longer!

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »