23 recursive subroutine atrcpt(msgin,lmsgot,msgot)
27 use modv_vars,
only: im8b, nbytw
33 integer,
intent(in) :: msgin(*), lmsgot
34 integer,
intent(out) :: msgot(*)
35 integer my_lmsgot, len0, len1, l2, l3, l4, l5, iad1, iad2, lenm, lenmot, len1ot, ibit,
iupbs01,
bort_target_set
41 call x84(lmsgot, my_lmsgot, 1)
42 call atrcpt(msgin, my_lmsgot*2, msgot)
57 call getlens(msgin,1,len0,len1,l2,l3,l4,l5)
67 if(lenmot>(lmsgot*nbytw)) &
68 call bort(
'BUFRLIB: ATRCPT - OVERFLOW OF OUTPUT MESSAGE ARRAY; TRY A LARGER DIMENSION FOR THIS ARRAY')
74 call mvb ( msgin, 1, msgot, 1, 4 )
76 call pkb ( lenmot, 24, msgot, ibit )
77 call mvb ( msgin, 8, msgot, 8, 1 )
82 call pkb ( len1ot, 24, msgot, ibit )
86 call mvb ( msgin, iad1+4, msgot, (ibit/8)+1, len1-3 )
99 call mvb ( msgin, iad2+1, msgot, (ibit/8)+1, lenm-iad2 )
121 recursive subroutine rtrcptb(mbay,iyr,imo,idy,ihr,imi,iret)
123 use modv_vars,
only: im8b
127 integer,
intent(in) :: mbay(*)
128 integer,
intent(out) :: iyr, imo, idy, ihr, imi, iret
135 call rtrcptb(mbay,iyr,imo,idy,ihr,imi,iret)
141 call x48(iret,iret,1)
150 if(
iupbs01(mbay,
'BEN')==4)
then
155 if( (is1byt+5) >
iupbs01(mbay,
'LEN1') )
return
162 imgbyt = is1byt +
iupbs01(mbay,
'LEN0')
164 iyr =
iupb(mbay,imgbyt,16)
165 imo =
iupb(mbay,imgbyt+2,8)
166 idy =
iupb(mbay,imgbyt+3,8)
167 ihr =
iupb(mbay,imgbyt+4,8)
168 imi =
iupb(mbay,imgbyt+5,8)
192 recursive subroutine rtrcpt(lunit,iyr,imo,idy,ihr,imi,iret)
196 use modv_vars,
only: im8b
202 integer,
intent(in) :: lunit
203 integer,
intent(out) :: iyr, imo, idy, ihr, imi, iret
210 call x84(lunit,my_lunit,1)
211 call rtrcpt(my_lunit,iyr,imo,idy,ihr,imi,iret)
217 call x48(iret,iret,1)
232 call status(lunit,lun,il,im)
233 if(il==0)
call bort(
'BUFRLIB: RTRCPT - INPUT BUFR FILE IS CLOSED; IT MUST BE OPEN FOR INPUT')
234 if(il>0)
call bort(
'BUFRLIB: RTRCPT - INPUT BUFR FILE IS OPEN FOR OUTPUT; IT MUST BE OPEN FOR INPUT')
235 if(im==0)
call bort(
'BUFRLIB: RTRCPT - A MESSAGE MUST BE OPEN IN INPUT BUFR FILE; NONE ARE')
271 recursive subroutine strcpt(cf,iyr,imo,idy,ihr,imi)
275 use modv_vars,
only: im8b
281 character,
intent(in) :: cf
282 character*128 bort_str
285 integer,
intent(in) :: iyr, imo, idy, ihr, imi
292 call x84(iyr,my_iyr,1)
293 call x84(imo,my_imo,1)
294 call x84(idy,my_idy,1)
295 call x84(ihr,my_ihr,1)
296 call x84(imi,my_imi,1)
297 call strcpt(cf,my_iyr,my_imo,my_idy,my_ihr,my_imi)
312 if(my_cf /=
'Y' .and. my_cf /=
'N')
then
313 write(bort_str,
'("BUFRLIB: STRCPT - INPUT ARGUMENT IS ",A1,", IT MUST BE EITHER Y, y, N OR n")') cf
recursive subroutine bort(str)
Log an error message, then either return to or abort the application program.
subroutine bort_target_unset
Clear any existing bort target.
integer function bort_target_set()
Sets a new bort target, if bort catching is enabled and such a target doesn't already exist.
recursive integer function iupb(mbay, nbyt, nbit)
Decode an integer value from within a specified number of bits of an integer array,...
subroutine pkb(nval, nbits, ibay, ibit)
Encode an integer value within a specified number of bits of an integer array, starting at the bit im...
subroutine mvb(ib1, nb1, ib2, nb2, nbm)
Copy a specified number of bytes from one packed binary array to another.
subroutine capit(str)
Capitalize all of the alphabetic characters in a string.
Wrap C NCEPLIBS-bufr functions so they can be called from within the Fortran part of the library.
Declare arrays and variables used to store BUFR messages internally for multiple file IDs.
integer, dimension(:,:), allocatable mbay
Current BUFR message for each file ID.
Declare variables used to store tank receipt time information within Section 1 of BUFR messages.
integer itrhr
Tank receipt hour.
integer itryr
Tank receipt year.
integer itrdy
Tank receipt day.
character ctrt
Flag indicating whether tank receipt times are to be included within output BUFR messages; this varia...
integer itrmi
Tank receipt minute.
integer itrmo
Tank receipt month.
recursive subroutine status(lunit, lun, il, im)
Check whether a specified Fortran logical unit number is currently connected to the NCEPLIBS-bufr sof...
recursive subroutine getlens(mbay, ll, len0, len1, len2, len3, len4, len5)
Read the section lengths of a BUFR message, up to a specified point in the message.
recursive integer function iupbs01(mbay, s01mnem)
Read a specified value from within Section 0 or Section 1 of a BUFR message.
recursive subroutine strcpt(cf, iyr, imo, idy, ihr, imi)
Specify a tank receipt time to be included within Section 1 of all BUFR messages output by future cal...
recursive subroutine rtrcpt(lunit, iyr, imo, idy, ihr, imi, iret)
Read the tank receipt time (if one exists) from Section 1 of a BUFR message.
recursive subroutine rtrcptb(mbay, iyr, imo, idy, ihr, imi, iret)
Read the tank receipt time (if one exists) from Section 1 of a BUFR message.
recursive subroutine atrcpt(msgin, lmsgot, msgot)
Read an input message and output an equivalent BUFR message with a tank receipt time added to Section...
subroutine x48(iin4, iout8, nval)
Encode one or more 4-byte integer values as 8-byte integer values.
subroutine x84(iin8, iout4, nval)
Encode one or more 8-byte integer values as 4-byte integer values.