NCEPLIBS-bufr  11.6.0
 All Data Structures Files Functions Variables Pages
cpyupd.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine cpyupd (LUNIT, LIN, LUN, IBYT)
 THIS SUBROUTINE COPIES A SUBSET FROM ONE MESSAGE BUFFER (ARRAY MBAY IN MODULE BITBUF) TO ANOTHER AND/OR RESETS THE POINTERS. More...
 

Detailed Description

Author
WOOLLEN
Date
1994-01-06

Definition in file cpyupd.f.

Function/Subroutine Documentation

subroutine cpyupd (   LUNIT,
  LIN,
  LUN,
  IBYT 
)

THIS SUBROUTINE COPIES A SUBSET FROM ONE MESSAGE BUFFER (ARRAY MBAY IN MODULE BITBUF) TO ANOTHER AND/OR RESETS THE POINTERS.

IF THE SUBSET WILL NOT FIT INTO THE OUTPUT MESSAGE, OR IF THE SUBSET BYTE COUNT EXCEEDS 65530 (SUFFICIENTLY CLOSE TO THE 16-BIT BYTE COUNTER UPPER LIMIT OF 65535), THEN THAT MESSAGE IS FLUSHED TO LUNIT AND A NEW ONE IS CREATED IN ORDER TO HOLD THE COPIED SUBSET. ANY SUBSET WITH BYTE COUNT > 65530 WILL BE WRITTEN INTO ITS OWN ONE-SUBSET MESSAGE. IF THE SUBSET TO BE COPIED IS LARGER THAN THE MAXIMUM MESSAGE LENGTH, THEN A CALL IS ISSUED TO BUFR ARCHIVE LIBRARY SUBROUTINE BORT.

PROGRAM HISTORY LOG: 1994-01-06 J. WOOLLEN – ORIGINAL AUTHOR 1998-07-08 J. WOOLLEN – REPLACED CALL TO CRAY LIBRARY ROUTINE "ABORT" WITH CALL TO NEW INTERNAL BUFRLIB ROUTINE "BORT" 1999-11-18 J. WOOLLEN – THE NUMBER OF BUFR FILES WHICH CAN BE OPENED AT ONE TIME INCREASED FROM 10 TO 32 (NECESSARY IN ORDER TO PROCESS MULTIPLE BUFR FILES UNDER THE MPI) 2000-09-19 J. WOOLLEN – MAXIMUM MESSAGE LENGTH INCREASED FROM 10,000 TO 20,000 BYTES 2002-05-14 J. WOOLLEN – REMOVED OLD CRAY COMPILER DIRECTIVES 2003-11-04 S. BENDER – ADDED REMARKS/BUFRLIB ROUTINE INTERDEPENDENCIES 2003-11-04 D. KEYSER – UNIFIED/PORTABLE FOR WRF; ADDED DOCUMENTATION (INCLUDING HISTORY); OUTPUTS MORE COMPLETE DIAGNOSTIC INFO WHEN ROUTINE TERMINATES ABNORMALLY 2004-08-09 J. ATOR – MAXIMUM MESSAGE LENGTH INCREASED FROM 20,000 TO 50,000 BYTES 2009-03-23 J. ATOR – USE MSGFULL 2014-10-27 J. WOOLLEN – ACCOUNT FOR SUBSETS WITH BYTE COUNT > 65530 (THESE MUST BE WRITTEN INTO THEIR OWN ONE-SUBSET MESSAGE) 2014-10-27 D. KEYSER – FOR CASE ABOVE, DO NOT WRITE "CURRENT" MESSAGE IF IT CONTAINS ZERO SUBSETS 2014-12-10 J. ATOR – USE MODULES INSTEAD OF COMMON BLOCKS 2015-09-24 D. STOKES – FIX MISSING DECLARATION OF COMMON /QUIET/

USAGE: CALL CPYUPD (LUNIT, LIN, LUN, IBYT) INPUT ARGUMENT LIST: LUNIT - INTEGER: FORTRAN LOGICAL UNIT NUMBER FOR BUFR FILE LIN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS FOR INPUT MESSAGE LOCATION LUN - INTEGER: I/O STREAM INDEX INTO INTERNAL MEMORY ARRAYS FOR OUTPUT MESSAGE LOCATION IBYT - INTEGER: NUMBER OF BYTES OCCUPIED BY THIS SUBSET

REMARKS: THIS ROUTINE CALLS: BORT ERRWRT IUPB MSGFULL MSGINI MSGWRT MVB PKB THIS ROUTINE IS CALLED BY: COPYSB Normally not called by any application programs.

Definition at line 60 of file cpyupd.f.

References bort(), errwrt(), iupb(), msgfull(), msgini(), msgwrt(), mvb(), and pkb().

Referenced by copysb().