NCEPLIBS-bufr  12.1.0
apxdx.F90
Go to the documentation of this file.
1 
5 
22 program apxdx
23 
24  implicit none
25 
26  character*240 cdxtbl, cbffil
27 
28  integer, parameter :: lunin = 10, lundx = 11, lunot = 12
29  integer narg
30 
31  logical exists
32 
33  ! Read and verify the input arguments.
34  narg = command_argument_count()
35  if ( narg /= 2 ) then
36  print *,'Usage: apxdx BUFRfile DXtable'
37  call exit(1)
38  endif
39  call get_command_argument( 1, cbffil )
40  inquire ( file = cbffil, exist = exists )
41  if ( .not. exists ) then
42  print *,'Specified BUFR file ' // trim(cbffil) // ' does not exist'
43  call exit(2)
44  endif
45  call get_command_argument( 2, cdxtbl )
46  inquire ( file = cdxtbl, exist = exists )
47  if ( .not. exists ) then
48  print *,'Specified DX table ' // trim(cdxtbl) // ' does not exist'
49  call exit(3)
50  endif
51 
52  ! Read the user DX table into the NCEPLIBS-bufr library.
53  cdxtbl = trim(cdxtbl) // char(0) ! append trailing null
54  open ( unit = lundx, file = cdxtbl )
55  call openbf ( lunin, 'INUL', lundx )
56 
57  ! Open the BUFR file for append.
58  cbffil = trim(cbffil) // char(0) ! append trailing null
59  open ( unit = lunot, file = cbffil, form = 'unformatted' )
60  call openbf ( lunot, 'APX', lunot )
61 
62  ! Generate DX messages from the table and append them to the BUFR file.
63  call wrdxtb ( lunin, lunot )
64 
65  ! Close the BUFR file.
66  call closbf ( lunot )
67 
68  stop
69 end program apxdx
program apxdx
Generate BUFR messages corresponding to a given DX BUFR table and append them to a given BUFR file.
Definition: apxdx.F90:22
recursive subroutine wrdxtb(lundx, lunot)
Generate one or more BUFR messages from the DX BUFR tables information associated with a given BUFR f...
Definition: dxtable.F90:850
recursive subroutine closbf(lunit)
Close the connection between logical unit lunit and the NCEPLIBS-bufr software.
recursive subroutine openbf(lunit, io, lundx)
Connect a new file to the NCEPLIBS-bufr software for input or output operations, or initialize the li...