Merge remote-tracking branch 'origin/release-v4.6.1'
[WRF.git] / var / external / bufr / mvb.f
blob5ae94eb3433d08bfa1f1a61144673fa012d95e63
1 SUBROUTINE MVB(IB1,NB1,IB2,NB2,NBM)
3 C$$$ SUBPROGRAM DOCUMENTATION BLOCK
5 C SUBPROGRAM: MVB
6 C PRGMMR: WOOLLEN ORG: NP20 DATE: 1994-01-06
8 C ABSTRACT: THIS SUBROUTINE COPIES A SPECIFIED NUMBER OF BYTES FROM
9 C ONE PACKED BINARY ARRAY TO ANOTHER.
11 C PROGRAM HISTORY LOG:
12 C 1994-01-06 J. WOOLLEN -- ORIGINAL AUTHOR
13 C 1998-07-08 J. WOOLLEN -- REPLACED CALL TO CRAY LIBRARY ROUTINE
14 C "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB
15 C ROUTINE "BORT"
16 C 1998-10-27 J. WOOLLEN -- MODIFIED TO CORRECT PROBLEMS CAUSED BY IN-
17 C LINING CODE WITH FPP DIRECTIVES
18 C 2002-05-14 J. WOOLLEN -- REMOVED OLD CRAY COMPILER DIRECTIVES
19 C 2003-11-04 S. BENDER -- ADDED REMARKS/BUFRLIB ROUTINE
20 C INTERDEPENDENCIES
21 C 2003-11-04 D. KEYSER -- UNIFIED/PORTABLE FOR WRF; ADDED
22 C DOCUMENTATION (INCLUDING HISTORY); OUTPUTS
23 C MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE
24 C TERMINATES ABNORMALLY
25 C 2005-11-29 J. ATOR -- MAXIMUM NUMBER OF BYTES TO COPY INCREASED
26 C FROM 24000 TO MXIMB
28 C USAGE: CALL MVB (IB1, NB1, IB2, NB2, NBM)
29 C INPUT ARGUMENT LIST:
30 C IB1 - INTEGER: *-WORD PACKED INPUT BINARY ARRAY
31 C NB1 - INTEGER: POINTER TO FIRST BYTE IN IB1 TO COPY FROM
32 C NB2 - INTEGER: POINTER TO FIRST BYTE IN IB2 TO COPY TO
33 C NBM - INTEGER: NUMBER OF BYTES TO COPY
35 C OUTPUT ARGUMENT LIST:
36 C IB2 - INTEGER: *-WORD PACKED OUTPUT BINARY ARRAY
38 C REMARKS:
39 C THIS ROUTINE CALLS: BORT PKB UPB
40 C THIS ROUTINE IS CALLED BY: ATRCPT CNVED4 CPYUPD MSGUPD
41 C STNDRD
42 C Normally not called by any application
43 C programs.
45 C ATTRIBUTES:
46 C LANGUAGE: FORTRAN 77
47 C MACHINE: PORTABLE TO ALL PLATFORMS
49 C$$$
51 INCLUDE 'bufrlib.prm'
53 CHARACTER*128 BORT_STR
54 DIMENSION IB1(*),IB2(*),NVAL(MXIMB)
56 C-----------------------------------------------------------------------
57 C-----------------------------------------------------------------------
59 IF(NBM.GT.MXIMB) GOTO 900
60 JB1 = 8*(NB1-1)
61 JB2 = 8*(NB2-1)
63 DO N=1,NBM
64 CALL UPB(NVAL(N),8,IB1,JB1)
65 ENDDO
67 DO N=1,NBM
68 CALL PKB(NVAL(N),8,IB2,JB2)
69 ENDDO
71 C EXITS
72 C -----
74 RETURN
75 900 WRITE(BORT_STR,'("BUFRLIB: MVB - THE NUMBER OF BYTES BEING '//
76 . 'REQUESTED TO COPY (",I7,") EXCEEDS THE LIMIT (",I7,")")')
77 . NBM, MXIMB
78 CALL BORT(BORT_STR)
79 END