Fix 1d advection testing program, broken with hybrid vert coord#1247
Merged
kkeene44 merged 2 commits intowrf-model:release-v4.2.1from Jul 10, 2020
Merged
Fix 1d advection testing program, broken with hybrid vert coord#1247kkeene44 merged 2 commits intowrf-model:release-v4.2.1from
kkeene44 merged 2 commits intowrf-model:release-v4.2.1from
Conversation
1. Original had `cpp -traditional`. This is supposed to be `cpp -traditional-cpp`. 2. Original had `cpp -C -P`. The `-C` flag puts the the GNU comments in the code: ``` /* Copyright (C) 1991-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ ``` Which is OK if you are writing in C.
With the introduction of the hybrid coordinate, two additional 1d arrays need to be passed in as args to the advection drivers. c1 = d(B)/d(eta) c2 = (1-c1)*(p00-ptop) For this simplified test, c1=1 and c2=0. Also, an oops was fixed in the title for the WENO PD for gnuplot. modified: module_advect_em.F
Contributor
Author
|
@weiwangncar @dudhia @kkeene44 @smileMchen I'd like someone to give it a cursory review. |
Collaborator
|
Looks reasonable to me. |
Contributor
Author
|
@kkeene44 |
kkeene44
approved these changes
Jul 10, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TYPE: bug fix
KEYWORDS: advection, program, 1d
SOURCE: internal
DESCRIPTION OF CHANGES:
There were two types of problems. First the original cpp commands were broken. The cpp command was commented out,
but it is used to build the source code, with cut and paste). The second problem is caused by the modification of the
advection interface with the release of v4.0.
First Problem and Solution:
Original suggested using
cpp -traditional. This is an incorrect cpp option. The flag is supposed to becpp -traditional-cpp.Original suggested using
cpp -C -P. The-Cflag puts these GNU comments in the code (which is OK if youare writing in the C language).
Second Problem:
The existing advection testing program had not been updated to assume the existence of the hybrid vertical coordinate.
That meant a few variables in the calls to the scalar advection routines (c1 and c2) were missing. The advection testing
tool would not compile.
Second Solution:
Initialize the 1d arrays c1 and c2 to terrain-following coordinate settings (c1=1, c2=0), and pass those args into the
WRF scalar advection drivers. The simplified settings are not important since this is just for a 1d advection.
LIST OF MODIFIED FILES:
modified: dyn_em/module_advection_em.F
TESTS CONDUCTED:
had the interfaces updated to match the current advection drivers.
after 0, 1200, 1400, 1600, 1800, and 2000 full time steps (each full time step is constructed of three small time steps).
Results from the advection schemes scalar_adv_opt = 0 (standard scalar advection), 1 (positive definite), 2 (monotonic),
3 (WENO), and 4 (WENO PD) are shown. Every 200 full steps, the square wave should be back in the original location.
RELEASE NOTE: I don't want to support this, so no release information.