Presentation is loading. Please wait.

Presentation is loading. Please wait.

Implementation of a general tracer treatment

Similar presentations


Presentation on theme: "Implementation of a general tracer treatment"— Presentation transcript:

1 Implementation of a general tracer treatment
Anne Roches, C2SM Oliver Fuhrer, MeteoSwiss COSMO GM 2011, Roma September 2011

2 Goal Provide a consistent and flexible tracer treatment In order to
Make the introduction of a new tracer straightforward Remove code redundancies Improve readability and maintainability Facilitate new developments Ensure coherence Suppress -> remove, avoid Make the code easier to understand and manage -> improve readibility and maintainability 2

3 Applications “Conventional” tracer users:
Microphysics Radionuclides Aerosols Chemical compounds Pollens Volcanic ashes Water isotopes Artificial tracers (indicator variables) Pollens -> Pollen ashes -> ash - Radionuclides 3

4 What if… ? I want to introduce a new tracer variable for the microphysics? For example, the number concentration of rain drops for the 2-moment scheme? remove “e.g.” Let’s say the number concentraion… -> For example, the number concentration… I would keep left-aligning the text (as on the previous slides!) I would remove indent of second and following line of a paragraph… 4

5 Currently Introducing a new tracer (prognostic variable) is…
… a lot of work 5

6 1st step data_fields.f90 src_allocation.f90 src_setup_vartab.f90 qnr exists in the model, is = 0, and can be written in the output 6

7 2nd step organize_data.f90 src_relaxation.f90 qnr has IC and BC and a “correct treatment” of the initial and lateral boundaries 7

8 3rd step src_advection_rk.f90 lmorg.f90 qnr has an is advected and with appropriate boundary conditions 8

9 4th step qnr undergoes artificial smoothing and turbulent mixing
hori_diffusion.f90 src_slow_tendencies_rk.f90 qnr undergoes artificial smoothing and turbulent mixing 9

10 Currently … and you still have “nothing” (e.g. microphysics)
Declare it in data_fields.f90 Allocate/deallocate it in src_allocation.f90 Add it to the table in src_setup_vartab.f90 Add it to the restart, IC and BC in organize_data.f90 Do the bound. relax. and Rayleigh damp. in src_relaxation.f90 Advect it in src_advection_rk.f90 Update the time step in lmorg.f90 Perform turbulent mixing in src_slow_tendencies_rk.f90 Perform horizontal diffusion in hori_diffusion.f90 Perform numerous boundary exchanges and clippings … and you still have “nothing” (e.g. microphysics) 10

11 Further steps qnr used and modified in the microphysics src_gscp.f90
11

12 Functionalities provided
Initialization Memory management I/O IC and BC treatment Advection Turbulent mixing Horizontal diffusion Arbitrary meta-data 12

13 In the future Introducing a new tracer (prognostic variable) looks like… … an easy task 13

14 1st step organize_physics.f90 14

15 Further steps qnr used and modified in the microphysics src_gscp.f90
15

16 Implementation 3 new modules: Modified modules: data_tracers.f90
src_tracers.f90 src_metadata.f90 Modified modules: For advection (src_advection_rk.f90, src_leapfrog.f90, src_runge_kutta.f90) For artificial diffusion (hori_diffusion.f90) For turbulent mixing (src_slow_tendencies_rk.f90, slow_tendencies_rk.f90) Main program (lmorg.f90) For the restart, IC and BC treatment (organize_data.f90) For BC treatment (src_relaxation.f90) 16

17 The tracer API User subroutines: trcr_new : definition of a new tracer
Provide its name, Grib n°/table, units, and optionally decide which operations it should undergo Get optionally its index for the data, the boundaries and tendencies trcr_get : access to a tracer Provide the name/index of the tracer and optionally a time level Get optionally its name, its data at the specified time level, its boundary data or tendencies, info about operations trcr_get_ntrcr : access to the total number of tracers trcr_errorstr : return of an error message for each tracer 17

18 The tracer API Infrastructure subroutines:
trcr_init : initialization of a tracer structure trcr_alloc : allocation of the memory for all tracers (data, boundaries, tendencies) trcr_setup_vartab : I/O (mimic src_setup_vartab) trcr_print : print of the list of tracers and associated metadata in sd out trcr_cleanup : deallocation of the memory 1 x 18

19 Status First ß-version implemented and already used
Attempt to handle microphysics (qc, qv, qi, qr, qs, qg) using the tracer mechanism for RK core Incoherence in their treatment Different processes (e.g. surface processes) Need of additional switches (=metadata) Development of a metadata mechanism Respect of the coding standards and contact with SCA 19

20 Outlook Finalize ß-version:
Resolve incoherence problems Integrate the metadata mechanism Prove correctness: fully (?) replace the microphysics Performance analysis and improvements Documentation Undergo the procedure described in the COSMO standards: Submit the idea to the SMC Pass the tests (technical) and verification (scientific) Nominate a responsible person Submit the code and documents to the SMC and SCA Implementation of additional processes 20

21 Acknowledgments: Pirmin Kaufmann, MeteoSwiss Ulrich Schättler, DWD Ulrich Blahak, DWD
21

22 Thank you! 22


Download ppt "Implementation of a general tracer treatment"

Similar presentations


Ads by Google