summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-11-03 01:13:36 +0000
committerschnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac>2004-11-03 01:13:36 +0000
commit0a9a7eb4e4377251cab038d9a7aad0485159a9bb (patch)
tree9bf3516ca4938261a8071215e63d0482b21fec37 /doc
parent30e737ecb1109d16f0975c7ba104dd959948369a (diff)
Update section on using Fortran modules.
Update section on using CCTK_INFO and CCTK_WARN from Fortran. git-svn-id: http://svn.cactuscode.org/flesh/trunk@3886 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'doc')
-rw-r--r--doc/UsersGuide/ThornWriters.tex31
1 files changed, 19 insertions, 12 deletions
diff --git a/doc/UsersGuide/ThornWriters.tex b/doc/UsersGuide/ThornWriters.tex
index b5dcf10f..1d933740 100644
--- a/doc/UsersGuide/ThornWriters.tex
+++ b/doc/UsersGuide/ThornWriters.tex
@@ -1664,16 +1664,23 @@ DECLARE_CCTK_FUNCTIONS
to a module or a subroutine after the \texttt{implicit none}
statement, but before any executable code.
-\subsubsection{Fortran 90 Modules}
-
-Fortran 90 modules should be included in a thorn's {\tt make.code.deps} file
-(\ref{sec:mabathbu}) to ensure they are compiled before the
-routines which use them. This is especially important for parallel
-building. For example, if a routine in {\tt MyRoutine.F} uses a module
-in {\tt MyModule.F} add the line:
+\subsubsection{Fortran Modules}
+
+Fortran modules should be placed into source files that have the same
+name as the module, followed by the corresponding file name suffix. A
+module \texttt{metric} should thus be placed e.g.\ into a file
+\texttt{metric.F90}. This convention allows the Cactus build system
+to automatically deduce the compile time dependencies.
+
+If you do not follow this convention, then you have to include the
+modules into the thorn's {\tt make.code.deps} file
+(\ref{sec:mabathbu}) to ensure they are compiled before the routines
+which use them. This is especially important for parallel building.
+For example, if a routine in {\tt MyRoutine.F90} uses a module in {\tt
+MyModule.F90}, then add the line:
%
\begin{verbatim}
-$(SYS_OBJD)/MyRoutine.F.o: $(SYS_OBJD)/MyModule.F.o
+$(SYS_OBJD)/MyRoutine.F90.o: $(SYS_OBJD)/MyModule.F90.o
\end{verbatim}
\subsubsection{The {\tt MOD} function}
@@ -3065,7 +3072,7 @@ But in Fortran you have to do the following:
character*200 message
write (message, '("The integer is ",i4)') myint
- call CCTK_INFO (message(1:len_trim(message)))
+ call CCTK_INFO (message)
\end{verbatim}
In Fortran 90, you can also do:
@@ -3074,7 +3081,7 @@ In Fortran 90, you can also do:
character(200) message
write (message, '("The integer is ",i4)') myint
- call CCTK_INFO (trim(message))
+ call CCTK_INFO (message)
\end{verbatim}
Note that:
@@ -3155,7 +3162,7 @@ But in Fortran you have to do the following:
character*200 message
write (message, '("Your warning message, including ",g12.7," and ",i8)') myreal, myint
- call CCTK_WARN (1, message(1:len_trim(message)))
+ call CCTK_WARN (1, message)
\end{verbatim}
In Fortran 90, you can also do:
@@ -3165,7 +3172,7 @@ In Fortran 90, you can also do:
character(200) message
write (message, '("Your warning message, including ",g12.7," and ",i8)') myreal, myint
- call CCTK_WARN (1, trim(message))
+ call CCTK_WARN (1, message)
\end{verbatim}
The Flesh will be implementing standard error return codes