Go to the documentation of this file.
34 INTEGER,
INTENT(IN):: LU,IB
35 INTEGER,
INTENT(INOUT):: LX
36 INTEGER,
INTENT(OUT):: IX
37 integer(kind=8) :: LONG_IB,LONG_LX ,LONG_IX=0
66 INTEGER,
INTENT(IN):: LU
67 INTEGER(KIND=8),
INTENT(IN):: IB
68 INTEGER(KIND=8),
INTENT(INOUT):: LX
69 INTEGER(KIND=8),
INTENT(OUT):: IX
70 INTEGER(KIND=8),
PARAMETER:: LBCW=4
71 INTEGER(KIND=LBCW):: BCW1,BCW2
73 CHARACTER(16) :: MACHINE_ENDIAN
74 LOGICAL :: DO_BYTESWAP = .true.
82 IF( trim(machine_endian)==
"big_endian")
THEN
84 ELSEIF( trim(machine_endian)==
"little_endian")
THEN
88 IF( trim(machine_endian)==
"big_endian")
THEN
90 ELSEIF( trim(machine_endian)==
"little_endian")
THEN
97 CALL bareadl(lu,ib,lbcw,kr,bcw1)
98 IF(do_byteswap)
CALL byteswap(bcw1,lbcw,1)
103 CALL bareadl(lu,ib+lbcw+bcw1,lbcw,kr,bcw2)
104 IF(do_byteswap)
CALL byteswap(bcw2,lbcw,1)
106 IF(kr.NE.lbcw.OR.bcw1.NE.bcw2)
THEN
117 IF(lx.GE.0) ix=ib+lbcw+lx+lbcw
138 INTEGER,
INTENT(IN):: LU,IB,NB
139 INTEGER,
INTENT(OUT):: KA
140 CHARACTER,
INTENT(OUT):: A(NB)
141 INTEGER(KIND=8) :: LONG_IB,LONG_NB,LONG_KA
143 if((ib<0.and.ib/=-1) .or. nb<0 )
THEN
144 print *,
'WRONG: in BAFRREAD starting postion IB or read '// &
145 'data size NB < 0, STOP! Consider use BAFREADL and long integer'
151 CALL bafrreadl(lu,long_ib,long_nb,long_ka,a)
171 INTEGER,
INTENT(IN):: LU
172 INTEGER(kind=8),
INTENT(IN):: IB,NB
173 INTEGER(kind=8),
INTENT(OUT):: KA
174 CHARACTER,
INTENT(OUT):: A(NB)
175 INTEGER(kind=8),
PARAMETER:: LBCW=4
176 INTEGER(kind=8):: LX=0,ix
185 ELSEIF(lx.LT.nb)
THEN
188 CALL bareadl(lu,ib+lbcw,nb,kr,a)
213 INTEGER,
INTENT(IN):: LU,IB,NB
214 INTEGER,
INTENT(OUT):: KA
215 CHARACTER,
INTENT(IN):: A(NB)
216 INTEGER(KIND=8) :: LONG_IB,LONG_NB,LONG_KA
218 if((ib<0.and.ib/=-1) .or. nb<0 )
THEN
219 print *,
'WRONG: in BAFRWRITE starting postion IB or read '// &
220 'data size NB <0, STOP! ' // &
221 'Consider use BAFRRWRITEL and long integer'
245 INTEGER,
INTENT(IN):: LU
246 INTEGER(KIND=8),
INTENT(IN):: IB,NB
247 INTEGER(kind=8),
INTENT(OUT):: KA
248 CHARACTER,
INTENT(IN):: A(NB)
250 INTEGER(kind=8),
PARAMETER:: LBCW=4
251 INTEGER(kind=LBCW):: BCW
253 CHARACTER(16) :: MACHINE_ENDIAN
254 LOGICAL :: DO_BYTESWAP = .true.
261 IF( trim(machine_endian)==
"big_endian")
THEN
263 ELSEIF( trim(machine_endian)==
"little_endian")
THEN
266 ELSEIF(lu<=1999)
THEN
267 IF( trim(machine_endian)==
"big_endian")
THEN
269 ELSEIF( trim(machine_endian)==
"little_endian")
THEN
275 IF(do_byteswap)
CALL byteswap(bcw,lbcw,1)
284 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 bafrwritel(LU, IB, NB, KA, A)
This subprogram writes an unformatted fortran record.
subroutine bafrindex(LU, IB, LX, IX)
This subprogram calls bafrindexl() to either read an unformatted fortran record and return its length...
subroutine bafrindexl(LU, IB, LX, IX)
This subprogram either reads an unformatted fortran record and return its length and start byte of th...
subroutine chk_endianc(mendian)
Obtain machine endianness.
subroutine bafrreadl(LU, IB, NB, KA, A)
This subprogram reads an unformatted fortran record.
subroutine bafrwrite(LU, IB, NB, KA, A)
This subprogram calls bafrwrite() to write an unformatted fortran record.
subroutine bafrread(LU, IB, NB, KA, A)
This subprogram calls bafread() to read an unformatted fortran record.
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...