[Dart-dev] DART/branches Revision: 12234

dart at ucar.edu dart at ucar.edu
Thu Dec 21 17:04:44 MST 2017


hendric at ucar.edu
2017-12-21 17:04:43 -0700 (Thu, 21 Dec 2017)
132

adding some print statements for debugging.  and
fixed a bug in computing geopotential height using
the hybrid coordinate column.




Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90	2017-12-21 18:13:10 UTC (rev 12233)
+++ DART/branches/recam/models/cam-fv/model_mod.f90	2017-12-22 00:04:43 UTC (rev 12234)
@@ -12,29 +12,26 @@
 
 module model_mod
 
-!>@todo fixme fill in the actual names we use after we've gotten
-!>further into writing the coded
-
-use             types_mod, only : MISSING_R8, MISSING_I, i8, r8, vtablenamelength, &
-                                  gravity, DEG2RAD
-use      time_manager_mod, only : set_time, time_type, set_date, &
-                                  set_calendar_type, get_date
-use          location_mod, only : location_type, set_vertical, set_location, &
-                                  get_location,get_close_obs, get_close_state, & 
-                                  VERTISUNDEF, VERTISSURFACE, VERTISLEVEL, &
-                                  VERTISPRESSURE, VERTISHEIGHT, &
-                                  VERTISSCALEHEIGHT, query_location
-use         utilities_mod, only : find_namelist_in_file, check_namelist_read, &
-                                  string_to_logical, string_to_real,& 
-                                  logfileunit, do_nml_file, do_nml_term, &
-                                  register_module, error_handler, &
-                                  file_exist, to_upper, E_ERR, E_MSG
-use          obs_kind_mod, only : QTY_SURFACE_ELEVATION, QTY_PRESSURE, &
-                                  QTY_GEOMETRIC_HEIGHT, QTY_VERTLEVEL, &
-                                  QTY_SURFACE_PRESSURE, QTY_PRECIPITABLE_WATER, &
-                                  QTY_TEMPERATURE, QTY_SPECIFIC_HUMIDITY, &
-                                  QTY_GEOPOTENTIAL_HEIGHT,  &
-                                  get_index_for_quantity, get_num_quantities
+use             types_mod,  only : MISSING_R8, MISSING_I, i8, r8, vtablenamelength, &
+                                   gravity, DEG2RAD
+use      time_manager_mod,  only : set_time, time_type, set_date, &
+                                   set_calendar_type, get_date
+use          location_mod,  only : location_type, set_vertical, set_location, &
+                                   get_location,get_close_obs, get_close_state, & 
+                                   VERTISUNDEF, VERTISSURFACE, VERTISLEVEL, &
+                                   VERTISPRESSURE, VERTISHEIGHT, &
+                                   VERTISSCALEHEIGHT, query_location
+use         utilities_mod,  only : find_namelist_in_file, check_namelist_read, &
+                                   string_to_logical, string_to_real,& 
+                                   logfileunit, do_nml_file, do_nml_term, &
+                                   register_module, error_handler, do_output,&
+                                   file_exist, to_upper, E_ERR, E_MSG
+use          obs_kind_mod,  only : QTY_SURFACE_ELEVATION, QTY_PRESSURE, &
+                                   QTY_GEOMETRIC_HEIGHT, QTY_VERTLEVEL, &
+                                   QTY_SURFACE_PRESSURE, QTY_PRECIPITABLE_WATER, &
+                                   QTY_TEMPERATURE, QTY_SPECIFIC_HUMIDITY, &
+                                   QTY_GEOPOTENTIAL_HEIGHT,  &
+                                   get_index_for_quantity, get_num_quantities
 use     mpi_utilities_mod,  only : my_task_id
 use        random_seq_mod,  only : random_seq_type, init_random_seq, random_gaussian
 use  ensemble_manager_mod,  only : ensemble_type, get_my_num_vars, get_my_vars
@@ -53,7 +50,6 @@
                                    nc_sync, nc_enddef, nc_redef, nc_open_readonly, &
                                    nc_close, nc_variable_exists
 use        chem_tables_mod, only : init_chem_tables, finalize_chem_tables, chem_convert_factor
-!#!use       location_io_mod
 use        quad_utils_mod,  only : quad_interp_handle, init_quad_interp, &
                                    set_quad_coords, finalize_quad_interp, &
                                    quad_lon_lat_locate, quad_lon_lat_evaluate, &
@@ -510,10 +506,11 @@
 real(r8) :: temp_vals(ens_size) 
 logical  :: member_done(ens_size)
 
+character(len=*), parameter :: routine = 'get_values_from_varid:'
 
 ! as we get the values for each ensemble member, we set the 'done' flag
 ! and a good return code. 
-my_status(:) = 16
+my_status(:)   = 16
 member_done(:) = .false.
 
 ! start with lev_index(1).  get the vals into a temp var.  
@@ -528,35 +525,36 @@
    if (member_done(i)) cycle
 
    state_indx = get_dart_vector_index(lon_index, lat_index, lev_index(i), domain_id, varid)
+
    if (state_indx < 0) then
       !>@todo FIXME this shouldn't happen, right?  should it call the error handler instead?
+      ! write(string1,*) 'could not find dart state index from '
+      ! write(string2,*) 'lon, lat, and lev index :', lon_index, lat_index, lev_index
+      ! call error_handler(E_ERR,routine,string1,source,revision,revdate,text2=string2)
       my_status(:) = 15
       return
    endif
 
-   !print*, 'state_indx ', state_indx
    temp_vals(:) = get_state(state_indx, ens_handle)    ! all the ensemble members for level (i)
-   ! if (lev_index(1) /= lev_index(2) .and. all(temp_vals > 0.00000001)) then
-   ! endif
 
    ! start at i, because my ensemble member is clearly at this level.
    ! then continue on to see if any other members are also at this level.
-   if (debug_level > 100) then
       do j=i, ens_size
          if (member_done(j)) cycle
+            if (debug_level > 100 .and. do_output()) then
             print*, 'lev_index(1) ', i, lev_index(i)


More information about the Dart-dev mailing list