[Dart-dev] DART/branches Revision: 12810

dart at ucar.edu dart at ucar.edu
Wed Sep 5 10:12:57 MDT 2018


nancy at ucar.edu
2018-09-05 10:12:57 -0600 (Wed, 05 Sep 2018)
426
update all the vertical interpolation routines to use
level 1 and level 2 instead of trying to sort out "top" and "bottom".
cam model levels start at the model top and end at the surface;
pressure and level values increase going down, heights decrease
going down - it is just too confusing.  at this point all the
interpolation in the vertical should be level 1 fraction = 0,
level 2 fraction = 1.0 and should be consistent.




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2018-08-31 21:47:17 UTC (rev 12809)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2018-09-05 16:12:57 UTC (rev 12810)
@@ -8,19 +8,7 @@
 !> 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 verify: 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 might 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)
-!>
-!----------------------------------------------------------------
 
 module model_mod
 
@@ -511,7 +499,7 @@
 integer,             intent(out) :: my_status
 
 integer :: next_lat, prev_lon, stagger
-real(r8) :: vals_bot(ens_size), vals_top(ens_size)
+real(r8) :: vals1(ens_size), vals2(ens_size)
 
 vals(:) = MISSING_R8
 stagger = grid_stagger%qty_stagger(stagger_qty)
@@ -524,25 +512,25 @@
    call quad_index_neighbors(lon_index, lat_index, prev_lon, next_lat)
 
    call get_values_from_single_level(ens_handle, ens_size, qty, lon_index, lat_index, lev_index, &
-                                     vals_bot, my_status)
+                                     vals1, my_status)
    if (my_status /= 0) return
    call get_values_from_single_level(ens_handle, ens_size, qty, lon_index, next_lat,  lev_index, &
-                                     vals_top, my_status)
+                                     vals2, my_status)
    if (my_status /= 0) return
 
-   vals = (vals_bot + vals_top) * 0.5_r8
+   vals = (vals1 + vals2) * 0.5_r8
 
   case (STAGGER_V)
    call quad_index_neighbors(lon_index, lat_index, prev_lon, next_lat)
 
    call get_values_from_single_level(ens_handle, ens_size, qty, lon_index, lat_index, lev_index, &
-                                     vals_bot, my_status)
+                                     vals1, my_status)
    if (my_status /= 0) return
    call get_values_from_single_level(ens_handle, ens_size, qty, prev_lon,  lat_index, lev_index, &
-                                     vals_top, my_status)
+                                     vals2, my_status)
    if (my_status /= 0) return
 
-   vals = (vals_bot + vals_top) * 0.5_r8
+   vals = (vals1 + vals2) * 0.5_r8
 
   ! no stagger - cell centers, or W stagger
   case default
@@ -916,7 +904,8 @@
 endif
 
 if (which_vert == VERTISLEVEL) then
-   if (vert_value > no_assim_above_level) my_status = 14
+   ! level 1 is top; watch less than/greater than in tests
+   if (vert_value < no_assim_above_level) my_status = 14
    return
 endif
 
@@ -947,7 +936,7 @@
 
 integer  :: icorner, numdims
 integer  :: level_one_array(ens_size)
-integer  :: four_bot_levs(4, ens_size), four_top_levs(4, ens_size)
+integer  :: four_levs1(4, ens_size), four_levs2(4, ens_size)
 real(r8) :: four_vert_fracts(4, ens_size)
 
 character(len=*), parameter :: routine = 'get_quad_vals:'
@@ -968,7 +957,7 @@
       call find_vertical_levels(state_handle, ens_size, &
                                 four_lons(icorner), four_lats(icorner), lon_lat_vert(3), &
                                 which_vert, obs_qty, varid, &
-                                four_bot_levs(icorner, :), four_top_levs(icorner, :), &    !$! 
+                                four_levs1(icorner, :), four_levs2(icorner, :), & 
                                 four_vert_fracts(icorner, :), my_status)
       if (any(my_status /= 0)) return
   
@@ -982,12 +971,12 @@
    if (varid > 0) then
 
       call get_four_state_values(state_handle, ens_size, four_lons, four_lats, &
-                                four_bot_levs, four_top_levs, four_vert_fracts, &       !$!
+                                four_levs1, four_levs2, four_vert_fracts, &   
                                 varid, quad_vals, my_status)
 


More information about the Dart-dev mailing list