10
Geosci. Model Dev., 7, 1573–1582, 2014 www.geosci-model-dev.net/7/1573/2014/ doi:10.5194/gmd-7-1573-2014 © Author(s) 2014. CC Attribution 3.0 License. The generic MESSy submodel TENDENCY (v1.0) for process-based analyses in Earth system models R. Eichinger and P. Jöckel Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR), Institut für Physik der Atmosphäre, Münchner Straße 20, Oberpfaffenhofen, 82234 Weßling, Germany Correspondence to: R. Eichinger ([email protected]) Received: 20 February 2014 – Published in Geosci. Model Dev. Discuss.: 8 April 2014 Revised: 12 June 2014 – Accepted: 13 June 2014 – Published: 31 July 2014 Abstract. The tendencies of prognostic variables in Earth system models are usually only accessible, e.g. for output, as a sum over all physical, dynamical and chemical processes at the end of one time integration step. Information about the contribution of individual processes to the total tendency is lost, if no special precautions are implemented. The knowl- edge on individual contributions, however, can be of impor- tance to track down specific mechanisms in the model sys- tem. We present the new MESSy (Modular Earth Submodel System) infrastructure submodel TENDENCY and use it ex- emplarily within the EMAC (ECHAM/MESSy Atmospheric Chemistry) model to trace process-based tendencies of prog- nostic variables. The main idea is the outsourcing of the ten- dency accounting for the state variables from the process op- erators (submodels) to the TENDENCY submodel itself. In this way, a record of the tendencies of all process–prognostic variable pairs can be stored. The selection of these pairs can be specified by the user, tailor-made for the desired appli- cation, in order to minimise memory requirements. More- over, a standard interface allows the access to the individual process tendencies by other submodels, e.g. for on-line di- agnostics or for additional parameterisations, which depend on individual process tendencies. An optional closure test as- sures the correct treatment of tendency accounting in all sub- models and thus serves to reduce the model’s susceptibility. TENDENCY is independent of the time integration scheme and therefore the concept is applicable to other model sys- tems as well. Test simulations with TENDENCY show an increase of computing time for the EMAC model (in a setup without atmospheric chemistry) of 1.8 ± 1 % due to the addi- tional subroutine calls when using TENDENCY. Exemplary results reveal the dissolving mechanisms of the stratospheric tape recorder signal in height over time. The separation of the tendency of the specific humidity into the respective pro- cesses (large-scale clouds, convective clouds, large-scale ad- vection, vertical diffusion and methane oxidation) show that the upward propagating water vapour signal dissolves mainly because of the chemical and the advective contribution. The TENDENCY submodel is part of version 2.42 or later of MESSy. 1 Introduction In Earth system models (ESMs) individual processes are de- scribed by various numerical algorithms for solving the un- derlying mathematical equations. Here, the term “process” describes any abstraction of a mechanism which alters the state of the system – these could be of physical, dynami- cal, chemical, biogeochemical, or even socio-economical na- ture. A corresponding “operator” describes the processes’ al- gorithmic formulation, which yields a deterministic output for any given (reasonable) input. Finally, within the Modular Earth Submodel System (MESSy) (Jöckel et al., 2005) we define any coded realisation of the corresponding operator as a “submodel” 1 . Thus, in a certain sense, the terms “process”, “operator” and “submodel” can be used as synonyms (and will be hereafter throughout the text). The method of choice for the combination of the individual processes is the so-called operator splitting concept. In this 1 Not all the MESSy submodels, however, necessarily represent processes. Some are designed for diagnostic purposes only, and a third class, comprising the here presented TENDENCY submodel, provide some basic model infrastructure. Published by Copernicus Publications on behalf of the European Geosciences Union.

The generic MESSy submodel TENDENCY (v1.0) for process ...Received: 20 February 2014 – Published in Geosci. Model Dev. Discuss.: 8 April 2014 Revised: 12 June 2014 – Accepted:

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

  • Geosci. Model Dev., 7, 1573–1582, 2014www.geosci-model-dev.net/7/1573/2014/doi:10.5194/gmd-7-1573-2014© Author(s) 2014. CC Attribution 3.0 License.

    The generic MESSy submodel TENDENCY (v1.0) for process-basedanalyses in Earth system modelsR. Eichinger and P. Jöckel

    Deutsches Zentrum für Luft- und Raumfahrt e.V. (DLR), Institut für Physik der Atmosphäre, Münchner Straße 20,Oberpfaffenhofen, 82234 Weßling, Germany

    Correspondence to:R. Eichinger ([email protected])

    Received: 20 February 2014 – Published in Geosci. Model Dev. Discuss.: 8 April 2014Revised: 12 June 2014 – Accepted: 13 June 2014 – Published: 31 July 2014

    Abstract. The tendencies of prognostic variables in Earthsystem models are usually only accessible, e.g. for output, asa sum over all physical, dynamical and chemical processesat the end of one time integration step. Information about thecontribution of individual processes to the total tendency islost, if no special precautions are implemented. The knowl-edge on individual contributions, however, can be of impor-tance to track down specific mechanisms in the model sys-tem. We present the new MESSy (Modular Earth SubmodelSystem) infrastructure submodel TENDENCY and use it ex-emplarily within the EMAC (ECHAM/MESSy AtmosphericChemistry) model to trace process-based tendencies of prog-nostic variables. The main idea is the outsourcing of the ten-dency accounting for the state variables from the process op-erators (submodels) to the TENDENCY submodel itself. Inthis way, a record of the tendencies of all process–prognosticvariable pairs can be stored. The selection of these pairs canbe specified by the user, tailor-made for the desired appli-cation, in order to minimise memory requirements. More-over, a standard interface allows the access to the individualprocess tendencies by other submodels, e.g. for on-line di-agnostics or for additional parameterisations, which dependon individual process tendencies. An optional closure test as-sures the correct treatment of tendency accounting in all sub-models and thus serves to reduce the model’s susceptibility.TENDENCY is independent of the time integration schemeand therefore the concept is applicable to other model sys-tems as well. Test simulations with TENDENCY show anincrease of computing time for the EMAC model (in a setupwithout atmospheric chemistry) of 1.8±1 % due to the addi-tional subroutine calls when using TENDENCY. Exemplaryresults reveal the dissolving mechanisms of the stratospheric

    tape recorder signal in height over time. The separation ofthe tendency of the specific humidity into the respective pro-cesses (large-scale clouds, convective clouds, large-scale ad-vection, vertical diffusion and methane oxidation) show thatthe upward propagating water vapour signal dissolves mainlybecause of the chemical and the advective contribution. TheTENDENCY submodel is part of version 2.42 or later ofMESSy.

    1 Introduction

    In Earth system models (ESMs) individual processes are de-scribed by various numerical algorithms for solving the un-derlying mathematical equations. Here, the term “process”describes any abstraction of a mechanism which alters thestate of the system – these could be of physical, dynami-cal, chemical, biogeochemical, or even socio-economical na-ture. A corresponding “operator” describes the processes’ al-gorithmic formulation, which yields a deterministic outputfor any given (reasonable) input. Finally, within the ModularEarth Submodel System (MESSy) (Jöckel et al., 2005) wedefine any coded realisation of the corresponding operator asa “submodel”1. Thus, in a certain sense, the terms “process”,“operator” and “submodel” can be used as synonyms (andwill be hereafter throughout the text).

    The method of choice for the combination of the individualprocesses is the so-calledoperator splitting concept. In this

    1Not all the MESSy submodels, however, necessarily representprocesses. Some are designed for diagnostic purposes only, anda third class, comprising the here presented TENDENCY submodel,provide some basic model infrastructure.

    Published by Copernicus Publications on behalf of the European Geosciences Union.

  • 1574 R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY

    method the contributing processes modifying a specific prog-nostic variable are calculated in sequence, each adding itsindividual contribution to the overall change over time (i.e.the total tendency). Depending on the chosen time integra-tion scheme, these individual process tendencies (of a spe-cific prognostic variable) depend on the initial condition (orthe state of the prognostic variable at the end of one or moretime steps before), and the sum of the process tendenciesat the same time step in the sequence of operators before.Commonly in ESMs only the total tendency is analysed andthe information about the individual contribution of a cer-tain process to the change of a state variable is lost. Un-derstanding the effects of individual processes on the statevariables, however, is important for unravelling the drivingmechanisms of patterns generated by ESMs. Moreover, theprocess-based tendencies of state variables can serve as in-put to further calculations of physical or chemical processes.

    Approaching the issue by excerpting every process ten-dency of each state variable directly from the operatorswould cause a range of technical problems like an excessivememory usage and a very inflexible data handling. There-fore we implemented a comprehensive and easily expand-able infrastructure submodel, which is based on the out-sourcing of the tendency accounting from every process sub-model to it, and name it TENDENCY. Beginning with ver-sion 2.42 of MESSy (Jöckel et al., 2010) TENDENCY is partof the overall model infrastructure. TENDENCY operateson all prognostic variables, including tracers (generic sub-model TRACER,Jöckel et al., 2008). The structure of TEN-DENCY is independent of the time integration scheme usedand thus the method is applicable to other model systemsas well. Moreover, the process-based diagnostics can be setup by the user via namelist during runtime, tailor-made forthe desired application, and thus avoiding a waste of mem-ory. In Sect.2 the implementation of TENDENCY is de-scribed, including specifics of the used EMAC model sys-tem (Jöckel et al., 2010). The benefits and the methods of theuser-controlled diagnostics are described in Sect.3. Further-more, an optional closure test is explained, which is includedin the TENDENCY submodel and makes the model less er-ror prone. A runtime performance analysis was carried outto determine the additional computing time arising from theincreased usage of subroutine calls. Section4 describes thetest method and the results which indicate an overhead of1.8± 1 %. Exemplary results of the method are presented inSect.5.

    A detailed reference manual of TENDENCY is availableas a Supplement.

    2 Implementation

    ESMs aim to represent the physical and chemical processesof the real world as realistically and completely as possible.To approach this aim these processes are solved numerically

    Figure 1.Operator splitting concept (image taken fromJöckel et al.,2005). For explanation see text.

    by individual algorithms. In the model the algorithms per-form sequentially as operators which alter the prognosticvariables. The common method of choice for the sequentialcombination of the operators is the operator splitting concept,which is illustrated in Fig.1.

    According to this principle a total tendency is computedfor a given state variable (X in Fig. 1) by the different op-erators (OP 1 . . . OPn in Fig. 1) in sequence and the sum(∂X/∂t) is added at the end of the time step to the valuefrom the beginning of the time step (X(t − 1)). We explainexemplarily the operator sequence controlling the specifichumidity q in EMAC. The first operator to be called isad-vect(OP 1), which simulates the advection of water vapour.As all the tendencies are set to zero at the beginning of themodel time step, theadvecttendency is based solely on theinitial value (X(t − 1)). The next operator, e.g.vdiff (repre-senting vertical diffusion), computes a tendency based on theinitial value and the tendency calculated by theadvectopera-tor. The operator OPn, which in our example iscloud, henceis based on the initial value and the sum of the tendencies ofall the previous operators. At the end of each time step thesum of all the tendencies calculated by the individual sub-models results in the total change of the prognostic variable.The individual process tendencies, however, are commonlycomputed within the respective operators and afterwards notused any more. Thus these values are overwritten in the fol-lowing time step and hence the information is lost.

    Always extracting all process tendencies for all state vari-ables with a straightforward approach by making them glob-ally available would cause several technical problems, forinstance an excessive memory requirement. A more flexi-ble method is therefore required. Hence, in order to retrievethe process-based model tendencies of the state variablesin a standardised and configurable manner, additional codehas to be included throughout the model system. Apart fromthe development of the TENDENCY module itself (for de-tails see Sect.2.1), every subroutine which computes tenden-cies has to be modified: the tendency accounting is relocatedto the TENDENCY module, where a user-defined record iskept. Details of the implementation are given in Sect.2.2andspecial notes concerning the EMAC model are documentedin Sect.2.3.

    Geosci. Model Dev., 7, 1573–1582, 2014 www.geosci-model-dev.net/7/1573/2014/

  • R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY 1575

    Each MESSy submodel comprises subroutines for theinitialisation, the time integration and the finalising phase.The submodels are connected via standardised interfacesand are controlled by a central unit (generic submodelSWITCH/CONTROL) calling one after the other. During theinitialisation phase, among other things, the memory is setup, while during the integration phase the actual develop-ment of the state variables in space and time is calculated.The memory in the EMAC model is managed via the MESSysubmodel CHANNEL (Jöckel et al., 2010), which we alsoutilise for TENDENCY.

    Commonly, within each prognostic submodel a processtendency for a specific state variable is calculated and addeddirectly to the total tendency. The TENDENCY submodel isbased on the outsourcing of this tendency accounting (i.e.the addition to the total tendency) from the submodels tothe TENDENCY module. Figure2 illustrates this concept.The addition of the process tendency to the total tendency ina specific submodel is replaced by a call to an interface sub-routine of TENDENCY, thus handing over the control overthe tendency (Tend in Fig.2). This allows us to keep a recordof the process-based tendencies of state variables. The out-put and corresponding memory requirements, however, cannow be controlled via a namelist by the user. This gener-alised access to the process tendencies is less error proneand more user friendly, because no recoding is required fortailor-made tendency diagnostics. Additional submodels caneasily be equipped with the TENDENCY feature by follow-ing the recipe in Sect.2.2. The principle of the TENDENCYsubmodel is independent of the time integration scheme andtherefore can be applied to every model system. An overviewof the TENDENCY module is given next.

    2.1 The TENDENCY module

    The TENDENCY module is written in Fortran 95 program-ming language. It operates in all three phases of the model:the initialisation phase, the time integration phase and the fi-nalising phase.

    The main entry points are called once from the base modelinterface layer (BMIL, for definition seeJöckel et al., 2010).In the initialisation phase the subroutine

    – main_tendency_initialize reads the TEN-DENCY CPL-namelist and sets up the “handles” andprognostic variable registrations (both explained below)for those processes of the base model, which have notyet been re-implemented as MESSy submodels.

    – main_tendency_init_coupling parses theTENDENCY coupling (CPL)-namelist entries and setsup internal data structures and memory (channels andchannel objects,Jöckel et al., 2010), depending on theuser request in the CPL-namelist.

    In the time integration phase the subroutine

    Figure 2. Schematic of the MESSy TENDENCY submodel withinthe framework of the EMAC model system. The addition of theindividual process tendencies to the total tendency is now out-sourced from the respective submodels to the TENDENCY sub-model. A user-controlled namelist provides several possibilities forthe output of the process tendencies of state variables.

    – main_tendency_global_end performs the inter-nal closure test (explained below), if requested by theuser in the CPL-namelist.

    – main_tendency_reset resets the internal tenden-cies to zero at the beginning of the next time step.

    And in the finalising phase the subroutine

    – main_tendency_free_memory frees the non-channel object related memory and deletes the internaldata structures.

    Besides these main entry points, TENDENCY providesa number of functions and subroutines, which need to becalled from within the various submodels (more preciselyfrom their respective submodel interface layer, SMIL; fordefinition seeJöckel et al., 2010). During the initialisationphase, each submodel needs to

    – be associated with a unique integer identifier (which wecall “handle”). This is accomplished by calling the func-tion mtend_get_handle as provided by the TEN-DENCY submodel. This function requires as argumenta unique name of the process, which can be used in theuser interface (see Sect.3.1), i.e. the CPL-namelist.

    – register the prognostic variables, which are subjectto be modified. This is done by calling the subrou-tine mtend_register with the process handle anda unique identifier (provided as integer parameter byTENDENCY) of the respective prognostic variable asarguments.

    Note that for processes of the base model, which have not yetbeen re-implemented as MESSy submodels, these two steps

    www.geosci-model-dev.net/7/1573/2014/ Geosci. Model Dev., 7, 1573–1582, 2014

  • 1576 R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY

    are performed withinmain_tendency_initialize(see above). These initialisation procedures are used to setup an internal logical structure, which is used in combinationwith the user request (CPL-namelist), to set up the memory(in main_tendency_init_coupling ) and to controlthe tendency accounting during the time integration phase.

    During the time integration phase, mainly two subroutinesare called by each submodel:

    – mtend_get_start is called to calculate the up-to-date (“start”) values of the respective prognostic vari-able.

    – mtend_add is called to add the new process tendencyto the total tendency.

    Both subroutines need to be called for each prognostic vari-able to be modified. Details on the argument lists of TEN-DENCY subroutines are documented in the Supplement.

    As it is implemented now, the submodel TENDENCY isdirectly portable only to other MESSy base models (i.e. mod-els equipped with the MESSy infrastructure), since it utilisesthe two other MESSy infrastructure submodels CHANNEL(for memory management and I/O,Jöckel et al., 2010) andTRACER (for chemical constituents,Jöckel et al., 2008).Still, for porting the concept to another model system, largeparts of the code can be reused, as well. The list of prognos-tic variables, however, needs to be adapted to the respectivebase model in any case.

    2.2 Equipping submodels with the TENDENCY feature

    Table 1 shows the required submodel modifications exem-plarily for the temperature as prognostic variable. As can beseen, the TENDENCY approach has some advantages: thedirect access (by Fortran USE) to the central prognostic vari-ables and their corresponding tendencies (in the exampletm1and tte) is no longer required. The same holds for the timestep length (time_step_len) for calculating the start value (t),which is potentially (in Table1 not explicitly shown) re-quired to calculate the process tendencymy_tte. This is lesserror prone, since the correct calculation (last two rows inTable1) is entirely hidden in the TENDENCY submodel.

    As Table1 shows, equipping a submodel with the TEN-DENCY option requires four main modifications: two dur-ing the initialisation phase and two during the time in-tegration phase of the submodel. During the initialisationphase a handle (see Sect.2.1, in the examplemy_handle)has to be assigned to each submodel by calling the func-tion mtend_get_handle . Additionally the subroutinemtend_register must be called for every variable whichis going to be altered by the submodel (temperature in theexample, selected via the identifiermtend_id_t). This reg-isters the respective process–prognostic variable pair in theTENDENCY module and sets an individually assigned logi-cal to “true”. This is used for the definition of the respective

    channel object (memory) as well as for controlling the calcu-lations in the time integration phase.

    During the integration phase of the model the computa-tion of the start values of the prognostic variables as well asthe addition of the process-based tendencies are replaced bycalls of subroutines from the TENDENCY module. The sub-routinemtend_get_start now computes the start valuesand the subroutinemtend_add updates and records the ten-dencies. The respective start values represent the sum of theinitial value (the value from the previous time step) and allthe process tendencies of the submodels called prior to thissubmodel multiplied with the time step length.

    Since not all submodels could be modified for TEN-DENCY at once, and also to enable model configurationswithout the TENDENCY feature, we decided to encapsulatethe submodel modifications in pre-processor directives. Ad-ditional code is introduced using

    #ifdef MESSYTENDENCY

    . . .new code . . .

    #endif

    and code, which is modified for the usage of TENDENCY,looks like

    #ifndef MESSYTENDENCY

    . . .original code . . .

    #else

    . . .TENDENCY specific code . . .

    #endif

    Thus all modifications and the TENDENCY sub-model are only active if the model is configured with-enable-MESSYTENDENCY. This structure is also rec-ommended for equipping further submodels with the TEN-DENCY feature.

    2.3 EMAC-specific implementation details

    Since some processes of the physics in EMAC (v2.42) havenot yet been re-implemented as independent MESSy sub-models, they are still operated directly within the ECHAM5base model. In the sequence of operations, the MESSyinfrastructure initialises the memory before the remain-ing parts of the base model ECHAM5 are initialised. Onthe other hand, the process–prognostic variable pair reg-istrations determine the memory (channel objects). Thusthe function mtend_get_handle and the subroutinemtend_register would be called too late, if only calledfrom the remaining parts of the ECHAM5 base model.Therefore, these associated process identifiers (namelyad-vect, surf2, vdiff, gwspect, ssodrag, dyn) have to be assigned,

    2In MESSy 2.50surf has been replaced by the MESSy sub-modelsurface.

    Geosci. Model Dev., 7, 1573–1582, 2014 www.geosci-model-dev.net/7/1573/2014/

  • R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY 1577

    Table 1. Required modification of submodels. The example shows the modification of the total temperature tendencytte. The left columnshows the typical classical code, the right column the TENDENCY approach. The value from the time step before istm1, the local variabletis the current (start) value, andmy_tteis the new, additional tendency, also a local variable. The time step length istime_step_lenandmodstrdenotes the name of the respective submodel. Note that the “_l” suffix of mtend_add and mtend_get_start are due to different possible entrypoints with access to different ranks of the variables (here 2-D, see Sect.2.3).

    without TENDENCY with TENDENCY

    initialisation phase

    USE messy_main_tendency_bi, ONLY: mtend_get_handle, &mtend_register, mtend_id_t

    INTEGER:: my_handle

    my_handle= mtend_get_handle(modstr)CALL mtend_register(my_handle, mtend_id_t)

    time integration phase

    USE messy_main_data_bi, ONLY: tte, tm1 USE messy_main_tendency_bi, ONLY: mtend_add_l, mtend_get_start_lUSE messy_main_timer, ONLY: time_step_len

    t(:,:)= tm1(:,:)+ tte(:,:)· time_step_len CALL mtend_get_start_l(mtend_id_t, v0= t(:,:))

    tte(:,:)= tte(:,:)+ my_tte(:,:) CALL mtend_add_l(my_handle, mtend_id_t, px= my_tte(:,:))

    and the possible process–prognostic variable pairs have to beregistered already during the initialisation phase of the TEN-DENCY module itself (see also Sect.2.1).

    A second EMAC specific is owed to the spectral trans-form dynamical core of the ECHAM5 base model: the windspeed is usually in units of m s−1, but to meet the needs ofthe spectral transform on the sphere, it has to be scaled withthe cosine of the latitude. Various physical subroutines inthe EMAC model, however, perform with the unscaled windspeed. Within TENDENCY, always the scaled wind speedis used. To avoid inconsistencies, TENDENCY provides thesubroutinemtend_set_sqcst_scal , which is used toset an internal logical switch telling TENDENCY whetherthe incoming wind tendency is scaled or not.

    The third EMAC specific is related to the dimensionsof the prognostic variables in 3-D grid-point space. TheECHAM5 base model uses a specific order of dimensions((h1,z,h2) whereh1 andh2 denote the horizontal andz thevertical dimensions) for code optimisation. Hereby some ofthe processes perform within a loop over the outer horizontaldimensionh2. Therefore, a distinction had to be made be-tween those processes being called globally (outside theh2loop) and those being called locally (inside theh2 loop). Inthe TENDENCY submodel this issue occurs during the timeintegration phase, i.e. concerning themtend_get_startand themtend_add subroutines. Here, the arrays have tobe of rank 2 ((h1,z)), if called inside the local loop, and ofrank 3 ((h1,z,h2)), if called outside. Therefore both subrou-tines are found twice in the TENDENCY module suffixed byeither_l (for local) or_g (for global), and differing only bythe rank of the array arguments.

    3 Diagnostic methods with TENDENCY

    The implementation of the MESSy generic submodel TEN-DENCY provides several benefits concerning the handlingof the process-based tendency data. The CHANNEL infras-tructure allows a flexible and user-defined output of the infor-mation and thus the memory requirement can be minimiseddepending on the specific needs. This section describes theindependent modes of operation, how the information can beextracted by the user and the optional closure test.

    The limitations of the bookkeeping of process tendencies,by design, is the partitioning of the individual processes, ac-cording to the operator splitting concept. If a process can besubdivided into further sub-processes, each calculating a dis-tinct contribution to the tendency, those sub-process tenden-cies can be handled by TENDENCY. This also implies thatintermediate tendencies within an implicit scheme cannot becaptured by TENDENCY, unless they are explicitly calcu-lated within the scheme.

    3.1 User interface

    The TENDENCY submodel provides various options for theuser to receive data output, which have to be set prior to themodel simulation. This is realised via two interfaces con-nected with the module, the corresponding coupling (CPL)namelist and the integrated subroutinemtend_request .

    The CPL-namelist contains three logical parameters:

    – l_full_diag enables the full diagnostic output, i.e.channel objects (in a separate output channel “ten-dency_full”) for the tendencies of all possible process–prognostic variable pairs are created. This option

    www.geosci-model-dev.net/7/1573/2014/ Geosci. Model Dev., 7, 1573–1582, 2014

  • 1578 R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY

    requires considerably large memory and has beenmainly implemented for debugging purposes.

    – l_closure enables the internal closure test and cre-ates the additional channel “tendency_clsr” with the twoobjects required for the closure test (see Sect.3.2). Thistest has been implemented to check if all submodels ina given model setup work correctly with respect to thetendency accounting.

    – l_clos_diag enables additional output of informa-tion during the model simulation into the log file. Thiscontains the external and the internal tendencies (for ex-planation see Sect.3.2) as well as their difference and ismostly used for development and debugging purposes,e.g. when including a new submodel.

    Individual tendency diagnostics can be requested in theCPL-namelist with entries looking like

    TDIAG(i) = “X” , “p1;p2+p3 ; . . .;pn” ,

    where i is an arbitrary but unique number,X is the nameof the prognostic variable (or tracer), andp1 to pn are thenames of the processes (see Sect.2.1). TENDENCY cre-ates a new output channel (named “tendency_diag”) and onechannel object for each semicolon separated list of processsums. These objects either contain the individual tendencyof the process–variable pair (examplep1), or the sum of ten-dencies of the corresponding processes (examplep2+p3 ).An additional “unaccounted” object is created, which con-tains the sum of all process tendencies missing in the list. Ifthe “unaccounted” object is zero for all time steps in everygrid box, all processes influencing the variableX are withinthe set of processesp1 to pn . With this feature, tailor-madediagnostics excerpting only the desired tendencies, thus witha minimised memory requirement, can be set up.

    Besides the CPL-namelist controlled generation of newoutput objects containing individual process tendencies (orsums thereof), TENDENCY also provides an interface sub-routine to enable the access to individual process tendenciesby other submodels. Callingmtend_request from the en-try point “init_coupling” of submodel A with the name of thedesired submodel B and the identifier of the desired prognos-tic variableX will generate a new channel object in the chan-nel “tendency_exch” (for exchange) and return a pointer toits memory. If the corresponding process submodel B willcommit its tendency by callingmtend_add , this tendencywill be copied into this new channel object and therefore beavailable in submodel A for further calculations.

    As for each of the possible modes of operation of the TEN-DENCY submodel an individual channel is generated, theydo not exclude or influence each other, but rather work inde-pendently.

    3.2 Closure test

    An optional closure test can be performed with the TEN-DENCY submodel for every time step during the simu-lation. The test is mainly implemented for developmenttasks like including new submodels to the TENDENCYstructure. If activated via the namelist (see Sect.3.1),two additional process handles (I_HANDLE_SUM andI_HANDLE_DIFF) are defined. Further, a separate chan-nel “tendency_clsr” is created with corresponding chan-nel objects, two (“sum” and “difference”) for each prog-nostic variable. The “sum” objects are updated every timea tendency is updated in themtend_add subroutines andthus display the total sum of tendencies, which are cal-culated only within the TENDENCY module (in the fol-lowing called “internal tendency”). As with TENDENCYthe total model tendency (in the following called “exter-nal tendency”) should be calculated only within the TEN-DENCY submodel, those two values are supposed to beequal. If these two values differ, the respective variable mustbe altered by another process of which the tendency com-putation was not relocated to the TENDENCY submodel.Testing this denotes the closure test which is conductedas follows: the channel objects corresponding to the han-dle I_HANDLE_DIFF are used to store the difference be-tween the two tendency values calculated in the subroutinemain_tendency_global_end by subtracting the inter-nal from the external tendency. This difference is used inthe subroutinecompute_eps_and_clear . In this sub-routine anε is calculated by

    ε = (max|xtee|) · 10−10, (1)

    wherextee denotes the external tendency of the variable ortracerx. Next, the difference between the two tendencies ischallenged to be smaller thanε. If so, certainty is given thatall processes changing the respective prognostic variable areproperly captured by the TENDENCY submodel. If not, anerror message will occur in the log file.

    4 Runtime performance analysis

    Including the TENDENCY submodel into the EMAC modelleads to a number of additional subroutine calls during thesimulation. To estimate the extra computing time the EMACmodel requires for these, a runtime performance analysishas been conducted. For this, four model simulations (withEMAC version 2.42) over 10 model days with a time stepof 15 min were carried out on 1 node with 64 tasks per nodeon the “blizzard” IBM Power 6 of the DKRZ (Deutsches Kli-marechenzentrum) in Hamburg. While in two of the four sim-ulations the TENDENCY submodel was performing, in theother two it was switched off.

    The model resolution of T42L90MA was chosen witha model setup including only the dynamical core of the

    Geosci. Model Dev., 7, 1573–1582, 2014 www.geosci-model-dev.net/7/1573/2014/

  • R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY 1579

    Figure 3. Time series of the average over the 5◦ S–5◦ N latitudinalband of the specific humidity (in mg kg−1).

    ECHAM5 base model and the basic submodels of theMESSy system (namely:cloud, convect, cvtrans, h2o andrad4all) as well as the extra routines for the middle atmo-sphere (gwspect, ssodrag). In order to receive comparableresults, apart from the wall clock no data output was enabledand due to the initialisation phase of the model the first timestep was not taken into consideration. For the calculation,the sum of the wall clock time has been taken for every MPI3

    parallel task and for every time step of one model simulation.The equation

    O =

    P∑

    p=1

    N∑n=2

    ton(p,n)

    P∑p=1

    N∑n=2

    toff(p,n)

    − 1

    · 100 (2)yields the averaged value of the overhead (O) produced bythe additional submodel per time step in percent. Here,n in-dicates the time step,P the number of MPI tasks andton andtoff represent the wall clock time for the simulations with theTENDENCY submodel either switched on or off. In our teststhe use of the TENDENCY submodel results in an additional1.8±1 % of computing time for the EMAC model in the de-scribed setup.

    5 Exemplary results

    Exemplarily for presenting a possible application of theTENDENCY submodel the analysis of simulated strato-spheric water vapour (q) has been chosen. Figure3 shows thesimulated representation of the well-known tropical (5◦ N–5◦ S) tape recorder signal between 100 and 10 hPa for threesimulated years, which was first discovered byMote et al.(1995, 1996) andWeinstock et al.(1995). For this, we carriedout a model simulation in T42L90MA resolution (2.8◦×2.8◦,

    3message passing interface

    Figure 4. Time series of the average over the 5◦ S–5◦ N latitudinalband of the total tendency (in ng kg−1 s−1) of the specific humidity.

    90 vertical layers) initialised from a previous long-term sim-ulation. Only the basic MESSy submodels (convect, cloud,cvtrans, rad4all, tropop) and the ECHAM5 base model areused plus the submodelh2o, which provides a simple pre-scribed water vapour production accounting for the methaneoxidation in the stratosphere.

    In Fig. 4 the total tendency of the water vapour is shownfor the simulated time period. Here a fairly clear distinctioncan be made between reddish (increasing water vapour) andbluish (decreasing water vapour) patches. These in fact cor-respond to the increasing and decreasing specific humidityover time in Fig.3. White patches in Fig.4 correspond tothe maxima and minima in Fig.3. The signal of the total ten-dency also propagates upward in time, like the actual taperecorder signal. At a pressure lower than 30 hPa, the signaldissolves or mixes in with less clear patterns in the upperstratosphere.

    Figures5–9 show the process-based tendencies retrievedvia the TENDENCY submodel. For this the line

    TDIAG(2) =

    “q” , “vdiff;cloud;convect;advect;h2o ” ,

    was included into the CPL namelist. As explained in Sect.3this generates an output file for the process tendencies of thespecific humidityq for each of the five stated submodels,involved in controlling the prognostic development ofq. Thesixth generated output object accounting for the unaccountedsubmodels was tested to be zero at any time and location, toassure that all the processes influencing the specific humidityhave been captured.

    Figures5 and6, showing the tendencies caused by large-scale clouds (cloud) and convective clouds (convect), showno signal above the tropopause or the lower stratosphere,as expected. The mostly bluish colour at the bottom of theimages accounts for condensing and re-sublimating watervapour and cloud formation, which reduces the specific hu-midity of the vapour. The small red spots (hardly visible) ontop of the blue colour are due to water vapour transport in the

    www.geosci-model-dev.net/7/1573/2014/ Geosci. Model Dev., 7, 1573–1582, 2014

  • 1580 R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY

    Figure 5. Time series of the average over the 5◦ S–5◦ N latitudi-nal band of the large-scale cloud tendency (in ng kg−1 s−1) of thespecific humidity.

    convection submodel (convect) and due to evaporation andsublimation of transported liquid or ice water in thecloudsubmodel.

    Figure 7 shows the impact of the vertical diffusion (vd-iff ). A strong signal goes up to 80 hPa. Above that region,the signal is considerably weaker. The vertical diffusion ten-dencies are about three orders of magnitude smaller than thetotal tendencies. Above 50 hPa there are almost no changescaused by vertical diffusion, apart from a downward propa-gating signal. It seems to be in phase with the quasi-biannualoscillation (QBO), which may influence the strength of thetape recorder signal (Niwano et al., 2003).

    The prescribed water vapour production caused bymethane oxidation is shown in Fig.8. The continuous pro-duction of water vapour from the chemical reactions in-creases with height and varies slightly with season. The mag-nitude of the tendencies are about one order of magnitudesmaller than the maxima of the total tendencies.

    The advection tendency of the specific humidity can beseen in Fig.9. It reproduces the tendency tape recorder sig-nal from the total specific humidity tendency in Fig.4 fairlywell, but is weaker. The advection tendency indicates upwardpropagation from 80 to 30 hPa where it fades out. In the up-per stratosphere the advection tendencies also resemble thetotal tendencies, but with reduced magnitude.

    Figure10 shows the 3-year temporal and zonal averagesof the individual tendencies at the Equator, to provide a pic-ture of the net effect of the processes over the entire sim-ulated period. Here again it can be seen that the influenceof the two cloud processes and of the vertical diffusion fadeout above the tropopause and the water vapour productionby methane oxidation simply increases with height. The av-eraged advection tendency changes from positive to negativevalues at around 50 hPa and above balances the chemicallyproduced water vapour. As the methane oxidation providesa constant signal it has the same net effect as the advectiveimpact when temporally averaged, even though the maximaare one order of magnitude smaller. Without the chemical

    Figure 6. Time series of the average over the 5◦ S–5◦ N latitudi-nal band of the convective cloud tendency (in ng kg−1 s−1) of thespecific humidity.

    Figure 7. Time series of the average over the 5◦ S–5◦ N latitudi-nal band of the vertical diffusion tendency (in ng kg−1 s−1) of thespecific humidity.

    production of water vapour, the advection tendencies wouldbecome zero above around 30 hPa, from which point the spe-cific humidity is fairly constant over time for a given altitude.

    A variety of studies can be carried out by means of TEN-DENCY. The relevance of certain processes as drivers forchanges in the dynamical or chemical state of the atmo-sphere can be analysed. However, the limitations describedin Sect.3 have to be considered. The relevance of solar ac-tivity for a temperature change over time, for instance, can inthe EMAC radiation scheme only be investigated by compar-ing the temperature tendencies from the radiation scheme oftwo model simulations, one with and one without variationsin solar activity. The level of detail that can be investigatedwith TENDENCY is limited by the specific process formu-lations. If one process calculates several contributions to avariable, though, these can be examined individually withTENDENCY.

    Geosci. Model Dev., 7, 1573–1582, 2014 www.geosci-model-dev.net/7/1573/2014/

  • R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY 1581

    Figure 8. Time series of the average over the 5◦ S–5◦ N latitudi-nal band of the methane oxidation tendency (in ng kg−1 s−1) of thespecific humidity.

    6 Summary

    We developed the generic submodel TENDENCY foraccessing process-based tendencies of state variables(including tracers) for Earth system models in a well struc-tured manner, with minimum memory requirements andmaximum flexibility and user friendliness. Implemented inthe EMAC model this Fortran 95 module enables us to diag-nose and to use these process tendencies and thus to simplifythe analyses of mechanisms as well as the computation of de-pendent processes. Another advantage of the new submodelis the reduced error susceptibility of the model system, ob-tained by the standardisation of the start value calculationand tendency accounting and by the additional, optional clo-sure test.

    The implementation is based on the relocation of the statevariable tendency accounting from the submodel of the re-spective process to the tendency module itself. This allows usto directly keep a record of all the process–variable tendencypairs and to output and transfer tailor-made subsets for di-agnostics and further analyses. This generalised approach isless error prone and more user friendly, because no recodingis required to set up specific tendency diagnostics. New sub-models can easily be equipped with the TENDENCY featureby following a simple coding standard. Due to the indepen-dence of the time integration scheme, the concept of TEN-DENCY is also applicable to other base models.

    With a computing time overhead of less than 2 % in aver-age for a setup without atmospheric chemistry of the EMACmodel due to the additional subroutine calls, we achieveda computationally light implementation of the additionaltool. Exemplary results from a 3-year model simulation showthe different process tendencies of water vapour in the strato-sphere. Here we see that it is the chemical and the advectiontendencies which control the dissipation of the tropical taperecorder signal with height over time.

    Figure 9. Time series of the average over the 5◦ S–5◦ N latitudi-nal band of the advection tendency (in ng kg−1 s−1) of the specifichumidity.

    Figure 10.Zonally averaged process tendencies of the specific hu-midity (in ng kg−1 s−1) at the Equator, averaged over the 3-yeartime period.

    Code availability

    TENDENCY is part of the Modular Earth Submodel System(MESSy) since version 2.42. MESSy is continuously furtherdeveloped and applied by a consortium of institutions. Theusage of MESSy and access to the source code is licensed toall affiliates of institutions which are members of the MESSyConsortium. Institutions can be a member of the MESSyConsortium by signing the MESSy Memorandum of Un-derstanding. More information can be found on the MESSyConsortium Website (http://www.messy-interface.org).

    The Supplement related to this article is available onlineat doi:10.5194/gmd-7-1573-2014-supplement.

    Acknowledgements.The authors thank the DFG (DeutscheForschungsgemeinschaft) for funding the research group SHARP(Stratospheric Change and its Role for Climate Prediction, DFG

    www.geosci-model-dev.net/7/1573/2014/ Geosci. Model Dev., 7, 1573–1582, 2014

    http://www.messy-interface.orghttp://dx.doi.org/10.5194/gmd-7-1573-2014-supplement

  • 1582 R. Eichinger and P. Jöckel: The generic MESSy submodel TENDENCY

    Research Unit 1095); the presented development was conducted aspart of R. Eichinger’s PhD thesis under grant number BR 1559/5-1.We acknowledge support from the German Climate ComputingCentre (DKRZ) and thank all MESSy developers and submodelmaintainers for their support. Furthermore, we thank M. Ponaterand S. Brinkop for valuable comments on the manuscript draft andK. Ketelsen for initiating the basic idea. We also thank A. Griniand an anonymous referee for their constructive reviews of themanuscript.

    The service charges for this open access publicationhave been covered by a Research Centre of theHelmholtz Association.

    Edited by: O. Boucher

    References

    Jöckel, P., Sander, R., Kerkweg, A., Tost, H., and Lelieveld, J.: Tech-nical Note: The Modular Earth Submodel System (MESSy) – anew approach towards Earth System Modeling, Atmos. Chem.Phys., 5, 433–444, doi:10.5194/acp-5-433-2005, 2005.

    Jöckel, P., Kerkweg, A., Buchholz-Dietsch, J., Tost, H., Sander, R.,and Pozzer, A.: Technical Note: Coupling of chemical processeswith the Modular Earth Submodel System (MESSy) submodelTRACER, Atmos. Chem. Phys., 8, 1677–1687, doi:10.5194/acp-8-1677-2008, 2008.

    Jöckel, P., Kerkweg, A., Pozzer, A., Sander, R., Tost, H., Riede, H.,Baumgaertner, A., Gromov, S., and Kern, B.: Development cycle2 of the Modular Earth Submodel System (MESSy2), Geosci.Model Dev., 3, 717–752, doi:10.5194/gmd-3-717-2010, 2010.

    Mote, P., Rosenlof, K., Holton, J., Harwood, R., and Waters, J.: Sea-sonal variations of water vapor in the tropical lower stratosphere,Geophys. Res. Lett., 9, 1093–1096, 1995.

    Mote, P., Rosenlof, K., Mclntyre, M., Carr, E., Gille, J., Holton, J.,Kinnersley, J., Pumphrey, H., Russel, J., and Waters, J.: An at-mospheric tape recorder: the imprint of tropical tropopause tem-peratures on stratospheric water vapor, J. Geophys. Res., 101,3989–4006, 1996.

    Niwano, M., Yamazaki, K., and Shiotani, M.: Seasonal and QBOvariations of ascent rate in the tropical lower stratosphere as in-ferred from UARS HALOE trace gas data, J. Geophys. Res., 108,4794, doi:10.1029/2003JD003871, 2003.

    Weinstock, E., Hintsa, E., Dessler, A., and Anderson, J.: Measure-ments of water vapor in the tropical lower stratosphere duringthe CEPEX Campaign: results and interpretation, Geophys. Res.Lett., 22, 3231–3234, 1995.

    Geosci. Model Dev., 7, 1573–1582, 2014 www.geosci-model-dev.net/7/1573/2014/

    http://dx.doi.org/10.5194/acp-5-433-2005http://dx.doi.org/10.5194/acp-8-1677-2008http://dx.doi.org/10.5194/acp-8-1677-2008http://dx.doi.org/10.5194/gmd-3-717-2010http://dx.doi.org/10.1029/2003JD003871