[Dart-dev] DART/branches Revision: 11949

dart at ucar.edu dart at ucar.edu
Thu Sep 21 16:24:11 MDT 2017


nancy at ucar.edu
2017-09-21 16:24:09 -0600 (Thu, 21 Sep 2017)
601
fix a serious error (that i created) when pre-converting the vertical
coordinates for either obs or state vector items.  the 'count' in the
call from assim_tools() is the number of separate items.  it was being
passed directly to an existing convert_vert() routine that expected to
convert an ensemble of locations where all had the same lon/lat and might
only differ in the vertical.  i believe it would hammer numbers 2-N with
the lon/lat from item 1. 

only print debug messages which have global information
(grid sizes, variables in the state vector, etc) on a single
task instead of all tasks.




Modified: DART/branches/rma_trunk/models/mpas_atm/model_mod.f90
===================================================================
--- DART/branches/rma_trunk/models/mpas_atm/model_mod.f90	2017-09-21 22:13:41 UTC (rev 11948)
+++ DART/branches/rma_trunk/models/mpas_atm/model_mod.f90	2017-09-21 22:24:09 UTC (rev 11949)
@@ -714,9 +714,9 @@
 if ( debug > 0 .and. do_output()) then
   write(logfileunit,*)
   write(     *     ,*)
-  write(logfileunit,'(" static_init_model: nCells, nEdges, nVertices, nVertLevels =",4(1x,i6))') &
+  write(logfileunit,'(" static_init_model: nCells, nEdges, nVertices, nVertLevels =",4(1x,i9))') &
                                           nCells, nEdges, nVertices, nVertLevels
-  write(     *     ,'(" static_init_model: nCells, nEdges, nVertices, nVertLevels =",4(1x,i6))') &
+  write(     *     ,'(" static_init_model: nCells, nEdges, nVertices, nVertLevels =",4(1x,i9))') &
                                           nCells, nEdges, nVertices, nVertLevels
   write(logfileunit, *)'static_init_model: model_size = ', model_size
   write(     *     , *)'static_init_model: model_size = ', model_size
@@ -815,7 +815,7 @@
                      var_names  = variable_table (1:nfields,1), &
                      clamp_vals = variable_bounds(1:nfields,:) )
 
-if ( debug > 4 ) call state_structure_info(domid)
+if ( debug > 4 .and. do_output()) call state_structure_info(domid)
 
 ! tell the location module how we want to localize in the vertical
 call set_vertical_localization_coord(vert_localization_coord)
@@ -2993,7 +2993,7 @@
 call nc_check(nf90_close(grid_id), &
          'read_grid_dims','close '//trim(grid_definition_filename) )
 
-if (debug > 4) then
+if (debug > 4 .and. do_output()) then
    write(*,*)
    write(*,*)'read_grid_dims: nCells        is ', nCells
    write(*,*)'read_grid_dims: nVertices     is ', nVertices
@@ -3160,7 +3160,7 @@
 
 ! A little sanity check
 
-if ( debug > 9 ) then
+if ( debug > 9 .and. do_output() ) then
 
    write(*,*)
    write(*,*)'latCell           range ',minval(latCell),           maxval(latCell)
@@ -4288,8 +4288,12 @@
 integer,             intent(in)    :: which_vert
 integer,             intent(out)   :: status(:)
 
-call convert_vert_distrib(state_handle, num, locs, loc_qtys(1), which_vert, status)
+integer :: i
 
+do i=1, num
+   call convert_vert_distrib(state_handle, 1, locs(i:i), loc_qtys(i), which_vert, status(i:i))
+enddo
+
 end subroutine convert_vertical_obs
 
 !--------------------------------------------------------------------
@@ -4305,15 +4309,16 @@
 integer,             intent(in)    :: which_vert
 integer,             intent(out)   :: istatus
 
-integer :: status(num)
+integer :: i, status(1)
 
-call convert_vert_distrib(state_handle, num, locs, loc_qtys(1), which_vert, status)
+do i=1, num
+   call convert_vert_distrib(state_handle, 1, locs(i:i), loc_qtys(i), which_vert, status)
+   if (status(1) /= 0) then
+      istatus = status(1)
+      return
+   endif
+enddo
 
-if (any(status /= 0)) then 
-   istatus = 1
-else
-   istatus = 0
-endif
 
 end subroutine convert_vertical_state
 
@@ -4413,9 +4418,14 @@
 do e = 1, ens_size
    if (zin(e) == missing_r8) then
       location(e) = set_location(llv_loc(1, e),llv_loc(2, e),missing_r8,ztypeout)
-      !return ! you can't return yet?
    endif
 enddo
+! if the entire ensemble has missing vertical values we can return now.
+! otherwise we need to continue to convert the members with good vertical values.
+if (all(zin == missing_r8)) then
+   istatus(:) = 0
+   return
+endif
 
 ! Convert the incoming vertical type (ztypein) into the vertical
 ! localization coordinate given in the namelist (ztypeout).
@@ -4473,7 +4483,7 @@
    ! Convert theta, rho, qv into pressure
    call compute_full_pressure(ens_size, values(1, :), values(2, :), values(3, :), zout(:), tk(:), istatus(:))
    if (debug > 10) then


More information about the Dart-dev mailing list