1 #include <simgear/compiler.h>
3 #include "Local.h" /* standard header file */
7 float fracPart( char * );
9 /********************************************************************/
12 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
13 /* Date: 06 May 1996 */
14 /* Programmer: CARL MCCALLA */
17 /* Abstract: Identify the input character string as a thunder- */
18 /* storm location. If the input string is a thunder- */
19 /* storm location, then return TRUE. Otherwise, */
23 /* External Functions Called: */
26 /* Input: string - a pointer to a pointer to a charac- */
27 /* ter string from a METAR report. */
29 /* Mptr - a pointer to a structure that has the */
30 /* data type Decoded_METAR. */
32 /* NDEX - a pointer to an integer that is the index */
33 /* into an array that contains the indi- */
34 /* vidual groups of the METAR report being */
35 /* decoded. Upon entry, NDEX is the index */
36 /* of the current group of the METAR report */
37 /* that is to be indentified. */
39 /* Output: TRUE - if the input string is a thunderstorm */
41 /* FALSE - the input string is not a thunderstorm */
44 /* Modification History: */
47 /********************************************************************/
49 static bool isTS_LOC( char **string, Decoded_METAR *Mptr,
53 /***************************/
54 /* DECLARE LOCAL VARIABLES */
55 /***************************/
59 /*************************/
60 /* START BODY OF ROUTINE */
61 /*************************/
62 /*******************************************/
63 /* COMPARE THE INPUT CHARACTER STRING WITH */
64 /* VALID AUTOMATED STATION CODE TYPE. IF */
65 /* A MATCH IS FOUND, RETURN TRUE. OTHER- */
66 /* WISE, RETURN FALSE */
67 /*******************************************/
74 if( strcmp( *string, "TS") != 0 )
82 if( strcmp(*string,"N") == 0 ||
83 strcmp(*string,"NE") == 0 ||
84 strcmp(*string,"NW") == 0 ||
85 strcmp(*string,"S") == 0 ||
86 strcmp(*string,"SE") == 0 ||
87 strcmp(*string,"SW") == 0 ||
88 strcmp(*string,"E") == 0 ||
89 strcmp(*string,"W") == 0 ) {
90 strcpy( Mptr->TS_LOC, *string );
98 if( strcmp( *string, "MOV" ) == 0 ) {
101 if( *string == NULL ) {
106 if( strcmp(*string,"N") == 0 ||
107 strcmp(*string,"NE") == 0 ||
108 strcmp(*string,"NW") == 0 ||
109 strcmp(*string,"S") == 0 ||
110 strcmp(*string,"SE") == 0 ||
111 strcmp(*string,"SW") == 0 ||
112 strcmp(*string,"E") == 0 ||
113 strcmp(*string,"W") == 0 ) {
114 strcpy( Mptr->TS_MOVMNT, *string );
133 /********************************************************************/
136 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
137 /* Date: 15 Sep 1994 */
138 /* Programmer: CARL MCCALLA */
139 /* Language: C/370 */
143 /* External Functions Called: */
150 /* Modification History: */
153 /********************************************************************/
155 static bool isDVR( char *token, Decoded_METAR *Mptr, int *NDEX )
157 char *slashPtr, *FT_ptr;
164 if( (length = strlen( token )) < 4 )
167 if( strncmp( token, "DVR", 3 ) != 0 )
170 if( *(slashPtr = token+3) != '/' ) {
175 if( strcmp(token+(strlen(token)-2),"FT") != 0 )
178 FT_ptr = token + (strlen(token)-2);
180 if( strchr(slashPtr+1, 'P' ) != NULL )
181 Mptr->DVR.above_max_DVR = TRUE;
183 if( strchr(slashPtr+1, 'M' ) != NULL )
184 Mptr->DVR.below_min_DVR = TRUE;
187 if( (vPtr = strchr(slashPtr, 'V' )) != NULL )
189 Mptr->DVR.vrbl_visRange = TRUE;
190 Mptr->DVR.Min_visRange = antoi(slashPtr+1,
191 (vPtr-(slashPtr+1)) );
192 Mptr->DVR.Max_visRange = antoi(vPtr+1,
193 (FT_ptr - (vPtr+1)) );
199 if( Mptr->DVR.below_min_DVR ||
200 Mptr->DVR.above_max_DVR )
201 Mptr->DVR.visRange = antoi(slashPtr+2,
202 (FT_ptr - (slashPtr+2)) );
204 Mptr->DVR.visRange = antoi(slashPtr+1,
205 (FT_ptr - (slashPtr+1)) );
212 /********************************************************************/
214 /* Title: isTornadicActiv */
215 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
216 /* Date: 15 Sep 1994 */
217 /* Programmer: CARL MCCALLA */
218 /* Language: C/370 */
220 /* Abstract: Determines whether or not the input character */
221 /* string is signals the beginning of TORNADIC */
222 /* ACTIVITY data. If it is, then interrogate subse- */
223 /* quent report groups for time, location, and movement*/
224 /* of tornado. Return TRUE, if TORNADIC ACTIVITY is */
225 /* found. Otherwise, return FALSE. */
228 /* External Functions Called: */
231 /* Input: string - the address of a pointer to a charac- */
232 /* ter string that may or may not signal */
233 /* TORNADIC ACTIVITY. */
235 /* Mptr - a pointer to a structure that has the */
236 /* data type Decoded_METAR. */
238 /* NDEX - a pointer to an integer that is the index */
239 /* into an array that contains the indi- */
240 /* vidual groups of the METAR report being */
241 /* decoded. Upon entry, NDEX is the index */
242 /* of the current group of the METAR report */
243 /* that is to be indentified. */
245 /* Output: TRUE - if TORNADIC ACTIVITY is found. */
246 /* FALSE - if no TORNADIC ACTIVITY is found. */
248 /* Modification History: */
251 /********************************************************************/
253 static bool isTornadicActiv( char **string, Decoded_METAR *Mptr,
258 bool Completion_flag;
263 /*************************/
264 /* START BODY OF ROUTINE */
265 /*************************/
273 if( *string == NULL )
276 if( !( strcmp(*string, "TORNADO") == 0 ||
277 strcmp(*string, "TORNADOS") == 0 ||
278 strcmp(*string, "TORNADOES") == 0 ||
279 strcmp(*string, "WATERSPOUT") == 0 ||
280 strcmp(*string, "WATERSPOUTS") == 0 ||
281 strcmp(*string, "FUNNEL") == 0 ) )
284 if( strcmp(*string, "FUNNEL") == 0 ) {
287 if( *string == NULL )
290 if( !(strcmp(*string,"CLOUD") == 0 ||
291 strcmp(*string,"CLOUDS") == 0 ) ) {
296 strcpy(Mptr->TornadicType,"FUNNEL CLOUD");
299 strcpy(Mptr->TornadicType, *string);
304 Completion_flag = FALSE;
306 if( *string == NULL )
309 while( !Completion_flag ) {
311 /* printf("isTornadicActivity: current *string = %s\n",
314 if( *(*string) =='B' || *(*string) == 'E') {
315 if( *(*string) == 'B' ) {
316 B_stringPtr = *string;
317 E_stringPtr = strchr((*string)+1,'E');
320 B_stringPtr = strchr((*string)+1,'B');
321 E_stringPtr = *string;
324 if( B_stringPtr != NULL )
325 printf("isTornadicActivity: B_stringPtr = %x\n",
328 printf("isTornadicActivity: B_stringPtr = NULL\n");
330 if( E_stringPtr != NULL )
331 printf("isTornadicActivity: E_stringPtr = %x\n",
334 printf("isTornadicActivity: E_stringPtr = NULL\n");
336 if( B_stringPtr != NULL && E_stringPtr == NULL ) {
337 if( nisdigit((*string)+1, strlen((*string)+1)) &&
338 strlen((*string)+1) <= 4 ) {
339 TornadicTime = antoi((*string)+1,
340 strlen((*string)+1));
341 if( TornadicTime > 99 ) {
342 Mptr->BTornadicHour = TornadicTime / 100;
343 Mptr->BTornadicMinute = TornadicTime % 100;
348 Mptr->BTornadicHour = TornadicTime;
358 else if( B_stringPtr == NULL && E_stringPtr != NULL ) {
359 if( nisdigit((*string)+1,strlen((*string)+1)) &&
360 strlen((*string)+1) <= 4 ) {
361 TornadicTime = antoi((*string)+1,
362 strlen((*string)+1));
363 if( TornadicTime > 99 ) {
364 Mptr->ETornadicHour = TornadicTime / 100;
365 Mptr->ETornadicMinute = TornadicTime % 100;
370 Mptr->ETornadicHour = TornadicTime;
381 /* printf("isTornadicActivity: B_stringPtr != NULL"
382 " and E_stringPtr != NULL\n"); */
383 if( nisdigit((B_stringPtr+1),(E_stringPtr -
385 TornadicTime = antoi(( B_stringPtr+1),
386 (E_stringPtr-(B_stringPtr+1)));
387 if( TornadicTime > 99 ) {
388 Mptr->BTornadicHour = TornadicTime / 100;
389 Mptr->BTornadicMinute = TornadicTime % 100;
394 Mptr->BTornadicHour = TornadicTime;
399 TornadicTime = antoi(( E_stringPtr+1),
400 strlen(E_stringPtr+1));
402 if( TornadicTime > 99 ) {
403 Mptr->ETornadicHour = TornadicTime / 100;
404 Mptr->ETornadicMinute = TornadicTime % 100;
409 Mptr->ETornadicHour = TornadicTime;
420 else if( nisdigit(*string, strlen(*string))) {
423 if( *string == NULL )
426 if( strcmp(*string,"N") == 0 ||
427 strcmp(*string,"NE") == 0 ||
428 strcmp(*string,"NW") == 0 ||
429 strcmp(*string,"S") == 0 ||
430 strcmp(*string,"SE") == 0 ||
431 strcmp(*string,"SW") == 0 ||
432 strcmp(*string,"E") == 0 ||
433 strcmp(*string,"W") == 0 ) {
435 Mptr->TornadicDistance = antoi(*string,
443 if( saveNdex == *NDEX )
450 else if(strcmp(*string,"DSNT") == 0 ||
451 strcmp(*string,"VC") == 0 ||
452 strcmp(*string,"VCY") == 0 ) {
453 if( strcmp(*string,"VCY") == 0 ||
454 strcmp(*string,"VC") == 0 ) {
457 if( *string == NULL )
460 if( strcmp(*string,"STN") == 0 ){
461 strcpy(Mptr->TornadicLOC,"VC STN");
467 strcpy(Mptr->TornadicLOC,"VC");
472 strcpy(Mptr->TornadicLOC,"DSNT");
477 else if(strcmp(*string,"N") == 0 ||
478 strcmp(*string,"NE") == 0 ||
479 strcmp(*string,"NW") == 0 ||
480 strcmp(*string,"S") == 0 ||
481 strcmp(*string,"SE") == 0 ||
482 strcmp(*string,"SW") == 0 ||
483 strcmp(*string,"E") == 0 ||
484 strcmp(*string,"W") == 0 ) {
485 strcpy(Mptr->TornadicDIR, *string);
489 else if( strcmp(*string, "MOV" ) == 0 ) {
493 if( *string == NULL )
496 if( strcmp(*string, "N") == 0 ||
497 strcmp(*string, "S") == 0 ||
498 strcmp(*string, "E") == 0 ||
499 strcmp(*string, "W") == 0 ||
500 strcmp(*string, "NE") == 0 ||
501 strcmp(*string, "NW") == 0 ||
502 strcmp(*string, "SE") == 0 ||
503 strcmp(*string, "SW") == 0 ) {
504 strcpy( Mptr->TornadicMovDir, *string );
511 Completion_flag = TRUE;
514 if( saveNdex == *NDEX )
522 /********************************************************************/
524 /* Title: isPartObscur */
525 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
526 /* Date: 15 Sep 1994 */
527 /* Programmer: CARL MCCALLA */
528 /* Language: C/370 */
530 /* Abstract: Determine whether or not the input character string */
531 /* is a partial obscuration phenomenon. If a partial */
532 /* obscuration is found, then take the preceding group */
533 /* as the obscuring phenomenon. If a partial obscura- */
534 /* tion is found, then return TRUE. Otherwise, return */
538 /* External Functions Called: */
541 /* Input: string - the address of a pointer to a group */
542 /* in a METAR report that may or may not */
543 /* be a partial obscuration indicator. */
545 /* Mptr - a pointer to a structure that has the */
546 /* data type Decoded_METAR. */
548 /* NDEX - a pointer to an integer that is the index */
549 /* into an array that contains the indi- */
550 /* vidual groups of the METAR report being */
551 /* decoded. Upon entry, NDEX is the index */
552 /* of the current group of the METAR report */
553 /* that is to be indentified. */
555 /* Output: TRUE - if the input string is a partial obscura- */
557 /* FALSE - if the input string is not a partial ob- */
560 /* Modification History: */
563 /********************************************************************/
564 static bool isPartObscur( char **string, Decoded_METAR *Mptr,
565 int ndex, int *NDEX )
568 /***************************/
569 /* DECLARE LOCAL VARIABLES */
570 /***************************/
574 static char *phenom[] = {"-DZ", "DZ", "+DZ",
575 "FZDZ", "-RA", "RA", "+RA",
576 "SHRA", "TSRA", "FZRA", "-SN", "SN", "+SN", "DRSN", "BLSN",
577 "SHSN", "TSSN", "-SG", "SG", "+SG", "IC", "-PE", "PE", "+PE",
578 "SHPE", "TSPE", "GR", "SHGR", "TSGR", "GS", "SHGS", "TSGS", "-GS",
579 "+GS", "TS", "VCTS", "-TSRA", "TSRA", "+TSRA", "-TSSN", "TSSN",
580 "+TSSN", "-TSPE", "TSPE", "+TSPE", "-TSGS", "TSGS", "+TSGS",
581 "VCSH", "-SHRA", "+SHRA", "-SHSN", "+SHSN", "-SHPE", "+SHPE",
582 "-SHGS", "+SHGS", "-FZDZ", "+FZDZ", "-FZRA", "+FZRA", "FZFG",
583 "+FZFG", "BR", "FG", "VCFG", "MIFG", "PRFG", "BCFG", "FU",
584 "VA", "DU", "DRDU", "BLDU", "SA", "DRSA", "BLSA", "HZ",
585 "BLPY", "BLSN", "+BLSN", "VCBLSN", "BLSA", "+BLSA",
586 "VCBLSA", "+BLDU", "VCBLDU", "PO", "VCPO", "SQ", "FC", "+FC",
587 "VCFC", "SS", "+SS", "VCSS", "DS", "+DS", "VCDS", NULL};
591 printf("isPartObscur: Routine Entered...\n");
592 printf("isPartObscur: *string = %s\n",*string);
593 if( Mptr->PartialObscurationAmt[ndex][0] != '\0' ) {
594 printf("PartialObscurationAmt = %s\n",
595 &(Mptr->PartialObscurationAmt[ndex][0]));
596 if( strcmp( *string, "FEW///" ) == 0 ||
597 strcmp( *string, "SCT///" ) == 0 ||
598 strcmp( *string, "BKN///" ) == 0 ||
599 strcmp( *string, "FEW000" ) == 0 ||
600 strcmp( *string, "SCT000" ) == 0 ||
601 strcmp( *string, "BKN000" ) == 0 ) {
604 printf("isPartObscur: Preceding group = %s\n",
611 if( *string == NULL )
614 if( strcmp( *string, "FEW///" ) == 0 ||
615 strcmp( *string, "SCT///" ) == 0 ||
616 strcmp( *string, "BKN///" ) == 0 ||
617 strcmp( *string, "FEW000" ) == 0 ||
618 strcmp( *string, "SCT000" ) == 0 ||
619 strcmp( *string, "BKN000" ) == 0 ) {
620 if( Mptr->PartialObscurationAmt[ndex][0] == '\0' )
627 &(Mptr->PartialObscurationAmt[ndex][0]) ) == 0 )
631 if( *string == NULL )
635 while( phenom[i] != NULL ) {
636 if( strcmp( *string, phenom[i] ) == 0 ) {
637 strcpy(&(Mptr->PartialObscurationPhenom[ndex][0]),
664 /********************************************************************/
666 /* Title: isA0indicator */
667 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
668 /* Date: 15 Sep 1994 */
669 /* Programmer: CARL MCCALLA */
670 /* Language: C/370 */
672 /* Abstract: Identify the input character string as an automated */
673 /* station code type. If the input character string */
674 /* is an automated station code type, then return */
675 /* TRUE. Otherwise, return FALSE. */
678 /* External Functions Called: */
681 /* Input: indicator - a pointer to a character string */
682 /* that may or may not be an ASOS */
683 /* automated station code type. */
685 /* Mptr - a pointer to a structure that has the */
686 /* data type Decoded_METAR. */
688 /* NDEX - a pointer to an integer that is the index */
689 /* into an array that contains the indi- */
690 /* vidual groups of the METAR report being */
691 /* decoded. Upon entry, NDEX is the index */
692 /* of the current group of the METAR report */
693 /* that is to be indentified. */
695 /* Output: TRUE - if the input string matches one of the */
696 /* valid ASOS automated station indicators. */
697 /* FALSE - the input string did not match one of the*/
698 /* valid ASOS automated station indicators. */
700 /* Modification History: */
703 /********************************************************************/
705 static bool isA0indicator( char *indicator, Decoded_METAR *Mptr,
709 /***************************/
710 /* DECLARE LOCAL VARIABLES */
711 /***************************/
713 char *autoFlag[] = {"A01", "A01A", "A02", "A02A", "AOA",
714 "A0A", "AO1", "AO1A", "AO2", "AO2A", NULL};
717 /*************************/
718 /* START BODY OF ROUTINE */
719 /*************************/
720 /*******************************************/
721 /* COMPARE THE INPUT CHARACTER STRING WITH */
722 /* VALID AUTOMATED STATION CODE TYPE. IF */
723 /* A MATCH IS FOUND, RETURN TRUE. OTHER- */
724 /* WISE, RETURN FALSE */
725 /*******************************************/
727 if( indicator == NULL )
732 while( autoFlag[ i ] != NULL )
734 if( strcmp( indicator, autoFlag[ i ]) == 0 )
737 strcpy(Mptr->autoIndicator, indicator);
746 /********************************************************************/
748 /* Title: isPeakWind */
749 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
750 /* Date: 15 Sep 1994 */
751 /* Programmer: CARL MCCALLA */
752 /* Language: C/370 */
754 /* Abstract: Determine whether or not the current and subsequent */
755 /* groups from the METAR report make up a valid report */
759 /* Input: string - the addr of a ptr to a character string */
760 /* that may or may not be the indicator */
761 /* for a peak wind data group. */
763 /* Mptr - a pointer to a structure that has the */
764 /* data type Decoded_METAR. */
766 /* NDEX - a pointer to an integer that is the index */
767 /* into an array that contains the indi- */
768 /* vidual groups of the METAR report being */
769 /* decoded. Upon entry, NDEX is the index */
770 /* of the current group of the METAR report */
771 /* that is to be indentified. */
773 /* Output: TRUE - if the input string (and subsequent grps) */
774 /* are decoded as peak wind. */
775 /* FALSE - if the input string (and subsequent grps)*/
776 /* are not decoded as peak wind. */
777 /* External Functions Called: */
781 /* Modification History: */
784 /********************************************************************/
785 static bool isPeakWind( char **string, Decoded_METAR *Mptr,
789 /***************************/
790 /* DECLARE LOCAL VARIABLES */
791 /***************************/
797 /*************************/
798 /* START BODY OF ROUTINE */
799 /*************************/
803 /******************************************************/
804 /* IF THE CURRENT AND NEXT GROUPS ARE "PK WND", THEN */
805 /* DETERMINE WHETHER OR NOT THE GROUP THAT FOLLOWS IS */
806 /* A VALID PK WND GROUP. IF IT IS, THEN DECODE THE */
807 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
808 /******************************************************/
810 if( *string == NULL )
813 if( strcmp(*string,"PK") != 0 )
818 if( *string == NULL )
820 if( strcmp(*string,"WND") != 0 ) {
827 if( *string == NULL )
830 if( (slash = strchr(*string,'/')) == NULL ) {
831 /********************************/
832 /* INVALID PEAK WIND. BUMP PAST */
833 /* PK AND WND GROUP AND RETURN */
835 /********************************/
840 else if( strlen(*string) >= 8 && strlen(*string) <= 11 &&
841 nisdigit(slash+1,strlen(slash+1)) &&
842 nisdigit(*string, (slash - *string)) &&
843 (slash - *string) <= 6 )
845 memset( buf, '\0', 4);
846 strncpy( buf, *string, 3 );
847 Mptr->PKWND_dir = atoi( buf );
849 memset( buf, '\0', 4);
850 strncpy( buf, *string+3, slash-(*string+3) );
851 Mptr->PKWND_speed = atoi( buf );
853 memset( buf, '\0', 5);
854 strcpy( buf, slash+1 );
859 Mptr->PKWND_hour = atoi(buf)/100;
860 Mptr->PKWND_minute = (atoi(buf)) % 100;
863 Mptr->PKWND_minute = atoi( buf );
864 /********************************/
865 /* VALID PEAK WIND FOUND. BUMP */
866 /* PAST PK, WND, AND PEAK WIND */
867 /* GROUPS AND RETURN TRUE. */
868 /********************************/
877 /********************************************************************/
879 /* Title: isWindShift */
880 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
881 /* Date: 15 Sep 1994 */
882 /* Programmer: CARL MCCALLA */
883 /* Language: C/370 */
885 /* Abstract: Determine whether or not the current and subsequent */
886 /* groups from the METAR report make up a valid report */
887 /* of wind shift and frontal passage, if included. */
890 /* Input: string - the addr of a ptr to a character string */
891 /* that may or may not be the indicator */
892 /* for a wind shift data group. */
894 /* Mptr - a pointer to a structure that has the */
895 /* data type Decoded_METAR. */
897 /* NDEX - a pointer to an integer that is the index */
898 /* into an array that contains the indi- */
899 /* vidual groups of the METAR report being */
900 /* decoded. Upon entry, NDEX is the index */
901 /* of the current group of the METAR report */
902 /* that is to be indentified. */
904 /* Output: TRUE - if the input string (and subsequent grps) */
905 /* are decoded as wind shift. */
906 /* FALSE - if the input string (and subsequent grps)*/
907 /* are not decoded as wind shift. */
908 /* External Functions Called: */
912 /* Modification History: */
915 /********************************************************************/
916 static bool isWindShift( char **string, Decoded_METAR *Mptr,
920 /***************************/
921 /* DECLARE LOCAL VARIABLES */
922 /***************************/
926 /*************************/
927 /* START BODY OF ROUTINE */
928 /*************************/
931 /****************************************************/
932 /* IF THE CURRENT GROUP IS "WSHFT", THEN DETERMINE */
933 /* WHETHER OR NOT THE GROUP THAT FOLLOWS IS A VALID */
934 /* WSHFT GROUP. IF IT IS, THEN DECODE THE GROUP */
935 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
936 /****************************************************/
938 if( *string == NULL )
941 if( strcmp( *string, "WSHFT" ) != 0 )
946 if( *string == NULL )
949 if( nisdigit(*string,strlen(*string)) && strlen(*string) <= 4)
951 temp = atoi( *string );
955 Mptr->WshfTime_hour = (atoi(*string))/100;
956 Mptr->WshfTime_minute = (atoi(*string)) % 100;
959 Mptr->WshfTime_minute = (atoi(*string)) % 100;
963 if( *string == NULL )
967 if( **string == '\0') {
972 else if( strcmp( *string, "FROPA") == 0 )
974 Mptr->Wshft_FROPA = TRUE;
975 /********************************/
976 /* VALID WIND SHIFT FOUND. BUMP */
977 /* PAST WSHFT, WSHFT GROUP, AND */
978 /* FROPA GROUPS AND RETURN TRUE.*/
979 /********************************/
986 /********************************/
987 /* VALID WIND SHIFT FOUND. BUMP */
988 /* PAST WSHFT AND WSHFT GROUP */
989 /* AND RETURN TRUE. */
990 /********************************/
997 /**********************************/
998 /* INVALID WIND SHIFT FOUND. BUMP */
999 /* PAST WSHFT AND RETURN FALSE. */
1000 /********************************/
1005 /********************************************************************/
1007 /* Title: isTowerVsby */
1008 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1009 /* Date: 15 Sep 1994 */
1010 /* Programmer: CARL MCCALLA */
1011 /* Language: C/370 */
1013 /* Abstract: Determine whether or not the current and subsequent */
1014 /* groups from the METAR report make up a valid report */
1015 /* of tower visibility. */
1018 /* Input: string - the addr of a ptr to a character string */
1019 /* that may or may not be the indicator */
1020 /* for tower visibility. */
1022 /* Mptr - a pointer to a structure that has the */
1023 /* data type Decoded_METAR. */
1025 /* NDEX - a pointer to an integer that is the index */
1026 /* into an array that contains the indi- */
1027 /* vidual groups of the METAR report being */
1028 /* decoded. Upon entry, NDEX is the index */
1029 /* of the current group of the METAR report */
1030 /* that is to be indentified. */
1032 /* Output: TRUE - if the input string (and subsequent grps) */
1033 /* are decoded as tower visibility. */
1034 /* FALSE - if the input string (and subsequent grps)*/
1035 /* are not decoded as tower visibility */
1036 /* External Functions Called: */
1039 /* Modification History: */
1042 /********************************************************************/
1043 static bool isTowerVsby( char **token, Decoded_METAR *Mptr, int *NDEX)
1046 /***************************/
1047 /* DECLARE LOCAL VARIABLES */
1048 /***************************/
1053 /*************************/
1054 /* START BODY OF ROUTINE */
1055 /*************************/
1058 /****************************************************************/
1059 /* IF THE CURRENT AND NEXT GROUPS ARE "TWR VIS", THEN DETERMINE */
1060 /* WHETHER OR NOT THE GROUP(S) THAT FOLLOWS IS(ARE) A VALID */
1061 /* TOWER VISIBILITY GROUP. IF IT IS, THEN DECODE THE GROUP */
1062 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
1063 /****************************************************************/
1065 if( *token == NULL )
1068 if(strcmp(*token,"TWR") != 0)
1073 if( *token == NULL )
1076 if( strcmp(*token,"VIS") != 0) {
1083 if( *token == NULL )
1086 if( nisdigit(*token,
1089 Mptr->TWR_VSBY = (float) atoi(*token);
1091 if( *token != NULL )
1093 if( (slash = strchr(*token, '/'))
1096 if( nisdigit(slash+1,strlen(slash+1)) &&
1100 T_vsby = fracPart(*token);
1101 Mptr->TWR_VSBY += T_vsby;
1131 else if( (slash = strchr(*token, '/'))
1134 if( nisdigit(slash+1,strlen(slash+1)) &&
1138 Mptr->TWR_VSBY = fracPart(*token);
1157 /********************************************************************/
1159 /* Title: isSurfaceVsby */
1160 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1161 /* Date: 15 Sep 1994 */
1162 /* Programmer: CARL MCCALLA */
1163 /* Language: C/370 */
1165 /* Abstract: Determine whether or not the current and subsequent */
1166 /* groups from the METAR report make up a valid report */
1167 /* of surface visibility. */
1170 /* Input: string - the addr of a ptr to a character string */
1171 /* that may or may not be the indicator */
1172 /* for surface visibility. */
1174 /* Mptr - a pointer to a structure that has the */
1175 /* data type Decoded_METAR. */
1177 /* NDEX - a pointer to an integer that is the index */
1178 /* into an array that contains the indi- */
1179 /* vidual groups of the METAR report being */
1180 /* decoded. Upon entry, NDEX is the index */
1181 /* of the current group of the METAR report */
1182 /* that is to be indentified. */
1184 /* Output: TRUE - if the input string (and subsequent grps) */
1185 /* are decoded as surface visibility. */
1186 /* FALSE - if the input string (and subsequent grps)*/
1187 /* are not decoded as surface visibility. */
1188 /* External Functions Called: */
1191 /* Modification History: */
1194 /********************************************************************/
1195 static bool isSurfaceVsby( char **token, Decoded_METAR *Mptr,
1199 /***************************/
1200 /* DECLARE LOCAL VARIABLES */
1201 /***************************/
1207 /*************************/
1208 /* START BODY OF ROUTINE */
1209 /*************************/
1212 /****************************************************************/
1213 /* IF THE CURRENT AND NEXT GROUPS ARE "SFC VIS", THEN DETERMINE */
1214 /* WHETHER OR NOT THE GROUP(S) THAT FOLLOWS IS(ARE) A VALID */
1215 /* SURFACE VISIBILITY GROUP. IF IT IS, THEN DECODE THE GROUP */
1216 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
1217 /****************************************************************/
1219 if( *token == NULL )
1222 if(strcmp(*token,"SFC") != 0)
1227 if( strcmp(*token,"VIS") != 0) {
1235 if( *token == NULL )
1239 if( nisdigit(*token,
1242 Mptr->SFC_VSBY = (float) atoi(*token);
1244 if( *token != NULL )
1246 if( (slash = strchr(*token, '/'))
1249 if( nisdigit(slash+1,strlen(slash+1)) &&
1253 S_vsby = fracPart(*token);
1254 Mptr->SFC_VSBY += S_vsby;
1284 else if( (slash = strchr(*token, '/'))
1287 if( nisdigit(slash+1,strlen(slash+1)) &&
1291 Mptr->SFC_VSBY = fracPart(*token);
1311 /********************************************************************/
1313 /* Title: isVariableVsby */
1314 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1315 /* Date: 21 Nov 1994 */
1316 /* Programmer: CARL MCCALLA */
1317 /* Language: C/370 */
1319 /* Abstract: Determine whether or not the current and subsequent */
1320 /* groups from the METAR report make up a valid report */
1321 /* of variable prevailing visibility. */
1324 /* Input: string - the addr of a ptr to a character string */
1325 /* that may or may not be the indicator */
1326 /* for variable prevailing visibility. */
1328 /* Mptr - a pointer to a structure that has the */
1329 /* data type Decoded_METAR. */
1331 /* NDEX - a pointer to an integer that is the index */
1332 /* into an array that contains the indi- */
1333 /* vidual groups of the METAR report being */
1334 /* decoded. Upon entry, NDEX is the index */
1335 /* of the current group of the METAR report */
1336 /* that is to be indentified. */
1338 /* Output: TRUE - if the input string (and subsequent grps) */
1339 /* are decoded as variable prevailing vsby. */
1340 /* FALSE - if the input string (and subsequent grps)*/
1341 /* are not decoded as variable prevailing */
1343 /* External Functions Called: */
1346 /* Modification History: */
1349 /********************************************************************/
1350 static bool isVariableVsby( char **string, Decoded_METAR *Mptr,
1354 /***************************/
1355 /* DECLARE LOCAL VARIABLES */
1356 /***************************/
1368 /*************************/
1369 /* START BODY OF ROUTINE */
1370 /*************************/
1373 /***************************************************/
1374 /* IF THE CURRENT GROUP IS "VIS", THEN DETERMINE */
1375 /* WHETHER OR NOT THE GROUPS THAT FOLLOW ARE VALID */
1376 /* VARIABLE PREVAILING VSBY. IF THEY ARE, THEN */
1377 /* DECODE THE GROUPS AND RETURN TRUE. OTHERWISE, */
1379 /***************************************************/
1381 if( *string == NULL )
1384 if( strcmp(*string, "VIS") != 0 )
1389 if( *string == NULL )
1392 if( !((V_char = strchr(*string, 'V')) != NULL ||
1393 nisdigit(*string,strlen(*string))) )
1395 else if( nisdigit(*string,strlen(*string)) ) {
1396 minimumVsby = (float) atoi(*string);
1399 if( *string == NULL )
1402 if( (V_char = strchr(*string,'V')) == NULL )
1405 if( (slash = strchr(*string,'/')) == NULL )
1408 if( nisdigit(*string,(slash - *string)) &&
1409 nisdigit(slash+1,(V_char-(slash+1))) &&
1410 nisdigit(V_char+1,strlen(V_char+1)) ) {
1411 if( (V_char - *string) > 4 )
1415 strncpy(buf,*string,(V_char - *string));
1416 Mptr->minVsby = minimumVsby + fracPart(buf);
1417 maximumVsby = (float) atoi(V_char+1);
1422 if( *string == NULL )
1425 if( (slash = strchr(*string,'/')) == NULL ) {
1426 Mptr->maxVsby = maximumVsby;
1432 else if( nisdigit(*string,(slash - *string)) &&
1433 nisdigit(slash+1, strlen(slash+1)) ) {
1434 Mptr->maxVsby = maximumVsby + fracPart(*string);
1442 Mptr->maxVsby = maximumVsby;
1455 if( (V_char = strchr(*string,'V')) == NULL )
1457 if(nisdigit(*string,(V_char - *string)) &&
1458 nisdigit(V_char+1,strlen(V_char+1)) ) {
1459 Mptr->minVsby = (float) antoi(*string,(V_char - *string));
1460 maximumVsby = (float) atoi(V_char+1);
1464 if( *string == NULL )
1467 if( (slash = strchr(*string,'/')) == NULL ) {
1468 Mptr->maxVsby = maximumVsby;
1473 else if( nisdigit(*string, (slash - *string)) &&
1474 nisdigit(slash+1,strlen(slash+1)) ) {
1475 Mptr->maxVsby = maximumVsby + fracPart( *string );
1482 Mptr->maxVsby = maximumVsby;
1489 if( (slash2 = strchr(V_char+1,'/')) == NULL &&
1490 (slash1 = strchr(*string,'/')) == NULL )
1492 else if( slash1 == NULL )
1494 else if( slash == slash2 )
1496 else if( nisdigit(*string,(slash1 - *string)) &&
1497 nisdigit((slash1+1),(V_char-(slash1+1))) ) {
1498 if( (V_char - *string) > 4 )
1502 strncpy(buf,*string,(V_char - *string));
1503 minimumVsby = fracPart(buf);
1505 if( slash2 == NULL) {
1506 if( nisdigit(V_char+1, strlen(V_char+1)) ) {
1507 maximumVsby = (float) atoi(V_char+1);
1511 if( *string == NULL )
1514 if( (slash = strchr(*string,'/')) == NULL ) {
1515 Mptr->minVsby = minimumVsby;
1516 Mptr->maxVsby = maximumVsby;
1521 else if( nisdigit(*string,(slash-*string)) &&
1522 nisdigit((slash+1),strlen(slash+1)) ) {
1523 Mptr->minVsby = minimumVsby;
1524 Mptr->maxVsby = maximumVsby +
1532 Mptr->minVsby = minimumVsby;
1533 Mptr->maxVsby = maximumVsby;
1543 if( nisdigit(V_char+1,(slash2-V_char+1)) &&
1544 nisdigit((slash2+1),strlen(slash2+1)) ) {
1545 Mptr->minVsby = minimumVsby;
1546 Mptr->maxVsby = fracPart(V_char+1);
1559 /********************************************************************/
1561 /* Title: isVsby2ndSite */
1562 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1563 /* Date: 15 Sep 1994 */
1564 /* Programmer: CARL MCCALLA */
1565 /* Language: C/370 */
1567 /* Abstract: Determine whether or not the current and subsequent */
1568 /* groups from the METAR report make up a valid report */
1569 /* of visibility at a secondary site. */
1572 /* Input: token - the addr of a ptr to a character string */
1573 /* that may or may not be the indicator */
1574 /* for visibility at a secondary site. */
1576 /* Mptr - a pointer to a structure that has the */
1577 /* data type Decoded_METAR. */
1579 /* NDEX - a pointer to an integer that is the index */
1580 /* into an array that contains the indi- */
1581 /* vidual groups of the METAR report being */
1582 /* decoded. Upon entry, NDEX is the index */
1583 /* of the current group of the METAR report */
1584 /* that is to be indentified. */
1586 /* Output: TRUE - if the input string (and subsequent grps) */
1587 /* are decoded as visibility at a 2ndry site.*/
1588 /* FALSE - if the input string (and subsequent grps)*/
1589 /* are not decoded as visibility at a 2ndry */
1592 /* External Functions Called: */
1598 /* Modification History: */
1601 /********************************************************************/
1602 static bool isVsby2ndSite( char **token, Decoded_METAR *Mptr,
1606 /***************************/
1607 /* DECLARE LOCAL VARIABLES */
1608 /***************************/
1615 /*************************/
1616 /* START BODY OF ROUTINE */
1617 /*************************/
1620 /***************************************************/
1621 /* IF THE CURRENT GROUP IS "VIS", THEN DETERMINE */
1622 /* WHETHER OR NOT THE GROUPS THAT FOLLOW ARE VALID */
1623 /* VSBILITY AT A 2NDRY SITE. IF THEY ARE, THEN */
1624 /* DECODE THE GROUPS AND RETURN TRUE. OTHERWISE, */
1626 /***************************************************/
1628 if( *token == NULL )
1631 if(strcmp(*token,"VIS") != 0)
1636 if( *token == NULL )
1639 if( nisdigit(*token,
1642 VSBY_2ndSite = (float) atoi(*token);
1644 if( *token != NULL )
1646 if( (slash = strchr(*token, '/'))
1649 if( nisdigit(slash+1,strlen(slash+1)) &&
1653 S_vsby = fracPart(*token);
1657 if( *token == NULL )
1660 if( strncmp( *token, "RY", 2 ) == 0) {
1661 if( nisalnum( *token, strlen(*token) ) ) {
1662 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1663 Mptr->VSBY_2ndSite = VSBY_2ndSite + S_vsby;
1677 if( strncmp( *token, "RY", 2 ) == 0) {
1678 if( nisalnum( *token, strlen(*token) ) ) {
1679 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1680 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1695 if( strncmp( *token, "RY", 2 ) == 0) {
1696 if( nisalnum( *token, strlen(*token) ) ) {
1697 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1698 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1712 if( strncmp( *token, "RY", 2 ) == 0) {
1713 if( nisalnum( *token, strlen(*token) ) ) {
1714 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1715 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1729 else if( (slash = strchr(*token, '/'))
1732 if( nisdigit(slash+1,strlen(slash+1)) &&
1736 VSBY_2ndSite = fracPart(*token);
1737 if( strncmp( *(++token), "RY", 2 ) == 0) {
1738 if( nisalnum( *token, strlen(*token) ) ) {
1739 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1740 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1760 /********************************************************************/
1762 /* Title: isLTGfreq */
1763 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1764 /* Date: 15 Sep 1994 */
1765 /* Programmer: CARL MCCALLA */
1766 /* Language: C/370 */
1768 /* Abstract: Determine whether or not the current and subsequent */
1769 /* groups from the METAR report make up a valid report */
1773 /* Input: string - the addr of a ptr to a character string */
1774 /* that may or may not be the indicator */
1775 /* for lightning. */
1777 /* Mptr - a pointer to a structure that has the */
1778 /* data type Decoded_METAR. */
1780 /* NDEX - a pointer to an integer that is the index */
1781 /* into an array that contains the indi- */
1782 /* vidual groups of the METAR report being */
1783 /* decoded. Upon entry, NDEX is the index */
1784 /* of the current group of the METAR report */
1785 /* that is to be indentified. */
1787 /* Output: TRUE - if the input string (and subsequent grps) */
1788 /* are decoded as lightning. */
1789 /* FALSE - if the input string (and subsequent grps)*/
1790 /* are not decoded as lightning. */
1792 /* External Functions Called: */
1796 /* Modification History: */
1797 /* 09 May 1996: Software modified to properly */
1798 /* decode lightning types. */
1802 /********************************************************************/
1804 bool static isLTGfreq( char **string, Decoded_METAR *Mptr, int *NDEX )
1807 /***************************/
1808 /* DECLARE LOCAL VARIABLES */
1809 /***************************/
1818 /*************************/
1819 /* START BODY OF ROUTINE */
1820 /*************************/
1824 /***************************************************/
1825 /* IF THE CURRENT GROUP IS "LTG", THEN DETERMINE */
1826 /* WHETHER OR NOT THE PREVIOUS GROUP AS WELL AS */
1827 /* GROUPS THAT FOLLOW ARE VALID LIGHTNING REPORT */
1828 /* PARAMETERS. IF THEY ARE, THEN DECODE THE */
1829 /* GROUPS AND RETURN TRUE. OTHERWISE, RETURN */
1831 /***************************************************/
1833 if( *string == NULL )
1836 if( strcmp(*string,"VCTS") == 0 ) {
1837 Mptr->LightningVCTS = TRUE;
1843 if( *string == NULL )
1846 if( strncmp( *string, "LTG", 3 ) != 0 ) {
1851 if( *string == NULL )
1857 LTG_FREQ_FLAG = FALSE;
1858 /*-- CHECK FOR LIGHTNING FREQUENCY -----------*/
1859 if( strcmp( *string, "OCNL" ) == 0 ) {
1860 Mptr->OCNL_LTG = TRUE;
1861 LTG_FREQ_FLAG = TRUE;
1863 else if( strcmp( *string, "FRQ" ) == 0 ) {
1864 Mptr->FRQ_LTG = TRUE;
1865 LTG_FREQ_FLAG = TRUE;
1867 else if( strcmp( *string, "CNS" ) == 0 ) {
1868 Mptr->CNS_LTG = TRUE;
1869 LTG_FREQ_FLAG = TRUE;
1875 if( *string == NULL )
1879 if( strcmp( *string, "LTG") == 0 ) {
1882 if( *string == NULL )
1887 LTG_LOC_FLAG = FALSE;
1888 /*-- CHECK FOR LIGHTNING LOCATION ------------*/
1889 if( strcmp( *string, "DSNT" ) == 0 ) {
1890 Mptr->DSNT_LTG = TRUE;
1891 LTG_LOC_FLAG = TRUE;
1893 else if( strcmp( *string, "AP" ) == 0 ) {
1894 Mptr->AP_LTG = TRUE;
1895 LTG_LOC_FLAG = TRUE;
1897 else if( strcmp( *string, "VCY" ) == 0 ||
1898 strcmp( *string, "VC" ) == 0 ) {
1899 Mptr->VcyStn_LTG = TRUE;
1900 LTG_LOC_FLAG = TRUE;
1902 else if( strcmp( *string, "OVHD" ) == 0 ||
1903 strcmp( *string, "OHD" ) == 0 ) {
1904 Mptr->OVHD_LTG = TRUE;
1905 LTG_LOC_FLAG = TRUE;
1911 if( *string == NULL ) {
1917 LTG_DIR_FLAG = FALSE;
1918 /*-- CHECK FOR LIGHTNING DIRECTION -----------*/
1919 if( strcmp( *string, "N" ) == 0 ||
1920 strcmp( *string, "NE" ) == 0 ||
1921 strcmp( *string, "NW" ) == 0 ||
1922 strcmp( *string, "S" ) == 0 ||
1923 strcmp( *string, "SE" ) == 0 ||
1924 strcmp( *string, "SW" ) == 0 ||
1925 strcmp( *string, "E" ) == 0 ||
1926 strcmp( *string, "W" ) == 0 ) {
1927 strcpy( Mptr->LTG_DIR, *string);
1928 LTG_DIR_FLAG = TRUE;
1941 LTG_TYPE_FLAG = FALSE;
1942 /*-- CHECK FOR LIGHTNING TYPE ----------------*/
1943 TYPE_NOT_FOUND = FALSE;
1944 temp = (*string) + 3;
1945 while( *temp != '\0' && !TYPE_NOT_FOUND ) {
1946 if( strncmp( temp, "CG", 2 ) == 0 ) {
1947 Mptr->CG_LTG = TRUE;
1948 LTG_TYPE_FLAG = TRUE;
1952 else if( strncmp( temp, "IC", 2 ) == 0 ) {
1953 Mptr->IC_LTG = TRUE;
1954 LTG_TYPE_FLAG = TRUE;
1958 else if( strncmp( temp, "CC", 2 ) == 0 ) {
1959 Mptr->CC_LTG = TRUE;
1960 LTG_TYPE_FLAG = TRUE;
1964 else if( strncmp( temp, "CA", 2 ) == 0 ) {
1965 Mptr->CA_LTG = TRUE;
1966 LTG_TYPE_FLAG = TRUE;
1971 TYPE_NOT_FOUND = TRUE;
1976 if( *string == NULL ) {
1983 LTG_LOC_FLAG = FALSE;
1984 /*-- CHECK FOR LIGHTNING LOCATION ------------*/
1985 if( strcmp( *string, "DSNT" ) == 0 ) {
1986 Mptr->DSNT_LTG = TRUE;
1987 LTG_LOC_FLAG = TRUE;
1989 else if( strcmp( *string, "AP" ) == 0 ) {
1990 Mptr->AP_LTG = TRUE;
1991 LTG_LOC_FLAG = TRUE;
1993 else if( strcmp( *string, "VCY" ) == 0 ||
1994 strcmp( *string, "VC" ) == 0 ) {
1995 Mptr->VcyStn_LTG = TRUE;
1996 LTG_LOC_FLAG = TRUE;
1998 else if( strcmp( *string, "OVHD" ) == 0 ) {
1999 Mptr->OVHD_LTG = TRUE;
2000 LTG_LOC_FLAG = TRUE;
2006 if( *string == NULL ) {
2014 LTG_DIR_FLAG = FALSE;
2015 /*-- CHECK FOR LIGHTNING DIRECTION -----------*/
2016 if( strcmp( *string, "N" ) == 0 ||
2017 strcmp( *string, "NE" ) == 0 ||
2018 strcmp( *string, "NW" ) == 0 ||
2019 strcmp( *string, "S" ) == 0 ||
2020 strcmp( *string, "SE" ) == 0 ||
2021 strcmp( *string, "SW" ) == 0 ||
2022 strcmp( *string, "E" ) == 0 ||
2023 strcmp( *string, "W" ) == 0 ) {
2024 strcpy( Mptr->LTG_DIR, *string);
2025 LTG_DIR_FLAG = TRUE;
2043 #include "Metar.h" /* standard header file */
2045 /********************************************************************/
2047 /* Title: isRecentWx */
2048 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2049 /* Date: 15 Sep 1994 */
2050 /* Programmer: CARL MCCALLA */
2051 /* Language: C/370 */
2053 /* Abstract: Determine whether or not the current and subsequent */
2054 /* groups from the METAR report make up a valid report */
2055 /* recent weather. */
2057 /* Input: token - the addr of a ptr to a character token */
2058 /* that may or may not be a recent weather */
2061 /* Mptr - a pointer to a structure that has the */
2062 /* data type Decoded_METAR. */
2064 /* NDEX - a pointer to an integer that is the i*NDEX */
2065 /* into an array that contains the indi- */
2066 /* vidual groups of the METAR report being */
2067 /* decoded. Upon entry, NDEX is the i*NDEX */
2068 /* of the current group of the METAR report */
2069 /* that is to be indentified. */
2071 /* Output: TRUE - if the input token (and possibly subse- */
2072 /* quent groups) are decoded as recent wx. */
2073 /* FALSE - if the input token (and possibly subse- */
2074 /* quent groups) are not decoded as recent */
2077 /* External Functions Called: */
2084 /* Modification History: */
2087 /********************************************************************/
2088 static bool isRecentWX( char **token, Decoded_METAR *Mptr,
2091 static char *phenom[] = {"-DZB", "DZB", "+DZB",
2092 "FZDZB", "-RAB", "RAB", "+RAB",
2093 "SHRAB", "TSRAB", "FZRAB", "-SNB",
2094 "SNB", "+SNB", "DRSNB", "BLSNB",
2095 "SHSNB", "TSSNB", "-SGB", "SGB",
2096 "+SGB", "ICB", "-PEB", "PEB", "+PEB",
2097 "SHPEB", "TSPEB", "GRB", "SHGRB",
2098 "TSGRB", "GSB", "SHGSB", "TSGSB", "-GSB",
2099 "+GSB", "TSB", "VCTSB", "-TSRAB",
2100 "TSRAB", "+TSRAB", "-TSSNB", "TSSNB",
2101 "+TSSNB", "-TSPEB", "TSPEB", "+TSPEB",
2102 "-TSGSB", "TSGSB", "+TSGSB",
2103 "VCSHB", "-SHRAB", "+SHRAB", "-SHSNB",
2104 "+SHSNB", "-SHPEB", "+SHPEB",
2105 "-SHGSB", "+SHGSB", "-FZDZB", "+FZDZB",
2106 "-FZRAB", "+FZRAB", "FZFGB",
2107 "+FZFGB", "BRB", "FGB", "VCFGB", "MIFGB",
2108 "PRFGB", "BCFGB", "FUB",
2109 "VAB", "DUB", "DRDUB", "BLDUB", "SAB",
2110 "DRSAB", "BLSAB", "HZB",
2111 "BLPYB", "BLSNB", "+BLSNB", "VCBLSNB",
2113 "VCBLSAB", "+BLDUB", "VCBLDUB", "POB",
2114 "VCPOB", "SQB", "FCB", "+FCB",
2115 "VCFCB", "SSB", "+SSB", "VCSSB", "DSB",
2119 "-DZE", "DZE", "+DZE",
2120 "FZDZE", "-RAE", "RAE", "+RAE",
2121 "SHRAE", "TSRAE", "FZRAE", "-SNE",
2122 "SNE", "+SNE", "DRSNE", "BLSNE",
2123 "SHSNE", "TSSNE", "-SGE", "SGE",
2124 "+SGE", "ICE", "-PEE", "PEE", "+PEE",
2125 "SHPEE", "TSPEE", "GRE", "SHGRE",
2126 "TSGRE", "GSE", "SHGSE", "TSGSE", "-GSE",
2127 "+GSE", "TSE", "VCTSE", "-TSRAE",
2128 "TSRAE", "+TSRAE", "-TSSNE", "TSSNE",
2129 "+TSSNE", "-TSPEE", "TSPEE", "+TSPEE",
2130 "-TSGSE", "TSGSE", "+TSGSE",
2131 "VCSHE", "-SHRAE", "+SHRAE", "-SHSNE",
2132 "+SHSNE", "-SHPEE", "+SHPEE",
2133 "-SHGSE", "+SHGSE", "-FZDZE", "+FZDZE",
2134 "-FZRAE", "+FZRAE", "FZFGE",
2135 "+FZFGE", "BRE", "FGE", "VCFGE", "MIFGE",
2136 "PRFGE", "BCFGE", "FUE",
2137 "VAE", "DUE", "DRDUE", "BLDUE", "SAE",
2138 "DRSAE", "BLSAE", "HZE",
2139 "BLPYE", "BLSNE", "+BLSNE", "VCBLSNE",
2141 "VCBLSAE", "+BLDUE", "VCBLDUE", "POE",
2142 "VCPOE", "SQE", "FCE", "+FCE",
2143 "VCFCE", "SSE", "+SSE", "VCSSE", "DSE",
2144 "+DSE", "VCDSE", "4-Zs"};
2158 if( *token == NULL )
2161 if( (free_temp = temp = (char *) malloc(sizeof(char) *
2162 (strlen(*token) + 1))) == NULL ) {
2166 strcpy(temp,*token);
2168 while ( *temp != '\0' ) {
2172 beg_hour = beg_min = end_hour = end_min = MAXINT;
2174 while( strncmp(temp, phenom[i],strlen(phenom[i])) != 0 &&
2175 strcmp(phenom[i],"4-Zs") != 0 )
2178 if( strcmp(phenom[i],"4-Zs") != 0 ) {
2180 printf("PHENOM = %s\n",phenom[i]);
2182 C_char = (strlen(phenom[i]) - 1) + temp;
2183 numb_char = C_char + 1;
2185 if( *numb_char == '\0')
2188 if( nisdigit(numb_char,4) && strlen(numb_char) >= 4) {
2189 if( *C_char == 'B' ) {
2190 beg_hour = antoi( numb_char, 2 );
2191 beg_min = antoi( numb_char+2,2 );
2193 printf("BEG_HOUR1 = %d\n",beg_hour);
2194 printf("BEG_MIN1 = %d\n",beg_min );
2199 Mptr->ReWx[*NDEX].Bmm = beg_min;
2200 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2203 if( *(numb_char+4) == 'E' ) {
2205 if( nisdigit(numb_char,4) &&
2206 strlen(numb_char) >= 4 ) {
2207 end_hour = antoi( numb_char, 2 );
2208 end_min = antoi( numb_char+2,2 );
2210 printf("END_HOUR2 = %d\n",end_hour);
2211 printf("END_MIN2 = %d\n",end_min );
2216 Mptr->ReWx[*NDEX].Emm = end_min;
2217 Mptr->ReWx[*NDEX].Ehh = end_hour;
2220 else if( nisdigit(numb_char,2) &&
2221 strlen(numb_char) >= 2 ) {
2222 end_min = antoi( numb_char,2 );
2225 Mptr->ReWx[*NDEX].Emm = end_min;
2227 printf("END_MIN3 = %d\n",end_min );
2236 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2237 phenom[i], (strlen(phenom[i])-1) );
2244 end_hour = antoi( numb_char, 2 );
2245 end_min = antoi( numb_char+2,2 );
2248 Mptr->ReWx[*NDEX].Emm = end_min;
2249 Mptr->ReWx[*NDEX].Ehh = end_hour;
2252 printf("END_HOUR4 = %d\n",end_hour);
2253 printf("END_MIN4 = %d\n",end_min );
2259 if( *(numb_char+4) == 'B' ) {
2261 if( nisdigit(numb_char,4) &&
2262 strlen(numb_char) >= 4 ) {
2263 /* beg_hour = antoi( numb_char, 2 );
2264 beg_min = antoi( numb_char+2,2 ); */
2267 Mptr->ReWx[*NDEX].Bmm = beg_min;
2268 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2271 printf("BEG_HOUR5 = %d\n",beg_hour);
2272 printf("BEG_MIN5 = %d\n",beg_min );
2278 else if( nisdigit(numb_char,2) &&
2279 strlen(numb_char) >= 2 ) {
2280 beg_min = antoi( numb_char,2 );
2283 Mptr->ReWx[*NDEX].Bmm = beg_min;
2285 printf("BEG_MIN6 = %d\n",beg_min );
2295 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2296 phenom[i], (strlen(phenom[i])-1) );
2304 else if(nisdigit(numb_char,2) && strlen(numb_char) >= 2 ) {
2305 if( *C_char == 'B' ) {
2306 beg_min = antoi( numb_char,2 );
2309 Mptr->ReWx[*NDEX].Bmm = beg_min;
2311 printf("BEG_MIN7 = %d\n",beg_min );
2317 if( *(numb_char+2) == 'E' ) {
2319 if( nisdigit(numb_char,4) &&
2320 strlen(numb_char) >= 4 ) {
2321 end_hour = antoi( numb_char,2 );
2322 end_min = antoi( numb_char+2,2 );
2325 Mptr->ReWx[*NDEX].Emm = end_min;
2326 Mptr->ReWx[*NDEX].Ehh = end_hour;
2329 printf("END_HOUR8 = %d\n",end_hour);
2330 printf("END_MIN8 = %d\n",end_min );
2336 else if( nisdigit(numb_char,2) &&
2337 strlen(numb_char) >= 2 ) {
2338 end_min = antoi( numb_char,2 );
2341 Mptr->ReWx[*NDEX].Emm = end_min;
2343 printf("END_MIN9 = %d\n",end_min );
2352 end_min = antoi( numb_char, 2 );
2355 Mptr->ReWx[*NDEX].Emm = end_min;
2357 printf("END_MIN10 = %d\n",end_min );
2363 if( *(numb_char+2) == 'B' ) {
2365 if( nisdigit(numb_char,4) &&
2366 strlen(numb_char) >= 4 ) {
2367 beg_hour = antoi( numb_char,2 );
2368 beg_min = antoi( numb_char+2,2 );
2371 Mptr->ReWx[*NDEX].Bmm = beg_min;
2372 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2375 printf("BEG_HOUR11 = %d\n",beg_hour);
2376 printf("BEG_MIN11 = %d\n",beg_min );
2382 else if( nisdigit(numb_char,2) &&
2383 strlen(numb_char) >= 2 ) {
2384 beg_min = antoi( numb_char,2 );
2387 Mptr->ReWx[*NDEX].Bmm = beg_min;
2389 printf("BEG_MIN12 = %d\n",beg_min );
2401 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2402 phenom[i], (strlen(phenom[i])-1) );
2424 /********************************************************************/
2426 /* Title: isVariableCIG */
2427 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2428 /* Date: 21 Nov 1994 */
2429 /* Programmer: CARL MCCALLA */
2430 /* Language: C/370 */
2432 /* Abstract: isVariableCIG determines whether or not the */
2433 /* current group in combination with the next */
2434 /* one or more groups is a report of variable */
2437 /* External Functions Called: */
2440 /* Input: token - a pointer to an array of METAR report */
2442 /* Mptr - a pointer to a decoded_METAR structure */
2443 /* NDEX - the index value of the current METAR */
2444 /* report group array element. */
2446 /* Output: TRUE, if the token is currently pointing to */
2447 /* METAR report group(s) that a report of vari- */
2450 /* Modification History: */
2453 /********************************************************************/
2454 static bool isVariableCIG( char **token, Decoded_METAR *Mptr,
2459 if( *token == NULL )
2462 if( strcmp(*token, "CIG") != 0 )
2467 if( *token == NULL )
2470 if( (V_char = strchr(*token,'V')) != NULL ) {
2471 if( nisdigit(*token, (V_char - *token)) &&
2472 nisdigit( V_char+1, strlen(V_char+1)) ) {
2473 Mptr->minCeiling = antoi(*token, (V_char - *token));
2474 Mptr->maxCeiling = atoi(V_char+1);
2486 /********************************************************************/
2488 /* Title: isCeil2ndSite */
2489 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2490 /* Date: 15 Sep 1994 */
2491 /* Programmer: CARL MCCALLA */
2492 /* Language: C/370 */
2494 /* Abstract: isCeil2ndSite determines whether or not the */
2495 /* current group in combination with the next */
2496 /* one or more groups is a report of a ceiling */
2497 /* at a secondary site. */
2499 /* External Functions Called: */
2502 /* Input: token - a pointer to an array of METAR report */
2504 /* Mptr - a pointer to a decoded_METAR structure */
2505 /* NDEX - the index value of the current METAR */
2506 /* report group array element. */
2508 /* Output: TRUE, if the token is currently pointing to */
2509 /* METAR report group(s) that are reporting */
2510 /* ceiling at a secondary site. */
2512 /* External Functions Called: */
2516 /* Modification History: */
2519 /********************************************************************/
2520 static bool isCIG2ndSite( char **token, Decoded_METAR *Mptr,
2525 if( (*token) == NULL )
2528 if(strcmp(*token,"CIG") != 0)
2533 if( (*token) == NULL )
2536 if( strlen(*token) != 3 )
2539 if( nisdigit(*token,3) )
2541 CIG2ndSite = atoi(*token ) * 10;
2543 if( strncmp(*(++token),"RY",2) != 0)
2546 strcpy(Mptr->CIG_2ndSite_LOC, *token );
2547 Mptr->CIG_2ndSite_Meters = CIG2ndSite;
2558 /********************************************************************/
2560 /* Title: isPRESFR */
2561 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2562 /* Date: 20 Nov 1994 */
2563 /* Programmer: CARL MCCALLA */
2564 /* Language: C/370 */
2577 /* External Functions Called: */
2602 /* Modification History: */
2605 /********************************************************************/
2607 static bool isPRESFR( char *string, Decoded_METAR *Mptr, int *NDEX)
2610 if( string == NULL )
2613 if( strcmp(string, "PRESFR") != 0 )
2616 Mptr->PRESFR = TRUE;
2622 /********************************************************************/
2624 /* Title: isPRESRR */
2625 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2626 /* Date: 20 Nov 1994 */
2627 /* Programmer: CARL MCCALLA */
2628 /* Language: C/370 */
2641 /* External Functions Called: */
2666 /* Modification History: */
2669 /********************************************************************/
2671 static bool isPRESRR( char *string, Decoded_METAR *Mptr, int *NDEX)
2674 if( string == NULL )
2677 if( strcmp(string, "PRESRR") != 0 )
2680 Mptr->PRESRR = TRUE;
2687 /********************************************************************/
2690 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2691 /* Date: 15 Sep 1994 */
2692 /* Programmer: CARL MCCALLA */
2693 /* Language: C/370 */
2697 /* External Functions Called: */
2704 /* Modification History: */
2707 /********************************************************************/
2709 static bool isSLP( char **token, Decoded_METAR *Mptr, int *NDEX )
2712 /***************************/
2713 /* DECLARE LOCAL VARIABLES */
2714 /***************************/
2719 /*************************/
2720 /* BEGIN BODY OF ROUTINE */
2721 /*************************/
2723 if( *token == NULL )
2726 if( strcmp(*token, "SLPNO") == 0 ) {
2733 if( strncmp(*token, "SLP", 3) != 0 )
2737 if( strncmp(*token, "SLP", 3) == 0 &&
2738 strcmp(*token,"SLP") != 0 )
2740 if( nisdigit( *token+3, 3) )
2742 pressure = atoi(*token+3);
2744 if(pressure >= 550 )
2745 Mptr->SLP = ((float) pressure)/10. + 900.;
2747 Mptr->SLP = ((float) pressure)/10. + 1000.;
2758 if( *token == NULL )
2761 if( nisdigit( *token, 3) )
2763 pressure = atoi(*token);
2765 if(pressure >= 550 )
2766 Mptr->SLP = ((float) pressure)/10. + 900.;
2768 Mptr->SLP = ((float) pressure)/10. + 1000.;
2781 static bool isSectorVsby( char **string, Decoded_METAR *Mptr,
2784 /***************************/
2785 /* DECLARE LOCAL VARIABLES */
2786 /***************************/
2792 /*************************/
2793 /* START BODY OF ROUTINE */
2794 /*************************/
2796 if( *string == NULL )
2799 memset( dd, '\0', 3 );
2801 if( strcmp(*string, "VIS") != 0 )
2806 if( *string == NULL )
2809 if( strncmp(*string,"NE", 2) == 0 )
2810 strncpy(dd,*string,2);
2811 else if( strncmp(*string,"SE",2) == 0 )
2812 strncpy(dd,*string,2);
2813 else if( strncmp(*string,"NW",2) == 0 )
2814 strncpy(dd,*string,2);
2815 else if( strncmp(*string,"SW",2) == 0 )
2816 strncpy(dd,*string,2);
2817 else if( strncmp(*string,"N",1) == 0 )
2818 strncpy(dd,*string,1);
2819 else if( strncmp(*string,"E",1) == 0 )
2820 strncpy(dd,*string,1);
2821 else if( strncmp(*string,"S",1) == 0 )
2822 strncpy(dd,*string,1);
2823 else if( strncmp(*string,"W",1) == 0 )
2824 strncpy(dd,*string,1);
2828 if(nisdigit((*string+strlen(dd)),(strlen(*string)-strlen(dd))))
2829 vsby = atoi((*string+strlen(dd)));
2832 if( *string == NULL )
2835 if( (slash = strchr(*string,'/')) == NULL ) {
2836 strcpy(Mptr->SectorVsby_Dir,dd);
2837 Mptr->SectorVsby = vsby;
2842 else if( nisdigit(*string,(slash-*string)) &&
2843 nisdigit(slash+1,strlen(slash+1)) ) {
2844 vsby += fracPart(*string);
2845 strcpy( Mptr->SectorVsby_Dir, dd );
2846 Mptr->SectorVsby = vsby;
2858 /********************************************************************/
2861 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2862 /* Date: 20 Nov 1994 */
2863 /* Programmer: CARL MCCALLA */
2864 /* Language: C/370 */
2877 /* External Functions Called: */
2902 /* Modification History: */
2905 /********************************************************************/
2906 static bool isGR( char **string, Decoded_METAR *Mptr, int *NDEX)
2910 if( *string == NULL )
2913 if( strcmp(*string, "GS") == 0 ) {
2920 if( strcmp(*string, "GR") != 0 )
2925 if( *string == NULL )
2928 if( (slash = strchr( *string, '/' )) != NULL ) {
2929 if( strcmp( *string, "M1/4" ) == 0 ) {
2930 Mptr->GR_Size = 1./8.;
2936 else if( nisdigit( *string, (slash - *string) ) &&
2937 nisdigit( slash+1, strlen(slash+1)) ) {
2938 Mptr->GR_Size = fracPart( *string );
2950 else if( nisdigit( *string, strlen(*string) ) ) {
2951 Mptr->GR_Size = antoi( *string, strlen(*string) );
2956 if( *string == NULL )
2959 if( (slash = strchr( *string, '/' )) != NULL ) {
2960 if( nisdigit( *string, (slash - *string) ) &&
2961 nisdigit( slash+1, strlen(slash+1)) ) {
2962 Mptr->GR_Size += fracPart( *string );
2988 /********************************************************************/
2990 /* Title: isVIRGA */
2991 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2992 /* Date: 20 Nov 1994 */
2993 /* Programmer: CARL MCCALLA */
2994 /* Language: C/370 */
3007 /* External Functions Called: */
3032 /* Modification History: */
3035 /********************************************************************/
3037 static bool isVIRGA( char **string, Decoded_METAR *Mptr, int *NDEX)
3040 if( *string == NULL )
3043 if( strcmp(*string, "VIRGA") != 0 )
3051 if( *string == NULL )
3055 if( strcmp( *string, "N" ) == 0 ||
3056 strcmp( *string, "S" ) == 0 ||
3057 strcmp( *string, "E" ) == 0 ||
3058 strcmp( *string, "W" ) == 0 ||
3059 strcmp( *string, "NE" ) == 0 ||
3060 strcmp( *string, "NW" ) == 0 ||
3061 strcmp( *string, "SE" ) == 0 ||
3062 strcmp( *string, "SW" ) == 0 ) {
3063 strcpy(Mptr->VIRGA_DIR, *string);
3071 static bool isSfcObscuration( char *string, Decoded_METAR *Mptr,
3074 /***************************/
3075 /* DECLARE LOCAL VARIABLES */
3076 /***************************/
3078 static char *WxSymbols[] = {"BCFG", "BLDU", "BLSA", "BLPY",
3079 "DRDU", "DRSA", "DRSN", "DZ", "DS", "FZFG", "FZDZ", "FZRA",
3080 "FG", "FC", "FU", "GS", "GR", "HZ", "IC", "MIFG",
3081 "PE", "PO", "RA", "SHRA", "SHSN", "SHPE", "SHGS",
3082 "SHGR", "SN", "SG", "SQ", "SA", "SS", "TSRA",
3083 "TSSN", "TSPE", "TSGS", "TSGR", "TS",
3084 "VCSH", "VCPO", "VCBLDU", "VCBLSA", "VCBLSN",
3085 "VCFG", "VCFC","VA", NULL};
3094 /*************************/
3095 /* START BODY OF ROUTINE */
3096 /*************************/
3098 if( string == NULL )
3101 memset( ww, '\0', sizeof(ww) );
3103 if( strlen(string) < 4 )
3106 if( strncmp(string, "-X",2 ) != 0 )
3109 if( !(nisdigit(string+(strlen(string)-1), 1)) )
3113 strncpy( ww, temp, (strlen(string)-2) );
3117 numLoc = temp + (strlen(temp) - 1 );
3119 while( temp < numLoc && ndex < 6 ) {
3122 IS_NOT_FOUND = TRUE;
3124 while( WxSymbols[i] != NULL && IS_NOT_FOUND ) {
3125 if( strncmp( WxSymbols[i], temp, strlen(WxSymbols[i]))
3129 IS_NOT_FOUND = FALSE;
3132 if( WxSymbols[i] == NULL ) {
3137 strcpy(&(Mptr->SfcObscuration[ndex][0]),WxSymbols[i]);
3138 temp += strlen(WxSymbols[i]);
3145 Mptr->Num8thsSkyObscured = antoi( numLoc,1 );
3158 static bool isCeiling( char *string, Decoded_METAR *Mptr, int *NDEX )
3161 if( string == NULL )
3164 if( !(strncmp(string,"CIG",3) == 0 && strlen(string) >= 5) )
3167 if( strcmp(string, "CIGNO") == 0 ) {
3172 else if( strlen( string+3 ) == 3 ) {
3173 if( nisdigit(string+3, strlen(string+3)) &&
3174 strlen(string+3) == 3 ) {
3175 Mptr->Ceiling = atoi(string+3) * 100;
3182 else if( strlen(string+3) == 4 ) {
3183 if( *(string+3) == 'E' && nisdigit(string+4,3) ) {
3184 Mptr->Estimated_Ceiling = antoi(string+4,3) * 100;
3197 static bool isVrbSky( char **string, Decoded_METAR *Mptr, int *NDEX )
3199 static char *cldPtr[] = {"FEW", "SCT", "BKN", "OVC", NULL };
3202 char SKY1[ SKY1_len ];
3205 if( *string == NULL )
3209 memset( SKY1, '\0', SKY1_len );
3211 IS_NOT_FOUND = TRUE;
3213 while( cldPtr[i] != NULL && IS_NOT_FOUND ) {
3215 printf("isVrbSky: *string = %s cldPtr[%d] = %s\n",
3216 *string,i,cldPtr[i]);
3218 if( strncmp(*string, cldPtr[i], strlen(cldPtr[i])) != 0 )
3221 IS_NOT_FOUND = FALSE;
3224 if( cldPtr[i] == NULL )
3228 printf("isVrbSky: *string = %s = cldPtr[%d] = %s\n",
3229 *string,i,cldPtr[i]);
3231 strcpy( SKY1, cldPtr[i] );
3235 if( *string == NULL )
3239 if( strcmp(*string, "V") != 0 )
3244 if( *string == NULL )
3248 IS_NOT_FOUND = TRUE;
3249 while( cldPtr[i] != NULL && IS_NOT_FOUND ) {
3251 printf("isVrbSky: *string = %s cldPtr[%d] = %s\n",
3252 *string,i,cldPtr[i]);
3254 if( strncmp(*string, cldPtr[i], strlen(cldPtr[i])) != 0 )
3257 IS_NOT_FOUND = FALSE;
3260 if( cldPtr[i] == NULL ) {
3266 if(strlen(SKY1) == 6 ) {
3267 if( nisdigit(SKY1+3,3)) {
3268 strncpy(Mptr->VrbSkyBelow,SKY1,3);
3269 strcpy(Mptr->VrbSkyAbove,cldPtr[i]);
3270 Mptr->VrbSkyLayerHgt = antoi(SKY1+3,3)*100;
3284 strcpy(Mptr->VrbSkyBelow,SKY1);
3285 strcpy(Mptr->VrbSkyAbove,cldPtr[i]);
3300 static bool isObscurAloft( char **string, Decoded_METAR *Mptr,
3304 /***************************/
3305 /* DECLARE LOCAL VARIABLES */
3306 /***************************/
3308 static char *WxSymbols[] = {"BCFG", "BLDU", "BLSA", "BLPY",
3309 "DRDU", "DRSA", "DRSN", "DZ", "DS", "FZFG", "FZDZ", "FZRA",
3310 "FG", "FC", "FU", "GS", "GR", "HZ", "IC", "MIFG",
3311 "PE", "PO", "RA", "SHRA", "SHSN", "SHPE", "SHGS",
3312 "SHGR", "SN", "SG", "SQ", "SA", "SS", "TSRA",
3313 "TSSN", "TSPE", "TSGS", "TSGR", "TS",
3314 "VCSH", "VCPO", "VCBLDU", "VCBLSA", "VCBLSN",
3315 "VCFG", "VCFC","VA", NULL};
3322 /*************************/
3323 /* START BODY OF ROUTINE */
3324 /*************************/
3326 if( *string == NULL )
3329 saveTemp = temp = *string;
3334 while( *temp != '\0' ) {
3337 IS_NOT_FOUND = TRUE;
3339 while( WxSymbols[i] != NULL && IS_NOT_FOUND ) {
3340 if( strncmp(temp,WxSymbols[i],strlen(WxSymbols[i])) != 0 )
3343 IS_NOT_FOUND = FALSE;
3346 if( WxSymbols[i] == NULL ) {
3350 temp += strlen(WxSymbols[i]);
3355 if( *string == NULL )
3358 if( strlen(*string) != 6 )
3361 if((strncmp(*string,"FEW",3) == 0 ||
3362 strncmp(*string,"SCT",3) == 0 ||
3363 strncmp(*string,"BKN",3) == 0 ||
3364 strncmp(*string,"OVC",3) == 0 ) &&
3365 (nisdigit(*string+3,3) &&
3366 strcmp(*string+3,"000") != 0 )) {
3367 strcpy(Mptr->ObscurAloft,saveTemp);
3368 strncpy(Mptr->ObscurAloftSkyCond, *string,3);
3369 Mptr->ObscurAloftHgt = atoi(*string+3)*100;
3383 static bool isNOSPECI( char *string, Decoded_METAR *Mptr, int *NDEX )
3386 if( string == NULL )
3389 if( strcmp(string,"NOSPECI") != 0 )
3392 Mptr->NOSPECI = TRUE;
3397 static bool isLAST( char *string, Decoded_METAR *Mptr, int *NDEX )
3400 if( string == NULL )
3403 if( strcmp(string,"LAST") != 0 )
3411 /********************************************************************/
3413 /* Title: isSynopClouds */
3414 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3415 /* Date: 15 Sep 1994 */
3416 /* Programmer: CARL MCCALLA */
3417 /* Language: C/370 */
3421 /* External Functions Called: */
3428 /* Modification History: */
3431 /********************************************************************/
3432 static bool isSynopClouds( char *token, Decoded_METAR *Mptr,
3440 if(strlen(token) != 5)
3443 if( *token == '8' &&
3444 *(token+1) == '/' &&
3445 ((*(token+2) <= '9' && *(token+2) >= '0') || *(token+2) == '/')
3447 ((*(token+3) <= '9' && *(token+3) >= '0') || *(token+3) == '/')
3449 ((*(token+4) <= '9' && *(token+4) >= '0') || *(token+4) == '/'))
3451 strcpy(Mptr->synoptic_cloud_type,token);
3453 Mptr->CloudLow = *(token+2);
3454 Mptr->CloudMedium = *(token+3);
3455 Mptr->CloudHigh = *(token+4);
3464 static bool isSNINCR( char **string, Decoded_METAR *Mptr, int *NDEX )
3469 if( *string == NULL )
3472 if( strcmp( *string, "SNINCR") != 0 )
3477 if( *string == NULL )
3481 if( (slash = strchr(*string,'/')) == NULL ) {
3485 else if( nisdigit (*string,(slash-*string)) &&
3486 nisdigit(slash+1,strlen(slash+1)) ) {
3487 Mptr->SNINCR = antoi(*string,(slash-*string));
3488 Mptr->SNINCR_TotalDepth = antoi(slash+1,strlen(slash+1));
3502 /********************************************************************/
3504 /* Title: isSnowDepth */
3505 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3506 /* Date: 15 Sep 1994 */
3507 /* Programmer: CARL MCCALLA */
3508 /* Language: C/370 */
3512 /* External Functions Called: */
3519 /* Modification History: */
3522 /********************************************************************/
3523 static bool isSnowDepth( char *token, Decoded_METAR *Mptr,
3530 if(strlen(token) != 5)
3533 if( *token == '4' &&
3534 *(token+1) == '/' &&
3535 nisdigit( (token+2),3) )
3537 strcpy(Mptr->snow_depth_group,token);
3538 Mptr->snow_depth = antoi(token+2,3);
3546 static bool isWaterEquivSnow( char *string,
3547 Decoded_METAR *Mptr,
3551 if( string == NULL )
3554 if( strlen(string) != 6 )
3556 else if( !(nisdigit(string,6)) )
3558 else if( strncmp(string, "933", 3) != 0 )
3561 Mptr->WaterEquivSnow = ((float) atoi(string+3))/10.;
3567 static bool isSunshineDur( char *string, Decoded_METAR *Mptr,
3571 if( string == NULL )
3574 if( strlen(string) != 5 )
3576 else if( strncmp(string, "98", 2) != 0 )
3578 else if(nisdigit(string+2,3)) {
3579 Mptr->SunshineDur = atoi(string+2);
3583 else if( strncmp(string+2, "///", 3) == 0 ) {
3584 Mptr->SunSensorOut = TRUE;
3592 /********************************************************************/
3594 /* Title: isHourlyPrecip */
3595 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3596 /* Date: 20 Nov 1994 */
3597 /* Programmer: CARL MCCALLA */
3598 /* Language: C/370 */
3611 /* External Functions Called: */
3636 /* Modification History: */
3639 /********************************************************************/
3641 static bool isHourlyPrecip( char **string, Decoded_METAR *Mptr,
3646 if( *string == NULL )
3649 if( !(strcmp(*string, "P") == 0 || charcmp(*string, "'P'dddd") ||
3650 charcmp(*string, "'P'ddd") ) )
3652 else if( strcmp(*string, "P") != 0 ) {
3653 if( nisdigit((*string+1), strlen(*string+1)) ) {
3654 Mptr->hourlyPrecip = ((float)
3655 atoi(*string+1)) * 0.01;
3668 if( *string == NULL )
3672 if( nisdigit(*string,strlen(*string)) ) {
3673 Mptr->hourlyPrecip = ((float)
3674 atoi(*string)) * 0.01;
3686 /********************************************************************/
3688 /* Title: isP6Precip */
3689 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3690 /* Date: 20 Nov 1994 */
3691 /* Programmer: CARL MCCALLA */
3692 /* Language: C/370 */
3705 /* External Functions Called: */
3730 /* Modification History: */
3733 /********************************************************************/
3735 static bool isP6Precip( char *string, Decoded_METAR *Mptr,
3739 if( string == NULL )
3742 if( *string == '6' && (nisdigit(string+1,4) ||
3743 strcmp(string+1,"////") == 0) ) {
3744 if( strcmp(string+1, "////") == 0 ) {
3745 Mptr->precip_amt = (float) MAXINT;
3746 Mptr->Indeterminant3_6HrPrecip = TRUE;
3751 Mptr->precip_amt = ((float) atoi(string+1)) / 100;
3761 /********************************************************************/
3763 /* Title: isP24Precip */
3764 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3765 /* Date: 20 Nov 1994 */
3766 /* Programmer: CARL MCCALLA */
3767 /* Language: C/370 */
3780 /* External Functions Called: */
3805 /* Modification History: */
3808 /********************************************************************/
3810 static bool isP24Precip( char *string, Decoded_METAR *Mptr,
3814 if( string == NULL )
3817 if( *string == '7' && (nisdigit(string+1,4) ||
3818 strcmp(string+1,"////") == 0) ) {
3819 if( strcmp(string+1, "////") == 0 ) {
3820 Mptr->precip_24_amt = (float) MAXINT;
3825 Mptr->precip_24_amt = ((float) atoi(string+1)) / 100.;
3834 /********************************************************************/
3836 /* Title: isTTdTenths */
3837 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3838 /* Date: 16 Nov 1994 */
3839 /* Programmer: CARL MCCALLA */
3840 /* Language: C/370 */
3853 /* External Functions Called: */
3878 /* Modification History: */
3881 /********************************************************************/
3883 static bool isTTdTenths( char *token, Decoded_METAR *Mptr, int *NDEX)
3886 /***************************/
3887 /* DECLARE LOCAL VARIABLES */
3888 /***************************/
3890 bool returnFlag = FALSE;
3898 else if( !(strlen(token) == 5 || strlen(token) == 9) )
3902 if( (*(token+1) == '0' || *(token+1) == '1') &&
3903 nisdigit(token+2,3) )
3905 if( *(token+1) == '0' )
3910 Mptr->Temp_2_tenths = sign * ((float) antoi(token+2,3));
3916 if( (*(token+5) == '0' || *(token+5) == '1') &&
3917 nisdigit(token+6,3) )
3919 if( *(token+5) == '0' )
3924 Mptr->DP_Temp_2_tenths = sign * ((float) atoi(token+6));
3942 /********************************************************************/
3944 /* Title: isMaxTemp */
3945 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3946 /* Date: 15 Sep 1994 */
3947 /* Programmer: CARL MCCALLA */
3948 /* Language: C/370 */
3952 /* External Functions Called: */
3959 /* Modification History: */
3962 /********************************************************************/
3963 static bool isMaxTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
3967 if( string == NULL )
3970 if(strlen(string) != 5 )
3972 else if(*string == '1' && (*(string+1) == '0' ||
3973 *(string+1) == '1' ||
3974 *(string+1) == '/' ) &&
3975 (nisdigit((string+2),3) ||
3976 strncmp(string+2,"///",3) == 0) )
3978 if(nisdigit(string+2,3))
3981 strncpy(buf,string+2,3);
3982 Mptr->maxtemp = ( (float) atoi(buf))/10.;
3984 if( *(string+1) == '1' )
3985 Mptr->maxtemp *= (-1.0);
3992 Mptr->maxtemp = (float) MAXINT;
4002 /********************************************************************/
4004 /* Title: isMinTemp */
4005 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4006 /* Date: 15 Sep 1994 */
4007 /* Programmer: CARL MCCALLA */
4008 /* Language: C/370 */
4012 /* External Functions Called: */
4019 /* Modification History: */
4022 /********************************************************************/
4023 static bool isMinTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
4027 if( string == NULL )
4030 if(strlen(string) != 5 )
4032 else if(*string == '2' && (*(string+1) == '0' ||
4033 *(string+1) == '1' ||
4034 *(string+1) == '/' ) &&
4035 (nisdigit((string+2),3) ||
4036 strncmp(string+2,"///",3) == 0) )
4038 if(nisdigit(string+2,3))
4041 strncpy(buf,string+2,3);
4042 Mptr->mintemp = ( (float) atoi(buf) )/10.;
4044 if( *(string+1) == '1' )
4045 Mptr->mintemp *= (-1.0);
4051 Mptr->mintemp = (float) MAXINT;
4061 /********************************************************************/
4063 /* Title: isT24MaxMinTemp */
4064 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4065 /* Date: 15 Sep 1994 */
4066 /* Programmer: CARL MCCALLA */
4067 /* Language: C/370 */
4071 /* External Functions Called: */
4078 /* Modification History: */
4081 /********************************************************************/
4082 static bool isT24MaxMinTemp( char *string, Decoded_METAR *Mptr,
4087 if( string == NULL )
4090 if( strlen(string) != 9 )
4092 else if( (*string == '4' && (*(string+1) == '0' ||
4093 *(string+1) == '1' ||
4094 *(string+1) == '/') &&
4095 (nisdigit((string+2),3) || strncmp(string+2,"///",3)))
4097 ((*(string+5) == '0' || *(string+5) == '1' ||
4098 *(string+5) == '/') &&
4099 (nisdigit((string+6),3) ||
4100 strncmp(string+6,"///",3) == 0 )) )
4102 if(nisdigit(string+1,4) && (*(string+1) == '0' ||
4103 *(string+1) == '1') )
4105 memset(buf, '\0', 6);
4106 strncpy(buf, string+2, 3);
4107 Mptr->max24temp = ( (float) atoi( buf ) )/10.;
4109 if( *(string+1) == '1' )
4110 Mptr->max24temp *= -1.;
4113 Mptr->max24temp = (float) MAXINT;
4116 if(nisdigit(string+5,4) && (*(string+5) == '0' ||
4117 *(string+5) == '1' ) )
4119 memset(buf, '\0', 6);
4120 strncpy(buf, string+6, 3);
4121 Mptr->min24temp = ( (float) atoi(buf) )/10.;
4123 if( *(string+5) == '1' )
4124 Mptr->min24temp *= -1.;
4127 Mptr->min24temp = (float) MAXINT;
4137 /********************************************************************/
4139 /* Title: isPtendency */
4140 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4141 /* Date: 15 Sep 1994 */
4142 /* Programmer: CARL MCCALLA */
4143 /* Language: C/370 */
4147 /* External Functions Called: */
4154 /* Modification History: */
4157 /********************************************************************/
4159 static bool isPtendency(char *string, Decoded_METAR *Mptr, int *NDEX)
4163 if( string == NULL )
4166 if(strlen(string) != 5)
4168 else if(*string == '5' && ('0' <= *(string+1) && *(string+1) <= '8') &&
4169 (nisdigit(string+2,3) || strncmp(string+2,"///",3)
4172 if( !(nisdigit(string+2,3)) )
4175 strncpy(buf,(string+1),1);
4176 Mptr->char_prestndcy = atoi(buf);
4183 strncpy(buf,(string+1),1);
4184 Mptr->char_prestndcy = atoi(buf);
4186 Mptr->prestndcy = ((float) atoi(string+2)) * 0.1;
4198 /********************************************************************/
4200 /* Title: isPWINO */
4201 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4202 /* Date: 20 Nov 1994 */
4203 /* Programmer: CARL MCCALLA */
4204 /* Language: C/370 */
4208 /* External Functions Called: */
4215 /* Modification History: */
4218 /********************************************************************/
4220 static bool isPWINO( char *string, Decoded_METAR *Mptr, int *NDEX)
4223 if( string == NULL )
4227 if( strcmp(string, "PWINO") != 0 )
4237 /********************************************************************/
4240 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4241 /* Date: 20 Nov 1994 */
4242 /* Programmer: CARL MCCALLA */
4243 /* Language: C/370 */
4247 /* External Functions Called: */
4254 /* Modification History: */
4257 /********************************************************************/
4259 static bool isPNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4263 if( string == NULL )
4266 if( strcmp(string, "PNO") != 0 )
4276 /********************************************************************/
4278 /* Title: isRVRNO */
4279 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4280 /* Date: 20 Nov 1994 */
4281 /* Programmer: CARL MCCALLA */
4282 /* Language: C/370 */
4286 /* External Functions Called: */
4293 /* Modification History: */
4296 /********************************************************************/
4298 static bool isRVRNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4301 if( string == NULL )
4304 if( strcmp(string, "RVRNO") != 0 )
4314 /********************************************************************/
4316 /* Title: isCHINO */
4317 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4318 /* Date: 20 Nov 1994 */
4319 /* Programmer: CARL MCCALLA */
4320 /* Language: C/370 */
4324 /* External Functions Called: */
4331 /* Modification History: */
4334 /********************************************************************/
4336 static bool isCHINO( char **string, Decoded_METAR *Mptr, int *NDEX)
4340 if( *string == NULL )
4343 if( strcmp(*string, "CHINO") != 0 )
4348 if( *string == NULL )
4351 if( strlen(*string) <= 2 ) {
4356 if( strncmp( *string, "RY", 2 ) == 0 &&
4357 nisdigit(*string+2,strlen(*string+2)) ) {
4359 strcpy(Mptr->CHINO_LOC, *string);
4372 /********************************************************************/
4374 /* Title: isVISNO */
4375 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4376 /* Date: 20 Nov 1994 */
4377 /* Programmer: CARL MCCALLA */
4378 /* Language: C/370 */
4382 /* External Functions Called: */
4389 /* Modification History: */
4392 /********************************************************************/
4394 static bool isVISNO( char **string, Decoded_METAR *Mptr, int *NDEX)
4397 if( *string == NULL )
4400 if( strcmp(*string, "VISNO") != 0 )
4405 if( *string == NULL )
4408 if( strlen(*string) <= 2 ) {
4413 if( strncmp( *string, "RY", 2 ) == 0 &&
4414 nisdigit(*string+2,strlen(*string+2))) {
4416 strcpy(Mptr->VISNO_LOC, *string);
4429 /********************************************************************/
4431 /* Title: isFZRANO */
4432 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4433 /* Date: 20 Nov 1994 */
4434 /* Programmer: CARL MCCALLA */
4435 /* Language: C/370 */
4439 /* External Functions Called: */
4446 /* Modification History: */
4449 /********************************************************************/
4451 static bool isFZRANO( char *string, Decoded_METAR *Mptr, int *NDEX)
4455 if( string == NULL )
4458 if( strcmp(string, "FZRANO") != 0 )
4461 Mptr->FZRANO = TRUE;
4468 /********************************************************************/
4471 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4472 /* Date: 20 Nov 1994 */
4473 /* Programmer: CARL MCCALLA */
4474 /* Language: C/370 */
4487 /* External Functions Called: */
4512 /* Modification History: */
4515 /********************************************************************/
4517 static bool isTSNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4520 if( string == NULL )
4523 if( strcmp(string, "TSNO") != 0 )
4533 /********************************************************************/
4535 /* Title: isDollarSign */
4536 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4537 /* Date: 15 Sep 1994 */
4538 /* Programmer: CARL MCCALLA */
4539 /* Language: C/370 */
4543 /* External Functions Called: */
4550 /* Modification History: */
4553 /********************************************************************/
4555 static bool isDollarSign( char *indicator, Decoded_METAR *Mptr,
4559 if( indicator == NULL )
4562 if( strcmp(indicator,"$") != 0 )
4567 Mptr->DollarSign = TRUE;
4572 /********************************************************************/
4574 /* Title: DcdMTRmk */
4575 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4576 /* Date: 15 Sep 1994 */
4577 /* Programmer: CARL MCCALLA */
4578 /* Language: C/370 */
4580 /* Abstract: DcdMTRmk takes a pointer to a METAR */
4581 /* report and parses/decodes data elements from */
4582 /* the remarks section of the report. */
4586 /* External Functions Called: */
4589 /* Input: token - the address of a pointer to a METAR */
4590 /* report character string. */
4591 /* Mptr - a pointer to a structure of the vari- */
4592 /* able type Decoded_METAR. */
4597 /* Modification History: */
4600 /********************************************************************/
4601 void DcdMTRmk( char **token, Decoded_METAR *Mptr )
4604 /***************************/
4605 /* DECLARE LOCAL VARIABLES */
4606 /***************************/
4608 int TornadicActvty = 0, A0indicator = 0,
4609 peakwind = 0, windshift = 0, towerVsby = 0, surfaceVsby = 0,
4610 variableVsby = 0, LTGfreq = 0,
4612 recentWX = 0, variableCIG = 0, PRESFR = 0,
4613 Vsby2ndSite = 0, CIG2ndSite = 0,
4614 PRESRR = 0, SLP = 0, PartObscur = 0,
4615 SectorVsby = 0, GR = 0, Virga = 0,
4616 SfcObscur = 0, Ceiling = 0, VrbSkyCond = 0, ObscurAloft = 0,
4617 NoSPECI = 0, Last = 0, SynopClouds = 0, Snincr = 0,
4618 SnowDepth = 0, WaterEquivSnow = 0, SunshineDur = 0,
4619 hourlyPrecip = 0, P6Precip = 0, P24Precip = 0,
4620 TTdTenths = 0, MaxTemp = 0, MinTemp = 0, T24MaxMinTemp = 0,
4621 Ptendency = 0, PWINO = 0,
4622 FZRANO = 0, TSNO = 0, maintIndicator = 0, CHINO = 0, RVRNO = 0,
4623 VISNO = 0, PNO = 0, DVR = 0;
4631 // char *temp_token;
4633 // bool extra_token;
4638 /*************************/
4639 /* START BODY OF ROUTINE */
4640 /*************************/
4644 /*************************************************/
4645 /* LOCATE THE START OF THE METAR REMARKS SECTION */
4646 /*************************************************/
4650 while( token[ NDEX ] != NULL && IS_NOT_RMKS) {
4652 printf("DcdMTRmk: token[%d] = %s\n",NDEX,token[NDEX]);
4654 if( strcmp(token[ NDEX ], "RMK") != 0 )
4657 IS_NOT_RMKS = FALSE;
4660 /***********************************************/
4661 /* IF THE METAR REPORT CONTAINS NO REMARKS */
4662 /* SECTION, THEN RETURN TO THE CALLING ROUTINE */
4663 /***********************************************/
4665 if( token[ NDEX ] != NULL ) {
4667 printf("DcdMTRmk: RMK found, token[%d] = %s\n",
4672 printf("DcdMTRmk: Bump NDEX, token[%d] = %s\n",
4678 printf("DcdMTRmk: No RMK found. NULL ptr encountered\n");
4682 /*****************************************/
4683 /* IDENTIFY AND VALIDATE REMARKS SECTION */
4684 /* DATA GROUPS FOR PARSING/DECODING */
4685 /*****************************************/
4687 while(token[NDEX] != NULL) {
4690 printf("DcdMTRmk: DECODE RMKS: token[%d] = %s\n",NDEX,token[NDEX]);
4694 if( isTornadicActiv( &(token[NDEX]), Mptr, &NDEX ) ) {
4696 if( TornadicActvty > 1 ) {
4697 memset(Mptr->TornadicType,'\0',15);
4698 memset(Mptr->TornadicLOC,'\0',10);
4699 memset(Mptr->TornadicDIR,'\0',4);
4700 Mptr->BTornadicHour = MAXINT;
4701 Mptr->BTornadicMinute = MAXINT;
4702 Mptr->ETornadicHour = MAXINT;
4703 Mptr->ETornadicMinute = MAXINT;
4706 else if( isA0indicator( token[NDEX], Mptr, &NDEX ) ) {
4708 if( A0indicator > 1 )
4709 memset(Mptr->autoIndicator,'\0',5);
4711 else if( isPeakWind( &(token[NDEX]), Mptr, &NDEX ) ) {
4713 if( peakwind > 1 ) {
4714 Mptr->PKWND_dir = MAXINT;
4715 Mptr->PKWND_speed = MAXINT;
4716 Mptr->PKWND_hour = MAXINT;
4717 Mptr->PKWND_minute = MAXINT;
4720 else if( isWindShift( &(token[NDEX]), Mptr, &NDEX ) ) {
4722 if( windshift > 1 ) {
4723 Mptr->WshfTime_hour = MAXINT;
4724 Mptr->WshfTime_minute = MAXINT;
4727 else if( isTowerVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4730 Mptr->TWR_VSBY = (float) MAXINT;
4732 else if( isSurfaceVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4734 if( surfaceVsby > 1 )
4735 Mptr->TWR_VSBY = (float) MAXINT;
4737 else if( isVariableVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4739 if( variableVsby > 1 ) {
4740 Mptr->minVsby = (float) MAXINT;
4741 Mptr->maxVsby = (float) MAXINT;
4744 else if( isVsby2ndSite( &(token[NDEX]), Mptr, &NDEX ) ) {
4746 if( Vsby2ndSite > 1 ) {
4747 Mptr->VSBY_2ndSite = (float) MAXINT;
4748 memset(Mptr->VSBY_2ndSite_LOC,'\0',10);
4751 else if( isLTGfreq( &(token[NDEX]), Mptr, &NDEX ) ) {
4754 Mptr->OCNL_LTG = FALSE;
4755 Mptr->FRQ_LTG = FALSE;
4756 Mptr->CNS_LTG = FALSE;
4757 Mptr->CG_LTG = FALSE;
4758 Mptr->IC_LTG = FALSE;
4759 Mptr->CC_LTG = FALSE;
4760 Mptr->CA_LTG = FALSE;
4761 Mptr->DSNT_LTG = FALSE;
4762 Mptr->OVHD_LTG = FALSE;
4763 Mptr->VcyStn_LTG = FALSE;
4764 Mptr->LightningVCTS = FALSE;
4765 Mptr->LightningTS = FALSE;
4766 memset(Mptr->LTG_DIR,'\0',3 );
4769 else if( isTS_LOC( &(token[NDEX]), Mptr, &NDEX ) ) {
4772 memset(Mptr->TS_LOC, '\0', 3);
4773 memset(Mptr->TS_MOVMNT, '\0', 3);
4776 else if( isRecentWX( &(token[NDEX]), Mptr, &recentWX ) ) {
4778 /* if( recentWX > 3 ) {
4779 for( i = 0; i < 3; i++ ) {
4780 memset(Mptr->ReWx[i].Recent_weather, '\0', 5);
4782 Mptr->ReWx[i].Bhh = MAXINT;
4783 Mptr->ReWx[i].Bmm = MAXINT;
4785 Mptr->ReWx[i].Ehh = MAXINT;
4786 Mptr->ReWx[i].Emm = MAXINT;
4794 else if( isVariableCIG( &(token[NDEX]), Mptr, &NDEX ) ) {
4796 if( variableCIG > 1) {
4797 Mptr->minCeiling = MAXINT;
4798 Mptr->maxCeiling = MAXINT;
4801 else if( isCIG2ndSite( &(token[NDEX]), Mptr, &NDEX ) ) {
4803 if( CIG2ndSite > 1) {
4804 Mptr->CIG_2ndSite_Meters = MAXINT;
4805 memset( Mptr->CIG_2ndSite_LOC, '\0', 10);
4808 else if( isPRESFR( token[NDEX], Mptr, &NDEX ) ) {
4811 Mptr->PRESFR = FALSE;
4813 else if( isPRESRR( token[NDEX], Mptr, &NDEX ) ) {
4816 Mptr->PRESRR = FALSE;
4818 else if( isSLP( &(token[NDEX]), Mptr, &NDEX ) ) {
4821 Mptr->SLP = (float) MAXINT;
4823 else if( isPartObscur( &(token[NDEX]), Mptr, PartObscur,
4826 if( PartObscur > 2 ) {
4827 memset(&(Mptr->PartialObscurationAmt[0][0]), '\0', 7 );
4828 memset(&(Mptr->PartialObscurationPhenom[0][0]),'\0',12 );
4830 memset(&(Mptr->PartialObscurationAmt[1][0]), '\0', 7 );
4831 memset(&(Mptr->PartialObscurationPhenom[1][0]),'\0',12 );
4834 else if( isSectorVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4836 if( SectorVsby > 1 ) {
4837 Mptr->SectorVsby = (float) MAXINT;
4838 memset(Mptr->SectorVsby_Dir, '\0', 3);
4841 else if( isGR( &(token[NDEX]), Mptr, &NDEX ) ) {
4844 Mptr->GR_Size = (float) MAXINT;
4848 else if( isVIRGA( &(token[NDEX]), Mptr, &NDEX ) ) {
4851 Mptr->VIRGA = FALSE;
4852 memset(Mptr->VIRGA_DIR, '\0', 3);
4855 else if( isSfcObscuration( token[NDEX], Mptr, &NDEX ) ) {
4857 if( SfcObscur > 1 ) {
4858 for( i = 0; i < 6; i++ ) {
4859 memset(&(Mptr->SfcObscuration[i][0]), '\0', 10);
4860 Mptr->Num8thsSkyObscured = MAXINT;
4864 else if( isCeiling( token[NDEX], Mptr, &NDEX ) ) {
4867 Mptr->CIGNO = FALSE;
4868 Mptr->Ceiling = MAXINT;
4869 Mptr->Estimated_Ceiling = FALSE;
4872 else if( isVrbSky( &(token[NDEX]), Mptr, &NDEX ) ) {
4874 if( VrbSkyCond > 1 ) {
4875 memset(Mptr->VrbSkyBelow, '\0', 4);
4876 memset(Mptr->VrbSkyAbove, '\0', 4);
4877 Mptr->VrbSkyLayerHgt = MAXINT;
4880 else if( isObscurAloft( &(token[NDEX]), Mptr, &NDEX ) ) {
4882 if( ObscurAloft > 1 ) {
4883 Mptr->ObscurAloftHgt = MAXINT;
4884 memset( Mptr->ObscurAloft, '\0', 12 );
4885 memset( Mptr->ObscurAloftSkyCond, '\0', 12 );
4888 else if( isNOSPECI( token[NDEX], Mptr, &NDEX ) ) {
4891 Mptr->NOSPECI = FALSE;
4893 else if( isLAST( token[NDEX], Mptr, &NDEX ) ) {
4898 else if( isSynopClouds( token[NDEX], Mptr, &NDEX ) ) {
4900 if( SynopClouds > 1 ) {
4901 memset( Mptr->synoptic_cloud_type, '\0', 6 );
4902 Mptr->CloudLow = '\0';
4903 Mptr->CloudMedium = '\0';
4904 Mptr->CloudHigh = '\0';
4907 else if( isSNINCR( &(token[NDEX]), Mptr, &NDEX ) ) {
4910 Mptr->SNINCR = MAXINT;
4911 Mptr->SNINCR_TotalDepth = MAXINT;
4914 else if( isSnowDepth( token[NDEX], Mptr, &NDEX ) ) {
4916 if( SnowDepth > 1 ) {
4917 memset( Mptr->snow_depth_group, '\0', 6 );
4918 Mptr->snow_depth = MAXINT;
4921 else if( isWaterEquivSnow( token[NDEX], Mptr, &NDEX ) ) {
4923 if( WaterEquivSnow > 1 )
4924 Mptr->WaterEquivSnow = (float) MAXINT;
4926 else if( isSunshineDur( token[NDEX], Mptr, &NDEX ) ) {
4928 if( SunshineDur > 1 ) {
4929 Mptr->SunshineDur = MAXINT;
4930 Mptr->SunSensorOut = FALSE;
4933 else if( isHourlyPrecip( &(token[NDEX]), Mptr, &NDEX ) ) {
4935 if( hourlyPrecip > 1 )
4936 Mptr->hourlyPrecip = (float) MAXINT;
4938 else if( isP6Precip( token[NDEX], Mptr, &NDEX ) ) {
4941 Mptr->precip_amt = (float) MAXINT;
4943 else if( isP24Precip( token[NDEX], Mptr, &NDEX ) ) {
4946 Mptr->precip_24_amt = (float) MAXINT;
4948 else if( isTTdTenths( token[NDEX], Mptr, &NDEX ) ) {
4950 if( TTdTenths > 1 ) {
4951 Mptr->Temp_2_tenths = (float) MAXINT;
4952 Mptr->DP_Temp_2_tenths = (float) MAXINT;
4955 else if( isMaxTemp( token[NDEX], Mptr, &NDEX ) ) {
4958 Mptr->maxtemp = (float) MAXINT;
4960 else if( isMinTemp( token[NDEX], Mptr, &NDEX ) ) {
4963 Mptr->mintemp = (float) MAXINT;
4965 else if( isT24MaxMinTemp( token[NDEX],
4968 if( T24MaxMinTemp > 1 ) {
4969 Mptr->max24temp = (float) MAXINT;
4970 Mptr->min24temp = (float) MAXINT;
4973 else if( isPtendency( token[NDEX], Mptr, &NDEX ) ) {
4975 if( Ptendency > 1 ) {
4976 Mptr->char_prestndcy = MAXINT;
4977 Mptr->prestndcy = (float) MAXINT;
4980 else if( isPWINO( token[NDEX], Mptr, &NDEX ) ) {
4983 Mptr->PWINO = FALSE;
4985 else if( isFZRANO( token[NDEX], Mptr, &NDEX ) ) {
4988 Mptr->FZRANO = FALSE;
4990 else if( isTSNO( token[NDEX], Mptr, &NDEX ) ) {
4995 else if( isDollarSign( token[NDEX], Mptr, &NDEX ) ) {
4997 if( maintIndicator > 1 )
4998 Mptr->DollarSign = FALSE;
5000 else if( isRVRNO( token[NDEX], Mptr, &NDEX ) ) {
5003 Mptr->RVRNO = FALSE;
5005 else if( isPNO( token[NDEX], Mptr, &NDEX ) ) {
5010 else if( isVISNO( &(token[NDEX]), Mptr, &NDEX ) ) {
5013 Mptr->VISNO = FALSE;
5014 memset(Mptr->VISNO_LOC, '\0', 6);
5017 else if( isCHINO( &(token[NDEX]), Mptr, &NDEX ) ) {
5020 Mptr->CHINO = FALSE;
5021 memset(Mptr->CHINO_LOC, '\0', 6);
5024 else if( isDVR( token[NDEX], Mptr, &NDEX ) ) {
5027 Mptr->DVR.Min_visRange = MAXINT;
5028 Mptr->DVR.Max_visRange = MAXINT;
5029 Mptr->DVR.visRange = MAXINT;
5030 Mptr->DVR.vrbl_visRange = FALSE;
5031 Mptr->DVR.below_min_DVR = FALSE;
5032 Mptr->DVR.above_max_DVR = FALSE;