Deutscher Wetterdienst 1FE 13 – Linear solutions of flow over mountains COSMO General Meeting WG2 'Numerics and Dynamics' Michael Baldauf Deutscher Wetterdienst, Offenbach, Germany
Deutscher Wetterdienst 2FE 13 – Development of a program to calculate a reference solution for convergence tests (task 5) Linear solutions of flow over mountain there exist a huge number of different linear solutions for flow over mountains: Queney (1947, 1948), Smith (1979, 1980),... reason: different goals: to get insight into the physical process: try to approximate as far as possible to get simple solutions/formulae to test numerical models: try to reduce the approximations as far as possible (perhaps by requiring more preconditions) to get an 'analytical' solution which fits best to the PDE- system (better say: a solution which can be calculated with higher numerical confidence, e.g. calculation of integrals or FFT's instead of solving PDE's)
Deutscher Wetterdienst 3FE 13 – Starting point: compressible Euler equations COSMO-dynamical core Preconditions: no friction only adiabatic processes (in particular no phase changes) ideal gas law c p =const., c V =const., R=const. no Coriolis force all movements take place on a plane (no earth curvature) These preconditions can be fulfilled easily by a dynamical core. Only 2 approximations will be made: 1.linearisation 1/Fr = h N / U <<< 1 simulate very flat mountains at high inflow velocities 2.the assumption that k z =const (see below; not absolutely necessary)
Deutscher Wetterdienst 4FE 13 – 'tracer'-parameter: 1 = 0/1 : hydrostatic / non-hydrostatic approximation 2 = 0/1 : incompressible / compressible model 3 = 0/1 : shallow / deep convection/atmosphere Compressible Euler equations (adiabatic, f=0,...) e.g. Smith (1979)
Deutscher Wetterdienst 5FE 13 – Base state: stationary, hydrostatic, only depends on z
Deutscher Wetterdienst 6FE 13 – Fouriertransformation: horizontal and temporal Perturbation equations: 4th 'tracer'-parameter introduced (Pichler, 1997): 4 =0/1 : small / big Mach-numbers
Deutscher Wetterdienst 7FE 13 – Def.: Heterogenity (Queney, 1947) Def: Stability parameter Def: Mach-number Def: Some abbreviations:
Deutscher Wetterdienst 8FE 13 – Stationary case ( =0 ) From perturbation equations: express u', v', ' and p' by w' equation 2nd order for w '( k x, k y, z ): with coefficient functions:
Deutscher Wetterdienst 9FE 13 – The whole derivation is in principle similar to many textbooks, but the only (!) approximation up to now is linearisation. Variable transformation (modified Bretherton (1960)-transformation): There are two special cases, which can be handled easily separately: 1.) =0, k x =0, k y 0 2.) =0, k x =0, k y =0
Deutscher Wetterdienst 10FE 13 – Boundary conditions: below: linearisation of the free-slip condition: above: assume k z =const. case k z ² < 0 : exponentially growing solution seems unphysical chooseand omit term ~B case k z ² > 0 : no energy transport downwards (Smith, 1980) choose and omit term ~B
Deutscher Wetterdienst 11FE 13 – Choice of the base state: N = const. k z ~ const. (= 2nd approx.!) experience: k z =const. is fulfilled rather good Some features of 'Lin_Mountain': written in C/C++ Makefile for Linux available Binary output (with an additional.ctl-File for GrADS) Use of FFT (Numerical recipes, Press et al.) for estimation about the accuracy of the approximation ' k z =const.' max. height:~ 35 km
Deutscher Wetterdienst 12FE 13 – nx 2 ny 160 nz dx dy dz 10.0 U_ T_00 1.0e5 p_ N_BV 1 delta1__0=hydrostat/1=nichthydrostat 1 delta2__0=inkompress/1=kompress 1 delta3__0=flach/1=tief 1 delta4__0=kleine/1=grosse_Machzahl topo.d oro_datei topo_ft.d oro_ft_datei Gaussdamm oro_typ oro_breite 10.0 oro_hoehe gauss_2D Ausgabekennung./ Ausgabepfad 100 ix_min 400 ix_max 1 ix_step 0 iy_min 0 iy_max 1 iy_step 0 iz_min 159 iz_max 1 FFT Input-File: (abc.inp)
Deutscher Wetterdienst 13FE 13 – Example 1: 2D-test case gaussian hill (for the Input-Data: slide before) w [m/s]
Deutscher Wetterdienst 14FE 13 – nx 2 ny 100 nz dx dy dz 10.0 U_ T_00 1.0e5 p_ N_BV 1 delta1__0=hydrostat/1=nichthydrostat 1 delta2__0=inkompress/1=kompress 1 delta3__0=flach/1=tief 1 delta4__0=kleine/1=grosse_Machzahl topo.d oro_datei topo_ft.d oro_ft_datei Rippeldamm oro_typ oro_breite oro_hoehe schaer Ausgabekennung./ Ausgabepfad 100 ix_min 400 ix_max 1 ix_step 0 iy_min 0 iy_max 1 iy_step 0 iz_min 99 iz_max 1 FFT Schaer et al. (2002) test case test case of Schaer et al (2002)
Deutscher Wetterdienst 15FE 13 – Example 2: 2D-test case from Schaer et al (2002) w [m/s]
Deutscher Wetterdienst 16FE 13 – nx 512 ny 20 nz dx dy dz 10.0 U_ T_00 1.0e5 p_ N_BV 1 delta1__0=hydrostat/1=nichthydrostat 1 delta2__0=inkompress/1=kompress 1 delta3__0=flach/1=tief 1 delta4__0=kleine/1=grosse_Machzahl topo.d oro_datei topo_ft.d oro_ft_datei Gaussberg oro_typ oro_breite 10.0 oro_hoehe gauss_3D Ausgabekennung./ Ausgabepfad 100 ix_min 400 ix_max 1 ix_step 100 iy_min 400 iy_max 1 iy_step 0 iz_min 19 iz_max 1 FFT test case: 3D Gaussian hill
Deutscher Wetterdienst 17FE 13 – Example 3: 3D Gaussian Hill w [m/s]
Deutscher Wetterdienst 18FE 13 – Optimization of horizontal advection: up to COSMO 4.3: 'advection operators' = a subroutine acting on every single grid point compiler has problems to optimize loops since COSMO 4.4: advection routines using 'field operations' (and additionally the DFI modifications by Lucio Torrisi) Efficiency gain for routine COSMO-DE at DWD (IBM): speedup of the horizontal advection alone: ~ 3 times faster overall reduction of model run time: ~ 1 Min. / 20 Min. ~ 5% Furthermore, some inconsistencies using metrical factors could be repaired acrlat(j,1) acrlat(j,2) lent to an error of ~ -0.05% in the term v dw/dy
Deutscher Wetterdienst 19FE 13 – ngranularity: Each sample hit covers 4 bytes. Time: seconds called/total parents index %time self descendents called+self name index called/total children /1.__start [2] [1] lmorg [1] /8514.organize_dynamics [3] /8514.organize_physics [6] /4256.initialize_loop [32] /8515.organize_diagnosis [39] /8514.organize_data [38] /12770.organize_assimilation [63] /4256.near_surface [79] /4256.exchange_runge_kutta [98] /8514.lmorg [1] [3] organize_dynamics [3] /4256.__src_runge_kutta_NMOD_org_runge_kutta [4] /4256.__src_relaxation_NMOD_sardass [31] /1.init_dynamics [302] /1.__src_relaxation_NMOD_init_relaxation [641] /1.input_dynctl [1105] /4256.organize_dynamics [3] [4] __src_runge_kutta_NMOD_org_runge_kutta [4] /12768.__fast_waves_rk_NMOD_fast_waves_runge_kutta [5] ===> /12768.__src_advection_rk_NMOD_advection_alt [7] /4256.__src_advection_rk_NMOD_advection_pd [11] /12768.__src_slow_tendencies_rk_NMOD_complete_tendencies_uvwtpp [13] /12768.__src_runge_kutta_NMOD_org_runge_kutta [4] [7] __src_advection_rk_NMOD_advection_alt [7] / __numeric_utilities_rk_NMOD_udsdx [8]... Old version with 'advection operator' (gprof - output)
Deutscher Wetterdienst 20FE 13 – ngranularity: Each sample hit covers 4 bytes. Time: seconds called/total parents index %time self descendents called+self name index called/total children 6.6s [1] lmorg [1] /8514.organize_dynamics [2] /8514.organize_physics [5] /8515.organize_diagnosis [42] /8514.organize_data [41] /12770.organize_assimilation [65] /4256.near_surface [81] /8514.lmorg [1] [2] organize_dynamics [2] /4256.__src_runge_kutta_NMOD_org_runge_kutta [3] /4256.organize_dynamics [2] [3] __src_runge_kutta_NMOD_org_runge_kutta [3] /12768.__fast_waves_rk_NMOD_fast_waves_runge_kutta [4] /4256.__src_advection_rk_NMOD_advection_pd [7] /12768.__src_slow_tendencies_rk_NMOD_complete_tendencies_uvwtpp [8] ===> /12768.__src_advection_rk_NMOD_advection [14] /4256.__hori_diffusion_NMOD_comp_hori_diff [17] /12768.__src_runge_kutta_NMOD_org_runge_kutta [3] [14] __src_advection_rk_NMOD_advection [14] /76608.__src_advection_rk_NMOD_horiz_adv_driver [24] / __environment_NMOD_exchg_boundaries [35] / __numeric_utilities_rk_NMOD_udsdx [38] New version with 'field operators' (gprof - output)