upstream nonoscillatory advection schemes

21
Upstream Nonoscillatory Advection Schemes JIAN-GUO LI Met Office, Exeter, United Kingdom (Manuscript received 8 November 2007, in final form 23 April 2008) ABSTRACT Upstream nonoscillatory (UNO) advection schemes are derived by optimizing existing classical advection schemes and combining them in different monotonic zones to avoid flux limiters for simplicity. The UNO schemes are extended to irregular grids in the form of upstream midflux linear interpolation with sym- metrical gradients and are adapted to multidimensions with an advective–conservative operator. They are given in finite-volume flux form and hence are consistent and conservative. They also preserve constancy and linear correlation. Implicit numerical diffusivity of these schemes is also derived and used as a guideline for the selection of advection schemes. One- and two-dimesional tests are used for comparisons with their classical counterparts. Multiple-cell grids are used to test the irregular grid formulation and demonstrate their performance. The simple second-order UNO2 scheme may be accurate enough when the physical diffusion or numerical smoothing term is larger than the numerical diffusion. The third-order UNO3 scheme has very small self-constrained numerical diffusion and is suitable for general atmospheric and oceanic tracer advection. 1. Introduction Advection is a fundamental physical process associ- ated with many fluid applications, such as mass, energy, and tracer transportation in atmospheric and oceanic flows. The conservation of a fluid mass with velocity v is represented by the advection equation: t v 0, 1 where t represents the time and the space gradient op- erator is over all space dimensions. Translation of the advection equation into an accurate discrete form is, however, not straightforward though modelers have been searching for the “perfect” one for many decades. As Leonard (1991) put it, even the one-dimensional (1D) scalar advection at constant velocity is super- ficially simple but embarrassingly difficult and the ultimate conservative difference scheme remains sur- prisingly elusive. The most frustrating obstacle in the development of advection schemes is numerical oscil- lation associated with high-order schemes derived from apparently the most straightforward finite-difference techniques. Following the publication of the first-order upstream scheme (Godunov 1959), many attempts to derive higher-order schemes were plagued with numerical os- cillations, including Lax and Wendroff (1960), Crowley (1968), Fromm (1968), Leonard (1979), Smolarkiewicz (1982), Takacs (1985), and Tremback et al. (1987), to name just a few. A great deal of effort has been spent on suppressing these spurious oscillations and has led to the invention of many novel techniques and schemes, such as the flux-corrected transport (FCT) algorithm (Boris and Book 1973; Book et al. 1975) and its multi- dimensional extension by Zalesak (1979), the ultimate conservative difference schemes (van Leer 1974, 1977, 1979), the flux limiters (Roe 1981; Sweby 1984), the total variance diminishing (TVD) approach (Harten 1983), the multidimensional positive definite advection transport algorithm (MPDATA; Smolarkiewicz 1984) and its monotonic version (Smolarkiewicz and Grabowski 1990), the essentially nonoscillation (ENO) scheme (Harten et al. 1987), the universal limiters (Leonard 1991), the monotone area-preserving flux- form (MAPF) advection algorithm (Bott 1992), the weighted essentially nonoscillatory (WENO) scheme (Liu et al. 1994; Jiang and Shu 1996), the multidimen- sional flux limiters (MFL; Thuburn 1996), and so on. Most of these advanced schemes come with a price, that is, the increased computing cost. It is not a surprise that Corresponding author address: Dr Jian-Guo Li, Met Office, FitzRoy Rd., Exeter EX1 3PB, United Kingdom. E-mail: [email protected] DECEMBER 2008 LI 4709 DOI: 10.1175/2008MWR2451.1 Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Upload: others

Post on 06-May-2022

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Upstream Nonoscillatory Advection Schemes

Upstream Nonoscillatory Advection Schemes

JIAN-GUO LI

Met Office, Exeter, United Kingdom

(Manuscript received 8 November 2007, in final form 23 April 2008)

ABSTRACT

Upstream nonoscillatory (UNO) advection schemes are derived by optimizing existing classical advectionschemes and combining them in different monotonic zones to avoid flux limiters for simplicity. The UNOschemes are extended to irregular grids in the form of upstream midflux linear interpolation with sym-metrical gradients and are adapted to multidimensions with an advective–conservative operator. They aregiven in finite-volume flux form and hence are consistent and conservative. They also preserve constancyand linear correlation. Implicit numerical diffusivity of these schemes is also derived and used as a guidelinefor the selection of advection schemes. One- and two-dimesional tests are used for comparisons with theirclassical counterparts. Multiple-cell grids are used to test the irregular grid formulation and demonstratetheir performance. The simple second-order UNO2 scheme may be accurate enough when the physicaldiffusion or numerical smoothing term is larger than the numerical diffusion. The third-order UNO3 schemehas very small self-constrained numerical diffusion and is suitable for general atmospheric and oceanictracer advection.

1. Introduction

Advection is a fundamental physical process associ-ated with many fluid applications, such as mass, energy,and tracer transportation in atmospheric and oceanicflows. The conservation of a fluid mass � with velocityv is represented by the advection equation:

����t � � � �v�� � 0, �1�

where t represents the time and the space gradient op-erator is over all space dimensions. Translation of theadvection equation into an accurate discrete form is,however, not straightforward though modelers havebeen searching for the “perfect” one for many decades.As Leonard (1991) put it, even the one-dimensional(1D) scalar advection at constant velocity is super-ficially simple but embarrassingly difficult and theultimate conservative difference scheme remains sur-prisingly elusive. The most frustrating obstacle in thedevelopment of advection schemes is numerical oscil-lation associated with high-order schemes derived fromapparently the most straightforward finite-differencetechniques.

Following the publication of the first-order upstreamscheme (Godunov 1959), many attempts to derivehigher-order schemes were plagued with numerical os-cillations, including Lax and Wendroff (1960), Crowley(1968), Fromm (1968), Leonard (1979), Smolarkiewicz(1982), Takacs (1985), and Tremback et al. (1987), toname just a few. A great deal of effort has been spenton suppressing these spurious oscillations and has led tothe invention of many novel techniques and schemes,such as the flux-corrected transport (FCT) algorithm(Boris and Book 1973; Book et al. 1975) and its multi-dimensional extension by Zalesak (1979), the ultimateconservative difference schemes (van Leer 1974, 1977,1979), the flux limiters (Roe 1981; Sweby 1984), thetotal variance diminishing (TVD) approach (Harten1983), the multidimensional positive definite advectiontransport algorithm (MPDATA; Smolarkiewicz 1984)and its monotonic version (Smolarkiewicz andGrabowski 1990), the essentially nonoscillation (ENO)scheme (Harten et al. 1987), the universal limiters(Leonard 1991), the monotone area-preserving flux-form (MAPF) advection algorithm (Bott 1992), theweighted essentially nonoscillatory (WENO) scheme(Liu et al. 1994; Jiang and Shu 1996), the multidimen-sional flux limiters (MFL; Thuburn 1996), and so on.Most of these advanced schemes come with a price, thatis, the increased computing cost. It is not a surprise that

Corresponding author address: Dr Jian-Guo Li, Met Office,FitzRoy Rd., Exeter EX1 3PB, United Kingdom.E-mail: [email protected]

DECEMBER 2008 L I 4709

DOI: 10.1175/2008MWR2451.1

MWR2451

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 2: Upstream Nonoscillatory Advection Schemes

advection is one of the most expensive processes inmany numerical models. Although computing powerhas increased dramatically in the last few decades, de-mands for higher resolution, more physics, and evencoupled models have far outstripped the computer ad-vances. It is hence still desirable to develop fast androbust advection schemes.

It is also arguable whether complex high-order ad-vection schemes are necessary in models where physicaldiffusion or numerical smoothing is an essential pro-cess, such as the eddy diffusion in atmospheric models(Davies et al. 2005). The difference among nonoscilla-tory advection schemes of different accuracy orders liesmerely within their diffusion properties. The first-orderupstream scheme is notoriously too diffusive andhigher-order schemes tend to reduce the numericaldiffusion. However, the diffusion reduction in higher-order schemes decreases quickly with increased orders.Leonard (1991) stated that the reduction becomestrivial soon after the order is larger than third. In ad-dition, the improvement in advection will effectively belimited by the physical diffusion or numerical smooth-ing term in the same model. Therefore, it should beenough to choose an advection scheme of numericaldiffusion that is no larger or one order higher than thereal diffusion. The real diffusion could be reduced, ifnecessary, to compensate for the numerical diffusionincurred by the advection scheme. In fact, the diffusivefirst-order upstream advection scheme is purposely se-lected for ocean wave models to smooth out the so-called garden sprinkler effect caused by the discretedirection bins of the wave energy spectra (WAMDIGroup 1988). When a less diffusive advection scheme isused, numerical smoothing has to be introduced to re-duce this garden sprinkler effect (Tolman et al. 2002).The implicit turbulence modeling approach (Margolinand Rider 2002) eliminates the diffusion term entirelyand allows the effects of unresolved eddies to be mod-eled by the implicit diffusion of a nonoscillatory finite-volume advection scheme. Hourdin and Armengaud(1999) demonstrated that higher-order schemes aremuch more accurate than lower-order schemes at agiven spatial resolution but much more comparablewhen the lower-order schemes are run on a finer gridto make the numerical costs equivalent and suggestedthat a second-order nonoscillatory scheme is well suitedfor tracer transportation by 3D atmospheric winds.Schroeder et al. (2006) recommended a second-orderWENO scheme for momentum advection in a meso-scale atmospheric model and considered a third-orderWENO scheme too costly for its limited improve-ment. Hofmann and Morales Maqueda (2006) used thesecond-order moments (SOM) conservation scheme

(Prather 1986) for ocean tracer transportation despiteits large memory demand. Nevertheless, some modelersare reluctant to use the numerical diffusion for smooth-ing as the numerical diffusivity depends on the flowvelocity and is hence difficult to control, especially inmultidimensional models (Shchepetkin and McWil-liams 1998). Knievel et al. (2007) added sixth-order ex-plicit diffusion to aid the implicit diffusion of their fifth-order advection scheme, which is not adequate tosmooth out dynamical noises at low wind speeds. Bidlotet al. (1997) rotated the wave model direction bins toavoid axial directions where the transverse diffusion ofthe first-order upstream advection scheme vanishes.

Irregular grids are commonly used in global atmo-spheric and oceanic models, such as the conventionallatitude–longitude grid where the longitudinal gridspacing decreases with latitude. As the Eulerian advec-tion scheme is subject to the Courant–Friedrichs–Lewy(CFL) restriction, one direct consequence is the re-duced time step due to the small longitudinal gridlength at high latitudes. One solution to this problem isswitching to Lagrangian advection schemes such as thesemi-Lagrangian inherently conserving and efficient(SLICE) scheme (Zerroukat et al. 2005). This option is,however, beyond the scope of this paper. Another op-tion is to increase the grid size in the polar regions suchas the spherical reduced grid (Rasch 1994), whichdoubles the longitudinal grid size gradually toward thepoles so that the actual grid spacing remains compa-rable to the equatorial one. The adaptive mesh refine-ment (Berger and Oliger 1984) and dynamic grid adap-tation (Iselin et al. 2002) attempt to accommodate thevarying spatial and temporal scales of the atmosphericflow with different resolutions within one model. Thesenonuniform grids add extra difficulties in developmentof advection schemes.

By illustrating the causes of oscillations in high-orderadvection schemes and some effective approaches toeradicate them, four simple upstream nonoscillatory(UNO) advection schemes will be derived in this paperby refining and/or optimizing existing advectionschemes. The quest will be limited up to the third orderor no more than five-point schemes for possible appli-cations in irregular and unstructured grids. It is alsobelieved that higher accuracy may be convenientlyachieved by higher resolution. Implicit numerical diffu-sivity of these schemes will be derived and used as aguideline for comparison with real diffusion and selec-tion of accuracy order. The advection schemes will bepresented in irregular grid formulations with symmetri-cal gradients. Classic 1D and 2D numerical tests onmultiple-cell grids will be used for comparison with

4710 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 3: Upstream Nonoscillatory Advection Schemes

their classical counterparts and for demonstration oftheir performance.

2. UNO advection schemes

To find a cure for the numerical oscillation in high-order advection schemes, it is best to start with thecause of the oscillation. The oscillation problem can beillustrated with the simple 1D advection of a step func-tion over a uniform grid. Assume that the step functionis initially zero for all grid points up to cell j and jumpsto 1 from cell j � 1 onward as shown in Fig. 1. The causeof the oscillations in advection schemes can be directlylinked to the evaluation of the j � 1/2 face value be-tween j and j � 1 cells. Four simple second-order linearinterpolation schemes are shown in Fig. 1 to demon-strate this in addition to the first-order upstreamscheme and a quadratic interpolation scheme. The flowis assumed to be nondivergent. For the 1D case thisrequires the velocity to be a constant and it is assumedto be positive in Fig. 1.

The cell notation in Fig. 1 follows Leonard (1991).For each given cell face, j � 1/2 with velocity uj�1/2 forinstance, a central (C) cell is defined as the cell fromwhich the flux cross the face comes (cell j when uj�1/2 �

0), which is also called the donor cell; the downstream(D) cell is the cell that receives the flux (cell j � 1 whenuj�1/2 � 0); and the other cell next to the central cell onthe side opposite the downstream cell is called the up-stream (U) cell (cell j � 1 when uj�1/2 � 0). If thevelocity is negative for the given j � 1/2 face, the j � 1cell becomes the central cell, j the downstream cell, andj � 2 the upstream cell. All subsequent formulationswill be given in this upstream–central–downstream(UCD) notation.

To facilitate extension to irregular grids, the cell co-ordinate x is assumed to be at the cell center and thecell width �x to be positive though the width may varyfor nonuniform grids. So a cell face will be half the cellwidth away from its cell center but may not be at themiddle point between the two bounding cells in irregu-lar grids. The finite difference will be based on the cellcenter coordinate and a gradient notation GAB is de-fined between any two cells A and B as

GAB ��A � �B���xA � xB�, �2�

which is symmetrical in the ordering of the two cells;that is, GAB � GBA.

Note that when the Courant number � u�t/�x isequal to 1, the advection simply moves the whole cen-

FIG. 1. Comparison of six classical advection schemes for interpolation of the MF value ofa step function.

DECEMBER 2008 L I 4711

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 4: Upstream Nonoscillatory Advection Schemes

tral cell content into the downstream cell in one timestep �t. This is exactly what the first-order upstreamscheme does. It is then essential for higher-orderschemes to revert to the first-order upstream schemewhen the Courant number approaches 1. For interpo-lation schemes, this may be achieved by using the in-terpolation value at the midflux (MF) point, which is|u|�t/2 upstream from the cell face or (�x � |u|�t)/2downstream from the donor cell center. The linearlyinterpolated MF value for flux crossing the j � 1/2 faceis then given by

� j�1�2MF � �C

n � 0.5 sgn�uj�1�2���xC � |uj�1�2|�t�GC, �3�

where �nC is the central (or donor) cell value at time

level n relative to the j � 1/2 face velocity uj�1/2, sgn(u)is the sign function (�1 if u � 0, 1 otherwise), and GC

the selected gradient for the central cell. One must becareful not to mix up GC with the gradient betweencells GAB, which has two subscripts. It is obvious thatthe interpolated value will be equal to the central cellvalue when the Courant number approaches unity nomatter what central gradient is used in (3). The updatedcell j value will be given in the conservative flux form as

� jn�1 � � j

n � �uj�1�2� j�1�2MF � uj�1�2� j�1�2

MF ��t��xj. �4�

All four linear interpolation schemes shown in Fig. 1can be interpreted as using the MF values but withdifferent central cell gradients. The first-order up-stream scheme is given by simply setting GC � 0. As thecentral cell j value is zero here, the outward flux fromcell j is simply zero. Because the input flux to cell j fromthe upstream cell j � 1 is also zero by the upstreamscheme, the net increment for cell j is then zero. Thus,the cell j content will be left unchanged by the upstreamscheme in the step function case shown in Fig. 1. This ispart of the reason why the upstream scheme is freefrom oscillation.

For the second-order Lax–Wendroff scheme, theface value is evaluated as the linear interpolation be-tween the central and downstream cells, which isequivalent to using a gradient of GC � GDC in (3). Theinterpolated MF value for the step function in Fig. 1 isobviously nonzero when � 1 as the cell value jumpsfrom 0 in cell j to 1 in cell j � 1. The flux entering cellj from the left cell face j � 1/2 will be zero when usingthe Lax–Wendroff scheme, resulting in a net nonzeroflux out of cell j. This nonzero net flux out of an emptycell j makes the updated cell j value negative and hencestirs up a trailing oscillation for the Lax–Wendroffscheme.

The Fromm (1968) scheme (though derived from adifferent approach) is equivalent to using the centered

gradient of the central cell for interpolation of the MFvalue; that is, GC � GDU. It results in a reduced but stillnonzero MF value for the step function as shown in Fig.1. The left-side flux from cell j � 1 to cell j is also zeroby the Fromm scheme and hence the net flux out of cellj is nonzero again though it is smaller than the Lax–Wendroff one. So the oscillation is alleviated in com-parison to the Lax–Wendroff scheme but not com-pletely eliminated by the Fromm scheme.

Roe (1985) introduced a simple but efficient way ofremoving the oscillation by choosing one gradient ofthe minimum modulus (hence called the minmodscheme) among the two side gradients (GDC and GCU)if the central cell value is between the upstream anddownstream cell values or within the monotonic regiondefined by GDCGCU � 0. Outside the monotonic re-gion, the gradient is simply set to be zero, which isequivalent to using the first-order upstream scheme.Because the side gradient between cell j � 1 and j iszero in the step function case in Fig. 1, the selectedgradient is effectively zero and hence the MF value isequal to the cell j value. So the minmod scheme leads toa net zero flux for cell j and keeps it unchanged in theupdate just as with the upstream scheme.

The minmod scheme can be simplified as it is notnecessary to restrict the minmod gradient within themonotonic region as long as the sign of the local sidegradient GDC is used. The simplified minmod schemeled to the following central cell gradient in the UCDnotation:

UNO2: GC � sgn�GDC� min�|GDC|, |GCU|�. �5�

This simplified second-order scheme will be referred toas the UNO2 scheme. Inserting (5) into (3) yields theMF value of the UNO2 scheme. Noticing that the signof the velocity is canceled with the sign of the griddifference (xD � xC), the product of the local gradientsign with the face velocity sign in (3) becomes a singlesign function of the cell difference (�D � �C). The MFvalue from the UNO2 scheme then reduces to

UNO2: � j�1�2MF � �C

n � 0.5 sgn��Dn � �C

n ���xC

� |uj�1�2|�t� min�|GDC|, |GCU|�. �6�

The optimized UNO2 scheme (6) is the simplest sec-ond-order nonoscillatory scheme as far as the authorknows. The UNO2 scheme differs from the minmodscheme only when the central cell is at a peak [�C �max(�U, �D)] or a dip [�C � min(�U, �D)] point. Aslong as the CFL condition, || � 1, is satisfied, theUNO2 scheme will only smooth back the peak or dippoint for a nondivergent flow and hence will preservethe nonoscillatory property of the minmod scheme.

4712 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 5: Upstream Nonoscillatory Advection Schemes

Van Leer (1977) suggested the harmonic average ofthe two side gradients as the central cell gradient. Theharmonic average becomes zero if any one of the twoside gradients is zero. For the step function case in Fig.1, it becomes zero for the j cell as the upstream sidegradient is zero. So the cell j value is kept unchanged inthe harmonic scheme update just like the upstream andminmod schemes. The harmonic average, however, isonly valid inside the monotonic region. The harmonicscheme reverts to the first-order scheme outside of themonotonic region for this reason. Based on the sameargument for the UNO2 scheme, the harmonic schememay be extended outside the monotonic region by usingthe harmonic average of absolute side gradients and thelocal gradient sign, resulting in the following modifiedabsolute harmonic scheme:

UNO2�: � j�1�2MF � �C

n � sgn��Dn � �C

n �

� ��xC � |uj�1�2|�t�|GDCGCU|�

�|GDC| � |GCU| � ��, �7�

which will be referred to as the UNO2� scheme as it isslightly better than the UNO2 scheme. Note that asmall positive value is added to the denominator inthe absolute harmonic average to avoid zero dividing. Itmay be chosen close to the minimum real value for agiven computer (e.g., � 10�38 on a 32-bit machine or � 10�308 on a 64-bit one) so that it has virtually noeffect on the gradient average.

Using four upstream-biased grid points for each cellupdate, Takacs (1985) derived an advection scheme ofthird-order accuracy in both time and space. It isequivalent to using the UCD cells for each flux evalu-ation. The scheme can be extended to irregular gridsand the equivalent central cell gradient for MF valueinterpolation is given in UCD notation as

GC � GDC ���xD � |uj�1�2|�t�

1.5 sgn�uj�1�2� �GDC � GCU

xD � xU�. �8�

The quadratic interpolation using the UCD cells for thej � 1/2 MF value as shown in Fig. 1 leads to a centralcell gradient similar to the third-order one in (8) exceptthat the numerical denominator 1.5 is replaced by 2.However, the quadratic interpolation scheme is onlysecond-order accurate in time. It is not very difficult toprove that both the third-order and quadratic schemesresult in nonzero fluxes out of cell j for the step functioncase shown in Fig. 1. As long as the Courant number isless than unity, they will generate oscillations as well.

It may be generalized that any interpolation based oncontinuous functions (such as polynomials) will result

in nonzero flux for this step function as shown in Fig. 1and hence may cause oscillations no matter how highthe order of accuracy is attempted. It may be consid-ered to be a physical interpretation of the Godunov(1959) theorem, which states that linear nonoscillatoryadvection schemes can be at most first-order accurate.This explains why all the high-order schemes given byTremback et al. (1987) resulted in oscillations. Otherinterpolation approaches, such as those that underliethe piecewise parabolic method (PPM; Colella andWoodward 1984), the SOM conservation (Prather1986), the second-degree Chebyshev polynomial inter-polation (Holm 1995), and the dual-linear subgrid ap-proximation (Walcek and Aleksic 1998), also result inoscillations and have to resort to flux limiters or fluxcorrection to remove them. It is then necessary for anynonoscillatory scheme to produce a net flux out of cellj to be zero in this step function case in order to keepthe cell j value unchanged. This is achieved in the up-stream, minimod, and harmonic schemes by reducingthe central cell gradient to be zero for j � 1/2 face MFvalue interpolation. Other nonoscillatory schemes, suchas TVD and flux limiters, though based on slightly dif-ferent concepts, all lead to mathematically equivalentlocal bounding schemes (Thuburn 1997) and result in anet zero flux out of cell j in the step function case in Fig.1. The ENO scheme (Harten et al. 1987) is virtually thesame as the minmod scheme for this special case. ThePPM scheme (Colella 1990) reverts to a constant sub-grid function for cell j and hence is equivalent to theupstream scheme in this case. The MAPF (Bott 1992)and MFL (Thuburn 1996) schemes modify the input oroutput flux so that the net flux of cell j is zero in thisstep function case. Proofs of these statements are omit-ted here and interested readers may refer to the origi-nal papers on these advanced schemes.

Leonard (1991) combined the third-order scheme[(8)] with the so-called ULTIMATE flux limitersand resulted in a nonoscillatory scheme called theULTIMATE QUICKEST scheme. One important con-clusion of this scheme is that the third-order scheme isused without any modification within a limited mono-tonic zone, which may be defined on an irregular gridby |GDC – GCU| � 1.2|GDU|. Outside this limited zonebut still within the monotonic region, flux limiters areused to modify the third-order flux value. The schemereverts to the first-order upstream scheme outside ofthe monotonic region as in the minmod and harmonicschemes. One drawback of the ULTIMATE strategy isthat the Courant number is used as a denominator inone of its limiters. As the Courant number may becomezero in multidimensional flow, it may generate an un-

DECEMBER 2008 L I 4713

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 6: Upstream Nonoscillatory Advection Schemes

necessarily large limiter even if a minimal numbermight be added to avoid zero dividing. In addition, fluxlimiters are also more expensive than direct formula-tion as they involve extra conditional checks that do notfavor vectorization. These flux limiters might be

avoided if another method of direct formulation, suchas the UNO2� scheme, is used outside of the limitedmonotonic zone. This leads to the following simplifiedthird-order scheme, which will be referred to as theUNO3� scheme:

UNO3�: GC � �GDC ���xD � |uj�1�2|�t�

1.5 sgn�uj�1�2� �GDC � GCU

xD � xU�, for |GDC � GCU| � 1.2|GDU|

sgn�GDC�2|GDCGCU|��|GDC| � |GCU| � ��, otherwise. �9�

One minor flaw in the UNO3� scheme is that the fluxvalue has a small drop at the switching point from thethird-order scheme to UNO2� scheme. This disconti-

nuity may be reduced if the UNO2 scheme is used andits gradient doubled within the monotonic region, re-sulting in the following improved third-order scheme:

UNO3: GC � �GDC ���xD � |uj�1�2|�t�

1.5 sgn�uj�1�2� �GDC � GCU

xD � xU�, for |GDC � GCU| � 1.2|GDU|

2 sgn�GDC� min�|GDC|, |GCU|�, for GDCGCU � 0

sgn�GDC� min�|GDC|, |GCU|�, otherwise

. �10�

The doubling factor of 2 for the UNO2 scheme insidethe monotonic zone is the maximum value allowed sothat the enhanced UNO2 value does not exceed thethird-order one at the switching point. The switchingfrom the doubled UNO2 gradient to the UNO2 one onthe monotonic edge is continuous as the UNO2 gradi-ent is zero there. Back to the step function case in Fig.1, as the central cell value is on the edge of the mono-tonic region, both the UNO3� and UNO3 schemes ef-fectively produce a zero central cell gradient for the j �1/2 MF value interpolation. So both schemes will keepthe cell j value unchanged in their updates as do othernonoscillatory schemes.

3. Comparison with classical schemes

a. Comparison by normalized variable diagrams

The differences among the UNO schemes from theirclassic counterparts (the minmod, the harmonic, andthe ULTIMATE QUICKEST schemes) can be illus-trated with the normalized variable diagram (NVD) in-troduced by Leonard (1991), which normalizes any cellor interpolated value, �, with the transformation �̃ �(� � �U)/(�D � �U), where the tilde indicates the nor-malized variable. It is obvious that the normalized up-stream and downstream cell values will be constant (0and 1, respectively, except for the trivial case when�U � �D). If a face value is derived from a linear func-tion of the three UCD cell values, the normalized facevalue will depend only on the normalized central cell

value and the local Courant number in a uniform grid.For instance, the normalized face value of the first-order upstream scheme is simply a straight diagonalline in NVD given by �̃Upstream � �̃C. The NVDs for thefour proposed UNO schemes are shown in Fig. 2. Forconvenience of comparison with those NVD plots inLeonard (1991), a constant positive velocity on a uni-form 1D grid is assumed in Fig. 2. Note that the up-stream scheme is represented by the diagonal line ineach of the diagrams and all four UNO schemes degen-erate into the upstream scheme when � 1.

The UNO2 scheme (Fig. 2a) is equivalent to the Lax–Wendroff scheme, �̃Lax-Wendroff � (1 � )/2 � (1 � )�̃C/2,when �̃C 1/2; otherwise, it becomes �̃UNO2 � �̃C �(1 � )| �̃C| /2. The minmod scheme is equal to theUNO2 scheme within the monotonic region (0 � �̃C �1). Outside the monotonic region the minmod schemereverts to the first-order upstream scheme while theUNO2 scheme sticks to its second-order scheme. This isthe major difference between the minmod and theUNO2 schemes.

The UNO2� scheme (Fig. 2b) is equal to the har-monic scheme, �̃Harmonic � �̃C � (1 � || )�̃C(1 � �̃C),within the monotonic region. Outside the monotonic re-gion, the harmonic scheme reverts to the upstreamscheme while the UNO2� becomes the absolute har-monic �̃Abs_Harmo � �̃C � sgn(1 � �̃C)(1 � ||)|�̃C| |1 � �̃C|/(| �̃C| � |1 � �̃C| ).

The UNO3� scheme (Fig. 2c) is equal to the Takacs third-order scheme given by �̃3rd � (1 � )/2 � (1 � )�̃C/2 �

4714 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 7: Upstream Nonoscillatory Advection Schemes

(1 � 2)(1 � 2�̃C)/6 within the limited monotonic zone(0.2 �̃C 0.8). Otherwise, the scheme switches to theUNO2� scheme. The minor discontinuities of theUNO3� scheme at the switching points are revealed inthe NVD.

The switching discontinuity is reduced in the UNO3scheme (Fig. 2d) by using the doubled minmod scheme,�̃2Minmod � �̃C � (1 � ) min(�̃C, 1 � �̃C), in the restof the monotonic region. Outside the monotonic re-gion, UNO3 is equal to the UNO2 scheme. The UNO3scheme differs from the ULTIMATE QUICKESTscheme outside the limited monotonic region. The fluxlimiters of the ULTIMATE QUICKEST scheme out-side the limited monotonic region are replaced bythe doubled minmod scheme for the UNO3 scheme.Outside the monotonic region, the ULTIMATEQUICKEST scheme reverts to the first-order schemewhile the UNO3 scheme uses the UNO2 scheme.NVD plots for those classical schemes are available inLeonard (1991).

b. 1D uniform grid advection

As most of the classical advection schemes are pre-sented in 1D uniform grid formulation, comparisons ofthe UNO schemes with their classical counterparts are

carried out in a 1D uniform grid of 500 cells as shown inFig. 3. The flow is assumed to be of a constant velocityand cyclic boundary conditions are used. The initialprofile consists of a cone and a step pulse as shown bythe thin lines in all the panels in Fig. 3. Because thewavelength of the numerical oscillation is on the orderof 10 cells (Li 2003), flat sections of 100 cells are allo-cated on both sides of those discontinuous points sothat any possible oscillations could be resolved. TheCourant number is set to be 0.625 so a full cycle overthe 500 cells takes exactly 800 steps. All the results inFig. 3 are after four complete cycles or 3200 time steps.

Figure 3a shows the results from the first-order up-stream scheme, which is included here as a referencefor other schemes. After 3200 time steps, both the ini-tial cone and the step pulse (shown by the thin solidline) are changed into smooth cones without any sharppoint (thick line) by the upstream advection scheme.The rms error between the initial and the final profilesover the 500 cell points is 0.1859.

Figures 3b and 3c show the UNO2 and minmod re-sults, respectively. They are almost identical and sharethe same rms error of 0.0842. So the UNO2 extensionof the minmod scheme beyond the monotonic regionhas no visible effect on the final result. This is not sur-prising, as the UNO2 and minmod schemes only differ

FIG. 2. Normalized variable diagrams for the four UNO advection schemes.

DECEMBER 2008 L I 4715

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 8: Upstream Nonoscillatory Advection Schemes

at their peak and dip points. The numerical smoothing,however, effectively rounds off these points, resultingin gradients around these points close to zero. Hence,the two schemes become effectively the same for thesmoothed field but the UNO2 scheme is simpler thanthe minmod because it does not need to compare thegradient signs.

This is also true for the UNO2� extension of theharmonic scheme as shown in Figs. 3d and 3e. The two

schemes share the same rms error of 0.0639. So theUNO2� scheme maintains the same accuracy as theharmonic scheme despite that it has eliminated the gra-dient sign comparison in the harmonic scheme to makethe code friendly to vectorization. Comparing with theUNO2 scheme, the UNO2� scheme replaces the mini-mum function in (6) with two multiplications in (7).Thus, it costs slightly more than the UNO2 scheme. Thesmall increase in cost leads to an enhanced accuracy as

FIG. 3. Comparison of the UNO advection schemes with their classical counterparts inuniform 1D tests.

4716 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 9: Upstream Nonoscillatory Advection Schemes

its rms error (0.0639) is smaller than the UNO2 one(0.0842).

The third-order ULTIMATE QUICKEST result isshown in Fig. 3g, which has the smallest rms error(0.0583) among all the schemes shown in Fig. 3. TheUNO3� and UNO3 schemes are shown in Figs. 3f and3h. The rms errors of these two schemes are 0.0589 and0.0586, respectively, which are slightly larger than thatfor ULTIMATE QUICKEST. Considering the simpli-fication of removing all flux limiters in the UNO3� andUNO3 schemes, this small loss of accuracy is worth-while.

It is obvious that all the schemes shown in Fig. 3 arefree from oscillations. Numerical results confirm thatall cell values remain nonnegative (minimum to be 0 in64-bit double precision) for all of the 3200 time stepswithout using any filter. So the UNO schemes will au-tomatically be positive definite for positive tracer trans-portation.

4. Diffusivity of the UNO schemes

To estimate the implicit numerical diffusivity of theUNO schemes, the following Taylor series expansion isassumed to be valid:

� in�1 � � i

n � �t�t � �xx

�2�x2

2� �xxx

�3�x3

6

� �xxxx

�4�x4

24� � � � , �11�

where � u�t/�x is the Courant number and the ad-vection equation �t � �u�x has been used to convertthe high-order time differentials into space ones, as-suming constant velocity and a uniform grid. The dif-ferentials with respect to time (�t) and space (�x,�xx, . . .) are all assumed at the grid point xi and timelevel n. Similar expansions for the space differenceterms are also assumed:

� i�1n � � i

n � �x�x � �xx

�x2

2� �xxx

�x3

6� �xxxx

�x4

24� � � � ,

� i�1n � � i

n � ��x�x � �xx

�x2

2� �xxx

�x3

6� �xxxx

�x4

24� � � � , and

� i�2n � � i

n � ��x2�x � �xx2�x2 � �xxx

4�x3

3� �xxxx

2�x4

3� � � � . �12�

These Taylor expansions will be substituted into a givenadvection scheme to illustrate its implicit diffusivity.

a. Upstream scheme

For positive constant velocity flow over a uniformgrid, the first-order upstream advection scheme is given by

� in�1 � � i

n � ��� i�1n � � i

n�. �13�

Inserting the Taylor expansions (11) and (12) into (13)and retaining up to second-order terms yields

�t � u�x � �2�xx�x2��t, where �2 ��1 � ���2,

�14�

which is equivalent to the original advection equationplus a second-order space differential term (Dif2),which is analogous to a physical diffusion term with anequivalent diffusivity �2�x2/�t. The dimensionlessnumber �2 is sometimes known as the Fourier number.Noting that 0 � � 1, the Fourier number has a maxi-mum value of �2m � 1/8 at � 1/2. The implicit diffu-

sivity vanishes when � 1 or 0. Its dependence on theCourant number might cause some trouble if a smooth-ing relies on the implicit diffusion, such as the control ofthe garden sprinkler effect by the first-order upstreamscheme in the ocean wave models (Bidlot et al. 1997;Tolman et al. 2002).

The numerical diffusion may be illustrated by sup-pressing the advection term, u�x, in (14). The Dif2 termmay be approximated by the following flux of the i �1/2 cell face:

Fi�1�2D2 �t��x � ��2�� i�1

n � � in�. �15�

The n � 1 time level value of cell i by the Dif2 diffusioncould be estimated as

� in�1 � � i

n � �Fi�1�2D2 � Fi�1�2

D2 ��t��x. �16�

The Dif2 diffusion is simulated on the same 1D uniformgrid as was used in the UNO scheme tests and is illus-trated in Fig. 4a. The Courant number is kept exactlythe same as the UNO scheme tests ( � 0.625) though

DECEMBER 2008 L I 4717

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 10: Upstream Nonoscillatory Advection Schemes

the advection term is suppressed. The Fourier number�2 is then about 0.117. The initial profile is also thesame as those in the previous tests. The resulting profileafter 3200 time steps of Dif2 diffusion is almost identi-cal to that produced by the upstream scheme (cf. Fig.3a), with a rms error that is identical up to four digits(0.1859). This result confirms that the implicit diffusiv-ity of the upstream scheme is equivalent to the Dif2diffusion. In fact, the MPDATA scheme (Smolar-kiewicz 1984) uses exactly the same diffusion flux as(15) but is of the opposite sign (antidiffusion) to com-pensate for the upstream scheme diffusivity.

Physical diffusion or numerical smoothing equivalentto this Dif2 diffusion term would then turn any high-order nonoscillatory advection scheme into one equiva-

lent to the first-order upstream scheme. This can bedemonstrated by adding the Dif2 flux [(15)] to theUNO2 or UNO3 fluxes. Results of the advection-diffusion simulation are shown in Figs. 4b and 4d. Therms error after 3200 time steps for the UNO2 plus Dif2case is 0.1873, slightly larger than for the Dif2 diffusioncase (0.1859). This can be readily explained as theUNO2 scheme has an extra implicit diffusion from itsown scheme. Comparing it with the UNO2 result (Fig.3b; rms � 0.0842), it becomes clear that the extra Dif2term has effectively turned the second-order UNO2scheme into one equivalent to the first-order upstreamscheme. Similarly, the UNO3 plus Dif2 advection dif-fusion produces a very similar profile (Fig. 4d). The rmserror (0.1860) is very close to the Dif2 diffusion one

FIG. 4. Comparison of implicit diffusion derived from the UNO schemes and thecombination of the UNO advection with lower-order diffusion.

4718 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 11: Upstream Nonoscillatory Advection Schemes

(0.1859) but is by no means comparable to the UNO3one (0.0586; see Fig. 3h). So the Dif2 diffusion term hasalso turned the UNO3 scheme into an equivalent first-order one. The difference is trivial whether the UNO2(0.1873) or UNO3 (0.1860) scheme is used as long asthe Dif2 term is present.

b. UNO2 scheme

Diffusivity analysis of the UNO2 scheme is slightlyawkward as it involves a few discontinuous functions.For a constant positive velocity flow over a uniformgrid, the UNO2 scheme reduces to

� in�1 � � i

n � ��� i�1n � � i

n� ���1 � ��

2�Si�1 � Si�, where

Si sgn�� i�1n � � i

n� min�|� i�1n � � i

n|, |� in � � i�1

n |�. �17�

Substituting the Taylor expansions (11) and (12) into(17) and carefully working out the sign and minimum

functions, the UNO2 scheme becomes, up to third-order terms,

�t � u�x � �3�xxx�x3��t, where �3 � ��3� �1 � ���2 � ����6, for �x�xx � 0

��3� ��1 � �2���6, for other cases

, �18�

which is the advection equation plus a third-order spacedifferential term (Dif3). The second-order terms havecanceled out, which confirms that the UNO2 scheme issecond-order accurate in time and space.

The sign change of the �3 parameter with curvatureensures that the Dif3 term will be analogous with theDif2 diffusion term but less diffusive. This differs fromthe second-order Lax and Wendroff (1960) scheme,

which is equivalent to the negative part only in (18)regardless of the curvature. The positive and negative�3 parameters in (18) share the same maximum mag-nitude, �3m � �3/27 at � 1 � 1/�3 for �� and at � 1/�3 for ��, respectively. They also vanish when � 1 or 0. The Dif3 term may be approximated by theface flux as

Fi�1�2D3 �t��x � ��3�� i�2

n � � i�1n � � i

n � � i�1n ��2,

where �3 � ��3� , if �� i�1

n � � in��� i�2

n � � i�1n � � i

n � � i�1n � � 0

��3� , for all other cases

. �19�

The numerical result using (16) but replacing FD2 with(19) is shown in Fig. 4c. It confirms that the Dif3 termdoes bear some similarity to the Dif2 diffusion thoughit causes some small-scale fluctuations. Its rms error(0.0636) after 3200 steps is even smaller than that withthe UNO2 scheme (0.0842; see Fig. 3b). If the Dif3 termis added to the UNO3 scheme, it may degrade the third-order scheme into a second-order one as shown in Fig.4f. The rms error after 3200 time steps (0.0844) is veryclose to that of the UNO2 scheme (0.0842; see Fig. 3b).

c. UNO3 scheme

As the UNO3 scheme is a combination of the third-order scheme [(8)] and the UNO2 scheme, its implicitdiffusivity will be similar to the third-order scheme in-side the limited monotonic region but it degenerates

into the second-order scheme outside this region. For aconstant positive velocity flow over uniform grid thethird-order advection scheme (8) reduces to

� in�1 � � i

n ��

2�� i�1

n � � i�1n � �

�2

2�� i�1

n � � i�1n � 2� i

n�

���1 � �2�

6�� i�1

n � 3� in � 3� i�1

n � � i�2n �.

�20�

Inserting the Taylor expansions (11) and (12) and re-taining up to the fourth-order terms, we have

�t � u�x � ��4�xxxx�x4��t, where

�4 �1 � �2��2 � ����24, �21�

DECEMBER 2008 L I 4719

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 12: Upstream Nonoscillatory Advection Schemes

which is equivalent to the advection equation plus afourth-order space differential term (Dif4). This ex-pression is also known as the biharmonic diffusionterm. The second- and third-order terms have vanishedas expected because the scheme is derived with theserestraints. The maximum value of �4 is �4m � 3/128 at � 1/2. The biharmonic diffusion is less diffusive thanare the Dif2 and Dif3 terms. An equivalent flux on thei � 1/2 cell face for the biharmonic diffusion may beapproximated as

Fi�1�2D4 �t��x � �4�� i�2

n � 3� i�1n � 3� i

n � � i�1n �. �22�

The biharmonic diffusion may be simulated with (16)but by replacing FD2 with (22), and the result is shownin Fig. 4e, which is very similar to the advection resultusing the third-order advection scheme (8) alone. Simi-lar to the third-order scheme, the biharmonic diffusiondoes not preserve monotonicity as the overshootsaround the step points indicate. Xue (2000) used fluxlimiters to remove the overshoots for the biharmonicdiffusion. The UNO3 scheme switches from the third-order scheme to UNO2 schemes near the step points toremain monotonic. So the implicit diffusion of theUNO3 scheme is a combination of the Dif4 and Dif3terms and hence should be slightly larger than the Dif4biharmonic diffusion.

Averaging over a space grid is a widely used tech-nique in numerical models for smoothing out unwantedsmall features, such as in the mesoscale atmosphericmodel (Li and Atkinson 2000). It is, however, also ef-fective at degrading high-order advection schemes. Forinstance, a simple three-point weighted average,

� in�1 � �� i�1

n � 2� in � � i�1

n ��4, �23�

is equivalent to a diffusion equation with a Fouriernumber equal to 1/4:

�t � �Av�xx�x2��t, where �Av 1�4. �24�

Noticing that the maximum value of �2 is only 1/8, thesimple space average [(23)] is at least 2 times as diffu-sive as the Dif2 term. So a second-order nonoscillatoryadvection scheme would be enough for any numericalmodel using such an average on advected quantities.

As a general guideline, if the physical diffusion ornumerical smoothing in a model is close to Dif2 or �2m,it would be unnecessary to implement an advectionscheme of order higher than the second order as long asit is nonoscillatory. The third-order nonoscillatoryscheme would be enough if the explicit diffusivity isequivalent to the Dif3 term or �3m. Advection of anorder higher than third will be required only if the

physical diffusion is smaller than the biharmonic diffu-sion Dif4 or �4m.

5. 1D irregular grid tests

The diffusivity analysis has revealed that the implicitdiffusivities of the UNO schemes depend on the gridlength, time step, and the Courant number . All the �parameters (�2, �3, and �4) vanish when � 0 or 1 andtheir maximum values are located at � 1/2 or nearby.So a moderate value will be more suitable for illus-trating the implicit diffusivity than would be a Courantnumber either very small or close to 1. The 0.625 valueused in the 1D test has taken this into consideration. Anonuniform grid is used to show the grid length effectand to test the irregular grid formulation of the UNOschemes. The previous uniform 1D grid is modified bymerging two cells into one (or doubling the grid length)for all 500 cells except the central 100 cells. So the totalnumber of cells is reduced from 500 to 300 though thedomain size is unchanged. The time step and flow speedare kept unchanged so the Courant number remains at0.625 for the central 100 cells but is halved (0.3125) forthe remaining 200 cells as their grid length is doubled.The two Courant numbers (0.3125 and 0.625) straddleacross the �2 and �4 peak point ( � 1/2) and are closeto the �3 peak points (� � 0.423 and � � 0.577),respectively. One full cycle over these 300 nonuniformcells will still take exactly 800 time steps, as is the casefor over the 500 uniform cells.

Figure 5 shows the nonuniform grid results for theupstream, UNO2, and UNO3 schemes at the start(number of time steps nts � 0, thin solid), and after1 cycle (nts � 800, dotted line), 4 cycles (nts � 3200,thick solid), and 16 cycles (nts � 12 800, dash–dot). Theticks on the horizontal axis indicate cell center positionsof every 10th cells. The initial profile as shown by thethin solid line in Fig. 5 has been modified to add a dippoint (at �50) for test of the UNO schemes outside themonotonic region. The new profile consists of one ex-tended step pulse (from �150 to 150) with a sine-shaped slope in the central part (from �50 to 50). Thesine slope is connected by two linear slopes with thestep pulse at its two ends, resulting in a dip at �50 anda peak at 50. The results in Fig. 5 clearly reveal that theUNO schemes smooth back the peak and dip pointsjust as does the first-order upstream scheme except thatthe smoothing by the UNO schemes is less diffusive.

The grid-length effect can be revealed by comparingthe nonuniform results in Fig. 5 with the uniform gridones in Fig. 3. Although the initial profiles are differentfor these two grids, the step functions are of the samelength scale. Just comparing the gradients of the thick

4720 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 13: Upstream Nonoscillatory Advection Schemes

solid lines (after four cycles of 3200 time steps) at theinitial step drop point (150) will illustrate the differ-ences. The slopes in the uniform grid (Figs. 3a, 3b, and3h) are obviously steeper than the corresponding onesin the nonuniform grid (Figs. 5a–c). So doubling thegrid length increases the implicit diffusivity. In fact, theDif2 diffusivity is proportional to the square of the gridlength. The Dif3 and Dif4 terms are proportional toeven higher powers (third and fourth) of �x.

The temporal effect manifests itself through thechanging profiles with time. The implicit diffusion de-creases with time as the smoothness of the profile in-

creases. This can be explained by the nature of theDif2–Dif4 terms as they are proportional to high-orderspace gradients. Because the implicit diffusion of theupstream scheme (Dif2) is proportional to the second-order space difference, it will remain nonzero until theprofile becomes a flat constant. This is illustrated in Fig.5a where the upstream scheme has smoothed out allfeatures of the initial profile after 12 800 time steps,leaving a nearly flat single bump. Implicit diffusions bythe UNO2 and UNO3 schemes are less diffusive thanby the upstream one because they are proportional tothe third- and fourth-order space differences, respec-

FIG. 5. Comparison of the UNO schemes on a nonuniform grid. Each panel shows theinitial profile and results after 1, 4, and 16 cycles or 800, 3200, and 12 800 time steps.

DECEMBER 2008 L I 4721

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 14: Upstream Nonoscillatory Advection Schemes

tively. As shown in Fig. 5b, the UNO2 scheme managedto keep the essential features of the initial profile (twobumps) though the flat parts of the step pulse were lostafter a few cycles. The UNO3 scheme preserved all thefeatures of the initial profile except that the discontinu-ous points have been smoothed out as shown in Fig. 5c.The profile after 16 cycles (rms � 0.0901) has very smalldifferences from the one after one cycles (rms �0.0616) and the differences are concentrated aroundthe initial discontinuous points.

The reduction of the implicit diffusion with time issometimes known as self-limiting. Allen et al. (1991)mentioned this self-limiting diffusion in the van Leerharmonic scheme and used a cyclic triangle advectionto illustrate it. An intercycle rms error may be usedhere to quantify the implicit diffusion of the UNOschemes. The intercycle rms error represents thechange of the advected profile over one full cycle, thatis, the rms error between the profiles at the start andend of a given cycle.

Figure 6 shows the intercycle rms errors for the threeschemes in the nonuniform grid test. Each cycle has 800time steps, and a total of 16 cycles (12 800 steps) areshown. The intercycle rms errors are normalized by thefirst-cycle error of the upstream scheme. After onecycle, the rms error for the UNO2 scheme is about 44%of the upstream scheme one. The UNO3 error is about32%. The intercycle rms error drops quickly in the sec-ond cycle, indicating that most of the smoothing hasbeen done in the first cycle especially for the UNO2and UNO3 schemes. The upstream scheme rms error,however, has a relatively slow fall in comparison withthe other two schemes. The rms error over the final16th cycle is about 5.6% for the upstream scheme and

3.5% and 0.7% for the UNO2 and UNO3 schemes,respectively.

Based on this result, it could be envisaged that thereduction of implicit diffusivity by advection schemes ofaccuracy higher than the third order will be rather lim-ited and deemed to be within the small gap below theUNO3 intercycle rms curve shown in Fig. 6. In addition,the improvement by high-order advection schemes willtarget primarily discontinuous points in the transportedfield and have little effect on the continuous variables.

6. 2D extension

Extending the 1D UNO schemes to 2D is straight-forward by applying the 1D scheme simultaneously toeach of the two dimensions before updating the nexttime level values. However, this direct or simultaneousimplementation may lead to a reduced stability condi-tion, || � |� | � 1.0, where � � ��t/�y is the Courantnumber and � is the velocity component for the y di-mension. If the 1D scheme is applied in sequence or bya time-splitting approach, the stability condition may berelaxed to each component one, max(||, |� |) � 1.0. Butit results in the so-called time-splitting error, whichtypically distorts a constant background into a noncon-stant field in deforming flow. Leonard et al. (1996) con-structed a multidimensional advective-conservative hy-brid operator (MACHO) to extend a 1D advectionscheme to 2D with preserved constancy. The operatoris similar to the time-splitting approach except that theMF value for the second dimension �*MF is calculatedwith a temporary advective-form update of the first-dimensional �* using the cell center velocity:

�*i, j � � i, jn � �� i�1�2, j

MF � � i�1�2, jMF ��ui�1�2, j � ui�1�2, j��t�2�xi.

�25�

This temporary update (25) ensures a constant fieldremains constant so that the MF values for both dimen-sions are interpolated from the same constant field. Thefinal update of the cell (i, j) value still uses the conser-vative-form for both dimensions:

� i, jn�1 � � i, j

n � �ui�1�2, j� i�1�2,jMF � ui�1�2, j� i�1�2, j

MF ��t��xi

� � i, j�1�2�*i, j�1�2MF � i, j�1�2�*i, j�1�2

MF ��t��yj,

�26�

which will remain constant for a constant field as longas the nondivergence condition is satisfied for each cellvolume; that is,

�ui�1�2, j � ui�1�2, j���xi � � i, j�1�2 � i, j�1�2���yj � 0.

�27�

FIG. 6. Intercycle rms errors for the UNO schemes over 16cycles at 800 time steps per cycle.

4722 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 15: Upstream Nonoscillatory Advection Schemes

Because the operator is asymmetrical, the dimensionsare alternated in sequence between time steps; that is,for the next time step, the second-dimensional MFvalues are calculated first and their advective-formupdates are used for the interpolation of the first-dimensional MF values. The stability condition for theMACHO update (26) remains the component one; thatis, max(||, |�|) � 1.0. The UNO schemes will be ex-tended to 2D using the MACHO approach.

The UNO schemes extended with the MACHOscheme are consistent; that is, they converge into thecontinuous advection Eq. (1) when �x and �t approachzero. Proof of the consistency is straightforward as allfour UNO schemes are based on cell gradients. Theyare also conservative due to their final conservative for-mulation (26). Apart from the above constancy, consis-tency, conservation, and stability requirements, Lin andRood (1996) introduced linear correlation conditionsfor advection schemes to preserve the constituent cor-relation in the transported field. It can be proved thatall four UNO schemes satisfy the correlation require-ments.

7. 2D multiple-cell grid tests

Two classical 2D numerical tests for advectionschemes are applied to the UNO schemes. The first oneis the solid rotation and the other is the Smolarkiewicz(1982) deformation test. These tests are carried out ona 2D multiple-cell grid (Li 2003) as shown in Fig. 7. Thecentral test bed is a square area consisting of 104 � 104size-1 (�x � �y) cells. Eight layers of size-2 (2�x �2�y) cells are laid around the central area and fartheraway are four layers of size-4 (4�x � 4�y) cells. Allcells are square (�x � �y) to meet the nondivergentrequirement of the deformation flow. Square cells arenot necessary for the solid rotation flow. The multiple-cell grid is different from the conventional 2D grid forits arbitrary cell arrangement. To demonstrate this flex-ibility, cells on the four corners have been removed ifthey are 88 basic cell lengths away from the model cen-ter. These redundant corner cells would not have mucheffect on the central test area in either the rotation orthe deformation tests if they were included. The re-maining cells are arranged in an arbitrary sequence in apreset cell array, which contains the cell position andsize information and is used for cell-related calcula-tions. The numbers inside the size-4 cells in Fig. 7 in-dicate the sequence numbers of the 344 size-4 cells usedin these tests. Cell faces are grouped by their normalvelocity components, and two (u and �) face arrays areused to store the face position, size, and its UCD cellnumbers for each face. These face arrays are used for

the calculation of MF values or fluxes crossing the cellfaces. Each boundary cell face is assumed to bebounded by two boundary cells of the same size as theface on the outside. This allows for all cell faces to betreated in the same way no matter whether they areinner faces or boundary faces. Boundary conditions canbe applied by modifying these boundary cell values. Forthe two tests here, the boundary cells are assumed to beconstantly empty; that is, no flux comes into the modeldomain and outward flux crossing the boundary faceswill disappear immediately. The multiple-cell grid issimilar to the adaptive mesh refinement (Berger andOliger 1984) except that the different resolution partsare preset and remain unchanged during the tests. Itmay be converted into the spherical reduced grid(Rasch 1994) by doubling only the longitude dimensionat high latitudes.

a. Solid rotation test

The 2D solid rotation velocity field is specified by

u�x, y� � ��y and �x, y� � �x. �28�

The angular velocity is set to be � � 2�/480�t so that afull rotation around the model center (x � 0, y � 0)takes exactly 480 time steps. The maximum Courantnumber on the edge of the central size-1 area (x ��52�x or y � �52�y) is 104�/480 � 0.681. Note thatthe Courant number is halved when the grid length isdoubled so that the Courant number outside the centralsize-1 area will be less than the central edge value(0.681). This is one of the advantages of using the mul-tiple-cell grid.

A Gaussian cone (five units high at peak) is initiallyplaced in the lower-left quarter of the central areaabove a uniform nonzero (one unit high) background asshown in the top panel of Fig. 8. Note that the multiple-cell field has been converted into a uniform square do-main of size-1 cell resolution for the mesh plot. Eachsize-2 cell is presented by 4 equal size-1 grids and eachsize-4 cell by 16 equal size-1 grids in the mesh plot. Theremoved corner parts are set to be zero. The differentcell sizes around the boundary are revealed by the dif-ferences between the one-unit-high uniform back-ground and the zero outside points. A perfect advectionscheme would restore the original cone after one com-plete rotation. The difference between the initial andthe rotated cone reveals how close the advectionscheme is to a perfect one.

The bottom panel in Fig. 8 shows the results of theUNO3 scheme after one full rotation or 480 steps. Thedifferent cell sizes are now indicated by the steps lead-

DECEMBER 2008 L I 4723

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 16: Upstream Nonoscillatory Advection Schemes

ing to the boundary. The uniform background in thecentral area remains uniform without any ripples evenin the cell-size-changing region, implying that the ir-regular grid formulation of the UNO3 scheme worksfine in the multiple-cell grid. Because fluxes out of theboundary faces are lost, the uniform background nearthe boundary was transformed into a smooth slopewithout any oscillation. The rotated cone preserved itsinitial shape quite well with its height reduced by aboutone unit out of five in 480 time steps.

For comparison purposes, the rotation results by theupstream and UNO2 schemes are shown in Fig. 9. Thediffusive upstream scheme (top panel in Fig. 9) reduced

the initial five-unit-high cone to a flat bump of a heightof less than 1 unit in 480 time steps. The leaks from theboundary faces are also quicker than those from theUNO3 scheme, resulting in a gentle slope extended intothe central size-1 area. The UNO2 scheme (bottompanel in Fig. 9) scored a mark between those of theUNO3 and the upstream schemes as expected. It man-aged to keep over half of the initial cone height (2.68out of 5 units) after one rotation and maintained thecentral background uniform. Performances of theUNO2� and the UNO3� schemes are between theUNO2 and UNO3 schemes as their names indicate buttheir results are not shown here.

FIG. 7. The 2D multiple-cell grid used for testing of the UNO schemes.

4724 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 17: Upstream Nonoscillatory Advection Schemes

b. Deformation test

Smolarkiewicz (1982) introduced a deformation flowto test advection schemes and this deformation test wasadopted by other authors (e.g., Bott 1993; Leonard etal. 1996). The 2D velocity field of this deformation flowis given by

u�x, y� � u0 sin�kx� sin�ky� and

�x, y� � u0 cos�kx� cos�ky�, �29�

where u0 is the wind speed on vortex edges and k ��/26�x is a constant wavenumber. The vortex size isslightly modified from the original one (Smolarkiewicz1982) so that all vortex edges fall on cell faces (exactly26 � 26 size-1 cells in each vortex) except in the size-4cell area. The wind field is nondivergent for each cell as

long as the cell is square. The multiple-cell grid is set tobe square for this purpose. The time step and u0 arechosen so that the maximum Courant number, u0�t/�x,is of the same value, 0.7, as used by other authors (e.g.,Smolarkiewicz 1982; Bott 1993). Staniforth et al. (1987)presented an exact solution of this deformation flow,which is characterized by two regimes: short time peri-ods when t is about the order of T � 2�/ku0 (or about75 time steps in this configuration) and long time peri-ods when t k T. In the first regime, numerical solutionsusing finite-difference schemes may be compared withthe exact solution in a quantitative manner. In the sec-ond regime, however, the exact solution has too muchshort-scale information that is beyond the practicalresolution of any finite-difference method. Numericalsolutions should be evaluated, in the latter regime, on

FIG. 8. Solid rotation test of the UNO3 scheme. (top) The initial Gaussian cone and theuniform background over the full multiple-cell grid. (bottom) The result by the UNO3 schemeafter one rotation or 480 time steps.

DECEMBER 2008 L I 4725

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 18: Upstream Nonoscillatory Advection Schemes

the basis of stability and a qualitative similarity with anappropriate averaging of the exact solution, whoseshape resembles an egg cup over each of the two centralvortices and has the strongest gradients at vortexboundaries, where the solution becomes almost verti-cal. A few classical schemes [e.g., the second-orderLax–Wendroff scheme and the third-order Gadd (1978)scheme] passed the first regime without much problembut failed to produce the egg-cup shaped average fieldin the second regime.

Figure 10 illustrates the results from the UNO3scheme in the two regimes. Figure 10a shows the initialcone used for the test (nts � 0). As the boundary con-dition does not affect the two central vertices spannedby the initial cone, only the central size-1 area is illus-trated here. The cone has a base radius of 15 size-1 cells

and height of 3.88 units and rests on a nonzero uniformbackground of 1 unit. Other panels in Fig. 10 show thesubsequent time steps of 38, 76, and 608, correspondingto roughly 1/2, 1, and 8 times T, respectively. The nts �38 and 76 results may be considered to be in the firstregime, which are comparable with the exact solution inFigs. 3b and 3d in Staniforth et al. (1987). These resultsare also comparable to those of more complicated ad-vection schemes, such as the MAPF scheme (Bott 1993,his Figs. 1b and 1d) and the high-order schemes(Leonard et al. 1996; their Figs. 9 and 10).

Figure 10d for nts � 608 illustrates the numericalsolution in the second regime, which shows the aver-aged features of the exact solution: two egg-cup-shapedcentral vortices and strong gradients at the vortexboundaries. Other 10 vertices around the two central

FIG. 9. Solid rotation results of the (top) upstream and (bottom) UNO2 schemes after onerotation or 480 time steps. Initial conditions are the same as shown in Fig. 8.

4726 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 19: Upstream Nonoscillatory Advection Schemes

vertices are fully contained within the central size-1area and maintain quite well the constancy of the uni-form background. Outside vertices are subject to theboundary conditions and the initial uniform back-ground is eroded by the boundary leak as shown by thefour partial vertices in the lower and upper parts of Fig.10d, respectively. The agreement of the UNO3 resultswith the exact solution is very satisfactory. The otherthree UNO schemes produce very similar deformationresults (not shown here) except that the final egg-cupdips are shallower than the UNO3 ones due to the in-creased numerical diffusion of these schemes.

8. Summary and conclusions

Four simple upstream nonoscillatory advectionschemes (UNO2, UNO2�, UNO3�, and UNO3) are

derived by modifying existing classical advectionschemes, including the minmod (Roe 1985), the har-monic (van Leer 1977), the third-order (Takacs 1985),and the ULTIMATE QUICKEST (Leonard 1991)schemes. The UNO schemes are presented in irregulargrid midflux interpolation form with symmetricalgradients and extended to multidimensions by theMACHO (Leonard et al. 1996) operator. Conditionalchecks are minimized to favor vectorization and lead tothe simplest second-order nonoscillatory advectionscheme among the existing schemes. A uniform grid 1Dtest is used to compare these UNO schemes with theirclassical counterparts and a nonuniform grid is used totest their irregular grid formulations. The implicit dif-fusivities of these UNO schemes are derived for com-parison with physical diffusion or numerical smoothing

FIG. 10. Deformation test of the UNO3 scheme. (a) The initial cone and the uniform background in the cen-tral size-1 cell area of the multiple-cell grid. Other panels show the results after 38, 76, and 608 time steps,respectively.

DECEMBER 2008 L I 4727

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 20: Upstream Nonoscillatory Advection Schemes

terms. This comparison may be used as a guideline forthe selection of advection schemes on a proper order ofaccuracy. Classical 2D solid rotation and deformationtests on a multiple-cell grid are also applied on theseschemes and the results are satisfactory. The UNOschemes are consistent, conservative, shape preserving,and free from numerical oscillations. They also pre-serve the constituent correlation of transported vari-ables. The UNO2 scheme may be accurate enough foradvection when explicit diffusion is larger than the nu-merical diffusion of the UNO2 scheme, such as thetracer advection in the atmospheric boundary layer.The simplicity and reliability of the UNO2 scheme willbe valuable for environmental models when many spe-cies have to be simulated. It may also be used in oceanwave spectral models where moderate smoothing is re-quired to reduce the garden sprinkler effect. The third-order UNO3 scheme has very small self-constraineddiffusion and may be used for less diffusive advectionprocesses, like tracer transportation in the deep ocean.

Acknowledgments. The author is grateful to Dr. Ni-gel Wood (Met Office) for his constructive commentson this work and to the two anonymous reviewers fortheir useful suggestions to improve the manuscript.

REFERENCES

Allen, D. J., A. R. Douglass, R. B. Rood, and P. D. Guthrie, 1991:Application of a monotonic upstream-biased transportscheme to three-dimensional constituent transport calcula-tions. Mon. Wea. Rev., 119, 2456–2464.

Berger, M., and J. Oliger, 1984: Adaptive mesh refinement forhyperbolic partial differential equations. J. Comput. Phys.,53, 484–512.

Bidlot, J.-R., P. Janssen, B. Hansen, and H. Gunther, 1997: Amodified set up of the advection scheme in the ECMWFwave model. ECMWF Tech. Memo. 237, Reading, UnitedKingdom, 31 pp.

Book, D. L., J. P. Boris, and K. Hain, 1975: Flux corrected trans-port. II: Generalizations of the method. J. Comput. Phys., 18,248–283.

Boris, J. P., and D. L. Book, 1973: Flux corrected transport I:SHASTA, a fluid transport algorithm that works. J. Comput.Phys., 11, 38–69.

Bott, A., 1992: Monotone flux limitation in the area-preservingflux-form advection algorithm. Mon. Wea. Rev., 120, 2592–2602.

——, 1993: The monotone area-preserving flux-form advectionalgorithm: Reducing the time-splitting error in two-dimen-sional fields. Mon. Wea. Rev., 121, 2637–2641.

Colella, P., 1990: Multidimensional upwind methods for hyper-bolic conservation laws. J. Comput. Phys., 87, 171–200.

——, and P. R. Woodward, 1984: The piecewise parabolic method(PPM) for gas-dynamical simulations. J. Comput. Phys., 54,174–201.

Crowley, W. P., 1968: Numerical advection experiments. Mon.Wea. Rev., 96, 1–11.

Davies, T., M. J. P. Cullen, A. J. Malcolm, M. H. Mawson, A.Staniforth, A. A. White, and N. Wood, 2005: A new dynami-cal core for the Met Office’s global and regional modelling ofthe atmosphere. Quart. J. Roy. Meteor. Soc., 131, 1759–1782.

Fromm, J. E., 1968: A method for reducing dispersion in convec-tive difference schemes. J. Comput. Phys., 3, 176–189.

Gadd, A. J., 1978: A numerical advection scheme with small phasespeed errors. Quart. J. Roy. Meteor. Soc., 104, 583–594.

Godunov, S. K., 1959: Finite-difference methods for the numericalcomputations of equations of gas dynamics. Math. Sb., 47,271–290.

Harten, A., 1983: High resolution schemes for hyperbolic conser-vation laws. J. Comput. Phys., 49, 357–393.

——, B. Engquist, S. Osher, and S. Chakravarthy, 1987: Uni-formly high order essentially non-oscillatory schemes, III. J.Comput. Phys., 71, 231–303.

Hofmann, M., and M. A. M. Maqueda, 2006: Performance of asecond-order moments advection scheme in an ocean generalcirculation model. J. Geophys. Res., 111, C05006, doi:10.1029/2005JC003279.

Holm, E. V., 1995: A fully two-dimensional, non-oscillatory ad-vection scheme for momentum and scalar transport equa-tions. Mon. Wea. Rev., 123, 536–552.

Hourdin, F., and A. Armengaud, 1999: The use of finite-volumemethods for atmospheric advection of trace species. Part I:Test of various formulations in a general circulation model.Mon. Wea. Rev., 127, 822–837.

Iselin, J. P., J. M. Prusa, and W. J. Gutowski, 2002: Dynamic gridadaptation using the MPDATA scheme. Mon. Wea. Rev.,130, 1026–1039.

Jiang, G. S., and C. W. Shu, 1996: Efficient implementation ofweighted ENO schemes. J. Comput. Phys., 126, 202–228.

Knievel, J. C., G. H. Bryan, and J. P. Hacker, 2007: Explicit nu-merical diffusion in the WRF model. Mon. Wea. Rev., 135,3808–3824.

Lax, P. D., and B. Wendroff, 1960: Systems of conservation laws.Comm. Pure Appl. Math., 13, 217–237.

Leonard, B. P., 1979: A stable and accurate conservative model-ling procedure based on quadratic upstream interpolation.Comput. Methods Appl. Mech. Eng., 19, 59–98.

——, 1991: The ULTIMATE conservative difference scheme ap-plied to unsteady one-dimensional advection. Comput. Meth-ods Appl. Mech. Eng., 88, 17–74.

——, A. P. Lock, and M. K. MacVean, 1996: Conservative explicitunrestricted-time-step multidimensional constancy-preserv-ing advection schemes. Mon. Wea. Rev., 124, 2588–2606.

Li, J. G., 2003: A multiple-cell flat-level model for atmospherictracer dispersion over complex terrain. Bound.-Layer Me-teor., 107, 289–322.

——, and B. W. Atkinson, 2000: An inert tracer dispersionscheme for use in a mesoscale atmospheric model. Atmos.Environ., 34, 4011–4018.

Lin, S.-J., and R. B. Rood, 1996: Multidimensional flux-formsemi-Lagrangian transport schemes. Mon. Wea. Rev., 124,2046–2070.

Liu, X.-D., S. Osher, and T. Chan, 1994: Weighted essentiallynon-oscillatory schemes. J. Comput. Phys., 115, 200–212.

Margolin, L. G., and W. J. Rider, 2002: A rationale for implicitturbulence modelling. Int. J. Numer. Methods Fluids, 39, 821–841.

Prather, M. J., 1986: Numerical advection by conservation of sec-ond-order moments. J. Geophys. Res., 91, 6671–6681.

Rasch, P. J., 1994: Conservative shape-preserving two-dimen-

4728 M O N T H L Y W E A T H E R R E V I E W VOLUME 136

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC

Page 21: Upstream Nonoscillatory Advection Schemes

sional transport on a spherical reduced grid. Mon. Wea. Rev.,122, 1337–1350.

Roe, P. L., 1981: Approximate Riemann solvers, parameter vec-tors and difference schemes. J. Comput. Phys., 43, 357–372.

——, 1985: Some contributions to the modelling of discontinuousflows. Lect. Appl. Math., 22, 163–193.

Schroeder, G., K. H. Schlunzen, and F. Schimmel, 2006: Use of(weighted) essentially non-oscillatory advection schemes in amesoscale model. Quart. J. Roy. Meteor. Soc., 132, 1509–1526.

Shchepetkin, A. F., and J. C. McWilliams, 1998: Quasi-monotoneadvection schemes based on explicit locally adaptive dissipa-tion. Mon. Wea. Rev., 126, 1541–1580.

Smolarkiewicz, P. K., 1982: The multi-dimensional advectionscheme. Mon. Wea. Rev., 110, 1968–1983.

——, 1984: A fully multidimensional positive definite advectiontransport algorithm with small implicit diffusion. J. Comput.Phys., 54, 325–362.

——, and W. W. Grabowski, 1990: The multidimensional positivedefinite advection transport algorithm: Monoscillatory op-tion. J. Comput. Phys., 86, 355–375.

Staniforth, A., J. Cote, and J. Pudykiewicz, 1987: Comments on“Smolarkiewicz’s deformation flow.” Mon. Wea. Rev., 115,894–900.

Sweby, P. K., 1984: High resolution schemes using flux limiters forhyperbolic conservation laws. SIAM J. Numer. Anal., 21,995–1011.

Takacs, L. L., 1985: A two-step scheme for the advection equationwith minimized dissipation and dispersion errors. Mon. Wea.Rev., 113, 1050–1065.

Thuburn, J., 1996: Multidimensional flux-limited advectionschemes. J. Comput. Phys., 123, 74–83.

——, 1997: TVD schemes, positive schemes, and the universallimiter. Mon. Wea. Rev., 125, 1990–1993.

Tolman, H. L., B. Balasubramaniyan, L. D. Burroughs, D. V.Chalikov, Y. Y. Chao, H. S. Chen, and V. M. Gerald, 2002:Development and implementation of wind-generated oceansurface wave models at NCEP. Wea. Forecasting, 17, 311–333.

Tremback, C. J., J. Powell, W. R. Cotton, and R. A. Pielke, 1987:The forward-in-time upstream advection scheme: Extensionto higher orders. Mon. Wea. Rev., 115, 540–555.

van Leer, B., 1974: Towards the ultimate conservative differenceschemes. II: Monotonicity and conservation combined in a2nd-order scheme. J. Comput. Phys., 14, 361–370.

——, 1977: Towards the ultimate conservative differenceschemes. IV: A new approach to numerical convection. J.Comput. Phys., 23, 276–299.

——, 1979: Towards the ultimate conservative differenceschemes. V: A second order sequel to Godanov’s method. J.Comput. Phys., 32, 101–136.

Walcek, C. J., and N. M. Aleksic, 1998: A simple but accuratemass conservative, peak-preserving, mixing ratio boundedadvection algorithm with FORTRAN code. Atmos. Environ.,32, 3863–3880.

WAMDI Group, 1988: The WAM model—A third-generationocean wave prediction model. J. Phys. Oceanogr., 18, 1775–1810.

Xue, M., 2000: High-order monotonic numerical diffusion andsmoothing. Mon. Wea. Rev., 128, 2853–2864.

Zalesak, S. T., 1979: Full multidimensional flux-corrected trans-port algorithms for fluids. J. Comput. Phys., 31, 335–362.

Zerroukat, M., N. Wood, and A. Staniforth, 2005: A monotonicand positive-definite filter for a semi-Lagrangian inherentlyconserving and efficient (SLICE) scheme. Quart. J. Roy. Me-teor. Soc., 131, 2923–2936.

DECEMBER 2008 L I 4729

Unauthenticated | Downloaded 05/06/22 03:53 AM UTC