46 INTEGER,
INTENT(IN):: LU,IB
47 INTEGER,
INTENT(INOUT):: LX
48 INTEGER,
INTENT(OUT):: IX
49 integer(kind=8) :: LONG_IB,LONG_LX ,LONG_IX=0
85 INTEGER,
INTENT(IN):: LU
86 INTEGER(KIND=8),
INTENT(IN):: IB
87 INTEGER(KIND=8),
INTENT(INOUT):: LX
88 INTEGER(KIND=8),
INTENT(OUT):: IX
89 INTEGER(KIND=8),
PARAMETER:: LBCW=4
90 INTEGER(KIND=LBCW):: BCW1,BCW2
92 CHARACTER(16) :: MACHINE_ENDIAN
93 LOGICAL :: DO_BYTESWAP = .true.
101 IF( trim(machine_endian)==
"big_endian")
THEN
103 ELSEIF( trim(machine_endian)==
"little_endian")
THEN
106 ELSEIF(lu<=1999)
THEN
107 IF( trim(machine_endian)==
"big_endian")
THEN
109 ELSEIF( trim(machine_endian)==
"little_endian")
THEN
116 CALL bareadl(lu,ib,lbcw,kr,bcw1)
117 IF(do_byteswap)
CALL byteswap(bcw1,lbcw,1)
122 CALL bareadl(lu,ib+lbcw+bcw1,lbcw,kr,bcw2)
123 IF(do_byteswap)
CALL byteswap(bcw2,lbcw,1)
125 IF(kr.NE.lbcw.OR.bcw1.NE.bcw2)
THEN
136 IF(lx.GE.0) ix=ib+lbcw+lx+lbcw
164 INTEGER,
INTENT(IN):: LU,IB,NB
165 INTEGER,
INTENT(OUT):: KA
166 CHARACTER,
INTENT(OUT):: A(NB)
167 INTEGER(KIND=8) :: LONG_IB,LONG_NB,LONG_KA
169 if((ib<0.and.ib/=-1) .or. nb<0 )
THEN
170 print *,
'WRONG: in BAFRREAD starting postion IB or read '// &
171 'data size NB < 0, STOP! Consider use BAFREADL and long integer'
177 CALL bafrreadl(lu,long_ib,long_nb,long_ka,a)
204 INTEGER,
INTENT(IN):: LU
205 INTEGER(kind=8),
INTENT(IN):: IB,NB
206 INTEGER(kind=8),
INTENT(OUT):: KA
207 CHARACTER,
INTENT(OUT):: A(NB)
208 INTEGER(kind=8),
PARAMETER:: LBCW=4
209 INTEGER(kind=8):: LX=0,ix
218 ELSEIF(lx.LT.nb)
THEN
221 CALL bareadl(lu,ib+lbcw,nb,kr,a)
253 INTEGER,
INTENT(IN):: LU,IB,NB
254 INTEGER,
INTENT(OUT):: KA
255 CHARACTER,
INTENT(IN):: A(NB)
256 INTEGER(KIND=8) :: LONG_IB,LONG_NB,LONG_KA
258 if((ib<0.and.ib/=-1) .or. nb<0 )
THEN
259 print *,
'WRONG: in BAFRWRITE starting postion IB or read '// &
260 'data size NB <0, STOP! ' // &
261 'Consider use BAFRRWRITEL and long integer'
292 INTEGER,
INTENT(IN):: LU
293 INTEGER(KIND=8),
INTENT(IN):: IB,NB
294 INTEGER(kind=8),
INTENT(OUT):: KA
295 CHARACTER,
INTENT(IN):: A(NB)
297 INTEGER(kind=8),
PARAMETER:: LBCW=4
298 INTEGER(kind=LBCW):: BCW
300 CHARACTER(16) :: MACHINE_ENDIAN
301 LOGICAL :: DO_BYTESWAP = .true.
308 IF( trim(machine_endian)==
"big_endian")
THEN
310 ELSEIF( trim(machine_endian)==
"little_endian")
THEN
313 ELSEIF(lu<=1999)
THEN
314 IF( trim(machine_endian)==
"big_endian")
THEN
316 ELSEIF( trim(machine_endian)==
"little_endian")
THEN
322 IF(do_byteswap)
CALL byteswap(bcw,lbcw,1)
331 CALL bawritel(lu,ib+lbcw+nb,lbcw,kr,bcw)
subroutine bawritel(LU, IB, NB, KA, A)
This subrouytine writes a given number of bytes to an unblocked file, skipping a given number of byte...
subroutine bareadl(LU, IB, NB, KA, A)
This subrouytine is using updated baciol() I/O package to read a given number of bytes from an unbloc...
subroutine bafrindex(LU, IB, LX, IX)
This subprogram calls bafrindexl() to either read an unformatted fortran record and return its length...
subroutine bafrread(LU, IB, NB, KA, A)
This subprogram calls bafread() to read an unformatted fortran record.
subroutine bafrindexl(LU, IB, LX, IX)
This subprogram either reads an unformatted fortran record and return its length and start byte of th...
subroutine bafrwrite(LU, IB, NB, KA, A)
This subprogram calls bafrwrite() to write an unformatted fortran record.
subroutine bafrwritel(LU, IB, NB, KA, A)
This subprogram writes an unformatted fortran record.
subroutine bafrreadl(LU, IB, NB, KA, A)
This subprogram reads an unformatted fortran record.
subroutine chk_endianc(mendian)
Obtain machine endianness.