NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fp06.f
Go to the documentation of this file.
1C> @file
2C> @brief NMC title subroutine.
3C> @author Ralph Jones @date 1988-11-28
4
5C> Provides a title for data fields formulated according to
6C> nmc o.n. 84. the extracted information is converted into up to
7C> 81 words and stored at a user provided location.
8C>
9C> Program history log:
10C> - Ralph Jones 1988-11-28
11C> - Ralph Jones 1990-02-12 Convert to cray cft77 fortran
12C> - Ralph Jones 1991-04-26 Add q type 23, 136, 137, 71, 159, 75, 118,
13C> 119, 24 to tables, changes for big records.
14C> - Ralph Jones 1993-02-23 Add q type 157 & 158 (core & tke) to tables
15C>
16C> @param[in] N Integer number of lines of output desired
17C> - = 1 First 88 char. the abbreviated title (line 1 starts at arg2(1))
18C> - = 2 First 216 char. decimal values of the parameters
19C> - = 3 All 324 char., hexidecimal dump of the 12 word field label (line 3 char. 221)
20C> @param ID, KTITLE
21C>
22C> @note See NMC O.N. 84 for data field abbreviations.
23C>
24C> @author Ralph Jones @date 1988-11-28
25 SUBROUTINE w3fp06(ID,KTITLE,N)
26C
27 INTEGER(8) ID(6)
28 INTEGER(4) MASK(8)
29C
30 CHARACTER * 324 KTITLE
31C
32 DATA mask(1)/z'0000000F'/
33 DATA mask(2)/z'000000FF'/
34 DATA mask(3)/z'00000FFF'/
35 DATA mask(4)/z'0000FFFF'/
36 DATA mask(5)/z'000FFFFF'/
37 DATA mask(6)/z'00FFFFFF'/
38 DATA mask(7)/z'0FFFFFFF'/
39 DATA mask(8)/z'FFFFFFFF'/
40C
41 CALL line01(id,mask,ktitle)
42 IF (n.GT.1) GO TO 10
43 RETURN
44C
45 10 CONTINUE
46 CALL line02(id,mask,ktitle)
47 IF (n.GT.2) GO TO 20
48 RETURN
49C
50 20 CONTINUE
51 CALL line03(id,ktitle)
52 RETURN
53 END
54C> @brief Creates the first line of title.
55C> @author Ralph Jones @date 1988-09-02
56
57C> Creates the fist line of the title from the id words.
58C> call by w3fp06() to make 1st line of title. Words 1 to 22.
59C>
60C> Program history log:
61C> - Ralph Jones 1988-09-02
62C> - Ralph Jones 1993-02-23 Add q type 157 & 158 (core & tke) to tables.
63C>
64C> @param[in] ID Id words (6 integer words) office note 84.
65C> @param[in] MASK Mask for unpacking id words (8 integer words).
66C> @param[out] KTITLE Character *324 array
67C>
68C> @author Ralph Jones @date 1988-09-02
69 SUBROUTINE line01(ID,MASK,KTITLE)
70
71C
72C CREATES THE FIRST 22 WORDS OF TITLER
73C
74 INTEGER(8) ID(6)
75 INTEGER(4) MASK(8)
76 INTEGER(4) SHFMSK(17)
77C
78 CHARACTER * 4 UNIT
79 CHARACTER * 4 UNIT1
80 CHARACTER * 4 DAYS
81 CHARACTER * 5 FOR
82 CHARACTER * 5 FOR1
83 CHARACTER * 1 DASH
84 CHARACTER * 8 KNAME(9)
85 CHARACTER * 8 KNAME1(3)
86 CHARACTER * 324 KTITLE
87 CHARACTER * 8 KWRITE(3)
88 CHARACTER * 8 INUM1
89 CHARACTER * 8 INUM2
90 CHARACTER * 6 QNAME1
91 CHARACTER * 6 QNAME2
92 CHARACTER * 6 QNAME3
93 CHARACTER * 2 DN
94 CHARACTER * 6 QNAME(166)
95 CHARACTER * 6 QWRITE
96 CHARACTER * 4 SNAME(18)
97 CHARACTER * 20 VUNIT(2)
98 CHARACTER * 7 AFTER
99 CHARACTER * 7 AFTBEF
100C
101 INTEGER KK(3)
102 INTEGER LL(166)
103 INTEGER JKEEP(17)
104 INTEGER JLIST(17)
105 INTEGER C1,C2,E1,E2,S1,S2,Q,M,G
106 INTEGER YY,MM,DD,HH,F1,F2,JT,JN
107C
108C IDWORDS: MASK CONTROL (INTEGER)
109C
110 DATA shfmsk( 1)/z'20020100'/
111 DATA shfmsk( 2)/z'28020400'/
112 DATA shfmsk( 3)/z'30020400'/
113 DATA shfmsk( 4)/z'38020400'/
114 DATA shfmsk( 5)/z'08050100'/
115 DATA shfmsk( 6)/z'00020100'/
116 DATA shfmsk( 7)/z'08050200'/
117 DATA shfmsk( 8)/z'00020200'/
118 DATA shfmsk( 9)/z'3C010200'/
119 DATA shfmsk(10)/z'28030100'/
120 DATA shfmsk(11)/z'28030200'/
121 DATA shfmsk(12)/z'34030100'/
122 DATA shfmsk(13)/z'20020400'/
123 DATA shfmsk(14)/z'30020400'/
124 DATA shfmsk(15)/z'1C010100'/
125 DATA shfmsk(16)/z'1C010200'/
126 DATA shfmsk(17)/z'20020200'/
127C
128C REFERENCE TABLE FOR SNAME.
129C
130 DATA jlist(1)/1/
131 DATA jlist(2)/2/
132 DATA jlist(3)/6/
133 DATA jlist(4)/7/
134 DATA jlist(5)/8/
135 DATA jlist(6)/16/
136 DATA jlist(7)/19/
137 DATA jlist(8)/128/
138 DATA jlist(9)/129/
139 DATA jlist(10)/130/
140 DATA jlist(11)/144/
141 DATA jlist(12)/145/
142 DATA jlist(13)/146/
143 DATA jlist(14)/147/
144 DATA jlist(15)/148/
145 DATA jlist(16)/131/
146 DATA jlist(17)/132/
147C
148C SNAME TABLE.
149C
150 DATA sname( 1)/' GPM'/
151 DATA sname( 2)/' PA '/
152 DATA sname( 3)/' M '/
153 DATA sname( 4)/' M '/
154 DATA sname( 5)/' MB '/
155 DATA sname( 6)/' DEG'/
156 DATA sname( 7)/' POT'/
157 DATA sname( 8)/' MSL'/
158 DATA sname( 9)/' SFC'/
159 DATA sname(10)/' TRO'/
160 DATA sname(11)/' BDY'/
161 DATA sname(12)/' TRS'/
162 DATA sname(13)/' STS'/
163 DATA sname(14)/' QCP'/
164 DATA sname(15)/' SIG'/
165 DATA sname(16)/'MWSL'/
166 DATA sname(17)/'PLYR'/
167 DATA sname(18)/' '/
168C
169C REFERENCE TABLE FOR QNAME.
170C
171 DATA ll( 1)/ 1/
172 DATA ll( 2)/ 2/
173 DATA ll( 3)/ 6/
174 DATA ll( 4)/ 8/
175 DATA ll( 5)/ 16/
176 DATA ll( 6)/ 17/
177 DATA ll( 7)/ 18/
178 DATA ll( 8)/ 19/
179 DATA ll( 9)/ 20/
180 DATA ll(10)/ 21/
181 DATA ll(11)/ 40/
182 DATA ll(12)/ 41/
183 DATA ll(13)/ 42/
184 DATA ll(14)/ 43/
185 DATA ll(15)/ 44/
186 DATA ll(16)/ 48/
187 DATA ll(17)/ 49/
188 DATA ll(18)/ 50/
189 DATA ll(19)/ 51/
190 DATA ll(20)/ 52/
191 DATA ll(21)/ 53/
192 DATA ll(22)/ 54/
193 DATA ll(23)/ 55/
194 DATA ll(24)/ 56/
195 DATA ll(25)/ 57/
196 DATA ll(26)/ 58/
197 DATA ll(27)/ 59/
198 DATA ll(28)/ 60/
199 DATA ll(29)/ 72/
200 DATA ll(30)/ 73/
201 DATA ll(31)/ 74/
202 DATA ll(32)/ 80/
203 DATA ll(33)/ 81/
204 DATA ll(34)/ 88/
205 DATA ll(35)/ 89/
206 DATA ll(36)/ 90/
207 DATA ll(37)/ 91/
208 DATA ll(38)/ 92/
209 DATA ll(39)/ 93/
210 DATA ll(40)/ 94/
211 DATA ll(41)/ 95/
212 DATA ll(42)/ 96/
213 DATA ll(43)/112/
214 DATA ll(44)/113/
215 DATA ll(45)/114/
216 DATA ll(46)/115/
217 DATA ll(47)/120/
218 DATA ll(48)/121/
219 DATA ll(49)/160/
220 DATA ll(50)/161/
221 DATA ll(51)/162/
222 DATA ll(52)/163/
223 DATA ll(53)/164/
224 DATA ll(54)/165/
225 DATA ll(55)/166/
226 DATA ll(56)/167/
227 DATA ll(57)/168/
228 DATA ll(58)/169/
229 DATA ll(59)/170/
230 DATA ll(60)/171/
231 DATA ll(61)/176/
232 DATA ll(62)/177/
233 DATA ll(63)/178/
234 DATA ll(64)/184/
235 DATA ll(65)/185/
236 DATA ll(66)/186/
237 DATA ll(67)/187/
238 DATA ll(68)/188/
239 DATA ll(69)/384/
240 DATA ll(70)/385/
241 DATA ll(71)/386/
242 DATA ll(72)/387/
243 DATA ll(73)/388/
244 DATA ll(74)/389/
245 DATA ll(75)/390/
246 DATA ll(76)/391/
247 DATA ll(77)/ 97/
248 DATA ll(78)/ 98/
249 DATA ll(79)/ 99/
250 DATA ll(80)/100/
251 DATA ll(81)/101/
252 DATA ll(82)/102/
253 DATA ll(83)/103/
254 DATA ll(84)/172/
255 DATA ll(85)/200/
256 DATA ll(86)/201/
257 DATA ll(87)/202/
258 DATA ll(88)/203/
259 DATA ll(89)/392/
260 DATA ll(90)/ 7/
261 DATA ll(91)/ 61/
262 DATA ll(92)/104/
263 DATA ll(93)/173/
264 DATA ll(94)/174/
265 DATA ll(95)/175/
266 DATA ll(96)/304/
267 DATA ll(97)/305/
268 DATA ll(98)/400/
269 DATA ll(99)/401/
270 DATA ll(100)/402/
271 DATA ll(101)/403/
272 DATA ll(102)/404/
273 DATA ll(103)/405/
274 DATA ll(104)/ 9/
275 DATA ll(105)/105/
276 DATA ll(106)/116/
277 DATA ll(107)/106/
278 DATA ll(108)/107/
279 DATA ll(109)/108/
280 DATA ll(110)/179/
281 DATA ll(111)/180/
282 DATA ll(112)/181/
283 DATA ll(113)/182/
284 DATA ll(114)/183/
285 DATA ll(115)/189/
286 DATA ll(116)/190/
287 DATA ll(117)/191/
288 DATA ll(118)/192/
289 DATA ll(119)/193/
290 DATA ll(120)/194/
291 DATA ll(121)/195/
292 DATA ll(122)/196/
293 DATA ll(123)/197/
294 DATA ll(124)/198/
295 DATA ll(125)/199/
296 DATA ll(126)/204/
297 DATA ll(127)/210/
298 DATA ll(128)/211/
299 DATA ll(129)/212/
300 DATA ll(130)/213/
301 DATA ll(131)/214/
302 DATA ll(132)/215/
303 DATA ll(133)/216/
304 DATA ll(134)/117/
305 DATA ll(135)/209/
306 DATA ll(136)/ 22/
307 DATA ll(137)/ 62/
308 DATA ll(138)/ 63/
309 DATA ll(139)/ 82/
310 DATA ll(140)/ 83/
311 DATA ll(141)/ 84/
312 DATA ll(142)/ 85/
313 DATA ll(143)/205/
314 DATA ll(144)/206/
315 DATA ll(145)/207/
316 DATA ll(146)/208/
317 DATA ll(147)/217/
318 DATA ll(148)/109/
319 DATA ll(149)/110/
320 DATA ll(150)/111/
321 DATA ll(151)/86/
322 DATA ll(152)/87/
323 DATA ll(153)/218/
324 DATA ll(154)/133/
325 DATA ll(155)/134/
326 DATA ll(156)/135/
327 DATA ll(157)/23/
328 DATA ll(158)/136/
329 DATA ll(159)/137/
330 DATA ll(160)/71/
331 DATA ll(161)/159/
332 DATA ll(162)/75/
333 DATA ll(163)/157/
334 DATA ll(164)/119/
335 DATA ll(165)/24/
336 DATA ll(166)/158/
337C
338C QNAME TABLE: CHARACTER*6
339C
340 DATA qname( 1)/' HGT '/
341 DATA qname( 2)/' P ALT'/
342 DATA qname( 3)/' DIST '/
343 DATA qname( 4)/' PRES '/
344 DATA qname( 5)/' TMP '/
345 DATA qname( 6)/' DPT '/
346 DATA qname( 7)/' DEPR '/
347 DATA qname( 8)/' POT '/
348 DATA qname( 9)/' T MAX'/
349 DATA qname(10)/' T MIN'/
350 DATA qname(11)/' V VEL'/
351 DATA qname(12)/' NETVD'/
352 DATA qname(13)/' DZDT '/
353 DATA qname(14)/' OROW '/
354 DATA qname(15)/' FRCVV'/
355 DATA qname(16)/' U GRD'/
356 DATA qname(17)/' V GRD'/
357 DATA qname(18)/' WIND '/
358 DATA qname(19)/' T WND'/
359 DATA qname(20)/' VW SH'/
360 DATA qname(21)/' U DIV'/
361 DATA qname(22)/' V DIV'/
362 DATA qname(23)/' WDIR '/
363 DATA qname(24)/' WWND '/
364 DATA qname(25)/' SWND '/
365 DATA qname(26)/' RATS '/
366 DATA qname(27)/' VECW '/
367 DATA qname(28)/' SFAC '/
368 DATA qname(29)/' ABS V'/
369 DATA qname(30)/' REL V'/
370 DATA qname(31)/' DIV '/
371 DATA qname(32)/' STRM '/
372 DATA qname(33)/' V POT'/
373 DATA qname(34)/' R H '/
374 DATA qname(35)/' P WAT'/
375 DATA qname(36)/' A PCP'/
376 DATA qname(37)/' P O P'/
377 DATA qname(38)/' P O Z'/
378 DATA qname(39)/' SNO D'/
379 DATA qname(40)/' ACPCP'/
380 DATA qname(41)/' SPF H'/
381 DATA qname(42)/' L H2O'/
382 DATA qname(43)/' LFT X'/
383 DATA qname(44)/' TOTOS'/
384 DATA qname(45)/' K X '/
385 DATA qname(46)/' C INS'/
386 DATA qname(47)/' L WAV'/
387 DATA qname(48)/' S WAV'/
388 DATA qname(49)/' DRAG '/
389 DATA qname(50)/' LAND '/
390 DATA qname(51)/' KFACT'/
391 DATA qname(52)/' 10TSL'/
392 DATA qname(53)/' 7TSL '/
393 DATA qname(54)/' RCPOP'/
394 DATA qname(55)/' RCMT '/
395 DATA qname(56)/' RCMP '/
396 DATA qname(57)/' ORTHP'/
397 DATA qname(58)/' ALBDO'/
398 DATA qname(59)/' ENFLX'/
399 DATA qname(60)/' TTHTG'/
400 DATA qname(61)/' LAT '/
401 DATA qname(62)/' LON '/
402 DATA qname(63)/' RADIC'/
403 DATA qname(64)/' PROB '/
404 DATA qname(65)/' CPROB'/
405 DATA qname(66)/' USTAR'/
406 DATA qname(67)/' TSTAR'/
407 DATA qname(68)/' MIXHT'/
408 DATA qname(69)/' WTMP '/
409 DATA qname(70)/' WVHGT'/
410 DATA qname(71)/' SWELL'/
411 DATA qname(72)/' WVSWL'/
412 DATA qname(73)/' WVPER'/
413 DATA qname(74)/' WVDIR'/
414 DATA qname(75)/' SWPER'/
415 DATA qname(76)/' SWDIR'/
416 DATA qname(77)/' RRATE'/
417 DATA qname(78)/' TSTM '/
418 DATA qname(79)/' CSVR '/
419 DATA qname(80)/' CTDR '/
420 DATA qname(81)/' MIXR '/
421 DATA qname(82)/' PSVR '/
422 DATA qname(83)/' MCONV'/
423 DATA qname(84)/' ENRGY'/
424 DATA qname(85)/' RDNCE'/
425 DATA qname(86)/' BRTMP'/
426 DATA qname(87)/' TCOZ '/
427 DATA qname(88)/' OZMR '/
428 DATA qname(89)/' ICWAT'/
429 DATA qname(90)/' DEPTH'/
430 DATA qname(91)/' GUST '/
431 DATA qname(92)/' VAPP '/
432 DATA qname(93)/' TOTHF'/
433 DATA qname(94)/' SPEHF'/
434 DATA qname(95)/' SORAD'/
435 DATA qname(96)/' UOGRD'/
436 DATA qname(97)/' VOGRD'/
437 DATA qname(98)/' HTSGW'/
438 DATA qname(99)/' PERPW'/
439 DATA qname(100)/' DIRPW'/
440 DATA qname(101)/' PERSW'/
441 DATA qname(102)/' DIRSW'/
442 DATA qname(103)/' WCAPS'/
443 DATA qname(104)/' PTEND'/
444 DATA qname(105)/' NCPCP'/
445 DATA qname(106)/' 4LFTX'/
446 DATA qname(107)/' ICEAC'/
447 DATA qname(108)/' NPRAT'/
448 DATA qname(109)/' CPRAT'/
449 DATA qname(110)/'CEILHT'/
450 DATA qname(111)/' VISIB'/
451 DATA qname(112)/'LIQPCP'/
452 DATA qname(113)/'FREPCP'/
453 DATA qname(114)/'FROPCP'/
454 DATA qname(115)/' MIXLY'/
455 DATA qname(116)/' DLRFL'/
456 DATA qname(117)/' ULRFL'/
457 DATA qname(118)/' DSRFL'/
458 DATA qname(119)/' USRFL'/
459 DATA qname(120)/' UTHFL'/
460 DATA qname(121)/' UTWFL'/
461 DATA qname(122)/' TTLWR'/
462 DATA qname(123)/' TTSWR'/
463 DATA qname(124)/' TTRAD'/
464 DATA qname(125)/' MSTAV'/
465 DATA qname(126)/' SWABS'/
466 DATA qname(127)/' CDLYR'/
467 DATA qname(128)/' CDCON'/
468 DATA qname(129)/' PBCLY'/
469 DATA qname(130)/' PTCLY'/
470 DATA qname(131)/' PBCON'/
471 DATA qname(132)/' PTCON'/
472 DATA qname(133)/' SFEXC'/
473 DATA qname(134)/' A EVP'/
474 DATA qname(135)/' STCOF'/
475 DATA qname(136)/' TSOIL'/
476 DATA qname(137)/'D DUDT'/
477 DATA qname(138)/'D DVDT'/
478 DATA qname(139)/' U STR'/
479 DATA qname(140)/' V STR'/
480 DATA qname(141)/' TUVRD'/
481 DATA qname(142)/' TVVRD'/
482 DATA qname(143)/' TTLRG'/
483 DATA qname(144)/' TTSHL'/
484 DATA qname(145)/' TTDEP'/
485 DATA qname(146)/' TTVDF'/
486 DATA qname(147)/' ZSTAR'/
487 DATA qname(148)/' TQDEP'/
488 DATA qname(149)/' TQSHL'/
489 DATA qname(150)/' TQVDF'/
490 DATA qname(151)/'XGWSTR'/
491 DATA qname(152)/'YGWSTR'/
492 DATA qname(153)/' STDZG'/
493 DATA qname(154)/' A LEV'/
494 DATA qname(155)/' T AIL'/
495 DATA qname(156)/' B AIL'/
496 DATA qname(157)/' EPOT '/
497 DATA qname(158)/' MSLSA'/
498 DATA qname(159)/' MSLMA'/
499 DATA qname(160)/'MGSTRM'/
500 DATA qname(161)/' CONDP'/
501 DATA qname(162)/' POT V'/
502 DATA qname(163)/' CAPE '/
503 DATA qname(164)/' CIN '/
504 DATA qname(165)/' VTMP '/
505 DATA qname(166)/' TKE '/
506C
507C REFERENCE TABLE FOR G (GENERATING PROGRAM NAME)
508C
509 DATA kk(1)/57/
510 DATA kk(2)/58/
511 DATA kk(3)/59/
512C
513C G TABLE (GENERATING PROGRM NAME):
514C
515 DATA kname/' ECMWF', ' READING', ',UK. ',
516 & ' FNOC', ' MONTERE', 'Y, CA. ',
517 & ' AFGWC ', 'OFFUTT A', 'FB, NB. '/
518 DATA kname1/' WMC N','MC WASHI', 'NGTON '/
519C
520 DATA after /' AFTER '/
521 DATA dn /'DN'/
522 DATA qname1/' THCK '/
523 DATA qname2/' THKDN'/
524 DATA qname3/' PRSDN'/
525C
526 DATA vunit(1)/' 0-HR FCST VALID AT '/
527 DATA vunit(2)/' ANALYSIS VALID AT '/
528 DATA unit1 /' HRS'/
529 DATA days /' DYS'/
530 DATA for1 /' FOR '/
531 DATA dash /'-'/
532C
533 200 FORMAT ( ' ',a7,a4,' ',a7)
534 210 FORMAT ( a4,1x,a6,a5,f4.1,a4,a7,
535 & i2.2,a1,i2.2,a1,i2.2,1x,i2.2,'Z',3a8)
536 220 FORMAT ( 13x,a7)
537 230 FORMAT ( ' Q IS AN ILLEGAL OFFICE NOTE 84 DATA TYPE, Q = ',
538 & i5,35x)
539 240 FORMAT ( a4,1x,a6,a20,
540 & i2.2,a1,i2.2,a1,i2.2,1x,i2.2,'Z',3a8)
541C
542C 1. UNPACK ID WORDS.
543C
544 DO 10 n = 1,17
545 itemp = 0
546 ktemp = 0
547 itemp = shfmsk(n)
548 nshift = iand(ishft(itemp,-24),255)
549 nmask = iand(ishft(itemp,-16),255)
550 nid = iand(ishft(itemp,-8),255)
551 itemp = mask(nmask)
552 ktemp = id(nid)
553 jkeep(n) = iand(itemp,ishft(ktemp,-nshift))
554 10 CONTINUE
555C
556 f1 = jkeep(1)
557 dd = jkeep(2)
558 mm = jkeep(3)
559 yy = jkeep(4)
560 c1 = jkeep(5)
561 e1 = jkeep(6)
562 c2 = jkeep(7)
563 e2 = jkeep(8)
564 m = jkeep(9)
565 s1 = jkeep(10)
566 s2 = jkeep(11)
567 q = jkeep(12)
568 hh = jkeep(13)
569 g = jkeep(14)
570 jt = jkeep(15)
571 jn = jkeep(16)
572 f2 = jkeep(17)
573C
574 ks = iand(ishft(id(3),-40_8),255_8)
575C
576C 2. FIND WHICH PARAMETER (Q) IS INDICATED BE THE ID WORDS.
577C
578 DO 20 n = 1,166
579 nn = n
580 IF (q.EQ.ll(n)) GO TO 30
581 20 CONTINUE
582C
583C CAN NOT FIND A LEGAL Q
584 GO TO 170
585C
586 30 CONTINUE
587 unit(1:4) = unit1(1:4)
588 for(1:5) = for1(1:5)
589 aftbef(1:7) = after(1:7)
590C
591 IF (e1.GT.128) e1 = -(jkeep(6)-128)
592 IF (e2.GT.128) e2 = -(jkeep(8)-128)
593C
594C 3. FIND WHICH SURFACE IS INDICATED BY THE ID WORDS
595C AS BEING THE FIRST SURFACE.
596C
597 DO 40 i = 1,17
598 IF (s1.EQ.jlist(i)) THEN
599 k1 = i
600 GO TO 50
601 ENDIF
602 40 CONTINUE
603 k1 = 18
604C
605 50 CONTINUE
606C
607C 4. BEGIN PROCESSING OF A ONE-SURFACE TITLE
608C
609 IF (m.EQ.0.OR.m.EQ.8) THEN
610 k2 = k1
611 CALL value1(s1,c1,e1,inum1)
612 WRITE (ktitle(1:20),220) inum1
613 GO TO 80
614 ENDIF
615C
616C 5. FIND WHICH SURFACE IS INDICATED BY THE ID WORDS
617C AS BEING THE SECOND SURFACE.
618C
619 DO 60 i = 1,17
620 IF (s2.EQ.jlist(i)) THEN
621 k2 = i
622 GO TO 70
623 ENDIF
624 60 CONTINUE
625 k2 = 18
626C
627 70 CONTINUE
628C
629C 6. BEGIN PROCESSING OF A TWO-SURFACE TITLE
630C
631 CALL value1(s1,c1,e1,inum1)
632 CALL value1(s2,c2,e2,inum2)
633 WRITE (ktitle(1:20),200) inum1 , sname(k1) , inum2
634C
635 80 CONTINUE
636 qwrite = qname(nn)
637C
638 IF (q.EQ.1 .AND. m.EQ.1.AND. s1.EQ.8) qwrite = qname1
639 IF (q.EQ.1 .AND. m.EQ.1.AND. s1.EQ.8.AND.ks.EQ.2) qwrite = qname2
640 IF (q.EQ.8 .AND. s1.EQ.128.AND.ks.EQ.2) qwrite = qname3
641 IF (jt.EQ.6) qwrite(5:6) = dn(1:2)
642C
643C 7. SET DATE/TIME FIELDS
644C
645C A. CHECK IF F1 AND F2 ARE IN HRS, HALF DAYS OR DAYS.
646C
647 rf1 = f1
648 rf2 = f2
649C
650C B: IF F1 IN HALF DAYS: CONVERT TO HOURS
651C
652 IF (jn.EQ.15.OR.jt.EQ.7) THEN
653 rf1 = rf1 * 12.0
654 rf2 = rf2 * 12.0
655 ENDIF
656C
657C C: IF F1 IN DAYS: CONVERT TO HOURS
658C
659 IF (jt.EQ.10) THEN
660 rf1 = rf1 * 24.0
661 rf2 = rf2 * 24.0
662 ENDIF
663C
664C D: CONVERT HOURS TO DAYS IF HOURS GREATER THAN 72
665C
666 IF (jt.NE.6) THEN
667 IF (rf1.GT.72.0.OR.rf2.GT.72.0) THEN
668 rf1 = rf1 / 24.0
669 rf2 = rf2 / 24.0
670 unit(1:4) = days(1:4)
671 ENDIF
672 ENDIF
673C
674 IF (jt.EQ.6) THEN
675 IF (f1.GT.127) THEN
676 f1 = and(f1,127)
677 f1 = -f1
678 ENDIF
679 cf1 = f1
680 cf2 = f2
681 CALL climo(cf1,cf2,unit,for,aftbef)
682 rf1 = cf1
683 CALL setcl(cf2,unit,ktitle)
684 ENDIF
685C
686C 8. SET GENERATING PROGRAM NAME
687C
688 DO 110 k = 1,3
689 IF (g.EQ.kk(k)) GO TO 130
690 110 CONTINUE
691C
692 DO 120 l = 1,3
693 kwrite(l) = kname1(l)
694 120 CONTINUE
695 GO TO 150
696C
697 130 CONTINUE
698 DO 140 l = 1,3
699 kwrite(l) = kname( 3*(k-1) + l)
700 140 CONTINUE
701C
702C 9. ENCODE THE TITLE LINE
703C
704C 9.1 DISTINGUISH BETWEEN ANALYSIS AND ZERO FORECASTS
705C AND 'REAL' FORECASTS
706C
707 150 CONTINUE
708 IF (f1.NE.0) GO TO 160
709 IF (g.EQ.19.OR.g.EQ.22.OR.g.EQ.43.OR.g.EQ.44.OR.g.EQ.49.OR.
710 & g.EQ.55.OR.g.EQ.56.OR.g.EQ.64) THEN
711 iii = 2
712 IF (m.EQ.8.OR.m.EQ.9.OR.m.EQ.10) iii = 1
713 ELSE
714 iii = 1
715 ENDIF
716C
717 WRITE (ktitle(21:88),240) sname(k2), qwrite, vunit(iii),
718 & yy, dash, mm, dash, dd, hh, (kwrite(l),l=1,3)
719 RETURN
720C
721 160 CONTINUE
722 WRITE (ktitle(21:88),210) sname(k2), qwrite, for, rf1, unit,
723 & aftbef, yy, dash, mm, dash, dd, hh, (kwrite(l),l=1,3)
724 RETURN
725C
726 170 CONTINUE
727 WRITE (ktitle(1:88),230) q
728 RETURN
729 END
730C> @brief Creates value1 of surface from ids.
731C> @author Ralph Jones @date 1988-11-28
732
733C> Creates the numerical value for the surface
734C> to be built into the first line of the title.
735C>
736C> Program history log:
737C> - Ralph Jones 1988-11-28
738C> - Ralph Jones 1989-11-01 Convert to cray cft77 fortran.
739C>
740C> @param[in] S Integer number of surface.
741C> @param[in] C,E Numerical value of the surface (SURFACE = S * 10 ** E).
742C> @param[out] NUM 7 character value of the surface for the title.
743C>
744C> @author Ralph Jones @date 1988-11-28
745 SUBROUTINE value1(S,C,E,NUM)
746
747C
748 INTEGER C
749 INTEGER E
750 INTEGER S
751C
752 CHARACTER*8 JNUM
753 CHARACTER*8 KNUM
754 CHARACTER*7 LTEMP
755 CHARACTER*8 NUM
756 CHARACTER*1 POINT
757 CHARACTER*1 ZERO
758C
759 DATA jnum /' 0.0000 '/
760 DATA knum /' '/
761 DATA point /'.'/
762 DATA zero /'0'/
763C
764 101 FORMAT ( i6,' ')
765C
766 IF (s.GE.128.AND.s.LE.132) GO TO 110
767 IF (c.EQ.0) GO TO 100
768 WRITE (ltemp(1:7),101) c
769 j = e + 6
770 k = j + 1
771 IF (j.EQ.0) GO TO 90
772 num(1:j) = ltemp(1:j)
773C
774 90 CONTINUE
775 num(k:k) = point
776 num(k+1:8) = ltemp(k:7)
777 IF (j.EQ.0) num(2:2) = zero
778 GO TO 150
779C
780 100 CONTINUE
781 num = jnum
782 GO TO 150
783C
784 110 CONTINUE
785 num = knum
786C
787 150 CONTINUE
788C
789 RETURN
790 END
791C> @brief Creates the second line of title.
792C> @author Ralph Jones @date 1988-11-28
793
794C> Creates the second line of the title from the id words.
795C> called by w3fp06. words 23 to 54.
796C>
797C> Program history log:
798C> - Ralph Jones 1988-11-28
799C> - Ralph Jones 1989-11-01 Convert to cray cft77 fortran.
800C> - Ralph Jones 1991-03-01 Changes for big records.
801C>
802C> @param[in] ID Id words (6 integer words) office note 84
803C> @param[in] MASK Mask for unpacking id words (8 words)
804C> @param[out] KTITLE Title character*324
805C>
806C> @author Ralph Jones @date 1988-11-28
807 SUBROUTINE line02(ID,MASK,KTITLE)
808
809C
810 INTEGER(8) ID(6)
811 INTEGER(8) IKEEP(17)
812 INTEGER(4) MASK(8)
813 INTEGER(8) MASK32,MASKN
814 INTEGER(4) SHFMSK(17)
815 integer(8) irtemp
816 real(4) rtemp(2)
817 equivalence(irtemp,rtemp(1))
818C
819 CHARACTER * 324 KTITLE
820C
821C IDWORDS: MASK CONTROL (INTEGER)
822C
823 DATA maskn /z'FFFFFFFFFFFF0000'/
824 DATA mask32/z'00000000FFFFFFFF'/
825 DATA shfmsk( 1)/z'3C010200'/
826 DATA shfmsk( 2)/z'1C010100'/
827 DATA shfmsk( 3)/z'1C010200'/
828 DATA shfmsk( 4)/z'20020100'/
829 DATA shfmsk( 5)/z'20020200'/
830 DATA shfmsk( 6)/z'38020300'/
831 DATA shfmsk( 7)/z'30020300'/
832 DATA shfmsk( 8)/z'28020300'/
833 DATA shfmsk( 9)/z'20020300'/
834 DATA shfmsk(10)/z'3C010300'/
835 DATA shfmsk(11)/z'18020400'/
836 DATA shfmsk(12)/z'10020400'/
837 DATA shfmsk(13)/z'00040400'/
838 DATA shfmsk(14)/z'30040500'/
839 DATA shfmsk(15)/z'00040500'/
840 DATA shfmsk(16)/z'00080500'/
841 DATA shfmsk(17)/z'20040600'/
842C
843 100 FORMAT(' M=',i2,' T=',i2,' N=',i2,' F1=',i3,' F2=',i3,' CD=',i3,
844 1' CM=',i3,' KS=',i3,' K=',i3,' GES=',i2,' R=',i3,' G=',i3,
845 2' J=',i5,' B=',i5,' Z=',i5,' A=',e15.8,' N=',i5,' ')
846C
847C UNPACK ID WORDS.
848C
849 DO 10 n = 1,17
850 itemp = shfmsk(n)
851 nshift = iand(ishft(itemp,-24),255)
852 nmask = iand(ishft(itemp,-16),255)
853 nid = iand(ishft(itemp,-8),255)
854 jtemp = mask(nmask)
855 ktemp = id(nid)
856 ikeep(n) = iand(jtemp,ishft(ktemp,-nshift))
857 10 CONTINUE
858C
859C CONVERT IBM 32 BIT F.P. NUMBER TO IEEE F.P. NUMBER
860C
861C CALL USSCTC(ID(5),5,A,1)
862 irtemp=id(5)
863 call q9ie32(rtemp(2),rtemp(1),1,istat)
864 a=rtemp(1)
865C
866C CONVERT 16 BIT SIGNED INTEGER INTO A 64 BIT INTEGER.
867C
868 IF (btest(ikeep(17),15_8)) THEN
869 ikeep(17) = ior(ikeep(17),maskn)
870 ENDIF
871C
872C TEST FOR BIG RECORD
873C
874 IF (ikeep(13).EQ.0) THEN
875 ikeep(13) = iand(id(6),mask32)
876 END IF
877C
878 WRITE (ktitle(89:216),100) (ikeep(i),i=1,15) , a , ikeep(17)
879 RETURN
880 END
881C> @brief Creates the third line of title.
882C> @author Ralph Jones @date 1988-11-28
883
884C> Creates the third line of the title from the id words.
885C> called by w3fp06 to create words 55 to 81 of the title.
886C>
887C> Program history log:
888C> - Ralph Jones 1988-11-28
889C> - Ralph Jones 1990-02-03 Convert to cray cft77 fortran.
890C>
891C> @param[in] ID ID words (6 integer) office note 84.
892C> @param[out] KTITLE Character*324 array.
893C>
894C> @author Ralph Jones @date 1988-11-28
895 SUBROUTINE line03(ID,KTITLE)
896
897C
898 INTEGER(8) ID(6)
899 INTEGER(8) MASK32
900 INTEGER ID84(12)
901C
902 CHARACTER * 324 KTITLE
903C
904 DATA mask32/z'00000000FFFFFFFF'/
905C
906C FORTRAN INTERNAL WRITE STATEMENT REPLACES ENCODE
907C
908 100 FORMAT ( 12(1x,z8))
909C
910 DO 10 j = 1,11,2
911 id84(j) = ishft(id(j/2+1),-32_8)
912 id84(j+1) = iand(id(j/2+1),mask32)
913 10 CONTINUE
914C
915 WRITE (ktitle(217:324),100) (id84(i),i=1,12)
916 RETURN
917 END
918C> @brief Sets time-averaged titles.
919C> @author Ralph Jones @date 1988-11-28
920
921C> Fills in the first thirteen characters in the title
922C> to make the title a time-averaged title.
923C>
924C> Program history log:
925C> - Ralph Jones 1988-11-28
926C> - Ralph Jones 1989-11-01 Convert to cray cft77 fortran.
927C>
928C> @param[in] CF1 Forecast period length.
929C> @param[in] CF2 Length of the average.
930C> @param[inout] UNIT
931C> - [in] Originally set to ' hrs'.
932C> - [out] Set to ' dys' if necessary.
933C> @param[inout] FOR
934C> - [in] Originally set to ' for '.
935C> - [out] Set to ' ctr '.
936C> @param[inout] AFTBEF
937C> - [in] Originally set to ' after '.
938C> - [out] Set to ' befor ' if necessary.
939C>
940C> @author Ralph Jones @date 1988-11-28
941 SUBROUTINE climo(CF1,CF2,UNIT,FOR,AFTBEF)
942
943C
944 REAL CF1
945 REAL CF2
946C
947 CHARACTER*7 AFTBEF
948 CHARACTER*7 BEFOR
949 CHARACTER*5 FOR
950 CHARACTER*5 FOR1
951 CHARACTER*4 UNIT
952 CHARACTER*4 UNIT1
953 CHARACTER*4 UNIT2
954C
955 DATA befor /' BEFOR '/
956 DATA for1 /' CTR '/
957 DATA unit1 /' DYS'/
958 DATA unit2 /' HRS'/
959C
960C SET FOR TO ' CTR '
961C
962 for(1:5) = for1(1:5)
963C
964C DIFFERENCE = CENTERDAY - RUNDATE = F1 + 2 DAYS
965C CHANGE CF1 TO HOURS, ADD 48 HOURS
966C
967 diff = cf1 * 12.0 + 48.0
968C
969C IF DIFF NEGATIVE, SET AFTBEF TO ' BEFOR '
970C
971 IF (diff.LT.0.0) aftbef(1:7) = befor(1:7)
972C
973 cf2 = cf2 * 12.0
974C
975 IF (abs(diff).LE.72.0) THEN
976 cf1 = abs(diff)
977 cf2 = cf2 / 24.0
978C
979C SET UNIT TO ' HRS '
980C
981 unit(1:4) = unit2(1:4)
982 GO TO 100
983 ENDIF
984C
985 cf1 = abs(diff / 24.0 )
986 cf2 = cf2 / 24.0
987C
988C SET UNIT TO ' DYS '
989C
990 unit(1:4) = unit1(1:4)
991C
992 100 CONTINUE
993 RETURN
994 END
995C> @brief Encodes time-averaged title
996C> @author Ralph Jones @date 1988-11-28
997
998C> Encodes the first thirteen characters in the title
999C> to make the title a time-averaged title.
1000C>
1001C> Program history log:
1002C> - Ralph Jones 1988-11-28
1003C> - Ralph Jones 1989-11-01 Convert to cray cft77 fortran.
1004C>
1005C> @param[in] CF2 Length of the forecast period
1006C> @param[in] UNIT Units for cf2
1007C> @param[inout] KTITLE
1008C> - [in] Title to be modified
1009C> - [out] Title with the time-averaged included
1010C>
1011C> @author Ralph Jones @date 1988-11-28
1012 SUBROUTINE setcl(CF2,UNIT,KTITLE)
1013
1014C
1015 CHARACTER*324 KTITLE
1016 CHARACTER*13 BLANK
1017 CHARACTER*4 UNIT
1018 CHARACTER*4 DUNIT
1019 CHARACTER*4 HUNIT
1020C
1021 DATA blank /' '/
1022 DATA dunit /'-DAY'/
1023 DATA hunit /'-HR '/
1024C
1025 100 FORMAT (1x, f4.1, a4, ' AVG' )
1026C
1027 ktitle(1:13) = blank(1:13)
1028C
1029 WRITE (ktitle(1:13),100) cf2 , dunit(1:4)
1030C
1031 RETURN
1032 END
subroutine q9ie32(a, b, n, istat)
Convert ibm370 32 bit floating point numbers to ieee 32 bit task 754 floating point numbers.
Definition q9ie32.f:28
subroutine w3fp06(id, ktitle, n)
Provides a title for data fields formulated according to nmc o.n.
Definition w3fp06.f:26
subroutine value1(s, c, e, num)
Creates value1 of surface from ids.
Definition w3fp06.f:746
subroutine setcl(cf2, unit, ktitle)
Encodes time-averaged title.
Definition w3fp06.f:1013
subroutine line03(id, ktitle)
Creates the third line of title.
Definition w3fp06.f:896
subroutine line02(id, mask, ktitle)
Creates the second line of title.
Definition w3fp06.f:808
subroutine climo(cf1, cf2, unit, for, aftbef)
Sets time-averaged titles.
Definition w3fp06.f:942
subroutine line01(id, mask, ktitle)
Creates the first line of title.
Definition w3fp06.f:70