WRF model_mod - Why not allow last level?
Nobody has claimed this yet.
- Dominant language
- Fortran
- Stars
- 263
- Forks
- 182
- Avg merge
- 11d 12h
- Merged PRs (30d)
- 7
Description
Problem
My WRF simulation has 50 levels, (51 staggered) but debugging the obs_def_rttov_mod.f90 showed that it sees 49 levels and 48 layers. (see image here)
Reason
rttov_mod.f90 determines the number of levels in the COUNTLEVELS loop (https://github.com/NCAR/DART/blob/9c7d829a507311625edcaf0c145a580811fcd513/observations/forward_operators/obs_def_rttov_mod.f90#L3526)
and this loop stops at level 49 (wrong) since interpolate returns istatus 99
This is because interpolate checks the bounds and does NOT allow to retrieve the value at the last level (https://github.com/NCAR/DART/blob/9c7d829a507311625edcaf0c145a580811fcd513/models/wrf/model_mod.f90#L2042)
Solution
So I propose to change the code so that it also allows to access the last level (https://github.com/NCAR/DART/commit/25efb6c8ac49e5322300e0a5dd2244dc61e157bb)
This change will be part of the https://github.com/lkugler/DART/tree/rttov13 push request
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read the COUNTLEVELS loop in observations/forward_operators/obs_def_rttov_mod.f90 and the bounds check in models/wrf/model_mod.f90. Compare the behavior with the proposed commit and verify that the WRF simulation exposes the expected final level rather than returning status 99; the issue is resolved when the level and layer counts include the last level.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fortran
- Domain
- data
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100