[Dart-dev] DART/branches Revision: 12341

dart at ucar.edu dart at ucar.edu
Wed Jan 17 11:46:01 MST 2018


nancy at ucar.edu
2018-01-17 11:45:59 -0700 (Wed, 17 Jan 2018)
278
the convert routines already set the vert value in the obs
so remove the additional set_vertical with garbage values
from both convert_vertical_state() and convert_vertical_obs().

also add a convert call if the incoming base obs is not
yet converted (controlled by namelist).




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2018-01-16 22:50:27 UTC (rev 12340)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2018-01-17 18:45:59 UTC (rev 12341)
@@ -36,7 +36,7 @@
                                    QTY_TEMPERATURE, QTY_SPECIFIC_HUMIDITY, &
                                    QTY_GEOPOTENTIAL_HEIGHT,  &
                                    get_index_for_quantity, get_num_quantities, &
-                                   get_name_for_quantity
+                                   get_name_for_quantity, get_quantity_for_type_of_obs
 use     mpi_utilities_mod,  only : my_task_id
 use        random_seq_mod,  only : random_seq_type, init_random_seq, random_gaussian
 use  ensemble_manager_mod,  only : ensemble_type, get_my_num_vars, get_my_vars
@@ -795,6 +795,10 @@
    return
 endif
 
+if (using_chemistry) then
+   interp_vals = interp_vals * chem_convert_factor(obs_qty)
+endif
+
 ! all interp values should be set by now.  set istatus
 istatus(:) = 0
 
@@ -2885,11 +2889,15 @@
 
 ens_size = 1
 
+!print *, 'convert_vertical_state, num = ', num
 do i=1,num
    current_vert_type = nint(query_location(locs(i)))
 
    if ( current_vert_type == which_vert ) cycle
 
+   if ( current_vert_type == VERTISUNDEF) cycle
+
+!print *, 'i = ', i, ' current vert_type = ', current_vert_type
    select case (which_vert)
       case (VERTISPRESSURE)
          call state_vertical_to_pressure(    ens_handle, ens_size, locs(i), loc_indx(i), loc_qtys(i) )
@@ -2903,6 +2911,7 @@
          write(string1,*)'unable to convert vertical state "', which_vert, '"'
          call error_handler(E_MSG,routine,string1,source,revision,revdate)
    end select
+!print *, 'vloc now = ', query_location(locs(i), 'VLOC')
 enddo
 
 istatus = 0
@@ -2927,11 +2936,15 @@
 
 if (is_surface_field(myqty)) then
    
+!print *, 'surface field ', iloc, jloc, vloc
    level_one = 1
-   call get_staggered_values_from_qty(ens_handle, ens_size, QTY_SURFACE_PRESSURE, &
-                                      iloc, jloc, level_one, qty, surface_pressure, status1)
+   call get_values_from_single_level(ens_handle, ens_size, QTY_SURFACE_PRESSURE, &
+                                     iloc, jloc, level_one, surface_pressure, status1)
 
-   if (status1 /= 0) return
+   if (status1 /= 0) then
+!print *, 'err - status1 = ', status1
+      return
+   endif
    call set_vertical(location, surface_pressure(1), VERTISPRESSURE)
 else
    call cam_pressure_levels(ens_handle, ens_size, iloc, jloc, grid_data%lev%nsize, &
@@ -3144,6 +3157,8 @@
          call obs_vertical_to_pressure(   ens_handle, locs(i), my_status(i))
       case (VERTISHEIGHT)
          call obs_vertical_to_height(     ens_handle, locs(i), my_status(i))
+!call write_location(0, locs(i), charstring=string1)
+!print *, 'converting vert height to: '//trim(string1)
       case (VERTISLEVEL)
          call obs_vertical_to_level(      ens_handle, locs(i), my_status(i))
       case (VERTISSCALEHEIGHT)
@@ -3289,6 +3304,34 @@
 
 end subroutine obs_vertical_to_scaleheight
 
+!--------------------------------------------------------------------
+
+subroutine convert_vert_one_obs(ens_handle, loc, otype, vert_type, status1)
+type(ensemble_type), intent(in)    :: ens_handle
+type(location_type), intent(inout) :: loc
+integer,             intent(in)    :: otype
+integer,             intent(in)    :: vert_type
+integer,             intent(out)   :: status1
+
+type(location_type) :: bl(1)
+integer :: bq(1), bt(1), status(1)
+
+! these need to be arrays.  kinda a pain.
+bl(1) = loc
+bt(1) = otype
+bq(1) = get_quantity_for_type_of_obs(otype)
+
+call convert_vertical_obs(ens_handle, 1, bl, bq, bt, &
+                             vert_type, status)
+if (status(1) /= 0) then
+   status1 = status(1)


More information about the Dart-dev mailing list