With WRFDA Version 3.5.1 and later you should not experience these problems.
If you are using Version 3.5.1 or later and have trouble assimilating BUFR or PREPBUFR files, contact wrfhelp. |
Issues with reading PREPBUFR and BUFR radiance data with gfortran and intel compilers
Symptoms
WRFDA compiled with gfortran or ifort to read BUFR files will likely return the following error message when trying to read a file which has been unblocked and re-blocked by the "cwordsh" program:
**************BUFR ARCHIVE LIBRARY ABORT*****************
BUFRLIB: OPENBF - ERROR READING INPUT FILE CONNECTED TO UNIT 26 WHEN
CHECKING FOR 'BUFR' IN FIRST 4 BYTES OF RECORD
**************BUFR ARCHIVE LIBRARY ABORT*****************
For WRFDA 3.3 through 3.5 : Set environment variable
GFORTRAN_CONVERT_UNIT (gfortran) and F_UFMTENDIAN (ifort) environment variables will override the CONVERT specifier in the open statement.
This serves to reserve and fix the units used to open BUFR files. It is not necessary to amend the open statement for other compilers.
For csh
gfortran: setenv GFORTRAN_CONVERT_UNIT "little_endian:94-99"
ifort: setenv F_UFMTENDIAN "little:94-99"
For bash
gfortran: export GFORTRAN_CONVERT_UNIT="little_endian:94-99"
ifort: export F_UFMTENDIAN="little:94-99"
Side effect: In order not to interfere with other applications, it is good practice to unset the environment
variable after da_wrfvar.exe is completed.
For the reblocking utility, reblock.c writen by Baoyu YIN is recommended.
(http://www.math.ucdavis.edu/~cheung/PROJECTS/DAO_Projects/halem/iret/reblock.c)
It reads a blocked BUFR file, byteswap the f77 control words and
writes out the file directly, no bufrlib is needed.
For WRFDA v3.2.1 or earlier: Adding convert='little_endian' to the open statement
1. da/da_obs_io/da_read_obs_bufr.inc
At the section "bufrfile:", add convert='little_endian' to the open statement
open(unit = iunit, FILE = trim(filename), &
iostat = iost, form = 'unformatted', STATUS = 'OLD' &
convert='little_endian')
2. da/da_radiance/da_read_obs_bufrairs.inc
At the section "Open BUFR file" , add convert='little_endian' to the open statement
open(unit = lnbufr, FILE = trim(infile), &
form = 'unformatted', iostat = iost, &
convert='little_endian')
3. da/da_radiance/da_read_obs_bufrtovs.inc
At the section "! 0.0 Open unit to satellite bufr file and read file header", add convert='little_endian' to the open statement
open(unit = lnbufr, FILE = trim(infile), &
form = 'unformatted', iostat = iost, status = 'old', &
convert='little_endian')
4. da/da_radiance/da_read_obs_bufrssmis.inc
At the section "! 0.0 Open unit to satellite bufr file and read file header", add convert='little_endian' to the open statement
open(unit = lnbufr, FILE = trim(infile), &
form = 'unformatted', iostat = iost, status = 'old', &
convert='little_endian')
5. da/da_obs_io/da_read_obs_bufrgpsro.inc
At the section "! open file " add convert='little_endian' to the open statement
open(unit = iunit, FILE = trim(filename), &
iostat = iost, form = 'unformatted', STATUS ='OLD' , &
convert='little_endian')
Side effect: After the modification, the code will work just for gfortran and ifort compilers
![](images/transgif.gif) ![](images/shim162.gif) |