mpimod.tex 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. %--------------------------------------------------------------------------------
  2. \begin{center}
  3. \begin{tabular}{|p{15cm}|}
  4. \hline
  5. \vspace{-5mm} \section{mpimod.f90 / mpimod\_stub.f90} \vspace{-5mm}
  6. \\
  7. \hline
  8. \vspace{1mm} {\bf General} The module {\module mpimod.f90} contains interface
  9. subroutines
  10. to the MPI (Message Passing Interface) needed for (massive) parallel computing. Several MPI
  11. routines are called from the module. The interface to other modules are given by numerous
  12. subroutines which name starts with {\sub mp}. Subroutines from {\module mpimod.f90} are
  13. called in sveral other modules. There are no direct calls to MPI other than
  14. in {\module mpimod.f90}. This encapsulation makes it possible to
  15. use {\module mpimod\_stub.f90} for single CPU runs without
  16. changing any other part of the model code.
  17. The selection is done automatically by using MoSt or manually
  18. by editing "Most15/puma/src/make\_puma". \vspace{3mm}
  19. \\
  20. \hline
  21. \vspace{1mm} {\bf Input/Output} {\module mpimod.f90} and {\module mpimod\underline{
  22. }stub} do not use any extra input file or
  23. output file. No namelist input is required \vspace{3mm} \\
  24. \hline
  25. \vspace{2mm} {\bf Structure} Internally, {\module mpimod.f90} uses the FORTRAN-90
  26. module
  27. {\module mpimod}, which uses the global common module {\module pumamod} from
  28. {\module pumamod.f90} and the MPI module {\module mpi}. {\module mpimod\underline{
  29. }stub.f90} does not use any module. The following subroutines are included in {\module
  30. mpimod.f90}:
  31. \begin{center}
  32. \begin{tabular}{l p{2cm} l}
  33. Subroutine & &Purpose \\
  34. && \\
  35. {\sub mpbci} && broadcast 1 integer \\
  36. {\sub mpbcin} & &broadcast n integers \\
  37. {\sub mpbcr} & &broadcast 1 real \\
  38. {\sub mpbcrn} & &broadcast n reals \\
  39. {\sub mpbcl} && broadcast 1 logical \\
  40. {\sub mpscin} & &scatter n integers \\
  41. {\sub mpscrn} && scatter n reals \\
  42. {\sub mpscgp} && scatter grid point field \\
  43. {\sub mpgagp} && gather grid point field \\
  44. {\sub mpgallgp} && gather grid point field to all \\
  45. {\sub mpscsp} & &scatter spectral field \\
  46. {\sub mpgasp} && gather spectral field \\
  47. {\sub mpgacs} && gather cross section \\
  48. {\sub mpgallsp} && gather spectral field to all \\
  49. {\sub mpsum} && sum spectral field \\
  50. {\sub mpsumsc} && sum and scatter spectral field \\
  51. {\sub mpsumr} && sum n reals \\
  52. {\sub mpsumbcr}& & sum and broadcast n reals \\
  53. {\sub mpstart} & &initialize MPI \\
  54. {\sub mpstop} & &finalize MPI \\
  55. \end{tabular}
  56. \end{center}
  57. \vspace{3mm} \\
  58. \hline
  59. \end{tabular}
  60. \end{center}
  61. \newpage
  62. \begin{center}
  63. \begin{tabular}{|p{15cm}|}
  64. \hline
  65. \begin{center}
  66. \begin{tabular}{l p{2cm} l}
  67. Subroutine & &Purpose \\
  68. && \\
  69. {\sub mpreadgp}& & read and scatter grid point field \\
  70. {\sub mpwritegp}& & gather and write grid point field \\
  71. {\sub mpwritegph} && gather and write (with header) grid point field \\
  72. {\sub mpreadsp} & &read and scatter spectral field \\
  73. {\sub mpwritesp} &&gather and write spectral field \\
  74. {\sub mpi\_info} && give information about setup \\
  75. {\sub mpgetsp} && read spectral array from restart file \\
  76. {\sub mpgetgp} && read gridpoint array from restart file \\
  77. {\sub mpputsp} && write spectral array to restart file \\
  78. {\sub mpputgp} && write gridpoint array to restart file \\
  79. {\sub mpmaxval} && compute maximum value of an array \\
  80. {\sub mpsumval} && compute sum of all array elements \\
  81. \end{tabular}
  82. \end{center}
  83. \vspace{3mm} \\
  84. \hline
  85. \end{tabular}
  86. \end{center}
  87. \newpage
  88. %--------------------------------------------------------------------------------