[Dart-dev] DART/branches Revision: 11990

dart at ucar.edu dart at ucar.edu
Tue Oct 17 14:59:42 MDT 2017


raeder at ucar.edu
2017-10-17 14:59:40 -0600 (Tue, 17 Oct 2017)
341
Fixed indexing of model_h in definition of highest_obs_height_m,
so that the increment is positive (heights increase upward).
Added check of whether highest_obs_pressure_Pa is set uselessly high,
which causes problems for setting highest_obs_height_m.

Changed KINDs to QTYs.

Replaced some local num_levs variables with global lev%length.




Modified: DART/branches/rma_trunk/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/rma_trunk/models/cam-fv/model_mod.f90	2017-10-16 22:20:24 UTC (rev 11989)
+++ DART/branches/rma_trunk/models/cam-fv/model_mod.f90	2017-10-17 20:59:40 UTC (rev 11990)
@@ -39,7 +39,7 @@
 !>
 !>  The RMA model_mod does not refer to TYPE_s, since they were replaced by association
 !>  with CAM variables and use of find_name. 
-!>  In the future, DART KINDs will be associated with CAM variables by the ${comp}_variables
+!>  In the future, DART QTYs will be associated with CAM variables by the ${comp}_variables
 !>  mechanism as in models/clm.
 !>  If a user wants to add new CAM variables to the state vector,
 !>  then more QTY_s may be needed in the 'use obs_kind_mod' statement and maybe the obs_kind_mod.
@@ -309,6 +309,7 @@
    character(len=NF90_MAX_NAME), allocatable :: atts_vals(:)  
 end type grid_1d_type
 
+integer, parameter :: no_lev = MISSING_I  ! constant to tell get_val_level there are no levels.
 integer :: iii
 ! integer :: grid_num_0d = 0              ! # of grid scalars to read from file
 ! P0 now a "coordinate",  and may be removed entirely
@@ -400,7 +401,7 @@
   12.011_r8,      12.011_r8,      12.011_r8,    12.011_r8       &
 /)
 
-! 2 unit conversion arrays derived from adv_mass will be filled in map_kinds.
+! 2 unit conversion arrays derived from adv_mass will be filled in map_qtys.
 real(r8), parameter :: molar_mass_dry_air = 28.9644_r8
 
 ! CAM-chem end
@@ -554,17 +555,17 @@
 character(len=nf90_max_name), allocatable :: state_long_names(:)
 character(len=nf90_max_name), allocatable :: state_units(:)
 
-! Arrays for linking obs_kinds(QTY_) and model variable names are filled in map_kinds.
+! Arrays for linking obs_qtys(QTY_) and model variable names are filled in map_qtys.
 ! The max size of QTY_ should come from obs_kind_mod
 ! These should be dimensioned the same size as the total of state_names_Nd.
 character(len=8) :: dart_to_cam_types(300) = ''
-integer          :: cam_to_dart_kinds(300) = MISSING_I
+integer          :: cam_to_dart_qtys(300) = MISSING_I
 ! Strategy; array elements are only changed for conversion factors that are != 1.0.
 !           Then convert_mmr2vmr = MISSING_R8 triggers a convert_units of 1.0 in interp_lonlat.
 ! So far, the conversion from obs units back to state units is no needed.
 ! If it becomes needed: 
 ! 1) define array convert_vmr2mmr(MAX_STATE_NAMES) = MISSING_R8 
-! 2) Add lines to function map_kinds similar to the convert_mm42vmr lines:
+! 2) Add lines to function map_qtys similar to the convert_mmr2vmr lines:
 !       convert_vmr2mmr(i) = 1.0_r8/convert_mmr2vmr(i)
 real(r8)         :: convert_mmr2vmr(MAX_STATE_NAMES) = MISSING_R8
 
@@ -755,8 +756,8 @@
 !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ! RMA-KR; 
 !    p_col is now a local variable, allocated when/where it's needed.
-! Fills arrays for the linking of obs_kinds (QTY_) to model field names
-call map_kinds()
+! Fills arrays for the linking of obs_qtys (QTY_) to model field names
+call map_qtys()
 
 !- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 ! If restricting impact of a particular kind to only obs and state vars
@@ -1562,7 +1563,7 @@
 
 !-----------------------------------------------------------------------
 
-subroutine map_kinds()
+subroutine map_qtys()
 
 ! ? Should this be a function instead; removes need to dimension obs_loc_in arbitrarily
 !   and wastefully.  But then it's called millions of times, instead of accessing a small
@@ -1582,115 +1583,116 @@
 integer :: i
 
 ! Physically 2D fields
+
 i = find_name('PS',cflds)
 if (i /= MISSING_I) then
-   dart_to_cam_types(QTY_SURFACE_PRESSURE) = 'PS'
-   cam_to_dart_kinds(i) = QTY_SURFACE_PRESSURE
+   dart_to_cam_types(    QTY_SURFACE_PRESSURE) = 'PS'
+   cam_to_dart_qtys(i) = QTY_SURFACE_PRESSURE
    convert_mmr2vmr(i) = mmr2vmr(i)
 endif
 
 i = find_name('AEROD_v',cflds)
 if (i /= MISSING_I) then
-   dart_to_cam_types(QTY_AOD) = 'AEROD_v'
-   cam_to_dart_kinds(i) = QTY_AOD
+   dart_to_cam_types(    QTY_AOD) = 'AEROD_v'
+   cam_to_dart_qtys(i) = QTY_AOD
    convert_mmr2vmr(i) = mmr2vmr(i)
 endif
 
 i = find_name('SFCO',cflds)
 if (i /= MISSING_I) then
-   dart_to_cam_types(QTY_SFCO) = 'SFCO'
-   cam_to_dart_kinds(i) = QTY_SFCO
+   dart_to_cam_types(    QTY_SFCO) = 'SFCO'
+   cam_to_dart_qtys(i) = QTY_SFCO
    convert_mmr2vmr(i) = mmr2vmr(i)


More information about the Dart-dev mailing list