Skip to content

Commit

Permalink
Merge pull request #425 from NCAR/fixptype
Browse files Browse the repository at this point in the history
move code to set ptype variable outside the if() statement
  • Loading branch information
hkershaw-brown committed Dec 2, 2022
2 parents 16d37ab + 417cb23 commit da0d74e
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions models/cam-fv/model_mod.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2077,18 +2077,21 @@ subroutine obs_vertical_to_scaleheight(ens_handle, location, my_status)

ens_size = 1

! if this location is on the surface, use the surface pressure field
! in the computations below. otherwise use the 3d pressure field.
if (query_location(location) == VERTISSURFACE) then
ptype = QTY_SURFACE_PRESSURE
else
ptype = QTY_PRESSURE
endif


! there are 4 cases here.

if (no_normalization_of_scale_heights) then

! take log of pressure, either surface pressure or regular pressure

if (query_location(location) == VERTISSURFACE) then
ptype = QTY_SURFACE_PRESSURE
else
ptype = QTY_PRESSURE
endif

call ok_to_interpolate(ptype, varid1, my_status)
if (my_status /= 0) return

Expand Down

0 comments on commit da0d74e

Please sign in to comment.