[Dart-dev] DART/branches Revision: 12541

dart at ucar.edu dart at ucar.edu
Thu Apr 19 13:06:24 MDT 2018


thoar at ucar.edu
2018-04-19 13:06:24 -0600 (Thu, 19 Apr 2018)
190
Removed unused variables and routines.
All units compile with the exception of the test_interp.
That one will not work because the call to g_oplus_int()
has a different set of arguments.






Modified: DART/branches/openggcm/models/openggcm/model_mod.f90
===================================================================
--- DART/branches/openggcm/models/openggcm/model_mod.f90	2018-04-19 15:17:07 UTC (rev 12540)
+++ DART/branches/openggcm/models/openggcm/model_mod.f90	2018-04-19 19:06:24 UTC (rev 12541)
@@ -208,7 +208,7 @@
 type(grid_type), target :: mag_grid   ! Magnetic Grid
 
 ! Global Time Variables
-type(time_type) :: model_time, model_timestep
+type(time_type) :: model_timestep
 
 ! The state vector length
 integer(i8) :: model_size
@@ -329,8 +329,11 @@
 !> interpolated is obs_kind since normally this is used to find the expected
 !> value of an observation at some location. The interpolated value is 
 !> returned in interp_val and istatus is 0 for success.
+!>
+!> istatus of 99 ... unspecified
+!> istatus of 11 ... observation above or below top or bottom model level
+!> istatus of 12 ... unable to compute an integral
 
-
 subroutine model_interpolate(state_handle, ens_size, location, obs_kind, expected_obs, istatus)
 
 type(ensemble_type), intent(in) :: state_handle !< ensemble handle for data to interpolate in
@@ -344,11 +347,10 @@
 real(r8)    :: loc_array(3), llon, llat, lheight
 real(r8)    :: x,y,z   ! cartesian versions
 integer     :: ind
-integer     :: hgt_bot, hgt_top
-real(r8)    :: hgt_fract
-integer     :: hstatus
 type(grid_type), pointer :: mygrid
 logical     :: interp_initialized = .false.
+
+integer, parameter :: BAD_VERTICAL_LEVEL = 11
 integer, parameter :: DO_INTEGRAL = 12
 
 if ( .not. module_initialized ) call static_init_model
@@ -383,7 +385,7 @@
    ! convert the heights index to an actual height 
    ind = nint(loc_array(3))
    if ( ind < 1 .or. ind > geo_grid%nheight ) then 
-      istatus = 11
+      istatus = BAD_VERTICAL_LEVEL
       return
    else
       lheight = ind
@@ -471,209 +473,6 @@
 
 end function get_val
 
-!------------------------------------------------------------
-
-!> Given a longitude lon and a grid handle which contains both the 1D array 
-!> of longitudes and the grid longitude size, returns the indices of the grid
-!> below and above the location longitude and the fraction of the distance
-!> between.  This code assumes that the first and last rows are replicated
-!> and identical (e.g. 0 and 360 both have entries in the array)
-
-subroutine lon_bounds(lon, grid_handle, bot, top, fract)
-
-real(r8),        intent(in)  :: lon          !< input longitude
-type(grid_type), intent(in)  :: grid_handle  !< handle to either a geo or mag grid
-integer,         intent(out) :: bot          !< index of bottom layer
-integer,         intent(out) :: top          !< index of top layer
-real(r8),        intent(out) :: fract        !< fraction between layers
-
-! Local storage
-integer  :: i
-
-call error_handler(E_ERR, 'lon_bounds', 'routine needs to be rewritten for fully 3D grid', &
-                   source, revision, revdate )
-
-!todo do i = 2, grid_handle%nlon
-!todo    if (lon <= grid_handle%longitude(i)) then
-!todo       bot = i-1
-!todo       top = i
-!todo       fract = (lon - grid_handle%longitude(bot)) / &
-!todo               (grid_handle%longitude(top) - grid_handle%longitude(bot))
-!todo       return
-!todo    endif
-!todo enddo
-!todo 
-!todo write(string1, *) 'looking for lon ', lon
-!todo call error_handler(E_ERR, 'lon_bounds', 'reached end of loop without finding lon', &
-!todo                    source, revision, revdate, text2=string1)
-
-end subroutine lon_bounds
-
-!-------------------------------------------------------------
-
-!> Given a latitude lat and the grid_handle which contains both the 
-!> 1D array of latitudes and the grid latitude count, returns the
-!> indices of the grid below and above the location latitude and 
-!> the fraction of the distance between. istatus is returned as 0 
-!> unless the location latitude is south of the southernmost grid 
-!> point (1 returned) or north of the northernmost (2 returned),
-!> which may not be possible anymore and possibly could be removed.
-


More information about the Dart-dev mailing list