NCEPLIBS-w3emc
2.12.0
Loading...
Searching...
No Matches
mkfldsep.f
Go to the documentation of this file.
1
C> @file
2
C> @brief Makes TOC Flag Field Separator Block
3
C> @author Stephen Gilbert @date 2002-09-16
4
5
C> Generates a TOC Flag Field Separator Block used to separate WMO
6
C> Bulletins within a transmission file to be ingested in TOC's FTP Input
7
C> Service, which can be used to disseminate WMO buletins. See [File
8
C> Transfer Input Service Guide - Input examples and how to FTP files to
9
C> the Gateway] (https://www.weather.gov/tg/ftpingest).
10
C>
11
C> This routine can generate different flag field separator blocks
12
C> depending on the value of variable iopt. For details see [GATEWAY File
13
C> Standards & Content Structures] (https://www.weather.gov/tg/fstandrd).
14
C>
15
C> Bulletin "Flag Field Separator" block - OPTION 1 (old)
16
C> - bytes:
17
C> - 1 - 4 Marker string (####).
18
C> - 5 - 7 Block length [018 fixed value].
19
C> - 8 - 13 Total length of bulletin in bytes [octets]
20
C> (not including the flag field block).
21
C> - 14 - 17 Marker string (####).
22
C> - 18 Line Feed (ASCII "0A").
23
C>
24
C> Bulletin "Flag Field Separator" block - OPTION 1a (new)
25
C> - bytes:
26
C> - 1 - 4 Marker string (####).
27
C> - 5 - 7 Block length (nnn) - value always greater than 018.
28
C> - 8 - 18 Total length of bulletin in bytes [octets]
29
C> (not including the flag field block).
30
C> - 19 - nnn-5 Reserved for future use.
31
C> - nnn-4 - nnn-1 Marker string (####).
32
C> - nnn Line Feed (ASCII "0A").
33
C>
34
C> Bulletin "Flag Field Separator" block - OPTION 2 (limited)
35
C> - bytes:
36
C> - 1 - 4 Marker string (****).
37
C> - 5 - 14 Total length of bulletin in bytes [octets]
38
C> (not including the flag field block).
39
C> - 15 - 18 Marker string (****).
40
C> - 19 Line Feed (ASCII "0A").
41
C>
42
C> @param[in] iopt Flag Field Separator block option:
43
C> = 1: Separator block for use with alphanumeric bulletins.
44
C> if lenin <= 18 and lenbull <= 999999, OPTION 1 block will be generated.
45
C> if lenin > 18 or lenbull > 999999, OPTION 1a block will be generated.
46
C> = 2: Separator block for use with GRIB/BUFR bulletins.
47
C> @param[in] lenin Desired length of the flag field separator block.
48
C> ignored, if iopt=2.
49
C> @param[in] lenbull Integer length of the bulletin (in bytes) that will follow
50
C> this separator block.
51
C> @param[out] csep*(*) Character array containing the flag field separator.
52
C> @param[out] lenout Integer length of the flag field separator block.
53
C>
54
C> @author Stephen Gilbert @date 2002-09-16
55
subroutine
mkfldsep
(csep,iopt,lenin,lenbull,lenout)
56
C
57
character*(*)
,
intent(out)
:: csep
58
integer
,
intent(in)
:: iopt,lenin,lenbull
59
integer
,
intent(out)
:: lenout
60
C
61
character(len=4)
,
parameter
:: cstar=
'****'
,clb=
'####'
62
C
63
if
(iopt.eq.1)
then
64
if
( lenin .le. 18 .and. lenbull .le. 999999 )
then
65
C Create OPTION 1 separator block
66
csep(1:4)=clb
67
csep(5:7)=
'018'
68
write
(csep(8:13),fmt=
'(I6.6)'
) lenbull
69
csep(14:17)=clb
70
csep(18:18)=char(10)
71
lenout=18
72
else
! Create OPTION 1a separator block
73
nnn=lenin
74
if
( nnn.lt.23 ) nnn=23
75
csep(1:4)=clb
76
write
(csep(5:7),fmt=
'(I3.3)'
) nnn
77
write
(csep(8:18),fmt=
'(I11.11)'
) lenbull
78
! In docs, these bytes are "reserved for future use".
79
csep(19:nnn-5)=
'0'
80
csep(nnn-4:nnn-1)=clb
81
csep(nnn:nnn)=char(10)
82
lenout=nnn
83
endif
84
elseif
(iopt.eq.2)
then
! Create OPTION 2 separator block
85
csep(1:4)=cstar
86
write
(csep(5:14),fmt=
'(I10.10)'
) lenbull
87
csep(15:18)=cstar
88
csep(19:19)=char(10)
89
lenout=19
90
else
91
print *,
"mkfldsep: Option "
,iopt,
" not recognized."
92
csep(1:lenin)=
' '
93
endif
94
C
95
return
96
end
mkfldsep
subroutine mkfldsep(csep, iopt, lenin, lenbull, lenout)
Generates a TOC Flag Field Separator Block used to separate WMO Bulletins within a transmission file ...
Definition
mkfldsep.f:56
src
mkfldsep.f
Generated by
1.9.8