Skip to content

Commit

Permalink
Fix WRFDA reading of global attributes from netcdf input (wrf-model#258
Browse files Browse the repository at this point in the history
)

TYPE: bug fix

KEYWORDS: WRFDA, wrf_get_dom_ti_integer, ncd_ext_get_dom_ti_integer

SOURCE: internal

DESCRIPTION OF CHANGES:
When using ncd_ext_get_dom_ti_integer to get the global attribute,
only root processor gets the correct value, other processors returns
with the WRF_WARN_BAD_DATA_HANDLE error.
The problem is fixed by calling wrf_get_dom_ti_integer instead.

For HYBRID_OPT=2 case, root processor gets hybrid_opt=2 while other
processors end up with hybrid_opt=0.

LIST OF MODIFIED FILES:
M var/da/da_main/da_med_initialdata_input.inc
M var/da/da_main/da_wrfvar_io.f90

TESTS CONDUCTED:
Before the fix, the 3dvar/hybrid_opt=2 system have been cycled for ~3 weeks
until I 'accidentally' look at rsl.out from non-root processors...
  • Loading branch information
jamiebresch authored May 12, 2017
1 parent bae318b commit db7841c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions var/da/da_main/da_med_initialdata_input.inc
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ subroutine da_med_initialdata_input (grid, config_flags, filename, in_date)

! mp_physics is used in da_transfer_wrftoxb.inc
! get the setting from the input file
call ext_ncd_get_dom_ti_integer (fid, 'MP_PHYSICS', grid%mp_physics, 1, icnt, ierr)
call wrf_get_dom_ti_integer (fid, 'MP_PHYSICS', grid%mp_physics, 1, icnt, ierr)

! sf_surface_physics is used in da_transfer_xatowrf.inc
! get the setting from the input file
call ext_ncd_get_dom_ti_integer (fid, 'SF_SURFACE_PHYSICS', grid%sf_surface_physics, 1, icnt, ierr)
call wrf_get_dom_ti_integer (fid, 'SF_SURFACE_PHYSICS', grid%sf_surface_physics, 1, icnt, ierr)

!global attribute HYBRID_OPT exists in WRF V3.9 and later
call ext_ncd_get_dom_ti_integer (fid, 'HYBRID_OPT', grid%hybrid_opt, 1, icnt, ierr)
call wrf_get_dom_ti_integer (fid, 'HYBRID_OPT', grid%hybrid_opt, 1, icnt, ierr)
if ( ierr /= 0 ) then
grid%hybrid_opt = 0
write(unit=message(1),fmt='(A,A)') trim(filename), ' appears to be from earlier than WRF V3.9'
Expand Down
1 change: 1 addition & 0 deletions var/da/da_main/da_wrfvar_io.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ module da_wrfvar_io
input_input, open_w_dataset,output_input, &
input_boundary, output_boundary, output_auxhist4, &
input_auxhist6, input_auxhist4
use module_io, only: wrf_get_dom_ti_integer
use module_state_description, only : p_qv

use da_control, only : trace_use, ierr, var4d, var4d_lbc, num_fgat_time, rootproc
Expand Down

0 comments on commit db7841c

Please sign in to comment.