[Dart-dev] [9415] DART/trunk/models/wrf/model_mod.f90: Bug fix: wrf model_mod.
nancy at ucar.edu
nancy at ucar.edu
Wed Jan 6 11:31:57 MST 2016
Revision: 9415
Author: hkershaw
Date: 2016-01-06 11:31:56 -0700 (Wed, 06 Jan 2016)
Log Message:
-----------
Bug fix: wrf model_mod.
Fixes Jira issue DARTSUP-295
For cases where different variables are in different domains the wrong index was being used to access wrf%dom%.
This did not case a problem when the same variables were used in each domain because my_index = ind.
Modified Paths:
--------------
DART/trunk/models/wrf/model_mod.f90
-------------- next part --------------
Modified: DART/trunk/models/wrf/model_mod.f90
===================================================================
--- DART/trunk/models/wrf/model_mod.f90 2016-01-06 17:56:58 UTC (rev 9414)
+++ DART/trunk/models/wrf/model_mod.f90 2016-01-06 18:31:56 UTC (rev 9415)
@@ -4613,7 +4613,7 @@
if ( debug ) write(*,*) 'Defining variable ',varname
- if ( wrf%dom(id)%var_size(3,my_index) > 1 ) then ! 3D variable
+ if ( wrf%dom(id)%var_size(3,ind) > 1 ) then ! 3D variable
dimids_3D(4:5) = (/MemberDimID,unlimitedDimID/)
@@ -4633,11 +4633,11 @@
! vertical dimension can be stag, unstag, or staggered soil
! need to use if/then/else instead of select because testing
! is against variables
- if ( wrf%dom(id)%var_size(3,my_index) == wrf%dom(id)%bts ) then
+ if ( wrf%dom(id)%var_size(3,ind) == wrf%dom(id)%bts ) then
dimids_3D(3)=btStagDimID(id)
- elseif ( wrf%dom(id)%var_size(3,my_index) == wrf%dom(id)%bt ) then
+ elseif ( wrf%dom(id)%var_size(3,ind) == wrf%dom(id)%bt ) then
dimids_3D(3)=btDimID(id)
- elseif ( wrf%dom(id)%var_size(3,my_index) == wrf%dom(id)%sls ) then
+ elseif ( wrf%dom(id)%var_size(3,ind) == wrf%dom(id)%sls ) then
dimids_3D(3)=slSDimID(id)
else
write(errstring,*)'Could not determine dim_id for vertical dimension to output variable '//varname
@@ -4673,22 +4673,22 @@
endif ! 3D or 2D
- unitsval = trim(wrf%dom(id)%units(my_index))
+ unitsval = trim(wrf%dom(id)%units(ind))
call nc_check(nf90_put_att(ncFileID, var_id, "units", trim(unitsval)), &
'nc_write_model_atts','put_att '//varname//' units')
- descriptionval = trim(wrf%dom(id)%description(my_index))
+ descriptionval = trim(wrf%dom(id)%description(ind))
call nc_check(nf90_put_att(ncFileID, var_id, "description", trim(descriptionval)), &
'nc_write_model_atts','put_att '//varname//' description')
- long_nameval = trim(wrf%dom(id)%description(my_index))
+ long_nameval = trim(wrf%dom(id)%description(ind))
call nc_check(nf90_put_att(ncFileID, var_id, "long_name", trim(long_nameval)), &
'nc_write_model_atts','put_att '//varname//' long_name')
- coordinatesval = trim(wrf%dom(id)%coordinates(my_index))
+ coordinatesval = trim(wrf%dom(id)%coordinates(ind))
if (coordinatesval(1:7) .eq. 'XLONG_U') then
coordinate_char = "XLONG_U_d0"//idom//" XLAT_U_d0"//idom
else if (coordinatesval(1:7) .eq. 'XLONG_V') then
More information about the Dart-dev
mailing list