-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
THM is mandatory WRF temp variable #733
Merged
Merged
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7031c9d
THM is mandatory WRF temp variable
braczka 6436c17
Merge remote-tracking branch 'upstream/main' into THM_variable_doc
braczka 0f5f416
Force error for WRF variable T
braczka fac042b
Simplify THM error call
braczka 934d82e
Correct THM error call
braczka 2d99f18
Enforcing inclusion of THM
braczka 75b25ce
Apply suggestions from code review
braczka 95fbd1a
Editing boundscheck error comment
braczka 92dac72
Merge remote-tracking branch 'upstream/THM_variable_doc' into THM_var…
braczka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so at the comment, this check isn't checking that THM is in state and type_t
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went back and forth on this -- yes, the code will error out if user includes 'T' as temperature variable. It does not error out if 'THM' is in the DART state, but does give that information in the error message.
I could expand the error by saying:
if ( wrf%dom(id)%type_t >= 0 .and. (get_type_ind_from_type_string(id,'T') >=0 .or. get_type_ind_from_type_string(id,'THM') <=0)) then
Is that preferable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested edit will now error out if THM is not in DART state but type_t WRF variable is declared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line 702:
if ( wrf%dom(id)%type_t >= 0 .and. get_type_ind_from_type_string(id,'T') >=0)
thenwrf%dom(id)%type_t
isn't defined at this stage (unless I'm missing something) so this checkwrf%dom(id)%type_t >= 0
is using an uninitialized value for type_tline 713 is where wrf%dom(id)%type_t is set.
wrf%dom(id)%type_t = get_type_ind_from_type_string(id,'THM')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so to back up a bit, what has to be true to run wrf-dart?
THM has to be in the state and type_t has to be THM?
What's not allowed?
T can not be in the state vector?
T can be in the state vector but can not be type_t?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only thing that is not allowed is having the WRF variable 'T' in the DART state because it can throw the 'boundscheck' error which gives a non-intuitive error as described in #728 . There are other secondary reasons to not include 'T' in WRF -- because its diagnostic in WRFv4+, not prognostic, so updating it will not improve the forecast. Users who are used to older WRF versions may not be aware of this.
I also believe that including a 'type_t' WRF variable in the DART state is mandatory because of the way the WRF model_mod.f90 works. Even if you don't intend the 'type_t' variable to be updated by DART, the code still does boundchecks on the type_t variable for many (all?) WRF-DART simulations.
Given the 'type_t' requirement, and secondly, that using variable 'T' is not permitted, this makes including 'THM' mandatory because it is the only replacement variable that I know of for 'T' (3D temperature).