Title: PALM program structure
1PALM program structure
- Marcus Oliver Letzel
- University of Hannover
- LES / PALM - Seminar
- Zingst, Germany, July 2003
2Contents
- Flow chart
- Initialization
- Run-time (detailed)
- Final steps
- Important variables
- Preprocessor directives
3Flow chart
- Main simplifications
- omit optional software packages (dvrp_graphics,
spectra, particles) - omit Euler scheme
- omit cloud physics
- Colours
- normal
- job-chains (initial, restart run)
- user-code (? lecture by J. Uhlenbrock, Sat
9am) - important, special explanation on separate
slide
leap_frog
prognostic_equations
4Initialization
5Run-time 1/2 leap_frog
standard advection
1D topol.
6Run-time 2/2 prognostic_equations
standard advection
prognostic_equations
prognostic_equations_fast
DO inxl,nxr DO jnys,nyn u-component
ENDDOENDDO
DO inxl,nxr DO jnys,nyn u-component
v-component w-component pt q or s
e (TKE) ENDDO ENDDO
DO inxl,nxr DO jnys,nyn v-component
ENDDOENDDO
w pt q or s
DO inxl,nxr DO jnys,nyn e (TKE)
ENDDOENDDO
7Final steps
8Important variables 1/2
- space
- indices i nxl-1...nxr1 j nys-1...nyn1 k
nzb ...nzt1 - x, y simple variables z two (!) vertical
arrays (1nzt1) zu(k) ,
zwdx , dy dzu(k) zu(k)-zu(k-1),
dzwddx1/dx, ddy ddzu(k)1/dzu(k) , ddzw - time
- timestep dt_3d (? timestep.f90)
- counters nt_anz nt_anz
1 simulated_time simulated_time dt_3d
9Important variables 2/2
- prognostic variables, pointers
- u, v, w, pt, e, q (k,j,i)
- each variable has three pointer arrays and three
target arraysu_m gt u_1 u gt u_2 u_p gt u_3
... - to swap timelevel, only the targets of the
pointers are changed, e.g.u_m gt u_2 u gt u_3
u_p gt u_1 ... - diagnostic variables
- hom (contains, for example, horizontal and domain
averages)
10Preprocessor directives 1/2
- What are preprocessor directives?
- Preprocessor directives are little instructions
to the Fortran compiler that allow to explicitly
exclude certain parts of the source code from
compilation. (Syntax ? next slide) - Where does PALM use preprocessor directives?
- Optional software packages Certain parts of the
source code will only be activated through
parameters to be set in mrun (dvrp graphics,
spectra, particle advection). - Maschine dependencies Maschine architectures
differ. A good solution on one maschine may be
slow or may not work on another machine.As a
portable model, PALM includes solutions for
various machine types. But only the relevant
parts of source code are active for a particular
run.
11Preprocessor directives 2/2
- Syntax (example)
- if defined( __parallel )print,'parallel
mode'elseprint,'nonparallel mode'endif - logical "and" logical "or"
- Important machines
- __ibm IBM regatta (HLRN)__lcmuk linux
cluster (IMUK)__nec NEC vector (Hamburg)
__t3eb CRAY T3e (Berlin) - Important variables
- __parallel parallel execution
- Optional software packages
- __dvrp_graphics extra graphics__spectra
power spectra__particles particle advection
12A kind of summary Key points
- 3 main program phases
- Initialization, Run-time and Final steps
- Main hierarchy palm.f90, leap_frog.f90,
prognostic_equations.f90 - staggered grid two z-coordinates
- use multiplication with ddx, ddy, ddzu, ddzw
instead of division - be aware of pointers
- be aware of preprocessor directives