[Dart-dev] DART/branches Revision: 12042

dart at ucar.edu dart at ucar.edu
Fri Nov 3 15:38:55 MDT 2017


hendric at ucar.edu
2017-11-03 15:38:54 -0600 (Fri, 03 Nov 2017)
95
reading P0 as a 0 dimensional scalar.  getting ready to
start fleshing out model_interpolate.




Modified: DART/branches/recam/models/cam-fv/new_model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/new_model_mod.f90	2017-11-03 20:42:49 UTC (rev 12041)
+++ DART/branches/recam/models/cam-fv/new_model_mod.f90	2017-11-03 21:38:54 UTC (rev 12042)
@@ -147,6 +147,9 @@
 
 type(cam_stagger) :: grid_stagger
 
+! Surface potential; used for calculation of geometric heights.
+real(r8), allocatable :: phis(:, :)
+
 contains
 
 
@@ -198,12 +201,14 @@
 
 call set_calendar_type('GREGORIAN')
 
-call read_grid_info(cam_template_filename, cam_phis_filename, grid_data)
+call read_grid_info(cam_template_filename, grid_data)
+call read_cam_phis_array(cam_phis_filename)
 
-! is there a common subroutine outside of the model mod we can call here?
+!>@todo do we need to map_qtys here?
+!>@todo do we need to set the model top related stuff here?
 
 ! set_cam_variable_info() fills var_names, kind_list, clamp_vals, update_list
-! from the &model_mod_nml variables
+! from the &model_mod_nml state_variables
 call set_cam_variable_info(state_variables, nfields)
 
 end subroutine static_init_model
@@ -290,7 +295,7 @@
 !>
 !> Model interpolate will interpolate any DART state variable
 !> (i.e. S, T, U, V, Eta) to the given location given a state vector.
-!> The type of the variable being interpolated is obs_type since
+!> The type of the variable being interpolated is obs_qty since
 !> normally this is used to find the expected value of an observation
 !> at some location. The interpolated value is returned in interp_vals
 !> and istatus is 0 for success. NOTE: This is a workhorse routine and is
@@ -299,21 +304,24 @@
 !> @param state_handle DART ensemble handle
 !> @param ens_size DART ensemble size
 !> @param location the location of interest
-!> @param obs_type the DART KIND of interest
+!> @param obs_qty the DART KIND of interest
 !> @param interp_val the estimated value of the DART state at the location
 !>          of interest (the interpolated value).
 !> @param istatus interpolation status ... 0 == success, /=0 is a failure
 !>
 
-subroutine model_interpolate(state_handle, ens_size, location, obs_type, interp_val, istatus)
+subroutine model_interpolate(state_handle, ens_size, location, obs_qty, interp_val, istatus)
 
- type(ensemble_type), intent(in) :: state_handle
- integer,             intent(in) :: ens_size
- type(location_type), intent(in) :: location
- integer,             intent(in) :: obs_type
- integer,            intent(out) :: istatus(ens_size)
- real(r8),           intent(out) :: interp_val(ens_size) !< array of interpolated values
+type(ensemble_type), intent(in) :: state_handle
+integer,             intent(in) :: ens_size
+type(location_type), intent(in) :: location
+integer,             intent(in) :: obs_qty
+integer,            intent(out) :: istatus(ens_size)
+real(r8),           intent(out) :: interp_val(ens_size) !< array of interpolated values
 
+integer  :: varid
+real(r8) :: lon_lat_vert(3)
+
 if ( .not. module_initialized ) call static_init_model
 
 ! Successful istatus is 0
@@ -320,6 +328,19 @@
 interp_val = MISSING_R8
 istatus = 99
 
+lon_lat_vert = get_location(obs_loc)
+
+varid = get_varid_from_kind(domain_id, obs_qty)
+
+
+if (varid < 0) then
+   if(debug > 12) then
+      write(string1,*)'did not find obs_qty ', obs_qty, ' in the state'
+      call error_handler(E_MSG,'model_interpolate:',string1,source,revision,revdate)
+   endif
+   return
+endif
+
 write(string1,*)'model_interpolate should not be called.'
 write(string2,*)'we are getting forward observations directly from CAM'
 call error_handler(E_MSG,'model_interpolate:',string1,source,revision,revdate, text2=string2)
@@ -722,135 +743,6 @@
 
 !-----------------------------------------------------------------------
 !>
-!> Read the actual grid values from the ROMS netcdf file.
-!>
-!>@todo FIXME:  the original implementation opened 3 different files


More information about the Dart-dev mailing list