erf-model/ERF

Implementation of terrain grid with STF smoothing

Closed this issue · 5 comments

Real z_H = 2.44/(1-gamma_m);
Real A;
Real foo = cos((PI/2)*(zz/z_H));
if(zz < z_H) { A = foo*foo*foo*foo*foo*foo; } // A controls rate of return to atm
else { A = 0; }

Appears to follow Eqns 11 and 9 from Klemp 2011 (https://journals.ametsoc.org/view/journals/mwre/139/7/mwr-d-10-05046.1.xml), respectively. However, line 205 is missing any dependence on the actual terrain, i.e., the maximum terrain height (max_h).

@ewquon I agree with your findings and will test this modification on the WOA problem to verify it generates an appropriate grid.

Original code (left) compared to the suggested modification (right). Not a large change in the constructed grid but the code will be modified for consistency with the reference source.
image

I imagined you'd see a larger difference if you, say, doubled the height of the hill.

See PR 1377 where correction was made.

ewquon commented

Fixed in #1807, including divide by 0 handling (encountered when STF smoothing is applied with flat terrain)