[Dart-dev] DART/branches Revision: 12284
dart at ucar.edu
dart at ucar.edu
Thu Jan 4 15:02:31 MST 2018
nancy at ucar.edu
2018-01-04 15:02:29 -0700 (Thu, 04 Jan 2018)
179
added a conversion from height to pressure, intended to
be used only for rejecting obs above a given height.
also update the input.nml to match the change in the
model namelist
Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90 2018-01-04 20:03:30 UTC (rev 12283)
+++ DART/branches/recam/models/cam-fv/model_mod.f90 2018-01-04 22:02:29 UTC (rev 12284)
@@ -159,7 +159,7 @@
type cam_1d_array
integer :: nsize
real(r8), allocatable :: vals(:)
- !>@todo FIXME do we need a string name here anymore?
+ !>@todo FIXME do we need a string name here anymore? (no, so far)
end type
type cam_grid
@@ -195,6 +195,12 @@
! Surface potential; used for calculation of geometric heights.
real(r8), allocatable :: phis(:, :)
+! Precompute pressure -> height map once based on 1010mb surface pressure.
+! Used only to discard obs on heights above the user-defined top threshold.
+integer, parameter :: generic_nlevels = 17
+real(r8), allocatable :: generic_height_column(:)
+real(r8), allocatable :: generic_pressure_column(:)
+
! Horizontal interpolation code. Need a handle for nonstaggered, U and V.
type(quad_interp_handle) :: interp_nonstaggered, &
interp_u_staggered, &
@@ -274,7 +280,13 @@
!>@todo we need to set the model top related stuff here
if (no_assim_above_pressure > 0.0_r8) then
- print*, '"no_assim_above_pressure" not implemented yet'
+ write(string1, *) 'discarding observations above a pressure level of ', &
+ no_assim_above_pressure, ' Pascals' !>@todo FIXME units???
+
+ ! compute both height and pressure columns once, based on a surface
+ ! pressure of 1000 mb. use for quick conversions when absolute accuracy
+ ! isn't a primary concern.
+ call store_generic_columns()
endif
end subroutine static_init_model
@@ -717,9 +729,9 @@
! if we are avoiding assimilating obs above a given pressure, test here and return.
! we have to do a vertical conversion for obs which don't have a vertical of pressure.
!>@todo FIXME do we convert an entire ensemble of heights or just one and call that good?
+!> for now we are using a generic, 1000mb surface pressure for all obs, all ensembles.
if (no_assim_above_pressure > 0) then
- call obs_too_high(lon_lat_vert(3), which_vert, interp_handle, &
- four_lons, four_lats, lon_fract, lat_fract, status1)
+ call obs_too_high(lon_lat_vert(3), which_vert, status1)
if (status1 /= 0) then
istatus(:) = status1
return
@@ -835,30 +847,58 @@
end subroutine model_interpolate_no_top
!-----------------------------------------------------------------------
-!>
+!> discard observations above a user-defined threshold.
+!> intended to be quick (low-cost) and not exact.
-subroutine obs_too_high(vert_value, which_vert, interp_handle, &
- four_lons, four_lats, lon_fract, lat_fract, my_status)
+subroutine obs_too_high(vert_value, which_vert, my_status)
real(r8), intent(in) :: vert_value
integer, intent(in) :: which_vert
-type(quad_interp_handle), intent(in) :: interp_handle
-integer, intent(in) :: four_lons(4), four_lats(4)
-real(r8), intent(in) :: lon_fract, lat_fract
integer, intent(out) :: my_status
-! lower pressures are higher; watch the less than/greater than tests
-if (which_vert == VERTISPRESSURE .and. vert_value < no_assim_above_pressure) then
- my_status = 14
+integer :: nlevels
+integer :: bot_lev, top_lev
+real(r8) :: h_val, fract
+real(r8) :: this_pressure
+
+
+! assume ok to begin with
+my_status = 0
+
+! obs with a vertical type of pressure:
+! lower pressures are higher; watch the less than/greater than tests
+! note that this returns here no matter what the vert value is;
+! a good error code if below the threshold; with a bad error code if above.
+if (which_vert == VERTISPRESSURE) then
+ if (vert_value < no_assim_above_pressure) my_status = 14
return
endif
+! these are always ok
+if (which_vert == VERTISSURFACE .or. which_vert == VERTISUNDEF) return
+
+! for now we haven't run into observations where the vertical coordinate
+! (of the OBS) is in scale height. so return ok here also. if we have
+! obs with this vert, add code here to convert from pressure to scale height.
+if (which_vert == VERTISSCALEHEIGHT) return
+
!>@todo FIXME you were working here ----
More information about the Dart-dev
mailing list