[Dart-dev] DART/branches Revision: 10927

dart at ucar.edu dart at ucar.edu
Fri Jan 20 12:08:38 MST 2017


thoar at ucar.edu
2017-01-20 12:08:38 -0700 (Fri, 20 Jan 2017)
467
This test bitwise reproduces.

Implementing the wrf/model_mod.f90 r10342 to the trunk to the wrf_chem/model_mod.f90

"Using the correct type to grab
variable size in nc_write_model_atts for types w and gz. When
no variable type_w is present and type_gz is present then attributes
were grabbing type information exclusively from type_w to calculate sizes
which may not present.  This was causing filter to crash when writing 
attributes since type_w is not defined."




Modified: DART/branches/mizzi/models/wrf_chem/model_mod.f90
===================================================================
--- DART/branches/mizzi/models/wrf_chem/model_mod.f90	2017-01-20 18:43:15 UTC (rev 10926)
+++ DART/branches/mizzi/models/wrf_chem/model_mod.f90	2017-01-20 19:08:38 UTC (rev 10927)
@@ -5747,7 +5747,7 @@
 real(r8), intent(in)  :: x(:)
 real(r8)              :: model_pressure
 
-integer  :: off
+integer  :: off, type_x
 real(r8) :: pres1, pres2
 
 model_pressure = missing_r8
@@ -5756,6 +5756,12 @@
 !   we are at the upper or lower boundary in which case we will extrapolate.
 if( (var_type == wrf%dom(id)%type_w) .or. (var_type == wrf%dom(id)%type_gz) ) then
 
+   if (var_type == wrf%dom(id)%type_w) then
+      type_x = wrf%dom(id)%type_w
+   else
+      type_x = wrf%dom(id)%type_gz
+   endif
+
    if( k == 1 ) then
 
       pres1 = model_pressure_t(i,j,k,  id,x)
@@ -5762,7 +5768,7 @@
       pres2 = model_pressure_t(i,j,k+1,id,x)
       model_pressure = interp_pressure(pres1, pres2, extrapolate=.true.)
 
-   elseif( k == wrf%dom(id)%var_size(3,wrf%dom(id)%type_w) ) then
+   elseif( k == wrf%dom(id)%var_size(3,type_x) ) then
 
       pres1 = model_pressure_t(i,j,k-1,id,x)
       pres2 = model_pressure_t(i,j,k-2,id,x)


More information about the Dart-dev mailing list