[Dart-dev] DART/branches Revision: 12059

dart at ucar.edu dart at ucar.edu
Tue Nov 7 12:44:58 MST 2017


hendric at ucar.edu
2017-11-07 12:44:56 -0700 (Tue, 07 Nov 2017)
45
the start of adding vertical interpolation.




Modified: DART/branches/recam/models/cam-fv/new_model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/new_model_mod.f90	2017-11-07 16:42:42 UTC (rev 12058)
+++ DART/branches/recam/models/cam-fv/new_model_mod.f90	2017-11-07 19:44:56 UTC (rev 12059)
@@ -1,18 +1,18 @@
 ! DART software - Copyright UCAR. This open source software is provided
-! by UCAR, "as is", without charge, subject to all terms of use at
-! http://www.image.ucar.edu/DAReS/DART/DART_download
+! by ucar, "as is", without charge, subject to all terms of use at
+! http://www.image.ucar.edu/dares/dart/dart_download
 !
-! $Id$
+! $id: new_model_mod.f90 12058 2017-11-07 16:42:42z nancy at ucar.edu $
 !----------------------------------------------------------------
 !>
-!> This is the interface between the CAM-FV atmosphere model and DART.
-!> The required public interfaces and arguments CANNOT be changed.
+!> this is the interface between the cam-fv atmosphere model and dart.
+!> the required public interfaces and arguments cannot be changed.
 !>
 !----------------------------------------------------------------
 
 module model_mod
 
-!>@todo FIXME fill in the actual names we use after we've gotten
+!>@todo fixme fill in the actual names we use after we've gotten
 !>further into writing the coded
 
 use             types_mod
@@ -41,7 +41,7 @@
 private
 
 ! these routines must be public and you cannot change
-! the arguments - they will be called *from* the DART code.
+! the arguments - they will be called *from* the dart code.
 
 ! routines in this list have code in this module
 public :: static_init_model,             &
@@ -350,7 +350,7 @@
 integer  :: varid
 integer  :: lon_bot, lat_bot, lon_top, lat_top, lon_fract, lat_fract
 real(r8) :: lon_lat_vert(3), botvals(ens_size), topvals(ens_size)
-integer  :: which_vert, status, status1, status2, status_array(ens_size)
+integer  :: which_vert, status1, status2, status_array(ens_size)
 type(quad_interp_handle) :: interp_handle
 integer  :: ijk(3)
 integer  :: four_lons(4), four_lats(4)
@@ -414,7 +414,7 @@
 ! unpack the location type into lon, lat, vert
 ! also may need the vert type?
 lon_lat_vert = get_location(location)
-which_vert = nint(query_location(location))  ! default is to return the vertical type
+which_vert = nint(query_location(location))  ! default is to return the vertical type (JPH nint - nearist int)
 
 ! get the grid handle for the right staggered grid
 interp_handle = get_interp_handle(obs_qty)
@@ -423,8 +423,9 @@
 ! the fraction across the quad for the obs location
 call quad_lon_lat_locate(interp_handle, lon_lat_vert(1), lon_lat_vert(2) , &
                          lon_bot, lat_bot, lon_top, lat_top, lon_fract, lat_fract, &
-                         status)
-if (status /= 0) then
+                         status1)
+
+if (status1 /= 0) then
    istatus(:) = 3  ! cannot locate enclosing horizontal quad
    return
 endif
@@ -441,32 +442,39 @@
 ! and now here potentially we have different results for different
 ! ensemble members.  the things that can vary are dimensioned by ens_size.
 do i=1, 4
-   call find_vertical_levels(four_lons(i), four_lats(i), lon_lat_vert(3), &
-                             which_vert, obs_qty, state_handle, ens_size, &
-                             four_bot_levs(i, ens_size), four_top_levs(i, ens_size), &
-                             four_vert_fracts(i, ens_size), status_array)
+   !^>@todo FIXME build a vertical column to find vertical numbers... # need option for linear or log scale?
+   call find_vertical_levels(state_handle, ens_size, &
+                             four_lons(i), four_lats(i), lon_lat_vert(3), &
+                             which_vert, obs_qty, &
+                             four_bot_levs(i, :), four_top_levs(i, :), &
+                             four_vert_fracts(i, :), status_array)
+   
    if (any(status_array /= 0)) then
-      istatus(:) = 4   ! cannot locate enclosing vertical levels  !>@todo FIXME
+      istatus(:) = 4   ! cannot locate enclosing vertical levels  !>@todo FIXME use where statements?
       return
    endif
+
 enddo
 
 ! we have all the indices and fractions we could ever want.
 ! now start looking up data values and actually interpolating, finally.
 do i=1, 4
-   call find_vertical_values(four_lons(i), four_lats(i), four_bot_levs(i, j), varid, botvals, status_array)
+   call find_values(state_handle,  ens_size, four_lons(i), four_lats(i), &
+                    four_bot_levs(i, :), varid, botvals, status_array)
    if (any(status_array /= 0)) then
       istatus(:) = 5   ! cannot retrieve values
       return
    endif


More information about the Dart-dev mailing list