Skip to content

bug: wrf model_mod QTY_VAPOR_MIXING_RATIO with vertissurface always returns 0.0 with success if q2 is not in the state #1019

@hkershaw-brown

Description

@hkershaw-brown

🐛 Your bug may already be reported!
Please search on the issue tracker before creating a new issue.

Describe the bug

  1. List the steps someone needs to take to reproduce the bug.
    Run model_mod_check with
    &model_mod_check_nml
        ...
        loc_of_interest       = 1.715, 45.732, 1
        quantity_of_interest  = 'QTY_VAPOR_MIXING_RATIO'
        interp_test_vertcoord = 'VERTISSURFACE'
        ...
    /   
    
  2. What was the expected outcome?
    Interpolate using type_q2 if present or fail.
  3. What actually happened?

Error Message

Here is some prints to show the value of fld (q2)

interpolating at  Lon/Lat(deg):   1.71500000  45.73200000  Vert:      1.00000 surface (m)
interpolating for "QTY_VAPOR_MIXING_RATIO"
-------------------------------------------------------------

 hello helen surface elevation obs kind           20
 hello helen q2  -888888.00000000000       -888888.00000000000     
member     1, SUCCESS with value    ::    0.0000000000000000

Surface variable:

elseif(is_vertical(location,"SURFACE") .or. obs_kind == QTY_SURFACE_ELEVATION) then

Checks for q2, if not there fld gets set to 0 because -88888 is < 0 (! Don't accept negative water vapor amounts), model_interpolate returns 'success'

DART/models/wrf/model_mod.f90

Lines 2050 to 2063 in a32ab03

if(.not. surf_var) then
call simple_interp_distrib(fld, wrf, id, i, j, k, obs_kind, dxm, dx, dy, dym, uniquek, ens_size, state_handle )
if (all(fld == missing_r8)) goto 200
else ! This is for surface QV (Q2)
! Confirm that right field is in the DART state vector
if ( wrf%dom(id)%type_q2 >= 0 ) then
!HK I am not sure what the type should be
call surface_interp_distrib(fld, wrf, id, i, j, obs_kind, wrf%dom(id)%type_q2, dxm, dx, dy, dym, ens_size, state_handle)
if (all(fld == missing_r8)) goto 200
endif
endif
! Don't accept negative water vapor amounts
fld = max(0.0_r8, fld)

Which model(s) are you working with?

wrf

Version of DART

Which version of DART are you using?
v11.19.0-39-g41563ddd5

Have you modified the DART code?

Yes, but I believe also present on main
Edit: confirmed on main

Build information

Please describe:

  1. Mac M
  2. GNU Fortran (MacPorts gcc13 13.3.0_2+stdlib_flag) 13.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingwrfWeather Research & Forecasting Model

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions