1 #include "Local.h" /* standard header file */
5 float fracPart( char * );
9 #pragma subtitle("subtitle - description ")
10 /********************************************************************/
13 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
14 /* Date: 06 May 1996 */
15 /* Programmer: CARL MCCALLA */
18 /* Abstract: Identify the input character string as a thunder- */
19 /* storm location. If the input string is a thunder- */
20 /* storm location, then return TRUE. Otherwise, */
24 /* External Functions Called: */
27 /* Input: string - a pointer to a pointer to a charac- */
28 /* ter string from a METAR report. */
30 /* Mptr - a pointer to a structure that has the */
31 /* data type Decoded_METAR. */
33 /* NDEX - a pointer to an integer that is the index */
34 /* into an array that contains the indi- */
35 /* vidual groups of the METAR report being */
36 /* decoded. Upon entry, NDEX is the index */
37 /* of the current group of the METAR report */
38 /* that is to be indentified. */
40 /* Output: TRUE - if the input string is a thunderstorm */
42 /* FALSE - the input string is not a thunderstorm */
45 /* Modification History: */
48 /********************************************************************/
51 static bool isTS_LOC( char **string, Decoded_METAR *Mptr,
55 /***************************/
56 /* DECLARE LOCAL VARIABLES */
57 /***************************/
61 /*************************/
62 /* START BODY OF ROUTINE */
63 /*************************/
64 /*******************************************/
65 /* COMPARE THE INPUT CHARACTER STRING WITH */
66 /* VALID AUTOMATED STATION CODE TYPE. IF */
67 /* A MATCH IS FOUND, RETURN TRUE. OTHER- */
68 /* WISE, RETURN FALSE */
69 /*******************************************/
76 if( strcmp( *string, "TS") != 0 )
84 if( strcmp(*string,"N") == 0 ||
85 strcmp(*string,"NE") == 0 ||
86 strcmp(*string,"NW") == 0 ||
87 strcmp(*string,"S") == 0 ||
88 strcmp(*string,"SE") == 0 ||
89 strcmp(*string,"SW") == 0 ||
90 strcmp(*string,"E") == 0 ||
91 strcmp(*string,"W") == 0 ) {
92 strcpy( Mptr->TS_LOC, *string );
100 if( strcmp( *string, "MOV" ) == 0 ) {
103 if( *string == NULL ) {
108 if( strcmp(*string,"N") == 0 ||
109 strcmp(*string,"NE") == 0 ||
110 strcmp(*string,"NW") == 0 ||
111 strcmp(*string,"S") == 0 ||
112 strcmp(*string,"SE") == 0 ||
113 strcmp(*string,"SW") == 0 ||
114 strcmp(*string,"E") == 0 ||
115 strcmp(*string,"W") == 0 ) {
116 strcpy( Mptr->TS_MOVMNT, *string );
135 #pragma subtitle(" ")
137 #pragma subtitle("subtitle - description ")
138 /********************************************************************/
141 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
142 /* Date: 15 Sep 1994 */
143 /* Programmer: CARL MCCALLA */
144 /* Language: C/370 */
148 /* External Functions Called: */
155 /* Modification History: */
158 /********************************************************************/
161 static bool isDVR( char *token, Decoded_METAR *Mptr, int *NDEX )
163 char *slashPtr, *FT_ptr;
170 if( (length = strlen( token )) < 4 )
173 if( strncmp( token, "DVR", 3 ) != 0 )
176 if( *(slashPtr = token+3) != '/' ) {
181 if( strcmp(token+(strlen(token)-2),"FT") != 0 )
184 FT_ptr = token + (strlen(token)-2);
186 if( strchr(slashPtr+1, 'P' ) != NULL )
187 Mptr->DVR.above_max_DVR = TRUE;
189 if( strchr(slashPtr+1, 'M' ) != NULL )
190 Mptr->DVR.below_min_DVR = TRUE;
193 if( (vPtr = strchr(slashPtr, 'V' )) != NULL )
195 Mptr->DVR.vrbl_visRange = TRUE;
196 Mptr->DVR.Min_visRange = antoi(slashPtr+1,
197 (vPtr-(slashPtr+1)) );
198 Mptr->DVR.Max_visRange = antoi(vPtr+1,
199 (FT_ptr - (vPtr+1)) );
205 if( Mptr->DVR.below_min_DVR ||
206 Mptr->DVR.above_max_DVR )
207 Mptr->DVR.visRange = antoi(slashPtr+2,
208 (FT_ptr - (slashPtr+2)) );
210 Mptr->DVR.visRange = antoi(slashPtr+1,
211 (FT_ptr - (slashPtr+1)) );
218 #pragma subtitle(" ")
220 #pragma subtitle("subtitle - description ")
221 /********************************************************************/
223 /* Title: isTornadicActiv */
224 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
225 /* Date: 15 Sep 1994 */
226 /* Programmer: CARL MCCALLA */
227 /* Language: C/370 */
229 /* Abstract: Determines whether or not the input character */
230 /* string is signals the beginning of TORNADIC */
231 /* ACTIVITY data. If it is, then interrogate subse- */
232 /* quent report groups for time, location, and movement*/
233 /* of tornado. Return TRUE, if TORNADIC ACTIVITY is */
234 /* found. Otherwise, return FALSE. */
237 /* External Functions Called: */
240 /* Input: string - the address of a pointer to a charac- */
241 /* ter string that may or may not signal */
242 /* TORNADIC ACTIVITY. */
244 /* Mptr - a pointer to a structure that has the */
245 /* data type Decoded_METAR. */
247 /* NDEX - a pointer to an integer that is the index */
248 /* into an array that contains the indi- */
249 /* vidual groups of the METAR report being */
250 /* decoded. Upon entry, NDEX is the index */
251 /* of the current group of the METAR report */
252 /* that is to be indentified. */
254 /* Output: TRUE - if TORNADIC ACTIVITY is found. */
255 /* FALSE - if no TORNADIC ACTIVITY is found. */
257 /* Modification History: */
260 /********************************************************************/
263 static bool isTornadicActiv( char **string, Decoded_METAR *Mptr,
268 bool Completion_flag;
273 /*************************/
274 /* START BODY OF ROUTINE */
275 /*************************/
283 if( *string == NULL )
286 if( !( strcmp(*string, "TORNADO") == 0 ||
287 strcmp(*string, "TORNADOS") == 0 ||
288 strcmp(*string, "TORNADOES") == 0 ||
289 strcmp(*string, "WATERSPOUT") == 0 ||
290 strcmp(*string, "WATERSPOUTS") == 0 ||
291 strcmp(*string, "FUNNEL") == 0 ) )
294 if( strcmp(*string, "FUNNEL") == 0 ) {
297 if( *string == NULL )
300 if( !(strcmp(*string,"CLOUD") == 0 ||
301 strcmp(*string,"CLOUDS") == 0 ) ) {
306 strcpy(Mptr->TornadicType,"FUNNEL CLOUD");
309 strcpy(Mptr->TornadicType, *string);
314 Completion_flag = FALSE;
316 if( *string == NULL )
319 while( !Completion_flag ) {
321 /* printf("isTornadicActivity: current *string = %s\n",
324 if( *(*string) =='B' || *(*string) == 'E') {
325 if( *(*string) == 'B' ) {
326 B_stringPtr = *string;
327 E_stringPtr = strchr((*string)+1,'E');
330 B_stringPtr = strchr((*string)+1,'B');
331 E_stringPtr = *string;
334 if( B_stringPtr != NULL )
335 printf("isTornadicActivity: B_stringPtr = %x\n",
338 printf("isTornadicActivity: B_stringPtr = NULL\n");
340 if( E_stringPtr != NULL )
341 printf("isTornadicActivity: E_stringPtr = %x\n",
344 printf("isTornadicActivity: E_stringPtr = NULL\n");
346 if( B_stringPtr != NULL && E_stringPtr == NULL ) {
347 if( nisdigit((*string)+1, strlen((*string)+1)) &&
348 strlen((*string)+1) <= 4 ) {
349 TornadicTime = antoi((*string)+1,
350 strlen((*string)+1));
351 if( TornadicTime > 99 ) {
352 Mptr->BTornadicHour = TornadicTime / 100;
353 Mptr->BTornadicMinute = TornadicTime % 100;
358 Mptr->BTornadicHour = TornadicTime;
368 else if( B_stringPtr == NULL && E_stringPtr != NULL ) {
369 if( nisdigit((*string)+1,strlen((*string)+1)) &&
370 strlen((*string)+1) <= 4 ) {
371 TornadicTime = antoi((*string)+1,
372 strlen((*string)+1));
373 if( TornadicTime > 99 ) {
374 Mptr->ETornadicHour = TornadicTime / 100;
375 Mptr->ETornadicMinute = TornadicTime % 100;
380 Mptr->ETornadicHour = TornadicTime;
391 /* printf("isTornadicActivity: B_stringPtr != NULL"
392 " and E_stringPtr != NULL\n"); */
393 if( nisdigit((B_stringPtr+1),(E_stringPtr -
395 TornadicTime = antoi(( B_stringPtr+1),
396 (E_stringPtr-(B_stringPtr+1)));
397 if( TornadicTime > 99 ) {
398 Mptr->BTornadicHour = TornadicTime / 100;
399 Mptr->BTornadicMinute = TornadicTime % 100;
404 Mptr->BTornadicHour = TornadicTime;
409 TornadicTime = antoi(( E_stringPtr+1),
410 strlen(E_stringPtr+1));
412 if( TornadicTime > 99 ) {
413 Mptr->ETornadicHour = TornadicTime / 100;
414 Mptr->ETornadicMinute = TornadicTime % 100;
419 Mptr->ETornadicHour = TornadicTime;
430 else if( nisdigit(*string, strlen(*string))) {
433 if( *string == NULL )
436 if( strcmp(*string,"N") == 0 ||
437 strcmp(*string,"NE") == 0 ||
438 strcmp(*string,"NW") == 0 ||
439 strcmp(*string,"S") == 0 ||
440 strcmp(*string,"SE") == 0 ||
441 strcmp(*string,"SW") == 0 ||
442 strcmp(*string,"E") == 0 ||
443 strcmp(*string,"W") == 0 ) {
445 Mptr->TornadicDistance = antoi(*string,
453 if( saveNdex == *NDEX )
460 else if(strcmp(*string,"DSNT") == 0 ||
461 strcmp(*string,"VC") == 0 ||
462 strcmp(*string,"VCY") == 0 ) {
463 if( strcmp(*string,"VCY") == 0 ||
464 strcmp(*string,"VC") == 0 ) {
467 if( *string == NULL )
470 if( strcmp(*string,"STN") == 0 ){
471 strcpy(Mptr->TornadicLOC,"VC STN");
477 strcpy(Mptr->TornadicLOC,"VC");
482 strcpy(Mptr->TornadicLOC,"DSNT");
487 else if(strcmp(*string,"N") == 0 ||
488 strcmp(*string,"NE") == 0 ||
489 strcmp(*string,"NW") == 0 ||
490 strcmp(*string,"S") == 0 ||
491 strcmp(*string,"SE") == 0 ||
492 strcmp(*string,"SW") == 0 ||
493 strcmp(*string,"E") == 0 ||
494 strcmp(*string,"W") == 0 ) {
495 strcpy(Mptr->TornadicDIR, *string);
499 else if( strcmp(*string, "MOV" ) == 0 ) {
503 if( *string == NULL )
506 if( strcmp(*string, "N") == 0 ||
507 strcmp(*string, "S") == 0 ||
508 strcmp(*string, "E") == 0 ||
509 strcmp(*string, "W") == 0 ||
510 strcmp(*string, "NE") == 0 ||
511 strcmp(*string, "NW") == 0 ||
512 strcmp(*string, "SE") == 0 ||
513 strcmp(*string, "SW") == 0 ) {
514 strcpy( Mptr->TornadicMovDir, *string );
521 Completion_flag = TRUE;
524 if( saveNdex == *NDEX )
532 #pragma subtitle(" ")
534 #pragma subtitle("subtitle - description ")
535 /********************************************************************/
537 /* Title: isPartObscur */
538 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
539 /* Date: 15 Sep 1994 */
540 /* Programmer: CARL MCCALLA */
541 /* Language: C/370 */
543 /* Abstract: Determine whether or not the input character string */
544 /* is a partial obscuration phenomenon. If a partial */
545 /* obscuration is found, then take the preceding group */
546 /* as the obscuring phenomenon. If a partial obscura- */
547 /* tion is found, then return TRUE. Otherwise, return */
551 /* External Functions Called: */
554 /* Input: string - the address of a pointer to a group */
555 /* in a METAR report that may or may not */
556 /* be a partial obscuration indicator. */
558 /* Mptr - a pointer to a structure that has the */
559 /* data type Decoded_METAR. */
561 /* NDEX - a pointer to an integer that is the index */
562 /* into an array that contains the indi- */
563 /* vidual groups of the METAR report being */
564 /* decoded. Upon entry, NDEX is the index */
565 /* of the current group of the METAR report */
566 /* that is to be indentified. */
568 /* Output: TRUE - if the input string is a partial obscura- */
570 /* FALSE - if the input string is not a partial ob- */
573 /* Modification History: */
576 /********************************************************************/
578 static bool isPartObscur( char **string, Decoded_METAR *Mptr,
579 int ndex, int *NDEX )
582 /***************************/
583 /* DECLARE LOCAL VARIABLES */
584 /***************************/
588 static char *phenom[] = {"-DZ", "DZ", "+DZ",
589 "FZDZ", "-RA", "RA", "+RA",
590 "SHRA", "TSRA", "FZRA", "-SN", "SN", "+SN", "DRSN", "BLSN",
591 "SHSN", "TSSN", "-SG", "SG", "+SG", "IC", "-PE", "PE", "+PE",
592 "SHPE", "TSPE", "GR", "SHGR", "TSGR", "GS", "SHGS", "TSGS", "-GS",
593 "+GS", "TS", "VCTS", "-TSRA", "TSRA", "+TSRA", "-TSSN", "TSSN",
594 "+TSSN", "-TSPE", "TSPE", "+TSPE", "-TSGS", "TSGS", "+TSGS",
595 "VCSH", "-SHRA", "+SHRA", "-SHSN", "+SHSN", "-SHPE", "+SHPE",
596 "-SHGS", "+SHGS", "-FZDZ", "+FZDZ", "-FZRA", "+FZRA", "FZFG",
597 "+FZFG", "BR", "FG", "VCFG", "MIFG", "PRFG", "BCFG", "FU",
598 "VA", "DU", "DRDU", "BLDU", "SA", "DRSA", "BLSA", "HZ",
599 "BLPY", "BLSN", "+BLSN", "VCBLSN", "BLSA", "+BLSA",
600 "VCBLSA", "+BLDU", "VCBLDU", "PO", "VCPO", "SQ", "FC", "+FC",
601 "VCFC", "SS", "+SS", "VCSS", "DS", "+DS", "VCDS", NULL};
605 printf("isPartObscur: Routine Entered...\n");
606 printf("isPartObscur: *string = %s\n",*string);
607 if( Mptr->PartialObscurationAmt[ndex][0] != '\0' ) {
608 printf("PartialObscurationAmt = %s\n",
609 &(Mptr->PartialObscurationAmt[ndex][0]));
610 if( strcmp( *string, "FEW///" ) == 0 ||
611 strcmp( *string, "SCT///" ) == 0 ||
612 strcmp( *string, "BKN///" ) == 0 ||
613 strcmp( *string, "FEW000" ) == 0 ||
614 strcmp( *string, "SCT000" ) == 0 ||
615 strcmp( *string, "BKN000" ) == 0 ) {
618 printf("isPartObscur: Preceding group = %s\n",
625 if( *string == NULL )
628 if( strcmp( *string, "FEW///" ) == 0 ||
629 strcmp( *string, "SCT///" ) == 0 ||
630 strcmp( *string, "BKN///" ) == 0 ||
631 strcmp( *string, "FEW000" ) == 0 ||
632 strcmp( *string, "SCT000" ) == 0 ||
633 strcmp( *string, "BKN000" ) == 0 ) {
634 if( Mptr->PartialObscurationAmt[ndex][0] == '\0' )
641 &(Mptr->PartialObscurationAmt[ndex][0]) ) == 0 )
645 if( *string == NULL )
649 while( phenom[i] != NULL ) {
650 if( strcmp( *string, phenom[i] ) == 0 ) {
651 strcpy(&(Mptr->PartialObscurationPhenom[ndex][0]),
678 #pragma subtitle(" ")
680 #pragma subtitle("subtitle - description ")
681 /********************************************************************/
683 /* Title: isA0indicator */
684 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
685 /* Date: 15 Sep 1994 */
686 /* Programmer: CARL MCCALLA */
687 /* Language: C/370 */
689 /* Abstract: Identify the input character string as an automated */
690 /* station code type. If the input character string */
691 /* is an automated station code type, then return */
692 /* TRUE. Otherwise, return FALSE. */
695 /* External Functions Called: */
698 /* Input: indicator - a pointer to a character string */
699 /* that may or may not be an ASOS */
700 /* automated station code type. */
702 /* Mptr - a pointer to a structure that has the */
703 /* data type Decoded_METAR. */
705 /* NDEX - a pointer to an integer that is the index */
706 /* into an array that contains the indi- */
707 /* vidual groups of the METAR report being */
708 /* decoded. Upon entry, NDEX is the index */
709 /* of the current group of the METAR report */
710 /* that is to be indentified. */
712 /* Output: TRUE - if the input string matches one of the */
713 /* valid ASOS automated station indicators. */
714 /* FALSE - the input string did not match one of the*/
715 /* valid ASOS automated station indicators. */
717 /* Modification History: */
720 /********************************************************************/
723 static bool isA0indicator( char *indicator, Decoded_METAR *Mptr,
727 /***************************/
728 /* DECLARE LOCAL VARIABLES */
729 /***************************/
731 char *autoFlag[] = {"A01", "A01A", "A02", "A02A", "AOA",
732 "A0A", "AO1", "AO1A", "AO2", "AO2A", NULL};
735 /*************************/
736 /* START BODY OF ROUTINE */
737 /*************************/
738 /*******************************************/
739 /* COMPARE THE INPUT CHARACTER STRING WITH */
740 /* VALID AUTOMATED STATION CODE TYPE. IF */
741 /* A MATCH IS FOUND, RETURN TRUE. OTHER- */
742 /* WISE, RETURN FALSE */
743 /*******************************************/
745 if( indicator == NULL )
750 while( autoFlag[ i ] != NULL )
752 if( strcmp( indicator, autoFlag[ i ]) == 0 )
755 strcpy(Mptr->autoIndicator, indicator);
764 #pragma subtitle(" ")
766 #pragma subtitle("subtitle - description ")
767 /********************************************************************/
769 /* Title: isPeakWind */
770 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
771 /* Date: 15 Sep 1994 */
772 /* Programmer: CARL MCCALLA */
773 /* Language: C/370 */
775 /* Abstract: Determine whether or not the current and subsequent */
776 /* groups from the METAR report make up a valid report */
780 /* Input: string - the addr of a ptr to a character string */
781 /* that may or may not be the indicator */
782 /* for a peak wind data group. */
784 /* Mptr - a pointer to a structure that has the */
785 /* data type Decoded_METAR. */
787 /* NDEX - a pointer to an integer that is the index */
788 /* into an array that contains the indi- */
789 /* vidual groups of the METAR report being */
790 /* decoded. Upon entry, NDEX is the index */
791 /* of the current group of the METAR report */
792 /* that is to be indentified. */
794 /* Output: TRUE - if the input string (and subsequent grps) */
795 /* are decoded as peak wind. */
796 /* FALSE - if the input string (and subsequent grps)*/
797 /* are not decoded as peak wind. */
798 /* External Functions Called: */
802 /* Modification History: */
805 /********************************************************************/
807 static bool isPeakWind( char **string, Decoded_METAR *Mptr,
811 /***************************/
812 /* DECLARE LOCAL VARIABLES */
813 /***************************/
819 /*************************/
820 /* START BODY OF ROUTINE */
821 /*************************/
825 /******************************************************/
826 /* IF THE CURRENT AND NEXT GROUPS ARE "PK WND", THEN */
827 /* DETERMINE WHETHER OR NOT THE GROUP THAT FOLLOWS IS */
828 /* A VALID PK WND GROUP. IF IT IS, THEN DECODE THE */
829 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
830 /******************************************************/
832 if( *string == NULL )
835 if( strcmp(*string,"PK") != 0 )
840 if( *string == NULL )
842 if( strcmp(*string,"WND") != 0 ) {
849 if( *string == NULL )
852 if( (slash = strchr(*string,'/')) == NULL ) {
853 /********************************/
854 /* INVALID PEAK WIND. BUMP PAST */
855 /* PK AND WND GROUP AND RETURN */
857 /********************************/
862 else if( strlen(*string) >= 8 && strlen(*string) <= 11 &&
863 nisdigit(slash+1,strlen(slash+1)) &&
864 nisdigit(*string, (slash - *string)) &&
865 (slash - *string) <= 6 )
867 memset( buf, '\0', 4);
868 strncpy( buf, *string, 3 );
869 Mptr->PKWND_dir = atoi( buf );
871 memset( buf, '\0', 4);
872 strncpy( buf, *string+3, slash-(*string+3) );
873 Mptr->PKWND_speed = atoi( buf );
875 memset( buf, '\0', 5);
876 strcpy( buf, slash+1 );
881 Mptr->PKWND_hour = atoi(buf)/100;
882 Mptr->PKWND_minute = (atoi(buf)) % 100;
885 Mptr->PKWND_minute = atoi( buf );
886 /********************************/
887 /* VALID PEAK WIND FOUND. BUMP */
888 /* PAST PK, WND, AND PEAK WIND */
889 /* GROUPS AND RETURN TRUE. */
890 /********************************/
899 #pragma subtitle(" ")
901 #pragma subtitle("subtitle - description ")
902 /********************************************************************/
904 /* Title: isWindShift */
905 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
906 /* Date: 15 Sep 1994 */
907 /* Programmer: CARL MCCALLA */
908 /* Language: C/370 */
910 /* Abstract: Determine whether or not the current and subsequent */
911 /* groups from the METAR report make up a valid report */
912 /* of wind shift and frontal passage, if included. */
915 /* Input: string - the addr of a ptr to a character string */
916 /* that may or may not be the indicator */
917 /* for a wind shift data group. */
919 /* Mptr - a pointer to a structure that has the */
920 /* data type Decoded_METAR. */
922 /* NDEX - a pointer to an integer that is the index */
923 /* into an array that contains the indi- */
924 /* vidual groups of the METAR report being */
925 /* decoded. Upon entry, NDEX is the index */
926 /* of the current group of the METAR report */
927 /* that is to be indentified. */
929 /* Output: TRUE - if the input string (and subsequent grps) */
930 /* are decoded as wind shift. */
931 /* FALSE - if the input string (and subsequent grps)*/
932 /* are not decoded as wind shift. */
933 /* External Functions Called: */
937 /* Modification History: */
940 /********************************************************************/
942 static bool isWindShift( char **string, Decoded_METAR *Mptr,
946 /***************************/
947 /* DECLARE LOCAL VARIABLES */
948 /***************************/
952 /*************************/
953 /* START BODY OF ROUTINE */
954 /*************************/
957 /****************************************************/
958 /* IF THE CURRENT GROUP IS "WSHFT", THEN DETERMINE */
959 /* WHETHER OR NOT THE GROUP THAT FOLLOWS IS A VALID */
960 /* WSHFT GROUP. IF IT IS, THEN DECODE THE GROUP */
961 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
962 /****************************************************/
964 if( *string == NULL )
967 if( strcmp( *string, "WSHFT" ) != 0 )
972 if( *string == NULL )
975 if( nisdigit(*string,strlen(*string)) && strlen(*string) <= 4)
977 temp = atoi( *string );
981 Mptr->WshfTime_hour = (atoi(*string))/100;
982 Mptr->WshfTime_minute = (atoi(*string)) % 100;
985 Mptr->WshfTime_minute = (atoi(*string)) % 100;
989 if( *string == NULL )
993 if( **string == '\0') {
998 else if( strcmp( *string, "FROPA") == 0 )
1000 Mptr->Wshft_FROPA = TRUE;
1001 /********************************/
1002 /* VALID WIND SHIFT FOUND. BUMP */
1003 /* PAST WSHFT, WSHFT GROUP, AND */
1004 /* FROPA GROUPS AND RETURN TRUE.*/
1005 /********************************/
1012 /********************************/
1013 /* VALID WIND SHIFT FOUND. BUMP */
1014 /* PAST WSHFT AND WSHFT GROUP */
1015 /* AND RETURN TRUE. */
1016 /********************************/
1023 /**********************************/
1024 /* INVALID WIND SHIFT FOUND. BUMP */
1025 /* PAST WSHFT AND RETURN FALSE. */
1026 /********************************/
1031 #pragma subtitle(" ")
1033 #pragma subtitle("subtitle - description ")
1034 /********************************************************************/
1036 /* Title: isTowerVsby */
1037 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1038 /* Date: 15 Sep 1994 */
1039 /* Programmer: CARL MCCALLA */
1040 /* Language: C/370 */
1042 /* Abstract: Determine whether or not the current and subsequent */
1043 /* groups from the METAR report make up a valid report */
1044 /* of tower visibility. */
1047 /* Input: string - the addr of a ptr to a character string */
1048 /* that may or may not be the indicator */
1049 /* for tower visibility. */
1051 /* Mptr - a pointer to a structure that has the */
1052 /* data type Decoded_METAR. */
1054 /* NDEX - a pointer to an integer that is the index */
1055 /* into an array that contains the indi- */
1056 /* vidual groups of the METAR report being */
1057 /* decoded. Upon entry, NDEX is the index */
1058 /* of the current group of the METAR report */
1059 /* that is to be indentified. */
1061 /* Output: TRUE - if the input string (and subsequent grps) */
1062 /* are decoded as tower visibility. */
1063 /* FALSE - if the input string (and subsequent grps)*/
1064 /* are not decoded as tower visibility */
1065 /* External Functions Called: */
1068 /* Modification History: */
1071 /********************************************************************/
1073 static bool isTowerVsby( char **token, Decoded_METAR *Mptr, int *NDEX)
1076 /***************************/
1077 /* DECLARE LOCAL VARIABLES */
1078 /***************************/
1083 /*************************/
1084 /* START BODY OF ROUTINE */
1085 /*************************/
1088 /****************************************************************/
1089 /* IF THE CURRENT AND NEXT GROUPS ARE "TWR VIS", THEN DETERMINE */
1090 /* WHETHER OR NOT THE GROUP(S) THAT FOLLOWS IS(ARE) A VALID */
1091 /* TOWER VISIBILITY GROUP. IF IT IS, THEN DECODE THE GROUP */
1092 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
1093 /****************************************************************/
1095 if( *token == NULL )
1098 if(strcmp(*token,"TWR") != 0)
1103 if( *token == NULL )
1106 if( strcmp(*token,"VIS") != 0) {
1113 if( *token == NULL )
1116 if( nisdigit(*token,
1119 Mptr->TWR_VSBY = (float) atoi(*token);
1121 if( *token != NULL )
1123 if( (slash = strchr(*token, '/'))
1126 if( nisdigit(slash+1,strlen(slash+1)) &&
1130 T_vsby = fracPart(*token);
1131 Mptr->TWR_VSBY += T_vsby;
1161 else if( (slash = strchr(*token, '/'))
1164 if( nisdigit(slash+1,strlen(slash+1)) &&
1168 Mptr->TWR_VSBY = fracPart(*token);
1187 #pragma subtitle(" ")
1189 #pragma subtitle("subtitle - description ")
1190 /********************************************************************/
1192 /* Title: isSurfaceVsby */
1193 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1194 /* Date: 15 Sep 1994 */
1195 /* Programmer: CARL MCCALLA */
1196 /* Language: C/370 */
1198 /* Abstract: Determine whether or not the current and subsequent */
1199 /* groups from the METAR report make up a valid report */
1200 /* of surface visibility. */
1203 /* Input: string - the addr of a ptr to a character string */
1204 /* that may or may not be the indicator */
1205 /* for surface visibility. */
1207 /* Mptr - a pointer to a structure that has the */
1208 /* data type Decoded_METAR. */
1210 /* NDEX - a pointer to an integer that is the index */
1211 /* into an array that contains the indi- */
1212 /* vidual groups of the METAR report being */
1213 /* decoded. Upon entry, NDEX is the index */
1214 /* of the current group of the METAR report */
1215 /* that is to be indentified. */
1217 /* Output: TRUE - if the input string (and subsequent grps) */
1218 /* are decoded as surface visibility. */
1219 /* FALSE - if the input string (and subsequent grps)*/
1220 /* are not decoded as surface visibility. */
1221 /* External Functions Called: */
1224 /* Modification History: */
1227 /********************************************************************/
1229 static bool isSurfaceVsby( char **token, Decoded_METAR *Mptr,
1233 /***************************/
1234 /* DECLARE LOCAL VARIABLES */
1235 /***************************/
1241 /*************************/
1242 /* START BODY OF ROUTINE */
1243 /*************************/
1246 /****************************************************************/
1247 /* IF THE CURRENT AND NEXT GROUPS ARE "SFC VIS", THEN DETERMINE */
1248 /* WHETHER OR NOT THE GROUP(S) THAT FOLLOWS IS(ARE) A VALID */
1249 /* SURFACE VISIBILITY GROUP. IF IT IS, THEN DECODE THE GROUP */
1250 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
1251 /****************************************************************/
1253 if( *token == NULL )
1256 if(strcmp(*token,"SFC") != 0)
1261 if( strcmp(*token,"VIS") != 0) {
1269 if( *token == NULL )
1273 if( nisdigit(*token,
1276 Mptr->SFC_VSBY = (float) atoi(*token);
1278 if( *token != NULL )
1280 if( (slash = strchr(*token, '/'))
1283 if( nisdigit(slash+1,strlen(slash+1)) &&
1287 S_vsby = fracPart(*token);
1288 Mptr->SFC_VSBY += S_vsby;
1318 else if( (slash = strchr(*token, '/'))
1321 if( nisdigit(slash+1,strlen(slash+1)) &&
1325 Mptr->SFC_VSBY = fracPart(*token);
1345 #pragma subtitle(" ")
1347 #pragma subtitle("subtitle - description ")
1348 /********************************************************************/
1350 /* Title: isVariableVsby */
1351 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1352 /* Date: 21 Nov 1994 */
1353 /* Programmer: CARL MCCALLA */
1354 /* Language: C/370 */
1356 /* Abstract: Determine whether or not the current and subsequent */
1357 /* groups from the METAR report make up a valid report */
1358 /* of variable prevailing visibility. */
1361 /* Input: string - the addr of a ptr to a character string */
1362 /* that may or may not be the indicator */
1363 /* for variable prevailing visibility. */
1365 /* Mptr - a pointer to a structure that has the */
1366 /* data type Decoded_METAR. */
1368 /* NDEX - a pointer to an integer that is the index */
1369 /* into an array that contains the indi- */
1370 /* vidual groups of the METAR report being */
1371 /* decoded. Upon entry, NDEX is the index */
1372 /* of the current group of the METAR report */
1373 /* that is to be indentified. */
1375 /* Output: TRUE - if the input string (and subsequent grps) */
1376 /* are decoded as variable prevailing vsby. */
1377 /* FALSE - if the input string (and subsequent grps)*/
1378 /* are not decoded as variable prevailing */
1380 /* External Functions Called: */
1383 /* Modification History: */
1386 /********************************************************************/
1388 static bool isVariableVsby( char **string, Decoded_METAR *Mptr,
1392 /***************************/
1393 /* DECLARE LOCAL VARIABLES */
1394 /***************************/
1406 /*************************/
1407 /* START BODY OF ROUTINE */
1408 /*************************/
1411 /***************************************************/
1412 /* IF THE CURRENT GROUP IS "VIS", THEN DETERMINE */
1413 /* WHETHER OR NOT THE GROUPS THAT FOLLOW ARE VALID */
1414 /* VARIABLE PREVAILING VSBY. IF THEY ARE, THEN */
1415 /* DECODE THE GROUPS AND RETURN TRUE. OTHERWISE, */
1417 /***************************************************/
1419 if( *string == NULL )
1422 if( strcmp(*string, "VIS") != 0 )
1427 if( *string == NULL )
1430 if( !((V_char = strchr(*string, 'V')) != NULL ||
1431 nisdigit(*string,strlen(*string))) )
1433 else if( nisdigit(*string,strlen(*string)) ) {
1434 minimumVsby = (float) atoi(*string);
1437 if( *string == NULL )
1440 if( (V_char = strchr(*string,'V')) == NULL )
1443 if( (slash = strchr(*string,'/')) == NULL )
1446 if( nisdigit(*string,(slash - *string)) &&
1447 nisdigit(slash+1,(V_char-(slash+1))) &&
1448 nisdigit(V_char+1,strlen(V_char+1)) ) {
1449 if( (V_char - *string) > 4 )
1453 strncpy(buf,*string,(V_char - *string));
1454 Mptr->minVsby = minimumVsby + fracPart(buf);
1455 maximumVsby = (float) atoi(V_char+1);
1460 if( *string == NULL )
1463 if( (slash = strchr(*string,'/')) == NULL ) {
1464 Mptr->maxVsby = maximumVsby;
1470 else if( nisdigit(*string,(slash - *string)) &&
1471 nisdigit(slash+1, strlen(slash+1)) ) {
1472 Mptr->maxVsby = maximumVsby + fracPart(*string);
1480 Mptr->maxVsby = maximumVsby;
1493 if( (V_char = strchr(*string,'V')) == NULL )
1495 if(nisdigit(*string,(V_char - *string)) &&
1496 nisdigit(V_char+1,strlen(V_char+1)) ) {
1497 Mptr->minVsby = (float) antoi(*string,(V_char - *string));
1498 maximumVsby = (float) atoi(V_char+1);
1502 if( *string == NULL )
1505 if( (slash = strchr(*string,'/')) == NULL ) {
1506 Mptr->maxVsby = maximumVsby;
1511 else if( nisdigit(*string, (slash - *string)) &&
1512 nisdigit(slash+1,strlen(slash+1)) ) {
1513 Mptr->maxVsby = maximumVsby + fracPart( *string );
1520 Mptr->maxVsby = maximumVsby;
1527 if( (slash2 = strchr(V_char+1,'/')) == NULL &&
1528 (slash1 = strchr(*string,'/')) == NULL )
1530 else if( slash1 == NULL )
1532 else if( slash == slash2 )
1534 else if( nisdigit(*string,(slash1 - *string)) &&
1535 nisdigit((slash1+1),(V_char-(slash1+1))) ) {
1536 if( (V_char - *string) > 4 )
1540 strncpy(buf,*string,(V_char - *string));
1541 minimumVsby = fracPart(buf);
1543 if( slash2 == NULL) {
1544 if( nisdigit(V_char+1, strlen(V_char+1)) ) {
1545 maximumVsby = (float) atoi(V_char+1);
1549 if( *string == NULL )
1552 if( (slash = strchr(*string,'/')) == NULL ) {
1553 Mptr->minVsby = minimumVsby;
1554 Mptr->maxVsby = maximumVsby;
1559 else if( nisdigit(*string,(slash-*string)) &&
1560 nisdigit((slash+1),strlen(slash+1)) ) {
1561 Mptr->minVsby = minimumVsby;
1562 Mptr->maxVsby = maximumVsby +
1570 Mptr->minVsby = minimumVsby;
1571 Mptr->maxVsby = maximumVsby;
1581 if( nisdigit(V_char+1,(slash2-V_char+1)) &&
1582 nisdigit((slash2+1),strlen(slash2+1)) ) {
1583 Mptr->minVsby = minimumVsby;
1584 Mptr->maxVsby = fracPart(V_char+1);
1597 #pragma subtitle(" ")
1599 #pragma subtitle("subtitle - description ")
1600 /********************************************************************/
1602 /* Title: isVsby2ndSite */
1603 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1604 /* Date: 15 Sep 1994 */
1605 /* Programmer: CARL MCCALLA */
1606 /* Language: C/370 */
1608 /* Abstract: Determine whether or not the current and subsequent */
1609 /* groups from the METAR report make up a valid report */
1610 /* of visibility at a secondary site. */
1613 /* Input: token - the addr of a ptr to a character string */
1614 /* that may or may not be the indicator */
1615 /* for visibility at a secondary site. */
1617 /* Mptr - a pointer to a structure that has the */
1618 /* data type Decoded_METAR. */
1620 /* NDEX - a pointer to an integer that is the index */
1621 /* into an array that contains the indi- */
1622 /* vidual groups of the METAR report being */
1623 /* decoded. Upon entry, NDEX is the index */
1624 /* of the current group of the METAR report */
1625 /* that is to be indentified. */
1627 /* Output: TRUE - if the input string (and subsequent grps) */
1628 /* are decoded as visibility at a 2ndry site.*/
1629 /* FALSE - if the input string (and subsequent grps)*/
1630 /* are not decoded as visibility at a 2ndry */
1633 /* External Functions Called: */
1639 /* Modification History: */
1642 /********************************************************************/
1644 static bool isVsby2ndSite( char **token, Decoded_METAR *Mptr,
1648 /***************************/
1649 /* DECLARE LOCAL VARIABLES */
1650 /***************************/
1657 /*************************/
1658 /* START BODY OF ROUTINE */
1659 /*************************/
1662 /***************************************************/
1663 /* IF THE CURRENT GROUP IS "VIS", THEN DETERMINE */
1664 /* WHETHER OR NOT THE GROUPS THAT FOLLOW ARE VALID */
1665 /* VSBILITY AT A 2NDRY SITE. IF THEY ARE, THEN */
1666 /* DECODE THE GROUPS AND RETURN TRUE. OTHERWISE, */
1668 /***************************************************/
1670 if( *token == NULL )
1673 if(strcmp(*token,"VIS") != 0)
1678 if( *token == NULL )
1681 if( nisdigit(*token,
1684 VSBY_2ndSite = (float) atoi(*token);
1686 if( *token != NULL )
1688 if( (slash = strchr(*token, '/'))
1691 if( nisdigit(slash+1,strlen(slash+1)) &&
1695 S_vsby = fracPart(*token);
1699 if( *token == NULL )
1702 if( strncmp( *token, "RY", 2 ) == 0) {
1703 if( nisalnum( *token, strlen(*token) ) ) {
1704 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1705 Mptr->VSBY_2ndSite = VSBY_2ndSite + S_vsby;
1719 if( strncmp( *token, "RY", 2 ) == 0) {
1720 if( nisalnum( *token, strlen(*token) ) ) {
1721 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1722 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1737 if( strncmp( *token, "RY", 2 ) == 0) {
1738 if( nisalnum( *token, strlen(*token) ) ) {
1739 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1740 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1754 if( strncmp( *token, "RY", 2 ) == 0) {
1755 if( nisalnum( *token, strlen(*token) ) ) {
1756 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1757 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1771 else if( (slash = strchr(*token, '/'))
1774 if( nisdigit(slash+1,strlen(slash+1)) &&
1778 VSBY_2ndSite = fracPart(*token);
1779 if( strncmp( *(++token), "RY", 2 ) == 0) {
1780 if( nisalnum( *token, strlen(*token) ) ) {
1781 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1782 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1802 #pragma subtitle(" ")
1804 #pragma subtitle("subtitle - description ")
1805 /********************************************************************/
1807 /* Title: isLTGfreq */
1808 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1809 /* Date: 15 Sep 1994 */
1810 /* Programmer: CARL MCCALLA */
1811 /* Language: C/370 */
1813 /* Abstract: Determine whether or not the current and subsequent */
1814 /* groups from the METAR report make up a valid report */
1818 /* Input: string - the addr of a ptr to a character string */
1819 /* that may or may not be the indicator */
1820 /* for lightning. */
1822 /* Mptr - a pointer to a structure that has the */
1823 /* data type Decoded_METAR. */
1825 /* NDEX - a pointer to an integer that is the index */
1826 /* into an array that contains the indi- */
1827 /* vidual groups of the METAR report being */
1828 /* decoded. Upon entry, NDEX is the index */
1829 /* of the current group of the METAR report */
1830 /* that is to be indentified. */
1832 /* Output: TRUE - if the input string (and subsequent grps) */
1833 /* are decoded as lightning. */
1834 /* FALSE - if the input string (and subsequent grps)*/
1835 /* are not decoded as lightning. */
1837 /* External Functions Called: */
1841 /* Modification History: */
1842 /* 09 May 1996: Software modified to properly */
1843 /* decode lightning types. */
1847 /********************************************************************/
1850 bool static isLTGfreq( char **string, Decoded_METAR *Mptr, int *NDEX )
1853 /***************************/
1854 /* DECLARE LOCAL VARIABLES */
1855 /***************************/
1864 /*************************/
1865 /* START BODY OF ROUTINE */
1866 /*************************/
1870 /***************************************************/
1871 /* IF THE CURRENT GROUP IS "LTG", THEN DETERMINE */
1872 /* WHETHER OR NOT THE PREVIOUS GROUP AS WELL AS */
1873 /* GROUPS THAT FOLLOW ARE VALID LIGHTNING REPORT */
1874 /* PARAMETERS. IF THEY ARE, THEN DECODE THE */
1875 /* GROUPS AND RETURN TRUE. OTHERWISE, RETURN */
1877 /***************************************************/
1879 if( *string == NULL )
1882 if( strcmp(*string,"VCTS") == 0 ) {
1883 Mptr->LightningVCTS = TRUE;
1889 if( *string == NULL )
1892 if( strncmp( *string, "LTG", 3 ) != 0 ) {
1897 if( *string == NULL )
1903 LTG_FREQ_FLAG = FALSE;
1904 /*-- CHECK FOR LIGHTNING FREQUENCY -----------*/
1905 if( strcmp( *string, "OCNL" ) == 0 ) {
1906 Mptr->OCNL_LTG = TRUE;
1907 LTG_FREQ_FLAG = TRUE;
1909 else if( strcmp( *string, "FRQ" ) == 0 ) {
1910 Mptr->FRQ_LTG = TRUE;
1911 LTG_FREQ_FLAG = TRUE;
1913 else if( strcmp( *string, "CNS" ) == 0 ) {
1914 Mptr->CNS_LTG = TRUE;
1915 LTG_FREQ_FLAG = TRUE;
1921 if( *string == NULL )
1925 if( strcmp( *string, "LTG") == 0 ) {
1928 if( *string == NULL )
1933 LTG_LOC_FLAG = FALSE;
1934 /*-- CHECK FOR LIGHTNING LOCATION ------------*/
1935 if( strcmp( *string, "DSNT" ) == 0 ) {
1936 Mptr->DSNT_LTG = TRUE;
1937 LTG_LOC_FLAG = TRUE;
1939 else if( strcmp( *string, "AP" ) == 0 ) {
1940 Mptr->AP_LTG = TRUE;
1941 LTG_LOC_FLAG = TRUE;
1943 else if( strcmp( *string, "VCY" ) == 0 ||
1944 strcmp( *string, "VC" ) == 0 ) {
1945 Mptr->VcyStn_LTG = TRUE;
1946 LTG_LOC_FLAG = TRUE;
1948 else if( strcmp( *string, "OVHD" ) == 0 ||
1949 strcmp( *string, "OHD" ) == 0 ) {
1950 Mptr->OVHD_LTG = TRUE;
1951 LTG_LOC_FLAG = TRUE;
1957 if( *string == NULL ) {
1963 LTG_DIR_FLAG = FALSE;
1964 /*-- CHECK FOR LIGHTNING DIRECTION -----------*/
1965 if( strcmp( *string, "N" ) == 0 ||
1966 strcmp( *string, "NE" ) == 0 ||
1967 strcmp( *string, "NW" ) == 0 ||
1968 strcmp( *string, "S" ) == 0 ||
1969 strcmp( *string, "SE" ) == 0 ||
1970 strcmp( *string, "SW" ) == 0 ||
1971 strcmp( *string, "E" ) == 0 ||
1972 strcmp( *string, "W" ) == 0 ) {
1973 strcpy( Mptr->LTG_DIR, *string);
1974 LTG_DIR_FLAG = TRUE;
1987 LTG_TYPE_FLAG = FALSE;
1988 /*-- CHECK FOR LIGHTNING TYPE ----------------*/
1989 TYPE_NOT_FOUND = FALSE;
1990 temp = (*string) + 3;
1991 while( *temp != '\0' && !TYPE_NOT_FOUND ) {
1992 if( strncmp( temp, "CG", 2 ) == 0 ) {
1993 Mptr->CG_LTG = TRUE;
1994 LTG_TYPE_FLAG = TRUE;
1998 else if( strncmp( temp, "IC", 2 ) == 0 ) {
1999 Mptr->IC_LTG = TRUE;
2000 LTG_TYPE_FLAG = TRUE;
2004 else if( strncmp( temp, "CC", 2 ) == 0 ) {
2005 Mptr->CC_LTG = TRUE;
2006 LTG_TYPE_FLAG = TRUE;
2010 else if( strncmp( temp, "CA", 2 ) == 0 ) {
2011 Mptr->CA_LTG = TRUE;
2012 LTG_TYPE_FLAG = TRUE;
2017 TYPE_NOT_FOUND = TRUE;
2022 if( *string == NULL ) {
2029 LTG_LOC_FLAG = FALSE;
2030 /*-- CHECK FOR LIGHTNING LOCATION ------------*/
2031 if( strcmp( *string, "DSNT" ) == 0 ) {
2032 Mptr->DSNT_LTG = TRUE;
2033 LTG_LOC_FLAG = TRUE;
2035 else if( strcmp( *string, "AP" ) == 0 ) {
2036 Mptr->AP_LTG = TRUE;
2037 LTG_LOC_FLAG = TRUE;
2039 else if( strcmp( *string, "VCY" ) == 0 ||
2040 strcmp( *string, "VC" ) == 0 ) {
2041 Mptr->VcyStn_LTG = TRUE;
2042 LTG_LOC_FLAG = TRUE;
2044 else if( strcmp( *string, "OVHD" ) == 0 ) {
2045 Mptr->OVHD_LTG = TRUE;
2046 LTG_LOC_FLAG = TRUE;
2052 if( *string == NULL ) {
2060 LTG_DIR_FLAG = FALSE;
2061 /*-- CHECK FOR LIGHTNING DIRECTION -----------*/
2062 if( strcmp( *string, "N" ) == 0 ||
2063 strcmp( *string, "NE" ) == 0 ||
2064 strcmp( *string, "NW" ) == 0 ||
2065 strcmp( *string, "S" ) == 0 ||
2066 strcmp( *string, "SE" ) == 0 ||
2067 strcmp( *string, "SW" ) == 0 ||
2068 strcmp( *string, "E" ) == 0 ||
2069 strcmp( *string, "W" ) == 0 ) {
2070 strcpy( Mptr->LTG_DIR, *string);
2071 LTG_DIR_FLAG = TRUE;
2089 #pragma comment (compiler)
2090 //#pragma comment (date)
2091 //#pragma comment (timestamp)
2092 #pragma pagesize(80)
2094 #include "Metar.h" /* standard header file */
2096 #pragma subtitle(" ")
2098 #pragma subtitle("subtitle - description ")
2099 /********************************************************************/
2101 /* Title: isRecentWx */
2102 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2103 /* Date: 15 Sep 1994 */
2104 /* Programmer: CARL MCCALLA */
2105 /* Language: C/370 */
2107 /* Abstract: Determine whether or not the current and subsequent */
2108 /* groups from the METAR report make up a valid report */
2109 /* recent weather. */
2111 /* Input: token - the addr of a ptr to a character token */
2112 /* that may or may not be a recent weather */
2115 /* Mptr - a pointer to a structure that has the */
2116 /* data type Decoded_METAR. */
2118 /* NDEX - a pointer to an integer that is the i*NDEX */
2119 /* into an array that contains the indi- */
2120 /* vidual groups of the METAR report being */
2121 /* decoded. Upon entry, NDEX is the i*NDEX */
2122 /* of the current group of the METAR report */
2123 /* that is to be indentified. */
2125 /* Output: TRUE - if the input token (and possibly subse- */
2126 /* quent groups) are decoded as recent wx. */
2127 /* FALSE - if the input token (and possibly subse- */
2128 /* quent groups) are not decoded as recent */
2131 /* External Functions Called: */
2138 /* Modification History: */
2141 /********************************************************************/
2143 static bool isRecentWX( char **token, Decoded_METAR *Mptr,
2146 static char *phenom[] = {"-DZB", "DZB", "+DZB",
2147 "FZDZB", "-RAB", "RAB", "+RAB",
2148 "SHRAB", "TSRAB", "FZRAB", "-SNB",
2149 "SNB", "+SNB", "DRSNB", "BLSNB",
2150 "SHSNB", "TSSNB", "-SGB", "SGB",
2151 "+SGB", "ICB", "-PEB", "PEB", "+PEB",
2152 "SHPEB", "TSPEB", "GRB", "SHGRB",
2153 "TSGRB", "GSB", "SHGSB", "TSGSB", "-GSB",
2154 "+GSB", "TSB", "VCTSB", "-TSRAB",
2155 "TSRAB", "+TSRAB", "-TSSNB", "TSSNB",
2156 "+TSSNB", "-TSPEB", "TSPEB", "+TSPEB",
2157 "-TSGSB", "TSGSB", "+TSGSB",
2158 "VCSHB", "-SHRAB", "+SHRAB", "-SHSNB",
2159 "+SHSNB", "-SHPEB", "+SHPEB",
2160 "-SHGSB", "+SHGSB", "-FZDZB", "+FZDZB",
2161 "-FZRAB", "+FZRAB", "FZFGB",
2162 "+FZFGB", "BRB", "FGB", "VCFGB", "MIFGB",
2163 "PRFGB", "BCFGB", "FUB",
2164 "VAB", "DUB", "DRDUB", "BLDUB", "SAB",
2165 "DRSAB", "BLSAB", "HZB",
2166 "BLPYB", "BLSNB", "+BLSNB", "VCBLSNB",
2168 "VCBLSAB", "+BLDUB", "VCBLDUB", "POB",
2169 "VCPOB", "SQB", "FCB", "+FCB",
2170 "VCFCB", "SSB", "+SSB", "VCSSB", "DSB",
2174 "-DZE", "DZE", "+DZE",
2175 "FZDZE", "-RAE", "RAE", "+RAE",
2176 "SHRAE", "TSRAE", "FZRAE", "-SNE",
2177 "SNE", "+SNE", "DRSNE", "BLSNE",
2178 "SHSNE", "TSSNE", "-SGE", "SGE",
2179 "+SGE", "ICE", "-PEE", "PEE", "+PEE",
2180 "SHPEE", "TSPEE", "GRE", "SHGRE",
2181 "TSGRE", "GSE", "SHGSE", "TSGSE", "-GSE",
2182 "+GSE", "TSE", "VCTSE", "-TSRAE",
2183 "TSRAE", "+TSRAE", "-TSSNE", "TSSNE",
2184 "+TSSNE", "-TSPEE", "TSPEE", "+TSPEE",
2185 "-TSGSE", "TSGSE", "+TSGSE",
2186 "VCSHE", "-SHRAE", "+SHRAE", "-SHSNE",
2187 "+SHSNE", "-SHPEE", "+SHPEE",
2188 "-SHGSE", "+SHGSE", "-FZDZE", "+FZDZE",
2189 "-FZRAE", "+FZRAE", "FZFGE",
2190 "+FZFGE", "BRE", "FGE", "VCFGE", "MIFGE",
2191 "PRFGE", "BCFGE", "FUE",
2192 "VAE", "DUE", "DRDUE", "BLDUE", "SAE",
2193 "DRSAE", "BLSAE", "HZE",
2194 "BLPYE", "BLSNE", "+BLSNE", "VCBLSNE",
2196 "VCBLSAE", "+BLDUE", "VCBLDUE", "POE",
2197 "VCPOE", "SQE", "FCE", "+FCE",
2198 "VCFCE", "SSE", "+SSE", "VCSSE", "DSE",
2199 "+DSE", "VCDSE", "4-Zs"};
2213 if( *token == NULL )
2216 if( (free_temp = temp = (char *) malloc(sizeof(char) *
2217 (strlen(*token) + 1))) == NULL ) {
2221 strcpy(temp,*token);
2223 while ( *temp != '\0' ) {
2227 beg_hour = beg_min = end_hour = end_min = MAXINT;
2229 while( strncmp(temp, phenom[i],strlen(phenom[i])) != 0 &&
2230 strcmp(phenom[i],"4-Zs") != 0 )
2233 if( strcmp(phenom[i],"4-Zs") != 0 ) {
2235 printf("PHENOM = %s\n",phenom[i]);
2237 C_char = (strlen(phenom[i]) - 1) + temp;
2238 numb_char = C_char + 1;
2240 if( *numb_char == '\0')
2243 if( nisdigit(numb_char,4) && strlen(numb_char) >= 4) {
2244 if( *C_char == 'B' ) {
2245 beg_hour = antoi( numb_char, 2 );
2246 beg_min = antoi( numb_char+2,2 );
2248 printf("BEG_HOUR1 = %d\n",beg_hour);
2249 printf("BEG_MIN1 = %d\n",beg_min );
2254 Mptr->ReWx[*NDEX].Bmm = beg_min;
2255 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2258 if( *(numb_char+4) == 'E' ) {
2260 if( nisdigit(numb_char,4) &&
2261 strlen(numb_char) >= 4 ) {
2262 end_hour = antoi( numb_char, 2 );
2263 end_min = antoi( numb_char+2,2 );
2265 printf("END_HOUR2 = %d\n",end_hour);
2266 printf("END_MIN2 = %d\n",end_min );
2271 Mptr->ReWx[*NDEX].Emm = end_min;
2272 Mptr->ReWx[*NDEX].Ehh = end_hour;
2275 else if( nisdigit(numb_char,2) &&
2276 strlen(numb_char) >= 2 ) {
2277 end_min = antoi( numb_char,2 );
2280 Mptr->ReWx[*NDEX].Emm = end_min;
2282 printf("END_MIN3 = %d\n",end_min );
2291 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2292 phenom[i], (strlen(phenom[i])-1) );
2299 end_hour = antoi( numb_char, 2 );
2300 end_min = antoi( numb_char+2,2 );
2303 Mptr->ReWx[*NDEX].Emm = end_min;
2304 Mptr->ReWx[*NDEX].Ehh = end_hour;
2307 printf("END_HOUR4 = %d\n",end_hour);
2308 printf("END_MIN4 = %d\n",end_min );
2314 if( *(numb_char+4) == 'B' ) {
2316 if( nisdigit(numb_char,4) &&
2317 strlen(numb_char) >= 4 ) {
2318 /* beg_hour = antoi( numb_char, 2 );
2319 beg_min = antoi( numb_char+2,2 ); */
2322 Mptr->ReWx[*NDEX].Bmm = beg_min;
2323 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2326 printf("BEG_HOUR5 = %d\n",beg_hour);
2327 printf("BEG_MIN5 = %d\n",beg_min );
2333 else if( nisdigit(numb_char,2) &&
2334 strlen(numb_char) >= 2 ) {
2335 beg_min = antoi( numb_char,2 );
2338 Mptr->ReWx[*NDEX].Bmm = beg_min;
2340 printf("BEG_MIN6 = %d\n",beg_min );
2350 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2351 phenom[i], (strlen(phenom[i])-1) );
2359 else if(nisdigit(numb_char,2) && strlen(numb_char) >= 2 ) {
2360 if( *C_char == 'B' ) {
2361 beg_min = antoi( numb_char,2 );
2364 Mptr->ReWx[*NDEX].Bmm = beg_min;
2366 printf("BEG_MIN7 = %d\n",beg_min );
2372 if( *(numb_char+2) == 'E' ) {
2374 if( nisdigit(numb_char,4) &&
2375 strlen(numb_char) >= 4 ) {
2376 end_hour = antoi( numb_char,2 );
2377 end_min = antoi( numb_char+2,2 );
2380 Mptr->ReWx[*NDEX].Emm = end_min;
2381 Mptr->ReWx[*NDEX].Ehh = end_hour;
2384 printf("END_HOUR8 = %d\n",end_hour);
2385 printf("END_MIN8 = %d\n",end_min );
2391 else if( nisdigit(numb_char,2) &&
2392 strlen(numb_char) >= 2 ) {
2393 end_min = antoi( numb_char,2 );
2396 Mptr->ReWx[*NDEX].Emm = end_min;
2398 printf("END_MIN9 = %d\n",end_min );
2407 end_min = antoi( numb_char, 2 );
2410 Mptr->ReWx[*NDEX].Emm = end_min;
2412 printf("END_MIN10 = %d\n",end_min );
2418 if( *(numb_char+2) == 'B' ) {
2420 if( nisdigit(numb_char,4) &&
2421 strlen(numb_char) >= 4 ) {
2422 beg_hour = antoi( numb_char,2 );
2423 beg_min = antoi( numb_char+2,2 );
2426 Mptr->ReWx[*NDEX].Bmm = beg_min;
2427 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2430 printf("BEG_HOUR11 = %d\n",beg_hour);
2431 printf("BEG_MIN11 = %d\n",beg_min );
2437 else if( nisdigit(numb_char,2) &&
2438 strlen(numb_char) >= 2 ) {
2439 beg_min = antoi( numb_char,2 );
2442 Mptr->ReWx[*NDEX].Bmm = beg_min;
2444 printf("BEG_MIN12 = %d\n",beg_min );
2456 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2457 phenom[i], (strlen(phenom[i])-1) );
2479 #pragma subtitle(" ")
2481 #pragma subtitle("subtitle - description ")
2482 /********************************************************************/
2484 /* Title: isVariableCIG */
2485 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2486 /* Date: 21 Nov 1994 */
2487 /* Programmer: CARL MCCALLA */
2488 /* Language: C/370 */
2490 /* Abstract: isVariableCIG determines whether or not the */
2491 /* current group in combination with the next */
2492 /* one or more groups is a report of variable */
2495 /* External Functions Called: */
2498 /* Input: token - a pointer to an array of METAR report */
2500 /* Mptr - a pointer to a decoded_METAR structure */
2501 /* NDEX - the index value of the current METAR */
2502 /* report group array element. */
2504 /* Output: TRUE, if the token is currently pointing to */
2505 /* METAR report group(s) that a report of vari- */
2508 /* Modification History: */
2511 /********************************************************************/
2513 static bool isVariableCIG( char **token, Decoded_METAR *Mptr,
2518 if( *token == NULL )
2521 if( strcmp(*token, "CIG") != 0 )
2526 if( *token == NULL )
2529 if( (V_char = strchr(*token,'V')) != NULL ) {
2530 if( nisdigit(*token, (V_char - *token)) &&
2531 nisdigit( V_char+1, strlen(V_char+1)) ) {
2532 Mptr->minCeiling = antoi(*token, (V_char - *token));
2533 Mptr->maxCeiling = atoi(V_char+1);
2545 #pragma subtitle(" ")
2547 #pragma subtitle("subtitle - description ")
2548 /********************************************************************/
2550 /* Title: isCeil2ndSite */
2551 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2552 /* Date: 15 Sep 1994 */
2553 /* Programmer: CARL MCCALLA */
2554 /* Language: C/370 */
2556 /* Abstract: isCeil2ndSite determines whether or not the */
2557 /* current group in combination with the next */
2558 /* one or more groups is a report of a ceiling */
2559 /* at a secondary site. */
2561 /* External Functions Called: */
2564 /* Input: token - a pointer to an array of METAR report */
2566 /* Mptr - a pointer to a decoded_METAR structure */
2567 /* NDEX - the index value of the current METAR */
2568 /* report group array element. */
2570 /* Output: TRUE, if the token is currently pointing to */
2571 /* METAR report group(s) that are reporting */
2572 /* ceiling at a secondary site. */
2574 /* External Functions Called: */
2578 /* Modification History: */
2581 /********************************************************************/
2583 static bool isCIG2ndSite( char **token, Decoded_METAR *Mptr,
2588 if( (*token) == NULL )
2591 if(strcmp(*token,"CIG") != 0)
2596 if( (*token) == NULL )
2599 if( strlen(*token) != 3 )
2602 if( nisdigit(*token,3) )
2604 CIG2ndSite = atoi(*token ) * 10;
2606 if( strncmp(*(++token),"RY",2) != 0)
2609 strcpy(Mptr->CIG_2ndSite_LOC, *token );
2610 Mptr->CIG_2ndSite_Meters = CIG2ndSite;
2621 #pragma subtitle(" ")
2623 #pragma subtitle("subtitle - description ")
2624 /********************************************************************/
2626 /* Title: isPRESFR */
2627 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2628 /* Date: 20 Nov 1994 */
2629 /* Programmer: CARL MCCALLA */
2630 /* Language: C/370 */
2643 /* External Functions Called: */
2668 /* Modification History: */
2671 /********************************************************************/
2674 static bool isPRESFR( char *string, Decoded_METAR *Mptr, int *NDEX)
2677 if( string == NULL )
2680 if( strcmp(string, "PRESFR") != 0 )
2683 Mptr->PRESFR = TRUE;
2689 #pragma subtitle(" ")
2691 #pragma subtitle("subtitle - description ")
2692 /********************************************************************/
2694 /* Title: isPRESRR */
2695 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2696 /* Date: 20 Nov 1994 */
2697 /* Programmer: CARL MCCALLA */
2698 /* Language: C/370 */
2711 /* External Functions Called: */
2736 /* Modification History: */
2739 /********************************************************************/
2742 static bool isPRESRR( char *string, Decoded_METAR *Mptr, int *NDEX)
2745 if( string == NULL )
2748 if( strcmp(string, "PRESRR") != 0 )
2751 Mptr->PRESRR = TRUE;
2758 #pragma subtitle(" ")
2760 #pragma subtitle("subtitle - description ")
2761 /********************************************************************/
2764 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2765 /* Date: 15 Sep 1994 */
2766 /* Programmer: CARL MCCALLA */
2767 /* Language: C/370 */
2771 /* External Functions Called: */
2778 /* Modification History: */
2781 /********************************************************************/
2784 static bool isSLP( char **token, Decoded_METAR *Mptr, int *NDEX )
2787 /***************************/
2788 /* DECLARE LOCAL VARIABLES */
2789 /***************************/
2794 /*************************/
2795 /* BEGIN BODY OF ROUTINE */
2796 /*************************/
2798 if( *token == NULL )
2801 if( strcmp(*token, "SLPNO") == 0 ) {
2808 if( strncmp(*token, "SLP", 3) != 0 )
2812 if( strncmp(*token, "SLP", 3) == 0 &&
2813 strcmp(*token,"SLP") != 0 )
2815 if( nisdigit( *token+3, 3) )
2817 pressure = atoi(*token+3);
2819 if(pressure >= 550 )
2820 Mptr->SLP = ((float) pressure)/10. + 900.;
2822 Mptr->SLP = ((float) pressure)/10. + 1000.;
2833 if( *token == NULL )
2836 if( nisdigit( *token, 3) )
2838 pressure = atoi(*token);
2840 if(pressure >= 550 )
2841 Mptr->SLP = ((float) pressure)/10. + 900.;
2843 Mptr->SLP = ((float) pressure)/10. + 1000.;
2857 static bool isSectorVsby( char **string, Decoded_METAR *Mptr,
2860 /***************************/
2861 /* DECLARE LOCAL VARIABLES */
2862 /***************************/
2868 /*************************/
2869 /* START BODY OF ROUTINE */
2870 /*************************/
2872 if( *string == NULL )
2875 memset( dd, '\0', 3 );
2877 if( strcmp(*string, "VIS") != 0 )
2882 if( *string == NULL )
2885 if( strncmp(*string,"NE", 2) == 0 )
2886 strncpy(dd,*string,2);
2887 else if( strncmp(*string,"SE",2) == 0 )
2888 strncpy(dd,*string,2);
2889 else if( strncmp(*string,"NW",2) == 0 )
2890 strncpy(dd,*string,2);
2891 else if( strncmp(*string,"SW",2) == 0 )
2892 strncpy(dd,*string,2);
2893 else if( strncmp(*string,"N",1) == 0 )
2894 strncpy(dd,*string,1);
2895 else if( strncmp(*string,"E",1) == 0 )
2896 strncpy(dd,*string,1);
2897 else if( strncmp(*string,"S",1) == 0 )
2898 strncpy(dd,*string,1);
2899 else if( strncmp(*string,"W",1) == 0 )
2900 strncpy(dd,*string,1);
2904 if(nisdigit((*string+strlen(dd)),(strlen(*string)-strlen(dd))))
2905 vsby = atoi((*string+strlen(dd)));
2908 if( *string == NULL )
2911 if( (slash = strchr(*string,'/')) == NULL ) {
2912 strcpy(Mptr->SectorVsby_Dir,dd);
2913 Mptr->SectorVsby = vsby;
2918 else if( nisdigit(*string,(slash-*string)) &&
2919 nisdigit(slash+1,strlen(slash+1)) ) {
2920 vsby += fracPart(*string);
2921 strcpy( Mptr->SectorVsby_Dir, dd );
2922 Mptr->SectorVsby = vsby;
2934 #pragma subtitle(" ")
2936 #pragma subtitle("subtitle - description ")
2937 /********************************************************************/
2940 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2941 /* Date: 20 Nov 1994 */
2942 /* Programmer: CARL MCCALLA */
2943 /* Language: C/370 */
2956 /* External Functions Called: */
2981 /* Modification History: */
2984 /********************************************************************/
2986 static bool isGR( char **string, Decoded_METAR *Mptr, int *NDEX)
2990 if( *string == NULL )
2993 if( strcmp(*string, "GS") == 0 ) {
3000 if( strcmp(*string, "GR") != 0 )
3005 if( *string == NULL )
3008 if( (slash = strchr( *string, '/' )) != NULL ) {
3009 if( strcmp( *string, "M1/4" ) == 0 ) {
3010 Mptr->GR_Size = 1./8.;
3016 else if( nisdigit( *string, (slash - *string) ) &&
3017 nisdigit( slash+1, strlen(slash+1)) ) {
3018 Mptr->GR_Size = fracPart( *string );
3030 else if( nisdigit( *string, strlen(*string) ) ) {
3031 Mptr->GR_Size = antoi( *string, strlen(*string) );
3036 if( *string == NULL )
3039 if( (slash = strchr( *string, '/' )) != NULL ) {
3040 if( nisdigit( *string, (slash - *string) ) &&
3041 nisdigit( slash+1, strlen(slash+1)) ) {
3042 Mptr->GR_Size += fracPart( *string );
3068 #pragma subtitle(" ")
3070 #pragma subtitle("subtitle - description ")
3071 /********************************************************************/
3073 /* Title: isVIRGA */
3074 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3075 /* Date: 20 Nov 1994 */
3076 /* Programmer: CARL MCCALLA */
3077 /* Language: C/370 */
3090 /* External Functions Called: */
3115 /* Modification History: */
3118 /********************************************************************/
3121 static bool isVIRGA( char **string, Decoded_METAR *Mptr, int *NDEX)
3124 if( *string == NULL )
3127 if( strcmp(*string, "VIRGA") != 0 )
3135 if( *string == NULL )
3139 if( strcmp( *string, "N" ) == 0 ||
3140 strcmp( *string, "S" ) == 0 ||
3141 strcmp( *string, "E" ) == 0 ||
3142 strcmp( *string, "W" ) == 0 ||
3143 strcmp( *string, "NE" ) == 0 ||
3144 strcmp( *string, "NW" ) == 0 ||
3145 strcmp( *string, "SE" ) == 0 ||
3146 strcmp( *string, "SW" ) == 0 ) {
3147 strcpy(Mptr->VIRGA_DIR, *string);
3156 static bool isSfcObscuration( char *string, Decoded_METAR *Mptr,
3159 /***************************/
3160 /* DECLARE LOCAL VARIABLES */
3161 /***************************/
3163 static char *WxSymbols[] = {"BCFG", "BLDU", "BLSA", "BLPY",
3164 "DRDU", "DRSA", "DRSN", "DZ", "DS", "FZFG", "FZDZ", "FZRA",
3165 "FG", "FC", "FU", "GS", "GR", "HZ", "IC", "MIFG",
3166 "PE", "PO", "RA", "SHRA", "SHSN", "SHPE", "SHGS",
3167 "SHGR", "SN", "SG", "SQ", "SA", "SS", "TSRA",
3168 "TSSN", "TSPE", "TSGS", "TSGR", "TS",
3169 "VCSH", "VCPO", "VCBLDU", "VCBLSA", "VCBLSN",
3170 "VCFG", "VCFC","VA", NULL};
3179 /*************************/
3180 /* START BODY OF ROUTINE */
3181 /*************************/
3183 if( string == NULL )
3186 memset( ww, '\0', sizeof(ww) );
3188 if( strlen(string) < 4 )
3191 if( strncmp(string, "-X",2 ) != 0 )
3194 if( !(nisdigit(string+(strlen(string)-1), 1)) )
3198 strncpy( ww, temp, (strlen(string)-2) );
3202 numLoc = temp + (strlen(temp) - 1 );
3204 while( temp < numLoc && ndex < 6 ) {
3207 IS_NOT_FOUND = TRUE;
3209 while( WxSymbols[i] != NULL && IS_NOT_FOUND ) {
3210 if( strncmp( WxSymbols[i], temp, strlen(WxSymbols[i]))
3214 IS_NOT_FOUND = FALSE;
3217 if( WxSymbols[i] == NULL ) {
3222 strcpy(&(Mptr->SfcObscuration[ndex][0]),WxSymbols[i]);
3223 temp += strlen(WxSymbols[i]);
3230 Mptr->Num8thsSkyObscured = antoi( numLoc,1 );
3244 static bool isCeiling( char *string, Decoded_METAR *Mptr, int *NDEX )
3247 if( string == NULL )
3250 if( !(strncmp(string,"CIG",3) == 0 && strlen(string) >= 5) )
3253 if( strcmp(string, "CIGNO") == 0 ) {
3258 else if( strlen( string+3 ) == 3 ) {
3259 if( nisdigit(string+3, strlen(string+3)) &&
3260 strlen(string+3) == 3 ) {
3261 Mptr->Ceiling = atoi(string+3) * 100;
3268 else if( strlen(string+3) == 4 ) {
3269 if( *(string+3) == 'E' && nisdigit(string+4,3) ) {
3270 Mptr->Estimated_Ceiling = antoi(string+4,3) * 100;
3284 static bool isVrbSky( char **string, Decoded_METAR *Mptr, int *NDEX )
3286 static char *cldPtr[] = {"FEW", "SCT", "BKN", "OVC", NULL };
3289 char SKY1[ SKY1_len ];
3292 if( *string == NULL )
3296 memset( SKY1, '\0', SKY1_len );
3298 IS_NOT_FOUND = TRUE;
3300 while( cldPtr[i] != NULL && IS_NOT_FOUND ) {
3302 printf("isVrbSky: *string = %s cldPtr[%d] = %s\n",
3303 *string,i,cldPtr[i]);
3305 if( strncmp(*string, cldPtr[i], strlen(cldPtr[i])) != 0 )
3308 IS_NOT_FOUND = FALSE;
3311 if( cldPtr[i] == NULL )
3315 printf("isVrbSky: *string = %s = cldPtr[%d] = %s\n",
3316 *string,i,cldPtr[i]);
3318 strcpy( SKY1, cldPtr[i] );
3322 if( *string == NULL )
3326 if( strcmp(*string, "V") != 0 )
3331 if( *string == NULL )
3335 IS_NOT_FOUND = TRUE;
3336 while( cldPtr[i] != NULL && IS_NOT_FOUND ) {
3338 printf("isVrbSky: *string = %s cldPtr[%d] = %s\n",
3339 *string,i,cldPtr[i]);
3341 if( strncmp(*string, cldPtr[i], strlen(cldPtr[i])) != 0 )
3344 IS_NOT_FOUND = FALSE;
3347 if( cldPtr[i] == NULL ) {
3353 if(strlen(SKY1) == 6 ) {
3354 if( nisdigit(SKY1+3,3)) {
3355 strncpy(Mptr->VrbSkyBelow,SKY1,3);
3356 strcpy(Mptr->VrbSkyAbove,cldPtr[i]);
3357 Mptr->VrbSkyLayerHgt = antoi(SKY1+3,3)*100;
3371 strcpy(Mptr->VrbSkyBelow,SKY1);
3372 strcpy(Mptr->VrbSkyAbove,cldPtr[i]);
3388 static bool isObscurAloft( char **string, Decoded_METAR *Mptr,
3392 /***************************/
3393 /* DECLARE LOCAL VARIABLES */
3394 /***************************/
3396 static char *WxSymbols[] = {"BCFG", "BLDU", "BLSA", "BLPY",
3397 "DRDU", "DRSA", "DRSN", "DZ", "DS", "FZFG", "FZDZ", "FZRA",
3398 "FG", "FC", "FU", "GS", "GR", "HZ", "IC", "MIFG",
3399 "PE", "PO", "RA", "SHRA", "SHSN", "SHPE", "SHGS",
3400 "SHGR", "SN", "SG", "SQ", "SA", "SS", "TSRA",
3401 "TSSN", "TSPE", "TSGS", "TSGR", "TS",
3402 "VCSH", "VCPO", "VCBLDU", "VCBLSA", "VCBLSN",
3403 "VCFG", "VCFC","VA", NULL};
3410 /*************************/
3411 /* START BODY OF ROUTINE */
3412 /*************************/
3414 if( *string == NULL )
3417 saveTemp = temp = *string;
3422 while( *temp != '\0' ) {
3425 IS_NOT_FOUND = TRUE;
3427 while( WxSymbols[i] != NULL && IS_NOT_FOUND ) {
3428 if( strncmp(temp,WxSymbols[i],strlen(WxSymbols[i])) != 0 )
3431 IS_NOT_FOUND = FALSE;
3434 if( WxSymbols[i] == NULL ) {
3438 temp += strlen(WxSymbols[i]);
3443 if( *string == NULL )
3446 if( strlen(*string) != 6 )
3449 if((strncmp(*string,"FEW",3) == 0 ||
3450 strncmp(*string,"SCT",3) == 0 ||
3451 strncmp(*string,"BKN",3) == 0 ||
3452 strncmp(*string,"OVC",3) == 0 ) &&
3453 (nisdigit(*string+3,3) &&
3454 strcmp(*string+3,"000") != 0 )) {
3455 strcpy(Mptr->ObscurAloft,saveTemp);
3456 strncpy(Mptr->ObscurAloftSkyCond, *string,3);
3457 Mptr->ObscurAloftHgt = atoi(*string+3)*100;
3472 static bool isNOSPECI( char *string, Decoded_METAR *Mptr, int *NDEX )
3475 if( string == NULL )
3478 if( strcmp(string,"NOSPECI") != 0 )
3481 Mptr->NOSPECI = TRUE;
3487 static bool isLAST( char *string, Decoded_METAR *Mptr, int *NDEX )
3490 if( string == NULL )
3493 if( strcmp(string,"LAST") != 0 )
3501 #pragma subtitle(" ")
3503 #pragma subtitle("subtitle - description ")
3504 /********************************************************************/
3506 /* Title: isSynopClouds */
3507 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3508 /* Date: 15 Sep 1994 */
3509 /* Programmer: CARL MCCALLA */
3510 /* Language: C/370 */
3514 /* External Functions Called: */
3521 /* Modification History: */
3524 /********************************************************************/
3526 static bool isSynopClouds( char *token, Decoded_METAR *Mptr,
3534 if(strlen(token) != 5)
3537 if( *token == '8' &&
3538 *(token+1) == '/' &&
3539 ((*(token+2) <= '9' && *(token+2) >= '0') || *(token+2) == '/')
3541 ((*(token+3) <= '9' && *(token+3) >= '0') || *(token+3) == '/')
3543 ((*(token+4) <= '9' && *(token+4) >= '0') || *(token+4) == '/'))
3545 strcpy(Mptr->synoptic_cloud_type,token);
3547 Mptr->CloudLow = *(token+2);
3548 Mptr->CloudMedium = *(token+3);
3549 Mptr->CloudHigh = *(token+4);
3559 static bool isSNINCR( char **string, Decoded_METAR *Mptr, int *NDEX )
3564 if( *string == NULL )
3567 if( strcmp( *string, "SNINCR") != 0 )
3572 if( *string == NULL )
3576 if( (slash = strchr(*string,'/')) == NULL ) {
3580 else if( nisdigit (*string,(slash-*string)) &&
3581 nisdigit(slash+1,strlen(slash+1)) ) {
3582 Mptr->SNINCR = antoi(*string,(slash-*string));
3583 Mptr->SNINCR_TotalDepth = antoi(slash+1,strlen(slash+1));
3597 #pragma subtitle(" ")
3599 #pragma subtitle("subtitle - description ")
3600 /********************************************************************/
3602 /* Title: isSnowDepth */
3603 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3604 /* Date: 15 Sep 1994 */
3605 /* Programmer: CARL MCCALLA */
3606 /* Language: C/370 */
3610 /* External Functions Called: */
3617 /* Modification History: */
3620 /********************************************************************/
3622 static bool isSnowDepth( char *token, Decoded_METAR *Mptr,
3629 if(strlen(token) != 5)
3632 if( *token == '4' &&
3633 *(token+1) == '/' &&
3634 nisdigit( (token+2),3) )
3636 strcpy(Mptr->snow_depth_group,token);
3637 Mptr->snow_depth = antoi(token+2,3);
3646 static bool isWaterEquivSnow( char *string,
3647 Decoded_METAR *Mptr,
3651 if( string == NULL )
3654 if( strlen(string) != 6 )
3656 else if( !(nisdigit(string,6)) )
3658 else if( strncmp(string, "933", 3) != 0 )
3661 Mptr->WaterEquivSnow = ((float) atoi(string+3))/10.;
3668 static bool isSunshineDur( char *string, Decoded_METAR *Mptr,
3672 if( string == NULL )
3675 if( strlen(string) != 5 )
3677 else if( strncmp(string, "98", 2) != 0 )
3679 else if(nisdigit(string+2,3)) {
3680 Mptr->SunshineDur = atoi(string+2);
3684 else if( strncmp(string+2, "///", 3) == 0 ) {
3685 Mptr->SunSensorOut = TRUE;
3693 #pragma subtitle(" ")
3695 #pragma subtitle("subtitle - description ")
3696 /********************************************************************/
3698 /* Title: isHourlyPrecip */
3699 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3700 /* Date: 20 Nov 1994 */
3701 /* Programmer: CARL MCCALLA */
3702 /* Language: C/370 */
3715 /* External Functions Called: */
3740 /* Modification History: */
3743 /********************************************************************/
3746 static bool isHourlyPrecip( char **string, Decoded_METAR *Mptr,
3751 if( *string == NULL )
3754 if( !(strcmp(*string, "P") == 0 || charcmp(*string, "'P'dddd") ||
3755 charcmp(*string, "'P'ddd") ) )
3757 else if( strcmp(*string, "P") != 0 ) {
3758 if( nisdigit((*string+1), strlen(*string+1)) ) {
3759 Mptr->hourlyPrecip = ((float)
3760 atoi(*string+1)) * 0.01;
3773 if( *string == NULL )
3777 if( nisdigit(*string,strlen(*string)) ) {
3778 Mptr->hourlyPrecip = ((float)
3779 atoi(*string)) * 0.01;
3791 #pragma subtitle(" ")
3793 #pragma subtitle("subtitle - description ")
3794 /********************************************************************/
3796 /* Title: isP6Precip */
3797 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3798 /* Date: 20 Nov 1994 */
3799 /* Programmer: CARL MCCALLA */
3800 /* Language: C/370 */
3813 /* External Functions Called: */
3838 /* Modification History: */
3841 /********************************************************************/
3844 static bool isP6Precip( char *string, Decoded_METAR *Mptr,
3848 if( string == NULL )
3851 if( *string == '6' && (nisdigit(string+1,4) ||
3852 strcmp(string+1,"////") == 0) ) {
3853 if( strcmp(string+1, "////") == 0 ) {
3854 Mptr->precip_amt = (float) MAXINT;
3855 Mptr->Indeterminant3_6HrPrecip = TRUE;
3860 Mptr->precip_amt = ((float) atoi(string+1)) / 100;
3870 #pragma subtitle(" ")
3872 #pragma subtitle("subtitle - description ")
3873 /********************************************************************/
3875 /* Title: isP24Precip */
3876 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3877 /* Date: 20 Nov 1994 */
3878 /* Programmer: CARL MCCALLA */
3879 /* Language: C/370 */
3892 /* External Functions Called: */
3917 /* Modification History: */
3920 /********************************************************************/
3923 static bool isP24Precip( char *string, Decoded_METAR *Mptr,
3927 if( string == NULL )
3930 if( *string == '7' && (nisdigit(string+1,4) ||
3931 strcmp(string+1,"////") == 0) ) {
3932 if( strcmp(string+1, "////") == 0 ) {
3933 Mptr->precip_24_amt = (float) MAXINT;
3938 Mptr->precip_24_amt = ((float) atoi(string+1)) / 100.;
3947 #pragma subtitle(" ")
3949 #pragma subtitle("subtitle - description ")
3950 /********************************************************************/
3952 /* Title: isTTdTenths */
3953 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3954 /* Date: 16 Nov 1994 */
3955 /* Programmer: CARL MCCALLA */
3956 /* Language: C/370 */
3969 /* External Functions Called: */
3994 /* Modification History: */
3997 /********************************************************************/
4000 static bool isTTdTenths( char *token, Decoded_METAR *Mptr, int *NDEX)
4003 /***************************/
4004 /* DECLARE LOCAL VARIABLES */
4005 /***************************/
4007 bool returnFlag = FALSE;
4015 else if( !(strlen(token) == 5 || strlen(token) == 9) )
4019 if( (*(token+1) == '0' || *(token+1) == '1') &&
4020 nisdigit(token+2,3) )
4022 if( *(token+1) == '0' )
4027 Mptr->Temp_2_tenths = sign * ((float) antoi(token+2,3));
4033 if( (*(token+5) == '0' || *(token+5) == '1') &&
4034 nisdigit(token+6,3) )
4036 if( *(token+5) == '0' )
4041 Mptr->DP_Temp_2_tenths = sign * ((float) atoi(token+6));
4059 #pragma subtitle(" ")
4061 #pragma subtitle("subtitle - description ")
4062 /********************************************************************/
4064 /* Title: isMaxTemp */
4065 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4066 /* Date: 15 Sep 1994 */
4067 /* Programmer: CARL MCCALLA */
4068 /* Language: C/370 */
4072 /* External Functions Called: */
4079 /* Modification History: */
4082 /********************************************************************/
4084 static bool isMaxTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
4088 if( string == NULL )
4091 if(strlen(string) != 5 )
4093 else if(*string == '1' && (*(string+1) == '0' ||
4094 *(string+1) == '1' ||
4095 *(string+1) == '/' ) &&
4096 (nisdigit((string+2),3) ||
4097 strncmp(string+2,"///",3) == 0) )
4099 if(nisdigit(string+2,3))
4102 strncpy(buf,string+2,3);
4103 Mptr->maxtemp = ( (float) atoi(buf))/10.;
4105 if( *(string+1) == '1' )
4106 Mptr->maxtemp *= (-1.0);
4113 Mptr->maxtemp = (float) MAXINT;
4123 #pragma subtitle(" ")
4125 #pragma subtitle("subtitle - description ")
4126 /********************************************************************/
4128 /* Title: isMinTemp */
4129 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4130 /* Date: 15 Sep 1994 */
4131 /* Programmer: CARL MCCALLA */
4132 /* Language: C/370 */
4136 /* External Functions Called: */
4143 /* Modification History: */
4146 /********************************************************************/
4148 static bool isMinTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
4152 if( string == NULL )
4155 if(strlen(string) != 5 )
4157 else if(*string == '2' && (*(string+1) == '0' ||
4158 *(string+1) == '1' ||
4159 *(string+1) == '/' ) &&
4160 (nisdigit((string+2),3) ||
4161 strncmp(string+2,"///",3) == 0) )
4163 if(nisdigit(string+2,3))
4166 strncpy(buf,string+2,3);
4167 Mptr->mintemp = ( (float) atoi(buf) )/10.;
4169 if( *(string+1) == '1' )
4170 Mptr->mintemp *= (-1.0);
4176 Mptr->mintemp = (float) MAXINT;
4186 #pragma subtitle(" ")
4188 #pragma subtitle("subtitle - description ")
4189 /********************************************************************/
4191 /* Title: isT24MaxMinTemp */
4192 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4193 /* Date: 15 Sep 1994 */
4194 /* Programmer: CARL MCCALLA */
4195 /* Language: C/370 */
4199 /* External Functions Called: */
4206 /* Modification History: */
4209 /********************************************************************/
4211 static bool isT24MaxMinTemp( char *string, Decoded_METAR *Mptr,
4216 if( string == NULL )
4219 if( strlen(string) != 9 )
4221 else if( (*string == '4' && (*(string+1) == '0' ||
4222 *(string+1) == '1' ||
4223 *(string+1) == '/') &&
4224 (nisdigit((string+2),3) || strncmp(string+2,"///",3)))
4226 ((*(string+5) == '0' || *(string+5) == '1' ||
4227 *(string+5) == '/') &&
4228 (nisdigit((string+6),3) ||
4229 strncmp(string+6,"///",3) == 0 )) )
4231 if(nisdigit(string+1,4) && (*(string+1) == '0' ||
4232 *(string+1) == '1') )
4234 memset(buf, '\0', 6);
4235 strncpy(buf, string+2, 3);
4236 Mptr->max24temp = ( (float) atoi( buf ) )/10.;
4238 if( *(string+1) == '1' )
4239 Mptr->max24temp *= -1.;
4242 Mptr->max24temp = (float) MAXINT;
4245 if(nisdigit(string+5,4) && (*(string+5) == '0' ||
4246 *(string+5) == '1' ) )
4248 memset(buf, '\0', 6);
4249 strncpy(buf, string+6, 3);
4250 Mptr->min24temp = ( (float) atoi(buf) )/10.;
4252 if( *(string+5) == '1' )
4253 Mptr->min24temp *= -1.;
4256 Mptr->min24temp = (float) MAXINT;
4266 #pragma subtitle(" ")
4268 #pragma subtitle("subtitle - description ")
4269 /********************************************************************/
4271 /* Title: isPtendency */
4272 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4273 /* Date: 15 Sep 1994 */
4274 /* Programmer: CARL MCCALLA */
4275 /* Language: C/370 */
4279 /* External Functions Called: */
4286 /* Modification History: */
4289 /********************************************************************/
4292 static bool isPtendency(char *string, Decoded_METAR *Mptr, int *NDEX)
4296 if( string == NULL )
4299 if(strlen(string) != 5)
4301 else if(*string == '5' && ('0' <= *(string+1) <= '8') &&
4302 (nisdigit(string+2,3) || strncmp(string+2,"///",3)
4305 if( !(nisdigit(string+2,3)) )
4308 strncpy(buf,(string+1),1);
4309 Mptr->char_prestndcy = atoi(buf);
4316 strncpy(buf,(string+1),1);
4317 Mptr->char_prestndcy = atoi(buf);
4319 Mptr->prestndcy = ((float) atoi(string+2)) * 0.1;
4331 #pragma subtitle(" ")
4333 #pragma subtitle("subtitle - description ")
4334 /********************************************************************/
4336 /* Title: isPWINO */
4337 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4338 /* Date: 20 Nov 1994 */
4339 /* Programmer: CARL MCCALLA */
4340 /* Language: C/370 */
4344 /* External Functions Called: */
4351 /* Modification History: */
4354 /********************************************************************/
4357 static bool isPWINO( char *string, Decoded_METAR *Mptr, int *NDEX)
4360 if( string == NULL )
4364 if( strcmp(string, "PWINO") != 0 )
4374 #pragma subtitle(" ")
4376 #pragma subtitle("subtitle - description ")
4377 /********************************************************************/
4380 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4381 /* Date: 20 Nov 1994 */
4382 /* Programmer: CARL MCCALLA */
4383 /* Language: C/370 */
4387 /* External Functions Called: */
4394 /* Modification History: */
4397 /********************************************************************/
4400 static bool isPNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4404 if( string == NULL )
4407 if( strcmp(string, "PNO") != 0 )
4417 #pragma subtitle(" ")
4419 #pragma subtitle("subtitle - description ")
4420 /********************************************************************/
4422 /* Title: isRVRNO */
4423 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4424 /* Date: 20 Nov 1994 */
4425 /* Programmer: CARL MCCALLA */
4426 /* Language: C/370 */
4430 /* External Functions Called: */
4437 /* Modification History: */
4440 /********************************************************************/
4443 static bool isRVRNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4446 if( string == NULL )
4449 if( strcmp(string, "RVRNO") != 0 )
4459 #pragma subtitle(" ")
4461 #pragma subtitle("subtitle - description ")
4462 /********************************************************************/
4464 /* Title: isCHINO */
4465 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4466 /* Date: 20 Nov 1994 */
4467 /* Programmer: CARL MCCALLA */
4468 /* Language: C/370 */
4472 /* External Functions Called: */
4479 /* Modification History: */
4482 /********************************************************************/
4485 static bool isCHINO( char **string, Decoded_METAR *Mptr, int *NDEX)
4489 if( *string == NULL )
4492 if( strcmp(*string, "CHINO") != 0 )
4497 if( *string == NULL )
4500 if( strlen(*string) <= 2 ) {
4505 if( strncmp( *string, "RY", 2 ) == 0 &&
4506 nisdigit(*string+2,strlen(*string+2)) ) {
4508 strcpy(Mptr->CHINO_LOC, *string);
4521 #pragma subtitle(" ")
4523 #pragma subtitle("subtitle - description ")
4524 /********************************************************************/
4526 /* Title: isVISNO */
4527 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4528 /* Date: 20 Nov 1994 */
4529 /* Programmer: CARL MCCALLA */
4530 /* Language: C/370 */
4534 /* External Functions Called: */
4541 /* Modification History: */
4544 /********************************************************************/
4547 static bool isVISNO( char **string, Decoded_METAR *Mptr, int *NDEX)
4550 if( *string == NULL )
4553 if( strcmp(*string, "VISNO") != 0 )
4558 if( *string == NULL )
4561 if( strlen(*string) <= 2 ) {
4566 if( strncmp( *string, "RY", 2 ) == 0 &&
4567 nisdigit(*string+2,strlen(*string+2))) {
4569 strcpy(Mptr->VISNO_LOC, *string);
4582 #pragma subtitle(" ")
4584 #pragma subtitle("subtitle - description ")
4585 /********************************************************************/
4587 /* Title: isFZRANO */
4588 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4589 /* Date: 20 Nov 1994 */
4590 /* Programmer: CARL MCCALLA */
4591 /* Language: C/370 */
4595 /* External Functions Called: */
4602 /* Modification History: */
4605 /********************************************************************/
4608 static bool isFZRANO( char *string, Decoded_METAR *Mptr, int *NDEX)
4612 if( string == NULL )
4615 if( strcmp(string, "FZRANO") != 0 )
4618 Mptr->FZRANO = TRUE;
4625 #pragma subtitle(" ")
4627 #pragma subtitle("subtitle - description ")
4628 /********************************************************************/
4631 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4632 /* Date: 20 Nov 1994 */
4633 /* Programmer: CARL MCCALLA */
4634 /* Language: C/370 */
4647 /* External Functions Called: */
4672 /* Modification History: */
4675 /********************************************************************/
4678 static bool isTSNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4681 if( string == NULL )
4684 if( strcmp(string, "TSNO") != 0 )
4694 #pragma subtitle(" ")
4696 #pragma subtitle("subtitle - description ")
4697 /********************************************************************/
4699 /* Title: isDollarSign */
4700 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4701 /* Date: 15 Sep 1994 */
4702 /* Programmer: CARL MCCALLA */
4703 /* Language: C/370 */
4707 /* External Functions Called: */
4714 /* Modification History: */
4717 /********************************************************************/
4720 static bool isDollarSign( char *indicator, Decoded_METAR *Mptr,
4724 if( indicator == NULL )
4727 if( strcmp(indicator,"$") != 0 )
4732 Mptr->DollarSign = TRUE;
4738 #pragma subtitle(" ")
4739 #pragma subtitle("subtitle - description ")
4740 /********************************************************************/
4742 /* Title: DcdMTRmk */
4743 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4744 /* Date: 15 Sep 1994 */
4745 /* Programmer: CARL MCCALLA */
4746 /* Language: C/370 */
4748 /* Abstract: DcdMTRmk takes a pointer to a METAR */
4749 /* report and parses/decodes data elements from */
4750 /* the remarks section of the report. */
4754 /* External Functions Called: */
4757 /* Input: token - the address of a pointer to a METAR */
4758 /* report character string. */
4759 /* Mptr - a pointer to a structure of the vari- */
4760 /* able type Decoded_METAR. */
4765 /* Modification History: */
4768 /********************************************************************/
4770 void DcdMTRmk( char **token, Decoded_METAR *Mptr )
4773 /***************************/
4774 /* DECLARE LOCAL VARIABLES */
4775 /***************************/
4777 int TornadicActvty = 0, A0indicator = 0,
4778 peakwind = 0, windshift = 0, towerVsby = 0, surfaceVsby = 0,
4779 variableVsby = 0, LTGfreq = 0,
4781 recentWX = 0, variableCIG = 0, PRESFR = 0,
4782 Vsby2ndSite = 0, CIG2ndSite = 0,
4783 PRESRR = 0, SLP = 0, PartObscur = 0,
4784 SectorVsby = 0, GR = 0, Virga = 0,
4785 SfcObscur = 0, Ceiling = 0, VrbSkyCond = 0, ObscurAloft = 0,
4786 NoSPECI = 0, Last = 0, SynopClouds = 0, Snincr = 0,
4787 SnowDepth = 0, WaterEquivSnow = 0, SunshineDur = 0,
4788 hourlyPrecip = 0, P6Precip = 0, P24Precip = 0,
4789 TTdTenths = 0, MaxTemp = 0, MinTemp = 0, T24MaxMinTemp = 0,
4790 Ptendency = 0, PWINO = 0,
4791 FZRANO = 0, TSNO = 0, maintIndicator = 0, CHINO = 0, RVRNO = 0,
4792 VISNO = 0, PNO = 0, DVR = 0;
4807 /*************************/
4808 /* START BODY OF ROUTINE */
4809 /*************************/
4813 /*************************************************/
4814 /* LOCATE THE START OF THE METAR REMARKS SECTION */
4815 /*************************************************/
4819 while( token[ NDEX ] != NULL && IS_NOT_RMKS) {
4821 printf("DcdMTRmk: token[%d] = %s\n",NDEX,token[NDEX]);
4823 if( strcmp(token[ NDEX ], "RMK") != 0 )
4826 IS_NOT_RMKS = FALSE;
4829 /***********************************************/
4830 /* IF THE METAR REPORT CONTAINS NO REMARKS */
4831 /* SECTION, THEN RETURN TO THE CALLING ROUTINE */
4832 /***********************************************/
4834 if( token[ NDEX ] != NULL ) {
4836 printf("DcdMTRmk: RMK found, token[%d] = %s\n",
4841 printf("DcdMTRmk: Bump NDEX, token[%d] = %s\n",
4847 printf("DcdMTRmk: No RMK found. NULL ptr encountered\n");
4851 /*****************************************/
4852 /* IDENTIFY AND VALIDATE REMARKS SECTION */
4853 /* DATA GROUPS FOR PARSING/DECODING */
4854 /*****************************************/
4856 while(token[NDEX] != NULL) {
4859 printf("DcdMTRmk: DECODE RMKS: token[%d] = %s\n",NDEX,token[NDEX]);
4863 if( isTornadicActiv( &(token[NDEX]), Mptr, &NDEX ) ) {
4865 if( TornadicActvty > 1 ) {
4866 memset(Mptr->TornadicType,'\0',15);
4867 memset(Mptr->TornadicLOC,'\0',10);
4868 memset(Mptr->TornadicDIR,'\0',4);
4869 Mptr->BTornadicHour = MAXINT;
4870 Mptr->BTornadicMinute = MAXINT;
4871 Mptr->ETornadicHour = MAXINT;
4872 Mptr->ETornadicMinute = MAXINT;
4875 else if( isA0indicator( token[NDEX], Mptr, &NDEX ) ) {
4877 if( A0indicator > 1 )
4878 memset(Mptr->autoIndicator,'\0',5);
4880 else if( isPeakWind( &(token[NDEX]), Mptr, &NDEX ) ) {
4882 if( peakwind > 1 ) {
4883 Mptr->PKWND_dir = MAXINT;
4884 Mptr->PKWND_speed = MAXINT;
4885 Mptr->PKWND_hour = MAXINT;
4886 Mptr->PKWND_minute = MAXINT;
4889 else if( isWindShift( &(token[NDEX]), Mptr, &NDEX ) ) {
4891 if( windshift > 1 ) {
4892 Mptr->WshfTime_hour = MAXINT;
4893 Mptr->WshfTime_minute = MAXINT;
4896 else if( isTowerVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4899 Mptr->TWR_VSBY = (float) MAXINT;
4901 else if( isSurfaceVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4903 if( surfaceVsby > 1 )
4904 Mptr->TWR_VSBY = (float) MAXINT;
4906 else if( isVariableVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4908 if( variableVsby > 1 ) {
4909 Mptr->minVsby = (float) MAXINT;
4910 Mptr->maxVsby = (float) MAXINT;
4913 else if( isVsby2ndSite( &(token[NDEX]), Mptr, &NDEX ) ) {
4915 if( Vsby2ndSite > 1 ) {
4916 Mptr->VSBY_2ndSite = (float) MAXINT;
4917 memset(Mptr->VSBY_2ndSite_LOC,'\0',10);
4920 else if( isLTGfreq( &(token[NDEX]), Mptr, &NDEX ) ) {
4923 Mptr->OCNL_LTG = FALSE;
4924 Mptr->FRQ_LTG = FALSE;
4925 Mptr->CNS_LTG = FALSE;
4926 Mptr->CG_LTG = FALSE;
4927 Mptr->IC_LTG = FALSE;
4928 Mptr->CC_LTG = FALSE;
4929 Mptr->CA_LTG = FALSE;
4930 Mptr->DSNT_LTG = FALSE;
4931 Mptr->OVHD_LTG = FALSE;
4932 Mptr->VcyStn_LTG = FALSE;
4933 Mptr->LightningVCTS = FALSE;
4934 Mptr->LightningTS = FALSE;
4935 memset(Mptr->LTG_DIR,'\0',3 );
4938 else if( isTS_LOC( &(token[NDEX]), Mptr, &NDEX ) ) {
4941 memset(Mptr->TS_LOC, '\0', 3);
4942 memset(Mptr->TS_MOVMNT, '\0', 3);
4945 else if( isRecentWX( &(token[NDEX]), Mptr, &recentWX ) ) {
4947 /* if( recentWX > 3 ) {
4948 for( i = 0; i < 3; i++ ) {
4949 memset(Mptr->ReWx[i].Recent_weather, '\0', 5);
4951 Mptr->ReWx[i].Bhh = MAXINT;
4952 Mptr->ReWx[i].Bmm = MAXINT;
4954 Mptr->ReWx[i].Ehh = MAXINT;
4955 Mptr->ReWx[i].Emm = MAXINT;
4963 else if( isVariableCIG( &(token[NDEX]), Mptr, &NDEX ) ) {
4965 if( variableCIG > 1) {
4966 Mptr->minCeiling = MAXINT;
4967 Mptr->maxCeiling = MAXINT;
4970 else if( isCIG2ndSite( &(token[NDEX]), Mptr, &NDEX ) ) {
4972 if( CIG2ndSite > 1) {
4973 Mptr->CIG_2ndSite_Meters = MAXINT;
4974 memset( Mptr->CIG_2ndSite_LOC, '\0', 10);
4977 else if( isPRESFR( token[NDEX], Mptr, &NDEX ) ) {
4980 Mptr->PRESFR = FALSE;
4982 else if( isPRESRR( token[NDEX], Mptr, &NDEX ) ) {
4985 Mptr->PRESRR = FALSE;
4987 else if( isSLP( &(token[NDEX]), Mptr, &NDEX ) ) {
4990 Mptr->SLP = (float) MAXINT;
4992 else if( isPartObscur( &(token[NDEX]), Mptr, PartObscur,
4995 if( PartObscur > 2 ) {
4996 memset(&(Mptr->PartialObscurationAmt[0][0]), '\0', 7 );
4997 memset(&(Mptr->PartialObscurationPhenom[0][0]),'\0',12 );
4999 memset(&(Mptr->PartialObscurationAmt[1][0]), '\0', 7 );
5000 memset(&(Mptr->PartialObscurationPhenom[1][0]),'\0',12 );
5003 else if( isSectorVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
5005 if( SectorVsby > 1 ) {
5006 Mptr->SectorVsby = (float) MAXINT;
5007 memset(Mptr->SectorVsby_Dir, '\0', 3);
5010 else if( isGR( &(token[NDEX]), Mptr, &NDEX ) ) {
5013 Mptr->GR_Size = (float) MAXINT;
5017 else if( isVIRGA( &(token[NDEX]), Mptr, &NDEX ) ) {
5020 Mptr->VIRGA = FALSE;
5021 memset(Mptr->VIRGA_DIR, '\0', 3);
5024 else if( isSfcObscuration( token[NDEX], Mptr, &NDEX ) ) {
5026 if( SfcObscur > 1 ) {
5027 for( i = 0; i < 6; i++ ) {
5028 memset(&(Mptr->SfcObscuration[i][0]), '\0', 10);
5029 Mptr->Num8thsSkyObscured = MAXINT;
5033 else if( isCeiling( token[NDEX], Mptr, &NDEX ) ) {
5036 Mptr->CIGNO = FALSE;
5037 Mptr->Ceiling = MAXINT;
5038 Mptr->Estimated_Ceiling = FALSE;
5041 else if( isVrbSky( &(token[NDEX]), Mptr, &NDEX ) ) {
5043 if( VrbSkyCond > 1 ) {
5044 memset(Mptr->VrbSkyBelow, '\0', 4);
5045 memset(Mptr->VrbSkyAbove, '\0', 4);
5046 Mptr->VrbSkyLayerHgt = MAXINT;
5049 else if( isObscurAloft( &(token[NDEX]), Mptr, &NDEX ) ) {
5051 if( ObscurAloft > 1 ) {
5052 Mptr->ObscurAloftHgt = MAXINT;
5053 memset( Mptr->ObscurAloft, '\0', 12 );
5054 memset( Mptr->ObscurAloftSkyCond, '\0', 12 );
5057 else if( isNOSPECI( token[NDEX], Mptr, &NDEX ) ) {
5060 Mptr->NOSPECI = FALSE;
5062 else if( isLAST( token[NDEX], Mptr, &NDEX ) ) {
5067 else if( isSynopClouds( token[NDEX], Mptr, &NDEX ) ) {
5069 if( SynopClouds > 1 ) {
5070 memset( Mptr->synoptic_cloud_type, '\0', 6 );
5071 Mptr->CloudLow = '\0';
5072 Mptr->CloudMedium = '\0';
5073 Mptr->CloudHigh = '\0';
5076 else if( isSNINCR( &(token[NDEX]), Mptr, &NDEX ) ) {
5079 Mptr->SNINCR = MAXINT;
5080 Mptr->SNINCR_TotalDepth = MAXINT;
5083 else if( isSnowDepth( token[NDEX], Mptr, &NDEX ) ) {
5085 if( SnowDepth > 1 ) {
5086 memset( Mptr->snow_depth_group, '\0', 6 );
5087 Mptr->snow_depth = MAXINT;
5090 else if( isWaterEquivSnow( token[NDEX], Mptr, &NDEX ) ) {
5092 if( WaterEquivSnow > 1 )
5093 Mptr->WaterEquivSnow = (float) MAXINT;
5095 else if( isSunshineDur( token[NDEX], Mptr, &NDEX ) ) {
5097 if( SunshineDur > 1 ) {
5098 Mptr->SunshineDur = MAXINT;
5099 Mptr->SunSensorOut = FALSE;
5102 else if( isHourlyPrecip( &(token[NDEX]), Mptr, &NDEX ) ) {
5104 if( hourlyPrecip > 1 )
5105 Mptr->hourlyPrecip = (float) MAXINT;
5107 else if( isP6Precip( token[NDEX], Mptr, &NDEX ) ) {
5110 Mptr->precip_amt = (float) MAXINT;
5112 else if( isP24Precip( token[NDEX], Mptr, &NDEX ) ) {
5115 Mptr->precip_24_amt = (float) MAXINT;
5117 else if( isTTdTenths( token[NDEX], Mptr, &NDEX ) ) {
5119 if( TTdTenths > 1 ) {
5120 Mptr->Temp_2_tenths = (float) MAXINT;
5121 Mptr->DP_Temp_2_tenths = (float) MAXINT;
5124 else if( isMaxTemp( token[NDEX], Mptr, &NDEX ) ) {
5127 Mptr->maxtemp = (float) MAXINT;
5129 else if( isMinTemp( token[NDEX], Mptr, &NDEX ) ) {
5132 Mptr->mintemp = (float) MAXINT;
5134 else if( isT24MaxMinTemp( token[NDEX],
5137 if( T24MaxMinTemp > 1 ) {
5138 Mptr->max24temp = (float) MAXINT;
5139 Mptr->min24temp = (float) MAXINT;
5142 else if( isPtendency( token[NDEX], Mptr, &NDEX ) ) {
5144 if( Ptendency > 1 ) {
5145 Mptr->char_prestndcy = MAXINT;
5146 Mptr->prestndcy = (float) MAXINT;
5149 else if( isPWINO( token[NDEX], Mptr, &NDEX ) ) {
5152 Mptr->PWINO = FALSE;
5154 else if( isFZRANO( token[NDEX], Mptr, &NDEX ) ) {
5157 Mptr->FZRANO = FALSE;
5159 else if( isTSNO( token[NDEX], Mptr, &NDEX ) ) {
5164 else if( isDollarSign( token[NDEX], Mptr, &NDEX ) ) {
5166 if( maintIndicator > 1 )
5167 Mptr->DollarSign = FALSE;
5169 else if( isRVRNO( token[NDEX], Mptr, &NDEX ) ) {
5172 Mptr->RVRNO = FALSE;
5174 else if( isPNO( token[NDEX], Mptr, &NDEX ) ) {
5179 else if( isVISNO( &(token[NDEX]), Mptr, &NDEX ) ) {
5182 Mptr->VISNO = FALSE;
5183 memset(Mptr->VISNO_LOC, '\0', 6);
5186 else if( isCHINO( &(token[NDEX]), Mptr, &NDEX ) ) {
5189 Mptr->CHINO = FALSE;
5190 memset(Mptr->CHINO_LOC, '\0', 6);
5193 else if( isDVR( token[NDEX], Mptr, &NDEX ) ) {
5196 Mptr->DVR.Min_visRange = MAXINT;
5197 Mptr->DVR.Max_visRange = MAXINT;
5198 Mptr->DVR.visRange = MAXINT;
5199 Mptr->DVR.vrbl_visRange = FALSE;
5200 Mptr->DVR.below_min_DVR = FALSE;
5201 Mptr->DVR.above_max_DVR = FALSE;