Changeset 1515 for palm/trunk/TUTORIAL/SOURCE/user_defined_code.tex
- Timestamp:
- Jan 2, 2015 11:35:51 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/TUTORIAL/SOURCE/user_defined_code.tex
r1234 r1515 6 6 \usepackage{ngerman} 7 7 \usepackage{pgf} 8 \usetheme{Dresden}9 8 \usepackage{subfigure} 10 9 \usepackage{units} … … 27 26 \ttfamily,showstringspaces=false,captionpos=b} 28 27 29 \institute{Institut fÃŒr Meteorologie und Klimatologie, Leibniz UniversitÀt Hannover} 28 \institute{Institute of Meteorology and Climatology, Leibniz UniversitÀt Hannover} 29 \selectlanguage{english} 30 30 \date{last update: \today} 31 31 \event{PALM Seminar} … … 47 47 48 48 \title[The PALM User-Interface]{The PALM User-Interface} 49 \author{ Siegfried Raasch}49 \author{PALM group} 50 50 51 51 \begin{document} … … 70 70 \textbf{Problem:} 71 71 \begin{itemize} 72 \item<3-> If a new PALM version is released (current release is 3.9) and the user wants to use it, he would haveto add his modifications to the new release again.72 \item<3-> New releases of PALM (current release is 3.10) would require the user to add his modifications to the new release again. 73 73 \end{itemize} 74 74 \vspace{3mm} … … 76 76 \textbf{Solution:} 77 77 \begin{itemize} 78 \item<4-> PALM offers a \grqq user-interface\grqq, i.e. a set of subroutines, where the user can add his modifications and which can be re-used for future releases of the standard PALM code.79 \item<5-> By using the user-interface, the standard code does not have to be modified by the user in most of allcases.78 \item<4-> PALM offers a \grqq user-interface\grqq, i.e. a set of subroutines, where the user can add his modifications, and which can be re-used for future releases of the standard PALM code. 79 \item<5-> By using the user-interface, the standard code does not have to be modified by the user in most of the cases. 80 80 \item<6-> The user-interface subroutines are almost \grqq empty\grqq\, by default. They are called from the standard PALM code but (with some very minor exceptions) do not contain any executable code. 81 81 \end{itemize} … … 105 105 \par\medskip 106 106 ~~~~\texttt{USE control\_parameters}\\ 107 ~~~~\texttt{USE kinds}\\ 107 108 ~~~~\texttt{USE user}\\ 108 109 \par\medskip … … 497 498 \texttt{user\_lpm\_advec} & - - - & \texttt{lpm} & modification of particles after advection \\ 498 499 \hline 499 \texttt{user\_l mp\_init} & - - - & \texttt{lpm\_init} & defining initial particle sources \\500 \texttt{user\_lpm\_init} & - - - & \texttt{lpm\_init} & defining initial particle sources \\ 500 501 \hline 501 502 \texttt{user\_lpm\_set\_attributes} & - - - & \texttt{lpm} & defining particles attributes \\ … … 529 530 \begin{itemize} 530 531 \scriptsize 531 \item<3-> by including the respective PALM modulesin the user-interface subroutines.\\532 \item<3-> by including the respective \textcolor{blue}{PALM modules} in the user-interface subroutines.\\ 532 533 \begin{center} 533 534 % \includegraphics[scale=0.3]{user_defined_code_figures/data_access_exchange.png} … … 554 555 \begin{itemize} 555 556 \scriptsize 556 \item by the module \texttt{\textcolor{red}{user}} (file \texttt{user\underline{ }module.f90}), which is used in every subroutine included in the interface.\\ \textbf{This module is (and should be) never used in the standard PALM code , in order to avoid data flow from the user interface to the\\ PALM default code!}557 \item by the module \texttt{\textcolor{red}{user}} (file \texttt{user\underline{ }module.f90}), which is used in every subroutine included in the interface.\\ \textbf{This module is (and should be) never used in the standard PALM code (otherwise, the default code would depend on the user\\ interface).} 557 558 \end{itemize} 558 559 \end{itemize} … … 570 571 \item<2-> Therefore, several calls of \texttt{user\underline{ }actions} can be found in the default PALM routines \texttt{time\underline{ }integration} and \texttt{prognostic\underline{ }equations}. The place from which it is called is communicated to the routine by a string-argument, e.g.\\ 571 572 \ \\ 572 \quad \texttt{CALL user\underline{ }actions 573 \quad \texttt{CALL user\underline{ }actions( 'u-tendency' )}\\ 573 574 \ \\ 574 \onslide<3-> It means that this call is from a place within \texttt{prognostic\underline{ }equations}, where the tendencies for the u-component are calculated and integrated:575 \onslide<3-> It means that this call is from a line within \texttt{prognostic\underline{ }equations}, where the tendencies for the u-component are calculated and integrated: 575 576 \end{itemize} 576 577 \vspace{-3mm} … … 648 649 \begin{itemize} 649 650 \item<1-> The different versions of \texttt{prognostic\underline{ }equations} (\texttt{prognostic\underline{ }equations\underline{ }cache}, \texttt{prognostic\underline{ }equations\underline{ }vector}) contain different calls of \texttt{user\underline{ }actions}: 650 \item<2-> From \texttt{prognostic\underline{ }equations\underline{ }vector}: \hspace{0.6em}\texttt{CALL user\underline{ }actions 651 \item<2-> From \texttt{prognostic\underline{ }equations\underline{ }vector}: \hspace{0.6em}\texttt{CALL user\underline{ }actions( 'u-tendency' )} 651 652 \item<3-> From \texttt{prognostic\underline{ }equations},\\ 652 \texttt{prognostic\underline{ }equations\underline{ }cache}:\hspace{4em}\texttt{CALL user\underline{ }actions 653 \texttt{prognostic\underline{ }equations\underline{ }cache}:\hspace{4em}\texttt{CALL user\underline{ }actions( i, j, 'u-tendency' )} 653 654 \vspace{3mm} 654 655 \item<4-> In case that \texttt{prognostic\underline{ }equations}\\ … … 660 661 \item<5-> Here, only the \texttt{k}-loop (vertical direction)\\ 661 662 has to be used, because loops over\\ 662 i and j are carried outin\\663 i and j are executed in\\ 663 664 \texttt{prognostic\underline{ }equations\underline{ }cache}. 664 665 \end{itemize} … … 678 679 ~~~\texttt{CHARACTER (LEN=*) :: location}\\ 679 680 \par\medskip 680 ~~~\texttt{INTEGER :: i, idum, j}\\681 ~~~\texttt{INTEGER(iwp) :: i, idum, j}\\ 681 682 \par\medskip 682 683 \texttt{!}\\ … … 722 723 \texttt{...}\\ 723 724 \vspace{0.4mm} 724 ~\texttt{REAL \hspace{0.4cm}:: ~~\textcolor{blue}{foo = 0.0}}\\725 ~\texttt{REAL(wp) \hspace{0.4cm}:: ~~\textcolor{blue}{foo = 0.0}}\\ 725 726 \vspace{0.4mm} 726 727 \texttt{...}\\ … … 865 866 \begin{frame} 866 867 \frametitle{Using the User-Interface with \texttt{mrun}} 867 \ scriptsize868 \tiny 868 869 \begin{columns}[T] 869 870 \begin{column}{1.1\textwidth} … … 872 873 \begin{enumerate} 873 874 \item<2-> Copy the default (empty) user-interface files that you need (e.g. user\underline{ }module.f90, user\underline{ }parin.f90, user\underline{ }actions.f90) to a directory of your choice, e.g.:\\ 874 \ tiny875 \scriptsize 875 876 \par\smallskip 876 877 \quad \texttt{cd \~{ }/palm/current\underline{ }version}\\ … … 879 880 \quad \texttt{cp trunk/SOURCE/user\underline{ }parin.f90\hspace{1em}USER\underline{ }CODE/example\underline{ }cbl/user\underline{ }parin.f90}\\ 880 881 \quad \texttt{...} 881 \scriptsize 882 \vspace{-1mm} 882 883 883 \item<3-> Set an additional path in the configuration file \texttt{.mrun.config} to allow \texttt{mrun} to find and include this file:\\ 884 884 \tiny 885 \quad \texttt{\%add\underline{ }source\underline{ }path \hspace{1em} \$base\underline{ }directory/USER\underline{ }CODE/\$fname} 886 \scriptsize 885 \par\smallskip 886 \scriptsize \quad \texttt{\%add\underline{ }source\underline{ }path \hspace{1em} \$base\underline{ }directory/USER\underline{ }CODE/\$fname} 887 \par\smallskip 887 888 \item<4-> Modify the interface routines according to your needs. 888 889 \item<5-> Start a PALM run by executing\\ 890 \par\smallskip 891 \scriptsize \quad \texttt{mrun -d example\underline{ }cbl ...}\\ 892 \par\smallskip 889 893 \tiny 890 \quad \texttt{mrun -d example\underline{ }cbl ...}\\891 \scriptsize892 894 The files user\underline{ }*.f90 will be automatically compiled within the job / interactive run and will replace the respective PALM default user-interface files. 893 895 \end{enumerate} 894 \vspace{-2mm}895 896 \begin{itemize} 896 897 \item<6-> \textbf{The modified user-interface file cannot be pre-compiled by using} \texttt{mbuild}!
Note: See TracChangeset
for help on using the changeset viewer.