26 SUBROUTINE mtfnam ( IMT, IMTV, IOGCE, IMTVL, TBLTYP,
30 COMMON /mstinf/ lun1, lun2, lmtd, mtdir
32 CHARACTER*(*) STDFIL, LOCFIL, TBLTYP
37 CHARACTER*128 BORT_STR
43 CALL strsuc ( tbltyp, tbltyp2, ltbt )
47 IF ( ( imt .EQ. 0 ) .AND. ( imtv .LE. 13 ) )
THEN
52 stdfil = mtdir(1:lmtd) //
'/bufrtab.' // tbltyp2(1:ltbt) //
55 WRITE ( fmtf,
'(A,I1,A,I1,A)' )
56 .
'(4A,I',
isize(imt),
',A,I',
isize(imtv),
')'
57 WRITE ( stdfil, fmtf ) mtdir(1:lmtd),
'/bufrtab.',
58 . tbltyp2(1:ltbt),
'_STD_', imt,
'_', imtv
60 IF ( iprt .GE. 2 )
THEN
61 CALL errwrt(
'Standard ' // tbltyp2(1:ltbt) //
':')
64 INQUIRE ( file = stdfil, exist = found )
65 IF ( .NOT. found )
GOTO 900
73 WRITE ( fmtf,
'(A,I1,A,I1,A,I1,A)' )
75 .
',A,I',
isize(imtvl),
')'
76 WRITE ( locfil, fmtf ) mtdir(1:lmtd),
'/bufrtab.',
77 . tbltyp2(1:ltbt),
'_LOC_', imt,
'_', iogce,
'_', imtvl
78 IF ( iprt .GE. 2 )
THEN
79 CALL errwrt(
'Local ' // tbltyp2(1:ltbt) //
':')
82 INQUIRE ( file = locfil, exist = found )
83 IF ( .NOT. found )
THEN
87 locfil = mtdir(1:lmtd) //
'/bufrtab.' // tbltyp2(1:ltbt) //
89 IF ( iprt .GE. 2 )
THEN
90 CALL errwrt(
'Local ' // tbltyp2(1:ltbt) //
91 .
'not found, so using:')
94 INQUIRE ( file = locfil, exist = found )
95 IF ( .NOT. found )
GOTO 901
99 900 bort_str =
'BUFRLIB: MTFNAM - COULD NOT FIND STANDARD FILE:'
100 CALL bort2(bort_str,stdfil)
101 901 bort_str =
'BUFRLIB: MTFNAM - COULD NOT FIND LOCAL FILE:'
102 CALL bort2(bort_str,locfil)
subroutine bort2(STR1, STR2)
Log two error messages and abort application program.
subroutine errwrt(STR)
This subroutine allows the user to specify a custom location for the logging of error and diagnostic ...
integer function isize(NUM)
This function computes and returns the number of characters needed to encode the input integer NUM as...
subroutine mtfnam(IMT, IMTV, IOGCE, IMTVL, TBLTYP, STDFIL, LOCFIL)
Based on the input arguments, this subroutine determines the names of the corresponding standard and ...
subroutine strsuc(str1, str2, lens)
This subroutine removes leading and trailing blanks from a character string.