Changeset 1515 for palm/trunk/TUTORIAL/SOURCE/ncl.tex
- Timestamp:
- Jan 2, 2015 11:35:51 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/TUTORIAL/SOURCE/ncl.tex
r1080 r1515 79 79 \small 80 80 \begin{itemize} 81 \item<1-> Interpreted language designed specifically for scientific data processing and visualization, free available 82 \item<2-> Portable: it is running on many different operating systems including Solaris, AIX, IRIX, Linux, MacOSX, DecAlpha, Cygwin/Windows 83 \item<3-> It's a powerful tool for file input and output, visualization and data analysis (but please \textbf{avoid the excessive usage of loops}, as NCL is an interpreted language) $\rightarrow$ integrated processing environment 81 \item<1-> Interpreted language designed specifically for scientific 82 data processing and visualization, freely available 83 \item<2-> Portable: it is running on many different operating systems 84 including AIX, Linux, MacOSX, Cygwin/Windows 85 \item<3-> It's a powerful tool for file input and output, visualization 86 and data analysis (but please \textbf{avoid the excessive usage 87 of loops}, as NCL is an interpreted language) $\rightarrow$ 88 integrated processing environment 84 89 \end{itemize} 85 90 \centering … … 94 99 \begin{itemize} 95 100 \item<1-> Supports calling C and FORTRAN extended routines 96 \item<1-> Over 600 functions and procedures for visualization and data analysis are provided with NCL 101 \item<1-> Over 600 functions and procedures for visualization and 102 data analysis are provided with NCL 97 103 \item<2-> Interactive mode: \texttt{\$ ncl}\\ 98 104 \texttt{ncl 0>} 99 105 \item<3-> each line is interpreted as it is entered 100 \item< 1-> Batch mode: \texttt{\$ ncl ncl\underline{ }script.ncl}\\106 \item<4-> Batch mode: \texttt{\$ ncl ncl\underline{ }script.ncl}\\ 101 107 interpreter of complete scripts, variables within the NCL script can\\ 102 108 be steered by providing additional parameters with the ncl call\\ … … 140 146 \small 141 147 \begin{itemize} 142 \item<1-> Detailed information is available under\\ 143 \underline{http://www.ncl.ucar.edu/Download/index.shtml} 144 \item<1-> Request an Earth System Grid account 145 \underline{http://www.earthsystemgrid.org/} 146 \item<2-> Download the appropriate binaries e.g. \texttt{A.tar.gz} for your system e.g. to \texttt{\$HOME} 148 \item<1-> Detailed information is available under\\ 149 \underline{http://www.ncl.ucar.edu/Download/index.shtml} 150 \item<1-> Request an Earth System Grid account 151 \underline{http://www.earthsystemgrid.org/} 152 \item<2-> Download the appropriate binaries e.g. \texttt{A.tar.gz} 153 for your system e.g. to \texttt{\$HOME} 147 154 \item<2-> \texttt{\% gunzip \$HOME/A.tar.gz} 148 155 \item<2-> \texttt{\% mkdir -p /usr/local}\\ … … 158 165 \footnotesize 159 166 \begin{itemize} 160 \item<1-> Set the \texttt{NCARG\underline{ }ROOT} environment variable and your search path to where NCL/NCARG resides\\ 161 csh: \texttt{setenv NCARG\underline{ }ROOT /usr/local/}\\ 162 \hspace{1.6em} \texttt{setenv PATH /usr/local/bin:\$PATH}\\ 163 bash/ksh: \texttt{export NCARG\underline{ }ROOT=/usr/local/}\\ 164 \hspace{4.1em} \texttt{export PATH=/usr/local/bin:\$PATH}\\ 165 \vspace{3mm} 166 \item<2-> Set the DISPLAY environment variable to indicate where to display graphics as for any X11 Windows application that you run\\ 167 e.g. ksh: \texttt{export DISPLAY=localhost:13.0}, or use \texttt{ssh -X} to tunnel X-communication.\\ 167 \item<1-> Set the \texttt{NCARG\underline{ }ROOT} environment variable and 168 your search path to where NCL/NCARG resides\\ 169 csh: \texttt{setenv NCARG\underline{ }ROOT /usr/local/}\\ 170 \hspace{1.6em} \texttt{setenv PATH /usr/local/bin:\$PATH}\\ 171 bash/ksh: \texttt{export NCARG\underline{ }ROOT=/usr/local/}\\ 172 \hspace{4.1em} \texttt{export PATH=/usr/local/bin:\$PATH}\\ 173 \vspace{3mm} 174 \item<2-> Set the DISPLAY environment variable to indicate where to 175 display graphics as for any X11 Windows application that you 176 run\\ 177 e.g. ksh: \texttt{export DISPLAY=localhost:13.0}, or use 178 \texttt{ssh -X} to tunnel X-communication.\\ 168 179 \vspace{3mm} 169 180 \item<3-> Test your NCL installation\\ 170 \quad \texttt{\% ng4ex gsun01}\\ 171 NCL script gsun01n.ncl is copied to your working directory and run through NCL. An X11 window should pop up. 181 \quad \texttt{\% ng4ex gsun01}\\ 182 NCL script gsun01n.ncl is copied to your working directory and 183 run through NCL. An X11 window should pop up. 172 184 \end{itemize} 173 185 … … 179 191 \footnotesize 180 192 \begin{itemize} 181 \item<1-> Together with the PALM installation you have also received four NCL scripts, a configuration file and a manual; they can be found in the directory\\ 182 \texttt{\$HOME/palm/current\underline{ }version/trunk/SCRIPTS/NCL/} 183 \item<2-> All standard netCDF data output of PALM can be visualized by one of the scripts: 184 \begin{itemize} 185 \scriptsize 186 \item[-]<2-> \texttt{cross\underline{ }sections.ncl} (2D/3D data, e.g. contour or vector plots) 187 \item[-]<2-> \texttt{profiles.ncl} (profile data) 188 \item[-]<2-> \texttt{timeseries.ncl} (time series data) 189 \item[-]<2-> \texttt{spectra.ncl} (spectra data) 190 \end{itemize} 191 \item<3-> To run these NCL scripts you can use the shell script \texttt{palmplot} which can be found in the directory\\ 192 \texttt{\$HOME/palm/current\underline{ }version/trunk/SCRIPTS} 193 \item<4-> The output of the plots can be changed with several parameters; these parameters can be either written in the prompt (when calling the shell script \texttt{palmplot}) or modified within the configuration file \texttt{.ncl.config} 193 \item<1-> Together with the PALM installation you have also received four NCL scripts, a configuration file and a manual; they can be found in the directory\\ 194 \texttt{\$HOME/palm/current\underline{ }version/trunk/SCRIPTS/NCL/} 195 \item<2-> All standard netCDF data output of PALM can be visualized by one 196 of the scripts: 197 \begin{itemize} 198 \scriptsize 199 \item[-]<2-> \texttt{cross\underline{ }sections.ncl} 200 (2D/3D data, e.g. contour or vector plots) 201 \item[-]<2-> \texttt{profiles.ncl} (profile data) 202 \item[-]<2-> \texttt{timeseries.ncl} (time series data) 203 \item[-]<2-> \texttt{spectra.ncl} (spectra data) 204 \end{itemize} 205 \item<3-> To run these NCL scripts you can use the shell script 206 \texttt{palmplot} which can be found in the directory\\ 207 \texttt{\$HOME/palm/current\underline{ }version/trunk/SCRIPTS} 208 \item<4-> The output of the plots can be changed with several parameters; 209 these parameters can be either written in the prompt 210 (when calling the shell script \texttt{palmplot}) or set 211 within the configuration file \texttt{.ncl.config} 194 212 \end{itemize} 195 213 … … 203 221 \small 204 222 \begin{itemize} 205 \item[-]<1-> Please create a personal configuration file by copying the default configuration file \texttt{.ncl.config.default} to the PALM working directory \texttt{\$HOME/palm/current\underline{ }version} and naming it \texttt{.ncl.config} 206 \item[-]<2-> \texttt{.ncl.config} is used by NCL directly, thus the parameters have to be written according to the rules of the scripting language NCL 207 \item[-]<3-> The configuration file contains all steering parameters with a short description and can be modified to personal needs 223 \item[-]<1-> Please create a personal configuration file by copying 224 the default configuration file 225 \texttt{.ncl.config.default} to the PALM working 226 directory \texttt{\$HOME/palm/current\underline{ }version} 227 and naming it \texttt{.ncl.config} 228 \item[-]<2-> \texttt{.ncl.config} is used by NCL directly, thus the 229 parameters have to be written according to the rules of the 230 scripting language NCL 231 \item[-]<3-> The configuration file contains all steering parameters with 232 a short description and can be adjusted to personal needs 208 233 \end{itemize} 209 234 … … 217 242 \footnotesize 218 243 \begin{itemize} 219 \item[-]<1-> The shell script is used as follows:\\ 220 \texttt{palmplot <plot\underline{ }identifier>} 221 \item[-]<1-> \texttt{<plot\underline{ }identifier>} has to be \texttt{xy}, \texttt{xz}, \texttt{yz}, \texttt{pr}, \texttt{sp} or \texttt{ts} depending on the data to be plotted 244 \item[-]<1-> The shell script is used as follows:\\ 245 \texttt{palmplot <plot\underline{ }identifier>} 246 \item[-]<1-> \texttt{<plot\underline{ }identifier>} has to be \texttt{xy}, 247 \texttt{xz}, \texttt{yz}, \texttt{pr}, \texttt{sp} or 248 \texttt{ts} depending on the data to be plotted 222 249 \end{itemize} 223 250 \vspace{3mm} 224 \onslide<2->\begin{tabular}{ccc} 225 \textbf{plot\underline{ }identifier} & \textbf{data used} & \textbf{ncl script}\\ 226 xy & instantaneous or time-averaged xy or 3D data & cross\underline{ }sections.ncl\\ 227 xz & instantaneous or time-averaged xz or 3D data & cross\underline{ }sections.ncl\\ 228 yz & instantaneous or time-averaged yz or 3D data & cross\underline{ }sections.ncl\\ 229 pr & profile or 3D data & profiles.ncl\\ 230 sp & spectra data & spectra.ncl\\ 231 ts & time series data & timeseries.ncl\\ 251 \onslide<2-> 252 \begin{tabular}{ccc} 253 \textbf{plot\underline{ }identifier} & \textbf{data used} & \textbf{ncl script}\\ 254 xy & instantaneous or time-averaged xy or 3D data & cross\underline{ }sections.ncl\\ 255 xz & instantaneous or time-averaged xz or 3D data & cross\underline{ }sections.ncl\\ 256 yz & instantaneous or time-averaged yz or 3D data & cross\underline{ }sections.ncl\\ 257 pr & profile or 3D data & profiles.ncl\\ 258 sp & spectra data & spectra.ncl\\ 259 ts & time series data & timeseries.ncl\\ 232 260 \end{tabular} 233 261 … … 241 269 \footnotesize 242 270 \begin{itemize} 243 \item[-]<1-> To change the output of the plot you can also use:\\ 244 \scriptsize \texttt{palmplot \textbf{plot\underline{ }identifier} parameter=value parameter=string ...} 271 \item[-]<1-> To change the output of the plot you can also use:\\ 272 \scriptsize 273 \texttt{palmplot \textbf{plot\underline{ }identifier} 274 parameter=value parameter=string ...} 245 275 \footnotesize \\ 246 276 \vspace{2mm} 247 \item[-]<2-> A list of all available parameters can be found in the configuration file \texttt{.ncl.config} or in the documentation:\\ 248 \uncover<3->{\texttt{http://palm.muk.uni-hannover.de/wiki/doc/app/nclparlist}}\\ 277 \item[-]<2-> A list of all available parameters can be found in the 278 configuration file \texttt{.ncl.config} or in the 279 documentation:\\ 280 \uncover<3->{\texttt{http://palm.muk.uni-hannover.de/wiki/doc/app/nclparlist}}\\ 249 281 \vspace{2mm} 250 \item[-]<4-> Parameters specified in the prompt override parameters given in the configuration file\\ 282 \item[-]<4-> Parameters specified in the prompt override parameters given 283 in the configuration file\\ 251 284 \vspace{2mm} 252 \item[-]<5-> String parameters which can contain lists (\texttt{var}, \texttt{c\underline{ }var}, \texttt{vec1}, \texttt{vec2}, \texttt{plotvec}) have to be set in single quotes and the list itself has to be separated by blanks, e.g. \texttt{var='pt u w'}\\ 285 \item[-]<5-> String parameters which can contain lists (\texttt{var}, 286 \texttt{c\underline{ }var}, \texttt{vec1}, \texttt{vec2}, 287 \texttt{plotvec}) have to be set in single quotes and the 288 list itself has to be separated by blanks, e.g. 289 \texttt{var='pt u w'}\\ 253 290 \vspace{2mm} 254 \item[-]<1-> A short introduction for using the shell script is given by typing\\ 255 \texttt{palmplot ?} 291 \item[-]<6-> A short introduction for using the shell script is given by 292 typing\\ 293 \texttt{palmplot ?} 256 294 \end{itemize} 257 295 … … 260 298 % Folie 12 261 299 \begin{frame} 262 \frametitle{Application Example: Visualization of the Output of the Example Run (example\underline{ }cbl) (I)} 263 \small 264 \begin{itemize} 265 \item<1-> Starting the example run with the command\\ 266 \vspace{2mm} 267 \texttt{mrun -d example\underline{ }cbl ... -r 'd3\# pr\# ts\# xy\# xz\#'}\\ 268 \vspace{2mm} 269 results in the following output files in\\ 270 \vspace{2mm} 271 \texttt{\$HOME/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT/}:\\ 272 \texttt{example\underline{ }cbl\underline{ }pr.nc}, \texttt{example\underline{ }cbl\underline{ }xy.nc}, \texttt{example\underline{ }cbl\underline{ }xz.nc},\\ 273 \texttt{example\underline{ }cbl\underline{ }ts.nc} 300 \frametitle{Application Example: Visualization of the Output of the Example 301 Run (example\underline{ }cbl) (I)} 302 \small 303 \begin{itemize} 304 \item<1-> Starting the example run with the command\\ 305 \vspace{2mm} 306 \texttt{mrun -d example\underline{ }cbl ... -r 307 'd3\# pr\# ts\# xy\# xz\#'}\\ 308 \vspace{2mm} 309 results in the following output files in\\ 310 \vspace{2mm} 311 \texttt{\$HOME/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT/}:\\ 312 \texttt{example\underline{ }cbl\underline{ }pr.nc}, \texttt{example\underline{ }cbl\underline{ }xy.nc}, \texttt{example\underline{ }cbl\underline{ }xz.nc},\\ 313 \texttt{example\underline{ }cbl\underline{ }ts.nc} 274 314 \item<2-> Example: Visualization of the time series data\\ 275 \vspace{2mm} 276 Goal: Output as eps-file \texttt{timeseries.eps} (by default the plot would be output to an X11 window) 315 \vspace{2mm} 316 Goal: Output as eps-file \texttt{timeseries.eps} (by default the 317 plot would be output to an X11 window) 277 318 \end{itemize} 278 319 … … 281 322 % Folie 13 282 323 \begin{frame} 283 \frametitle{Application Example: Visualization of the Output of the Example Run (example\underline{ }cbl) (II)} 284 \small 285 \begin{itemize} 286 \item<1-> In order to reach the goal you can either ... 324 \frametitle{Application Example: Visualization of the Output of the Example 325 Run (example\underline{ }cbl) (II)} 326 \small 327 \begin{itemize} 328 \item<1-> In order to reach the goal you can either ... 287 329 \item<1-> ... Change to the directory\\ 288 \texttt{\$HOME/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT/}\\ 289 and use the shell script with the command\\ 290 \vspace{2mm} 291 \texttt{palmplot ts file\underline{ }1=example\underline{ }cbl\underline{ }ts.nc format\underline{ }out=eps file\underline{ }out=timeseries}\\ 292 \vspace{2mm} 293 Thus, the script \texttt{timeseries.ncl} is called and some of the parameters in the configuration file \texttt{.ncl.config} are directly set by specifying the related parameters in the command line,\\ 294 \vspace{2mm} 295 \onslide<2-> e.g. \texttt{file\underline{ }1 = <netCDF file>} \textbf{(Note: the input file has always to be specified!)}, \texttt{file\underline{ }out = <output file>} 330 \texttt{\$HOME/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT/}\\ 331 and use the shell script with the command\\ 332 \vspace{2mm} 333 \texttt{palmplot ts file\underline{ }1=example\underline{ }cbl\underline{ }ts.nc format\underline{ }out=eps file\underline{ }out=timeseries}\\ 334 \vspace{2mm} 335 Thus, the script \texttt{timeseries.ncl} is called and some of the parameters in the configuration file \texttt{.ncl.config} are directly set by specifying the related parameters in the command line,\\ 336 \vspace{2mm} 337 \onslide<2-> e.g. \texttt{file\underline{ }1 = <netCDF file>} 338 \textbf{(Note: the input file has always to be specified!)}, \texttt{file\underline{ }out = <output file>} 296 339 \end{itemize} 297 340 … … 300 343 % Folie 14 301 344 \begin{frame} 302 \frametitle{Application Example: Visualization of the Output of the Example Run (example\underline{ }cbl) (III)} 345 \frametitle{Application Example: Visualization of the Output of the Example 346 Run (example\underline{ }cbl) (III)} 303 347 \footnotesize 304 348 ... or you can modify the configuration file \texttt{.ncl.config}, e.g.\\ … … 318 362 % Folie 15 319 363 \begin{frame} 320 \frametitle{Application Example: Visualization of the Output of the Example Run (example\underline{ }cbl) (IV)} 364 \frametitle{Application Example: Visualization of the Output of the Example 365 Run (example\underline{ }cbl) (IV)} 321 366 \footnotesize 322 367 \begin{itemize} 323 \item<1-> Both ways will lead to the creation of a new file called \texttt{timeseries.eps} in the directory\\ 324 \texttt{\$HOME/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT/} 368 \item<1-> Both ways will create a new file called \texttt{timeseries.eps} 369 in the directory\\ 370 \texttt{\$HOME/palm/current\underline{ }version/JOBS/example\underline{ }cbl/OUTPUT/} 325 371 \end{itemize} 326 372 \centering 327 \onslide<2->\includegraphics[scale=0. 4]{ncl_figures/vis1.png}373 \onslide<2->\includegraphics[scale=0.25]{ncl_figures/vis1.png} 328 374 329 375 \end{frame} … … 331 377 % Folie 16 332 378 \begin{frame} 333 \frametitle{Application Example: Visualization of the Output of the Example Run (example\underline{ }cbl) (V)} 379 \frametitle{Application Example: Visualization of the Output of the Example 380 Run (example\underline{ }cbl) (V)} 334 381 \footnotesize 335 382 \begin{itemize} … … 341 388 \end{itemize} 342 389 \centering 343 \onslide<2->\includegraphics[scale=0. 7]{ncl_figures/vis2.png}390 \onslide<2->\includegraphics[scale=0.3]{ncl_figures/vis2.png} 344 391 345 392 \end{frame} … … 348 395 \begin{frame}[t] 349 396 \tikzstyle{plain} = [rectangle, text width=0.27\textwidth, font=\small] 350 \frametitle{Application Example: Visualization of the Output of the Example Run (example\underline{ }cbl) (VI)} 397 \frametitle{Application Example: Visualization of the Output of the Example 398 Run (example\underline{ }cbl) (VI)} 351 399 \footnotesize 352 400 Plot profiles with the command\\ … … 367 415 \node at (current page.north west){% 368 416 \begin{tikzpicture}[overlay] 369 \node[plain,anchor=west] at (72mm,-51.5mm) {\includegraphics[scale=0.32]{ncl_figures/vis3.png}}; 417 \node[plain,anchor=west] at (72mm,-51.5mm) 418 {\includegraphics[scale=0.32]{ncl_figures/vis3.png}}; 370 419 \end{tikzpicture} 371 420 }; … … 379 428 \small 380 429 \begin{itemize} 381 \item<1-> The other NCL scripts delivered with PALM can be used in a similar way, however the parameters that can be specified differ from script to script 382 \item<2-> There are plenty of parameters for each script. Please have a look to the NCL documentation (\texttt{http://palm.muk.uni-hannover.de/wiki/doc/app/nclparlist}) for detailed information 383 \item<1-> If one of the program aborts and there is no comment, check the configuration file - the scripts should not abort with the default values. Be sure to use the right data type (e.g.: integer = 2; float = 2.0; double = 2.0d; string = \dq name\dq ) 430 \item<1-> The other NCL scripts delivered with PALM can be used in 431 a similar way, however the parameters that can be specified 432 differ from script to script 433 \item<2-> There are plenty of parameters for each script. Please have a 434 look to the NCL documentation 435 (\texttt{http://palm.muk.uni-hannover.de/wiki/doc/app/nclparlist}) 436 for detailed information 437 \item<3-> If one of the program aborts and there is no comment, 438 check the configuration file - the scripts should not abort with 439 the default values. Be sure to use the right data type 440 (e.g.: integer = 2; float = 2.0; double = 2.0d; 441 string = \dq name\dq ) 384 442 \end{itemize} 385 443 \end{frame}
Note: See TracChangeset
for help on using the changeset viewer.