[Dart-dev] DART/branches Revision: 12091

dart at ucar.edu dart at ucar.edu
Fri Nov 10 13:46:05 MST 2017


hendric at ucar.edu
2017-11-10 13:46:02 -0700 (Fri, 10 Nov 2017)
25
fixing a compile error.




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2017-11-10 18:51:09 UTC (rev 12090)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2017-11-10 20:46:02 UTC (rev 12091)
@@ -2053,7 +2053,7 @@
       case (VERTISPRESSURE)
          call convert_to_pressure(ens_handle, ens_size, locs(i), loc_indx(i))
       case (VERTISHEIGHT)
-         call convert_to_pressure(ens_handle, ens_size, locs(i), loc_indx(i))
+         call convert_to_height(ens_handle, ens_size, locs(i), loc_indx(i))
       case (VERTISLEVEL)
          call convert_to_pressure(ens_handle, ens_size, locs(i), loc_indx(i))
       case (VERTISSCALEHEIGHT)
@@ -2104,6 +2104,43 @@
 
 !--------------------------------------------------------------------
 
+subroutine  convert_to_height(ens_handle, ens_size, location, location_indx)
+type(ensemble_type), intent(in)    :: ens_handle
+integer,             intent(in)    :: ens_size
+type(location_type), intent(inout) :: location
+integer(i8),         intent(in)    :: location_indx
+
+!>@todo FIXME move up to convert_vertical_state ?
+call state_level_to_height(ens_handle, ens_size, location, location_indx)
+
+end subroutine  convert_to_height
+
+!--------------------------------------------------------------------
+
+subroutine state_level_to_height(ens_handle, ens_size, location, location_indx)
+type(ensemble_type), intent(in)    :: ens_handle
+integer,             intent(in)    :: ens_size
+type(location_type), intent(inout) :: location
+integer(i8),         intent(in)    :: location_indx
+
+
+integer  :: iloc, jloc, vloc, my_status(ens_size)
+real(r8) :: height_array(  grid_data%lev%nsize, ens_size)
+real(r8) :: pressure_array(grid_data%lev%nsize)
+
+! build a height column and a pressure column and find the levels?
+call get_model_variable_indices(location_indx, iloc, jloc, vloc)
+
+call cam_height_levels(ens_handle, ens_size, iloc, jloc, grid_data%lev%nsize, &
+                       height_array, my_status) 
+
+!>@todo FIXME this can only be used if ensemble size is 1
+call set_vertical(location, height_array(vloc,1), VERTISHEIGHT)
+
+end subroutine state_level_to_height
+
+!--------------------------------------------------------------------
+
 subroutine obs_height_to_pressure(ens_handle, ens_size, location, location_indx)
 type(ensemble_type), intent(in)    :: ens_handle
 integer,             intent(in)    :: ens_size
@@ -2112,7 +2149,7 @@
 
 
 integer  :: iloc, jloc, vloc, my_status(ens_size)
-real(r8) :: height_array(grid_data%lev%nsize, ens_size)
+real(r8) :: height_array(  grid_data%lev%nsize, ens_size)
 real(r8) :: pressure_array(grid_data%lev%nsize)
 
 ! build a height column and a pressure column and find the levels?


More information about the Dart-dev mailing list