Skip to content
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

mpas rttov #95

Merged
merged 19 commits into from
Dec 18, 2020
Merged

mpas rttov #95

merged 19 commits into from
Dec 18, 2020

Conversation

hkershaw-brown
Copy link
Member

Aim of this pull request is to commit the work Nancy and Soyoung did on MPAS and RTTOV.

Fixes https://github.com/NCAR/DART_development/issues/119

The rttov obs_def changes:

  • E_ALLMSG used instead of E_MSG
  • loc_sea variable used to create sfc, 2m, 10m locations relative to model surface elevation
  • monotonically decreasing pressure from TOA check now has greater than or equal to ( this is the bug fix)

The mpas_atm model_mod changes:

  • Debugging info in the comment at the start of the module.
  • New error code for pressure not monotonically decreasing with level
  • QTY_CLOUD_FRACTION added. Force non-negative hydrometeors and for QTY_CLOUD_FRACTION <1
  • compute_scalar_with_barycentric passing tavs(1), values(1,:). when n=1. There is some discussion of this in https://github.com/NCAR/DART_development/issues/119. It is a bit of a gotcha, so is on the list of things to tidy up in the mpas_atm module.
  • theta_to_tk has debugging info for non-zero istatus going in

There is some discussion on VERTISUNDEFINED in the comments (whether there should be the error code 82).

Tested these changes on Cheyenne with a 10 member version on Soyoung's mpas case. Note it was a 10 member test since each restart is 3.7GB. /glade/p/cisl/dares/hkershaw/mpas_rttov_testing

Copy link
Contributor

@timhoar timhoar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could delete some commented-out lines.
I'm not a fan of the "Ha: " ... the comments are usually not informative, and git blame shows which lines were modified, when, and with the commit message.

models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
 VERTISUNDEF locations often come in with missing_r8 as the vertical

Note there is an early return in vert_convert_distrib_state
when VERTISUNDEF so I am not sure which errors the istatus 82
was catching
@timhoar
Copy link
Contributor

timhoar commented Dec 14, 2020

I was puzzling over the skintemp interpolation

       call compute_surface_data_with_barycentric(skintemp(:), location, expected_obs(1), istatus(1))

and am concerned that the skintemp is metadata common to all ensemble members. Ditto for seaice.
That doesn't seem right to me. Has anyone talked to Soyoung about this?

else
write(string1,*) 'interp routine returned a good status but set value to MISSING_R8'
endif

call error_handler(E_ERR,'model_interpolate', string1, source,revision,revdate, &
!call error_handler(E_ERR,'model_interpolate', string1, source,revision,revdate, &
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

edit: sorry! i just reread what section this is in. if the code is returning a good status but missing_r8, it should halt here because that's a bug. i'd remove the E_ALLMSG line and return it to using E_ERR in this case.

@@ -4533,7 +4595,7 @@ subroutine convert_vert_distrib(state_handle, ens_size, location, obs_kind, ztyp
! if the entire ensemble has missing vertical values we can return now.
! otherwise we need to continue to convert the members with good vertical values.
if (all(zin == missing_r8)) then
istatus(:) = 0
istatus(:) = 0 ! vertisundef might come here - nsc 82 ! FIXME: Ha - Why should this be zero? I created 82 if all zin are missing.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as before. if the location uses VERTISUNDEF as the type it often uses missing_r8 as the vertical value. setting this to an error code would fail the vertical conversion of all those obs. in this case, the code is right but clearly the comments need to be more explicit about mentioning VERTISUNDEF after line 4597 and then removing the comments on 4598.

@@ -4644,7 +4708,7 @@ subroutine convert_vert_distrib(state_handle, ens_size, location, obs_kind, ztyp
enddo

if (debug > 9 .and. do_output()) then
write(string2,'("zout_in_height [m]:",F10.2)') zout
write(string2,'("zout_in_height [m]:",F10.2)') zout(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if someone does change this code to print all the zout() values, it has to go into a loop. 80 or 100 member ensemble values won't fit into our strings. tests with 2-3 ensemble members work, then full-up experiments fail by overwriting the string. i think in most cases a single sample is enough to see if there's a gross problem - and the user can edit the code to loop over all the members to drill down. so i'd argue leaving the zout(1) for now.

models/mpas_atm/model_mod.f90 Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved
models/mpas_atm/model_mod.f90 Outdated Show resolved Hide resolved

! set the surface fields
call interpolate(state_handle, ens_size, loc_sfc, QTY_SURFACE_PRESSURE, atmos%sfc_p(:), this_istatus)
call check_status('QTY_SURFACE_PRESSURE', ens_size, this_istatus, val, loc_sfc, istatus, routine, source, revision, revdate, .true., return_now)
! start with elevation so the other locations can have appropriate vert values
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notes for future use: here is where this code could be getting the elevation from some source other than the model - some independent elevation map. but for now, to avoid all these obs being rejected, the easy way is to ask the model for the (model) height at this location, and use it below. that guarantees it won't be rejected by height-mismatch tests, but also prevents it from being legitimately rejected if the actual earth height at this location is not represented well by the model. [ not sure where you're keeping track of future revisions to this code ]

@hkershaw-brown hkershaw-brown merged commit b9eb67f into master Dec 18, 2020
@hkershaw-brown hkershaw-brown deleted the bugfix-mpas-rttov branch December 18, 2020 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants