gui.tex 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. \section{Graphical user interface (GUI)}
  2. \begin{figure}
  3. \centering
  4. \includegraphics[width=14cm]{Pics/mostsnap}
  5. \caption[]{Screenshot of Model Starter (MoSt)}
  6. \label{mostsnap}
  7. \end{figure}
  8. {\bf PUMA} may be used in the traditional fashion,
  9. with shell scripts, batch jobs, and network queuing
  10. systems. This is useful for long running simulations
  11. on complex machines and number crunchers, such as vector
  12. computers, massive parallel computers and workstation clusters.
  13. However, there is now a more convenient method.
  14. A graphical user interface (GUI) has been provided, which
  15. can be used for parameter configuration during model setup, and
  16. for interaction between the user and the model.
  17. PUMA is setup and configured using the first
  18. GUI module named {\module MoSt} ({\bf Mo}del {\bf St}arter,
  19. screenshot in \ref{mostsnap}).
  20. {\module MoSt} is the fastest way to get the
  21. model running. It gives access to the most important parameters of
  22. the model which are preset to the frequently used values.
  23. The model can be started with a mouse click on the button
  24. labelled ``Save \& Run'' either with the standard parameter setting,
  25. or after editing the parameters in the MoSt window.
  26. Some parameters, like horizontal and vertical resolution
  27. or the number of processors, require that a new executable is built
  28. (compile, link and load). MoSt achieves
  29. this by generating and executing build scripts,
  30. that perform the necessary code changes and
  31. create the required executables.
  32. Other parameters defining startup and
  33. boundary conditions or other settings, can
  34. be edited with MoSt. After they have been checked for
  35. correct range and for consistency with other parameters, they
  36. are written to the model's namelist file.
  37. Using these settings
  38. MoSt generates a run script for the simulation.
  39. The user then has the choice of leaving MoSt and
  40. starting the simulation under the control of the GUI
  41. immediately, or of leaving MoSt with the scripts ready
  42. to run. This second alternative is useful for users who
  43. want to include setup modifications beyond the scope of MoSt,
  44. or who want to run the model without the GUI.
  45. There is also a simple graphical editor for the topography.
  46. Check the box Orography and then use the mouse to mark
  47. elliptic areas in the topographic display.
  48. Enter a value for raising (positive) or lowering (negative) the area
  49. and press the button labelled {\bf Preprocess}.
  50. The preprocessor will be built and executed, and a new
  51. topography will be computed and written to the start file.
  52. Another editor is the Mode Editor for spherical harmonics.
  53. Green modes are enabled, red modes are disabled.
  54. This feature can be used to specify runs with only certain
  55. modes of spherical harmonics being active.
  56. LMB, MMB and RMB refer to the left, middle, and right mouse
  57. buttons respectively. You may toggle individual modes (press LMB)
  58. or whole lines (press RMB) and columns (press MMB).
  59. Currently the Mode Editor can only be used
  60. for PUMA in the T21 resolution.
  61. \begin{figure}
  62. \centering
  63. \includegraphics[width=14cm]{Pics/guisnap}
  64. \caption[]{Screenshot of Graphical User Interface (GUI)}
  65. \label{guisnap}
  66. \end{figure}
  67. The GUI for running PUMA
  68. (Figure \ref{guisnap})
  69. has two main uses. The first is to display the
  70. model arrays in suitable representations.
  71. Current implementations are:
  72. \begin{itemize}
  73. \item{Zonal mean cross sections}
  74. \item{Horizontal global fields in cylinder or polar projection}
  75. \item{Horizontal particle tracer in cylinder or polar projection}
  76. \item{Longitude-time (Hovmoeller) diagrams}
  77. \item{Longitude-level diagrams}
  78. \item{Amplitudes of spherical harmonic coefficients}
  79. \item{Time series}
  80. \item{Numerical values}
  81. \end{itemize}
  82. In the case of horizontal global grids, pressing the MMB
  83. toggles between cylinder and polar projection. If the grid is
  84. a single level of a three dimensional field like u or v,
  85. the level being shown can be decreased with the LMB or increased with the RMB.
  86. For Hovmoeller and longitude height sections the LMB and RMB can
  87. be used to select the latitude.
  88. The second use of the GUI is to allow the user to change
  89. selected model variables during the model run.
  90. It is not necessary, though possible, to pause the
  91. model while changing variables. Changes to model variables
  92. are written to the output file after being checked
  93. by the GUI for the appropriate range of values and the
  94. maximum possible change per timestep, because
  95. a rapid parameter change or a choice of values beyond the normal
  96. range may cause the model to crash.
  97. All model variables, which are candidates for display
  98. or for interactive changes, have special code to communicate
  99. with PUMA. The experienced modeller
  100. can add new code for additional variables using the existing
  101. communication code as a template. Thus all model fields
  102. or even fields received via coupling with other models
  103. can be shown on the GUI display.
  104. Both, MoSt and the GUI are implemented using Xlib (X11R5),
  105. which is a library of routines for graphics and event communication.
  106. As this library is part of every UNIX/Linux operating system
  107. and is the base of all desktop environments, there is no need
  108. to install additional software for running MoSt and the GUI.
  109. Another important property of Xlib is full network transparency.
  110. The display of MoSt and the GUI is not confined to the machines
  111. running the programs or the model. In fact, the best
  112. performance is obtained by running the PUMA on
  113. two or four CPUs of remote servers while displaying
  114. the GUI on the user's workstation.
  115. In summary, MoSt and the GUI programs automate many tedious tasks,
  116. minimize the time to become familiar with the PUMA,
  117. and make debugging and parameter tuning much easier.
  118. More types of presentation, coordinate projections
  119. and interactivity are being developed.
  120. A graphical preprocessor with editor for boundary
  121. conditions and a graphical postprocessor are part of the planned
  122. future expansion
  123. to build an almost complete environment for modellers.
  124. \section{GUI configuration}
  125. On initialization, the GUI reads its configuration from a file called
  126. {\bf GUI.cfg} which must be present in the current directory.
  127. MoSt copies the file {\bf GUI.cfg} from the ../dat/ directory
  128. to the run directory while building PUMA.
  129. After reading {\bf GUI.cfg} an attempt is made to read the file
  130. {\bf GUI\_last\_used.cfg}. This file is always written at the end
  131. of a GUI controlled simulation. So one may rearrange and position
  132. GUI windows during a run and the new layout will be saved to the
  133. file {\bf GUI\_last\_used.cfg}. In order to make this user
  134. layout the default for te following runs, just copy this file:
  135. \begin{verbatim}
  136. Most15/puma/run$ cp ../dat/GUI.cfg ../dat/GUI.cfg.old
  137. Most15/puma/run$ cp GUI_last_used.cfg ../dat/GUI.cfg
  138. \end{verbatim}
  139. MoSt will then copy your new layout to the run directory at
  140. the next invocation.
  141. The {\bf GUI.cfg} is a text file that may also be edited manually.
  142. There is a section for each window (counting from 0 to 8) which
  143. looks like:
  144. \begin{verbatim}
  145. [Window 00] <- window number (0..8)
  146. Array:CSU <- array name
  147. Plot:ISOCS <- picture type
  148. Palette:U <- colour palette
  149. Title:Zonal Wind [m/s] <- window title
  150. Geometry: 529 299 2 3 <- width height left top
  151. [Window 01]
  152. Array:SPAN
  153. Plot:ISOSH
  154. Palette:AMPLI
  155. Title:Spherical Harmonics Ps
  156. Geometry: 529 299 535 3
  157. ...
  158. \end{verbatim}
  159. Possible values for these items are:
  160. \subsection{Array}
  161. \begin{tabular}{|l|l|}
  162. \hline
  163. Name & Description \\
  164. \hline
  165. CSU & Cross Section U - Zonal mean zonal wind \\
  166. CSV & Cross Section V - Zonal mean meridional wind \\
  167. CST & Cross Section T - Zonal mean temperature \\
  168. SPAN & Spherical harmonic coefficients of surface pressure \\
  169. GU & Three dimensional grid of zonal wind \\
  170. GV & Three dimensional grid of meridional wind \\
  171. GP & Grid of surface pressure \\
  172. SCALAR & Selected scalars for time series and tables \\
  173. \hline
  174. \end{tabular}
  175. \subsection{Plot}
  176. \begin{tabular}{|l|l|}
  177. \hline
  178. Name & Description \\
  179. \hline
  180. ISOHOR & Isolines and colouring of horizontal grids \\
  181. ISOCS & Isolines and colouring of cross sections \\
  182. ISOHOV & Colouring of Hovmoeller diagram \\
  183. ISOTS & Timeseries \\
  184. ISOTAB & Tables \\
  185. ISOSH & Coloured amplitudes \\
  186. ISOLON & Isolines and colouring of longitude height section \\
  187. ISOTRA & Show the horizontal wind components with moving particles \\
  188. \hline
  189. \end{tabular}
  190. \subsection{Palette}
  191. \begin{tabular}{|l|l|l|}
  192. \hline
  193. Name & Range & Description \\
  194. \hline
  195. AUTO & automatic & rainbow colours \\
  196. U & -10 .. 50 & rainbow colours \\
  197. V & -10 .. 10 & rainbow colours \\
  198. T & -50 .. 50 & blue - red \\
  199. P & 985 .. 1025 & blue - red \\
  200. Q & 0 .. 60 & rainbow colours \\
  201. MARST & -90 .. 0 & blue -red \\
  202. AMPLI & 0 .. 12 & blue - green -red \\
  203. VEG & 0 .. 100 & shades of green \\
  204. \hline
  205. \end{tabular}
  206. \subsection{Title}
  207. The title item may contain any text, but keep it short.
  208. The length of the window's title bar is limited.
  209. The words {\em Latitude} and {\em Level} have special
  210. features in conjunction with three-dimensional arrays,
  211. where the user may scroll the level or latitude.
  212. The GUI will insert the level number after the word
  213. {\em Level} or the latitude after the word {\em Latitude}.
  214. \subsection{Geometry}
  215. The four integers following the geometry item describe
  216. the size and screen position of the window.
  217. The first two parameters refer to width and height in
  218. screen pixels. These are the sizes of the inner window.
  219. The title bar, the border and any other decorations are not counted.
  220. The third and fourth parameter set the x and y coordinates of the
  221. upper left corner of the window, again without borders.
  222. If the geometry item is not defined, the GUI will
  223. initialize the window's geometry depending on the screen size.