[Dart-dev] DART/branches Revision: 12500
dart at ucar.edu
dart at ucar.edu
Tue Apr 10 16:18:31 MDT 2018
nancy at ucar.edu
2018-04-10 16:18:31 -0600 (Tue, 10 Apr 2018)
820
fix bugs:
- height table was off by a factor of 100 for pressure
- scale height vertical conversion was returning error for all surface obs
change behavior to match original cam model_mod:
- allow conversion to scale height even if obs pressure is larger than the
surface pressure (e.g. obs is located below surface). this choice should be revisited.
enhancements:
- use binary search to find enclosing levels in height and pressure columns
- rename some routines to be clearer
- allow diagnostic files to optionally omit the grid info to be as small as possible
- remove debug print lines
- replace height/pressure table with two tables from a more accurate source.
one table top height is 86 km for cam; the other is 1000 km for waccm, waccm-x
fix nml file to be legal syntax (no array subscripts allowed)
Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90 2018-04-10 15:42:04 UTC (rev 12499)
+++ DART/branches/recam/models/cam-fv/model_mod.f90 2018-04-10 22:18:31 UTC (rev 12500)
@@ -8,25 +8,25 @@
!> this is the interface between the cam-fv atmosphere model and dart.
!> the required public interfaces and arguments cannot be changed.
!>
+!>
+!----------------------------------------------------------------
+!>@todo FIXME: consistent directions for interpolation/fractions
+!> still to change: we should always pass top level first, then bottom level.
+!> fraction should be computed and interpreted as 0 = top, 1 = bottom.
+!> in the code below, there are !x! marks on some lines. the meanings are:
+!> !$! - where top and bottom need to be swapped in call or subroutine
+!> interfaces.
+!> !*! - where fraction is used and may need the sense to be switched
+!> (may be using 1 = top and 0 = bottom)
+!>
!>@todo FIXME: feedback from WACCM-X meeting
-!> they need to build a special factor for the height conversion
-!> it's multiplied by G, so the code in build_heights() has to
-!> change slightly - they aren't passing in a different R array.
!>
!> test if the constants can be used from types_mod.f90 instead of
-!> having gravity and r redefined here.
+!> having gravity and r redefined here? PROBABLY NOT - every model
+! uses a slightly different value so what would we put in types?
!>
-!> not sure about generic height table for rejecting high obs - but
-!> it's not clear model_interpolate should be rejecting high obs
-!> at all. suggestions are we cull them from the input obs_seq before
-!> the run. in that case we can take it out!
-!>
-!> going to try to move the oxygen ion density code to a forward
-!> operator in an obs_def_xxx_mod.f90.
-!>
!> test with identity obs to make sure get_close_xx() doesn't need
!> special code to handle them.
-!>
!----------------------------------------------------------------
module model_mod
@@ -36,7 +36,7 @@
use time_manager_mod, only : set_time, time_type, set_date, &
set_calendar_type, get_date
use location_mod, only : location_type, set_vertical, set_location, &
- get_location, write_location, &
+ get_location, write_location, is_vertical, &
VERTISUNDEF, VERTISSURFACE, VERTISLEVEL, &
VERTISPRESSURE, VERTISHEIGHT, &
VERTISSCALEHEIGHT, query_location, &
@@ -46,9 +46,10 @@
vertical_localization_on, get_close_type
use utilities_mod, only : find_namelist_in_file, check_namelist_read, &
string_to_logical, string_to_real,&
- logfileunit, do_nml_file, do_nml_term, &
+ nmlfileunit, do_nml_file, do_nml_term, &
register_module, error_handler, &
- file_exist, to_upper, E_ERR, E_MSG, array_dump
+ file_exist, to_upper, E_ERR, E_MSG, array_dump, &
+ find_enclosing_indices
use obs_kind_mod, only : QTY_SURFACE_ELEVATION, QTY_PRESSURE, &
QTY_GEOMETRIC_HEIGHT, QTY_VERTLEVEL, &
QTY_SURFACE_PRESSURE, &
@@ -226,21 +227,40 @@
! default to localizing in pressure. override with namelist
integer :: vertical_localization_type = VERTISPRESSURE
+
+! commonly used numbers that we'll set in static_init_model
real(r8) :: global_model_top
real(r8) :: global_ref_pressure
integer :: global_nlevels
+!>@todo FIXME ask kevin if this is small enough to handle
+! all the possible cam configurations?
+! an arbitrary value to test the model top against to see
+! if we're running cam vs waccm or waccm-x. it changes the
+! standard atmosphere table we use to convert pressure to height,
+! and changes the formatting of numbers in dart_log output.
+real(r8), parameter :: high_top_threshold = 0.3_r8 ! pascals
+
! things related to damping at the model top
logical :: are_damping = .false.
real(r8) :: damp_weight = 1.0_r8
real(r8) :: ramp_start
type(location_type) :: ramp_start_loc
+logical :: discarding_high_obs = .false.
+real(r8) :: no_assim_above_height = -1.0_r8
+real(r8) :: no_assim_above_level = -1.0_r8
-! Precompute pressure -> height map once based on 1010mb surface pressure.
+!> build a pressure/height conversion column based on a
+!> standard atmosphere. this can only be used when we
+!> don't have a real ensemble to use, or we don't care
+!> about absolute accuracy.
+
+! Precompute pressure <-> height map once based on either a low-top or
+! high-top table depending on what the model top is.
! Used only to discard obs on heights above the user-defined top threshold.
More information about the Dart-dev
mailing list