NCAR / NCAR/DART

WRF model_mod - Why not allow last level?

Open
#366 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

rttov13 wrf
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.