1 #include <simgear/compiler.h>
3 #include "Local.h" /* standard header file */
7 float fracPart( char * );
11 #pragma subtitle("subtitle - description ")
12 /********************************************************************/
15 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
16 /* Date: 06 May 1996 */
17 /* Programmer: CARL MCCALLA */
20 /* Abstract: Identify the input character string as a thunder- */
21 /* storm location. If the input string is a thunder- */
22 /* storm location, then return TRUE. Otherwise, */
26 /* External Functions Called: */
29 /* Input: string - a pointer to a pointer to a charac- */
30 /* ter string from a METAR report. */
32 /* Mptr - a pointer to a structure that has the */
33 /* data type Decoded_METAR. */
35 /* NDEX - a pointer to an integer that is the index */
36 /* into an array that contains the indi- */
37 /* vidual groups of the METAR report being */
38 /* decoded. Upon entry, NDEX is the index */
39 /* of the current group of the METAR report */
40 /* that is to be indentified. */
42 /* Output: TRUE - if the input string is a thunderstorm */
44 /* FALSE - the input string is not a thunderstorm */
47 /* Modification History: */
50 /********************************************************************/
53 static bool isTS_LOC( char **string, Decoded_METAR *Mptr,
57 /***************************/
58 /* DECLARE LOCAL VARIABLES */
59 /***************************/
63 /*************************/
64 /* START BODY OF ROUTINE */
65 /*************************/
66 /*******************************************/
67 /* COMPARE THE INPUT CHARACTER STRING WITH */
68 /* VALID AUTOMATED STATION CODE TYPE. IF */
69 /* A MATCH IS FOUND, RETURN TRUE. OTHER- */
70 /* WISE, RETURN FALSE */
71 /*******************************************/
78 if( strcmp( *string, "TS") != 0 )
86 if( strcmp(*string,"N") == 0 ||
87 strcmp(*string,"NE") == 0 ||
88 strcmp(*string,"NW") == 0 ||
89 strcmp(*string,"S") == 0 ||
90 strcmp(*string,"SE") == 0 ||
91 strcmp(*string,"SW") == 0 ||
92 strcmp(*string,"E") == 0 ||
93 strcmp(*string,"W") == 0 ) {
94 strcpy( Mptr->TS_LOC, *string );
102 if( strcmp( *string, "MOV" ) == 0 ) {
105 if( *string == NULL ) {
110 if( strcmp(*string,"N") == 0 ||
111 strcmp(*string,"NE") == 0 ||
112 strcmp(*string,"NW") == 0 ||
113 strcmp(*string,"S") == 0 ||
114 strcmp(*string,"SE") == 0 ||
115 strcmp(*string,"SW") == 0 ||
116 strcmp(*string,"E") == 0 ||
117 strcmp(*string,"W") == 0 ) {
118 strcpy( Mptr->TS_MOVMNT, *string );
137 #pragma subtitle(" ")
139 #pragma subtitle("subtitle - description ")
140 /********************************************************************/
143 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
144 /* Date: 15 Sep 1994 */
145 /* Programmer: CARL MCCALLA */
146 /* Language: C/370 */
150 /* External Functions Called: */
157 /* Modification History: */
160 /********************************************************************/
163 static bool isDVR( char *token, Decoded_METAR *Mptr, int *NDEX )
165 char *slashPtr, *FT_ptr;
172 if( (length = strlen( token )) < 4 )
175 if( strncmp( token, "DVR", 3 ) != 0 )
178 if( *(slashPtr = token+3) != '/' ) {
183 if( strcmp(token+(strlen(token)-2),"FT") != 0 )
186 FT_ptr = token + (strlen(token)-2);
188 if( strchr(slashPtr+1, 'P' ) != NULL )
189 Mptr->DVR.above_max_DVR = TRUE;
191 if( strchr(slashPtr+1, 'M' ) != NULL )
192 Mptr->DVR.below_min_DVR = TRUE;
195 if( (vPtr = strchr(slashPtr, 'V' )) != NULL )
197 Mptr->DVR.vrbl_visRange = TRUE;
198 Mptr->DVR.Min_visRange = antoi(slashPtr+1,
199 (vPtr-(slashPtr+1)) );
200 Mptr->DVR.Max_visRange = antoi(vPtr+1,
201 (FT_ptr - (vPtr+1)) );
207 if( Mptr->DVR.below_min_DVR ||
208 Mptr->DVR.above_max_DVR )
209 Mptr->DVR.visRange = antoi(slashPtr+2,
210 (FT_ptr - (slashPtr+2)) );
212 Mptr->DVR.visRange = antoi(slashPtr+1,
213 (FT_ptr - (slashPtr+1)) );
220 #pragma subtitle(" ")
222 #pragma subtitle("subtitle - description ")
223 /********************************************************************/
225 /* Title: isTornadicActiv */
226 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
227 /* Date: 15 Sep 1994 */
228 /* Programmer: CARL MCCALLA */
229 /* Language: C/370 */
231 /* Abstract: Determines whether or not the input character */
232 /* string is signals the beginning of TORNADIC */
233 /* ACTIVITY data. If it is, then interrogate subse- */
234 /* quent report groups for time, location, and movement*/
235 /* of tornado. Return TRUE, if TORNADIC ACTIVITY is */
236 /* found. Otherwise, return FALSE. */
239 /* External Functions Called: */
242 /* Input: string - the address of a pointer to a charac- */
243 /* ter string that may or may not signal */
244 /* TORNADIC ACTIVITY. */
246 /* Mptr - a pointer to a structure that has the */
247 /* data type Decoded_METAR. */
249 /* NDEX - a pointer to an integer that is the index */
250 /* into an array that contains the indi- */
251 /* vidual groups of the METAR report being */
252 /* decoded. Upon entry, NDEX is the index */
253 /* of the current group of the METAR report */
254 /* that is to be indentified. */
256 /* Output: TRUE - if TORNADIC ACTIVITY is found. */
257 /* FALSE - if no TORNADIC ACTIVITY is found. */
259 /* Modification History: */
262 /********************************************************************/
265 static bool isTornadicActiv( char **string, Decoded_METAR *Mptr,
270 bool Completion_flag;
275 /*************************/
276 /* START BODY OF ROUTINE */
277 /*************************/
285 if( *string == NULL )
288 if( !( strcmp(*string, "TORNADO") == 0 ||
289 strcmp(*string, "TORNADOS") == 0 ||
290 strcmp(*string, "TORNADOES") == 0 ||
291 strcmp(*string, "WATERSPOUT") == 0 ||
292 strcmp(*string, "WATERSPOUTS") == 0 ||
293 strcmp(*string, "FUNNEL") == 0 ) )
296 if( strcmp(*string, "FUNNEL") == 0 ) {
299 if( *string == NULL )
302 if( !(strcmp(*string,"CLOUD") == 0 ||
303 strcmp(*string,"CLOUDS") == 0 ) ) {
308 strcpy(Mptr->TornadicType,"FUNNEL CLOUD");
311 strcpy(Mptr->TornadicType, *string);
316 Completion_flag = FALSE;
318 if( *string == NULL )
321 while( !Completion_flag ) {
323 /* printf("isTornadicActivity: current *string = %s\n",
326 if( *(*string) =='B' || *(*string) == 'E') {
327 if( *(*string) == 'B' ) {
328 B_stringPtr = *string;
329 E_stringPtr = strchr((*string)+1,'E');
332 B_stringPtr = strchr((*string)+1,'B');
333 E_stringPtr = *string;
336 if( B_stringPtr != NULL )
337 printf("isTornadicActivity: B_stringPtr = %x\n",
340 printf("isTornadicActivity: B_stringPtr = NULL\n");
342 if( E_stringPtr != NULL )
343 printf("isTornadicActivity: E_stringPtr = %x\n",
346 printf("isTornadicActivity: E_stringPtr = NULL\n");
348 if( B_stringPtr != NULL && E_stringPtr == NULL ) {
349 if( nisdigit((*string)+1, strlen((*string)+1)) &&
350 strlen((*string)+1) <= 4 ) {
351 TornadicTime = antoi((*string)+1,
352 strlen((*string)+1));
353 if( TornadicTime > 99 ) {
354 Mptr->BTornadicHour = TornadicTime / 100;
355 Mptr->BTornadicMinute = TornadicTime % 100;
360 Mptr->BTornadicHour = TornadicTime;
370 else if( B_stringPtr == NULL && E_stringPtr != NULL ) {
371 if( nisdigit((*string)+1,strlen((*string)+1)) &&
372 strlen((*string)+1) <= 4 ) {
373 TornadicTime = antoi((*string)+1,
374 strlen((*string)+1));
375 if( TornadicTime > 99 ) {
376 Mptr->ETornadicHour = TornadicTime / 100;
377 Mptr->ETornadicMinute = TornadicTime % 100;
382 Mptr->ETornadicHour = TornadicTime;
393 /* printf("isTornadicActivity: B_stringPtr != NULL"
394 " and E_stringPtr != NULL\n"); */
395 if( nisdigit((B_stringPtr+1),(E_stringPtr -
397 TornadicTime = antoi(( B_stringPtr+1),
398 (E_stringPtr-(B_stringPtr+1)));
399 if( TornadicTime > 99 ) {
400 Mptr->BTornadicHour = TornadicTime / 100;
401 Mptr->BTornadicMinute = TornadicTime % 100;
406 Mptr->BTornadicHour = TornadicTime;
411 TornadicTime = antoi(( E_stringPtr+1),
412 strlen(E_stringPtr+1));
414 if( TornadicTime > 99 ) {
415 Mptr->ETornadicHour = TornadicTime / 100;
416 Mptr->ETornadicMinute = TornadicTime % 100;
421 Mptr->ETornadicHour = TornadicTime;
432 else if( nisdigit(*string, strlen(*string))) {
435 if( *string == NULL )
438 if( strcmp(*string,"N") == 0 ||
439 strcmp(*string,"NE") == 0 ||
440 strcmp(*string,"NW") == 0 ||
441 strcmp(*string,"S") == 0 ||
442 strcmp(*string,"SE") == 0 ||
443 strcmp(*string,"SW") == 0 ||
444 strcmp(*string,"E") == 0 ||
445 strcmp(*string,"W") == 0 ) {
447 Mptr->TornadicDistance = antoi(*string,
455 if( saveNdex == *NDEX )
462 else if(strcmp(*string,"DSNT") == 0 ||
463 strcmp(*string,"VC") == 0 ||
464 strcmp(*string,"VCY") == 0 ) {
465 if( strcmp(*string,"VCY") == 0 ||
466 strcmp(*string,"VC") == 0 ) {
469 if( *string == NULL )
472 if( strcmp(*string,"STN") == 0 ){
473 strcpy(Mptr->TornadicLOC,"VC STN");
479 strcpy(Mptr->TornadicLOC,"VC");
484 strcpy(Mptr->TornadicLOC,"DSNT");
489 else if(strcmp(*string,"N") == 0 ||
490 strcmp(*string,"NE") == 0 ||
491 strcmp(*string,"NW") == 0 ||
492 strcmp(*string,"S") == 0 ||
493 strcmp(*string,"SE") == 0 ||
494 strcmp(*string,"SW") == 0 ||
495 strcmp(*string,"E") == 0 ||
496 strcmp(*string,"W") == 0 ) {
497 strcpy(Mptr->TornadicDIR, *string);
501 else if( strcmp(*string, "MOV" ) == 0 ) {
505 if( *string == NULL )
508 if( strcmp(*string, "N") == 0 ||
509 strcmp(*string, "S") == 0 ||
510 strcmp(*string, "E") == 0 ||
511 strcmp(*string, "W") == 0 ||
512 strcmp(*string, "NE") == 0 ||
513 strcmp(*string, "NW") == 0 ||
514 strcmp(*string, "SE") == 0 ||
515 strcmp(*string, "SW") == 0 ) {
516 strcpy( Mptr->TornadicMovDir, *string );
523 Completion_flag = TRUE;
526 if( saveNdex == *NDEX )
534 #pragma subtitle(" ")
536 #pragma subtitle("subtitle - description ")
537 /********************************************************************/
539 /* Title: isPartObscur */
540 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
541 /* Date: 15 Sep 1994 */
542 /* Programmer: CARL MCCALLA */
543 /* Language: C/370 */
545 /* Abstract: Determine whether or not the input character string */
546 /* is a partial obscuration phenomenon. If a partial */
547 /* obscuration is found, then take the preceding group */
548 /* as the obscuring phenomenon. If a partial obscura- */
549 /* tion is found, then return TRUE. Otherwise, return */
553 /* External Functions Called: */
556 /* Input: string - the address of a pointer to a group */
557 /* in a METAR report that may or may not */
558 /* be a partial obscuration indicator. */
560 /* Mptr - a pointer to a structure that has the */
561 /* data type Decoded_METAR. */
563 /* NDEX - a pointer to an integer that is the index */
564 /* into an array that contains the indi- */
565 /* vidual groups of the METAR report being */
566 /* decoded. Upon entry, NDEX is the index */
567 /* of the current group of the METAR report */
568 /* that is to be indentified. */
570 /* Output: TRUE - if the input string is a partial obscura- */
572 /* FALSE - if the input string is not a partial ob- */
575 /* Modification History: */
578 /********************************************************************/
580 static bool isPartObscur( char **string, Decoded_METAR *Mptr,
581 int ndex, int *NDEX )
584 /***************************/
585 /* DECLARE LOCAL VARIABLES */
586 /***************************/
590 static char *phenom[] = {"-DZ", "DZ", "+DZ",
591 "FZDZ", "-RA", "RA", "+RA",
592 "SHRA", "TSRA", "FZRA", "-SN", "SN", "+SN", "DRSN", "BLSN",
593 "SHSN", "TSSN", "-SG", "SG", "+SG", "IC", "-PE", "PE", "+PE",
594 "SHPE", "TSPE", "GR", "SHGR", "TSGR", "GS", "SHGS", "TSGS", "-GS",
595 "+GS", "TS", "VCTS", "-TSRA", "TSRA", "+TSRA", "-TSSN", "TSSN",
596 "+TSSN", "-TSPE", "TSPE", "+TSPE", "-TSGS", "TSGS", "+TSGS",
597 "VCSH", "-SHRA", "+SHRA", "-SHSN", "+SHSN", "-SHPE", "+SHPE",
598 "-SHGS", "+SHGS", "-FZDZ", "+FZDZ", "-FZRA", "+FZRA", "FZFG",
599 "+FZFG", "BR", "FG", "VCFG", "MIFG", "PRFG", "BCFG", "FU",
600 "VA", "DU", "DRDU", "BLDU", "SA", "DRSA", "BLSA", "HZ",
601 "BLPY", "BLSN", "+BLSN", "VCBLSN", "BLSA", "+BLSA",
602 "VCBLSA", "+BLDU", "VCBLDU", "PO", "VCPO", "SQ", "FC", "+FC",
603 "VCFC", "SS", "+SS", "VCSS", "DS", "+DS", "VCDS", NULL};
607 printf("isPartObscur: Routine Entered...\n");
608 printf("isPartObscur: *string = %s\n",*string);
609 if( Mptr->PartialObscurationAmt[ndex][0] != '\0' ) {
610 printf("PartialObscurationAmt = %s\n",
611 &(Mptr->PartialObscurationAmt[ndex][0]));
612 if( strcmp( *string, "FEW///" ) == 0 ||
613 strcmp( *string, "SCT///" ) == 0 ||
614 strcmp( *string, "BKN///" ) == 0 ||
615 strcmp( *string, "FEW000" ) == 0 ||
616 strcmp( *string, "SCT000" ) == 0 ||
617 strcmp( *string, "BKN000" ) == 0 ) {
620 printf("isPartObscur: Preceding group = %s\n",
627 if( *string == NULL )
630 if( strcmp( *string, "FEW///" ) == 0 ||
631 strcmp( *string, "SCT///" ) == 0 ||
632 strcmp( *string, "BKN///" ) == 0 ||
633 strcmp( *string, "FEW000" ) == 0 ||
634 strcmp( *string, "SCT000" ) == 0 ||
635 strcmp( *string, "BKN000" ) == 0 ) {
636 if( Mptr->PartialObscurationAmt[ndex][0] == '\0' )
643 &(Mptr->PartialObscurationAmt[ndex][0]) ) == 0 )
647 if( *string == NULL )
651 while( phenom[i] != NULL ) {
652 if( strcmp( *string, phenom[i] ) == 0 ) {
653 strcpy(&(Mptr->PartialObscurationPhenom[ndex][0]),
680 #pragma subtitle(" ")
682 #pragma subtitle("subtitle - description ")
683 /********************************************************************/
685 /* Title: isA0indicator */
686 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
687 /* Date: 15 Sep 1994 */
688 /* Programmer: CARL MCCALLA */
689 /* Language: C/370 */
691 /* Abstract: Identify the input character string as an automated */
692 /* station code type. If the input character string */
693 /* is an automated station code type, then return */
694 /* TRUE. Otherwise, return FALSE. */
697 /* External Functions Called: */
700 /* Input: indicator - a pointer to a character string */
701 /* that may or may not be an ASOS */
702 /* automated station code type. */
704 /* Mptr - a pointer to a structure that has the */
705 /* data type Decoded_METAR. */
707 /* NDEX - a pointer to an integer that is the index */
708 /* into an array that contains the indi- */
709 /* vidual groups of the METAR report being */
710 /* decoded. Upon entry, NDEX is the index */
711 /* of the current group of the METAR report */
712 /* that is to be indentified. */
714 /* Output: TRUE - if the input string matches one of the */
715 /* valid ASOS automated station indicators. */
716 /* FALSE - the input string did not match one of the*/
717 /* valid ASOS automated station indicators. */
719 /* Modification History: */
722 /********************************************************************/
725 static bool isA0indicator( char *indicator, Decoded_METAR *Mptr,
729 /***************************/
730 /* DECLARE LOCAL VARIABLES */
731 /***************************/
733 char *autoFlag[] = {"A01", "A01A", "A02", "A02A", "AOA",
734 "A0A", "AO1", "AO1A", "AO2", "AO2A", NULL};
737 /*************************/
738 /* START BODY OF ROUTINE */
739 /*************************/
740 /*******************************************/
741 /* COMPARE THE INPUT CHARACTER STRING WITH */
742 /* VALID AUTOMATED STATION CODE TYPE. IF */
743 /* A MATCH IS FOUND, RETURN TRUE. OTHER- */
744 /* WISE, RETURN FALSE */
745 /*******************************************/
747 if( indicator == NULL )
752 while( autoFlag[ i ] != NULL )
754 if( strcmp( indicator, autoFlag[ i ]) == 0 )
757 strcpy(Mptr->autoIndicator, indicator);
766 #pragma subtitle(" ")
768 #pragma subtitle("subtitle - description ")
769 /********************************************************************/
771 /* Title: isPeakWind */
772 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
773 /* Date: 15 Sep 1994 */
774 /* Programmer: CARL MCCALLA */
775 /* Language: C/370 */
777 /* Abstract: Determine whether or not the current and subsequent */
778 /* groups from the METAR report make up a valid report */
782 /* Input: string - the addr of a ptr to a character string */
783 /* that may or may not be the indicator */
784 /* for a peak wind data group. */
786 /* Mptr - a pointer to a structure that has the */
787 /* data type Decoded_METAR. */
789 /* NDEX - a pointer to an integer that is the index */
790 /* into an array that contains the indi- */
791 /* vidual groups of the METAR report being */
792 /* decoded. Upon entry, NDEX is the index */
793 /* of the current group of the METAR report */
794 /* that is to be indentified. */
796 /* Output: TRUE - if the input string (and subsequent grps) */
797 /* are decoded as peak wind. */
798 /* FALSE - if the input string (and subsequent grps)*/
799 /* are not decoded as peak wind. */
800 /* External Functions Called: */
804 /* Modification History: */
807 /********************************************************************/
809 static bool isPeakWind( char **string, Decoded_METAR *Mptr,
813 /***************************/
814 /* DECLARE LOCAL VARIABLES */
815 /***************************/
821 /*************************/
822 /* START BODY OF ROUTINE */
823 /*************************/
827 /******************************************************/
828 /* IF THE CURRENT AND NEXT GROUPS ARE "PK WND", THEN */
829 /* DETERMINE WHETHER OR NOT THE GROUP THAT FOLLOWS IS */
830 /* A VALID PK WND GROUP. IF IT IS, THEN DECODE THE */
831 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
832 /******************************************************/
834 if( *string == NULL )
837 if( strcmp(*string,"PK") != 0 )
842 if( *string == NULL )
844 if( strcmp(*string,"WND") != 0 ) {
851 if( *string == NULL )
854 if( (slash = strchr(*string,'/')) == NULL ) {
855 /********************************/
856 /* INVALID PEAK WIND. BUMP PAST */
857 /* PK AND WND GROUP AND RETURN */
859 /********************************/
864 else if( strlen(*string) >= 8 && strlen(*string) <= 11 &&
865 nisdigit(slash+1,strlen(slash+1)) &&
866 nisdigit(*string, (slash - *string)) &&
867 (slash - *string) <= 6 )
869 memset( buf, '\0', 4);
870 strncpy( buf, *string, 3 );
871 Mptr->PKWND_dir = atoi( buf );
873 memset( buf, '\0', 4);
874 strncpy( buf, *string+3, slash-(*string+3) );
875 Mptr->PKWND_speed = atoi( buf );
877 memset( buf, '\0', 5);
878 strcpy( buf, slash+1 );
883 Mptr->PKWND_hour = atoi(buf)/100;
884 Mptr->PKWND_minute = (atoi(buf)) % 100;
887 Mptr->PKWND_minute = atoi( buf );
888 /********************************/
889 /* VALID PEAK WIND FOUND. BUMP */
890 /* PAST PK, WND, AND PEAK WIND */
891 /* GROUPS AND RETURN TRUE. */
892 /********************************/
901 #pragma subtitle(" ")
903 #pragma subtitle("subtitle - description ")
904 /********************************************************************/
906 /* Title: isWindShift */
907 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
908 /* Date: 15 Sep 1994 */
909 /* Programmer: CARL MCCALLA */
910 /* Language: C/370 */
912 /* Abstract: Determine whether or not the current and subsequent */
913 /* groups from the METAR report make up a valid report */
914 /* of wind shift and frontal passage, if included. */
917 /* Input: string - the addr of a ptr to a character string */
918 /* that may or may not be the indicator */
919 /* for a wind shift data group. */
921 /* Mptr - a pointer to a structure that has the */
922 /* data type Decoded_METAR. */
924 /* NDEX - a pointer to an integer that is the index */
925 /* into an array that contains the indi- */
926 /* vidual groups of the METAR report being */
927 /* decoded. Upon entry, NDEX is the index */
928 /* of the current group of the METAR report */
929 /* that is to be indentified. */
931 /* Output: TRUE - if the input string (and subsequent grps) */
932 /* are decoded as wind shift. */
933 /* FALSE - if the input string (and subsequent grps)*/
934 /* are not decoded as wind shift. */
935 /* External Functions Called: */
939 /* Modification History: */
942 /********************************************************************/
944 static bool isWindShift( char **string, Decoded_METAR *Mptr,
948 /***************************/
949 /* DECLARE LOCAL VARIABLES */
950 /***************************/
954 /*************************/
955 /* START BODY OF ROUTINE */
956 /*************************/
959 /****************************************************/
960 /* IF THE CURRENT GROUP IS "WSHFT", THEN DETERMINE */
961 /* WHETHER OR NOT THE GROUP THAT FOLLOWS IS A VALID */
962 /* WSHFT GROUP. IF IT IS, THEN DECODE THE GROUP */
963 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
964 /****************************************************/
966 if( *string == NULL )
969 if( strcmp( *string, "WSHFT" ) != 0 )
974 if( *string == NULL )
977 if( nisdigit(*string,strlen(*string)) && strlen(*string) <= 4)
979 temp = atoi( *string );
983 Mptr->WshfTime_hour = (atoi(*string))/100;
984 Mptr->WshfTime_minute = (atoi(*string)) % 100;
987 Mptr->WshfTime_minute = (atoi(*string)) % 100;
991 if( *string == NULL )
995 if( **string == '\0') {
1000 else if( strcmp( *string, "FROPA") == 0 )
1002 Mptr->Wshft_FROPA = TRUE;
1003 /********************************/
1004 /* VALID WIND SHIFT FOUND. BUMP */
1005 /* PAST WSHFT, WSHFT GROUP, AND */
1006 /* FROPA GROUPS AND RETURN TRUE.*/
1007 /********************************/
1014 /********************************/
1015 /* VALID WIND SHIFT FOUND. BUMP */
1016 /* PAST WSHFT AND WSHFT GROUP */
1017 /* AND RETURN TRUE. */
1018 /********************************/
1025 /**********************************/
1026 /* INVALID WIND SHIFT FOUND. BUMP */
1027 /* PAST WSHFT AND RETURN FALSE. */
1028 /********************************/
1033 #pragma subtitle(" ")
1035 #pragma subtitle("subtitle - description ")
1036 /********************************************************************/
1038 /* Title: isTowerVsby */
1039 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1040 /* Date: 15 Sep 1994 */
1041 /* Programmer: CARL MCCALLA */
1042 /* Language: C/370 */
1044 /* Abstract: Determine whether or not the current and subsequent */
1045 /* groups from the METAR report make up a valid report */
1046 /* of tower visibility. */
1049 /* Input: string - the addr of a ptr to a character string */
1050 /* that may or may not be the indicator */
1051 /* for tower visibility. */
1053 /* Mptr - a pointer to a structure that has the */
1054 /* data type Decoded_METAR. */
1056 /* NDEX - a pointer to an integer that is the index */
1057 /* into an array that contains the indi- */
1058 /* vidual groups of the METAR report being */
1059 /* decoded. Upon entry, NDEX is the index */
1060 /* of the current group of the METAR report */
1061 /* that is to be indentified. */
1063 /* Output: TRUE - if the input string (and subsequent grps) */
1064 /* are decoded as tower visibility. */
1065 /* FALSE - if the input string (and subsequent grps)*/
1066 /* are not decoded as tower visibility */
1067 /* External Functions Called: */
1070 /* Modification History: */
1073 /********************************************************************/
1075 static bool isTowerVsby( char **token, Decoded_METAR *Mptr, int *NDEX)
1078 /***************************/
1079 /* DECLARE LOCAL VARIABLES */
1080 /***************************/
1085 /*************************/
1086 /* START BODY OF ROUTINE */
1087 /*************************/
1090 /****************************************************************/
1091 /* IF THE CURRENT AND NEXT GROUPS ARE "TWR VIS", THEN DETERMINE */
1092 /* WHETHER OR NOT THE GROUP(S) THAT FOLLOWS IS(ARE) A VALID */
1093 /* TOWER VISIBILITY GROUP. IF IT IS, THEN DECODE THE GROUP */
1094 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
1095 /****************************************************************/
1097 if( *token == NULL )
1100 if(strcmp(*token,"TWR") != 0)
1105 if( *token == NULL )
1108 if( strcmp(*token,"VIS") != 0) {
1115 if( *token == NULL )
1118 if( nisdigit(*token,
1121 Mptr->TWR_VSBY = (float) atoi(*token);
1123 if( *token != NULL )
1125 if( (slash = strchr(*token, '/'))
1128 if( nisdigit(slash+1,strlen(slash+1)) &&
1132 T_vsby = fracPart(*token);
1133 Mptr->TWR_VSBY += T_vsby;
1163 else if( (slash = strchr(*token, '/'))
1166 if( nisdigit(slash+1,strlen(slash+1)) &&
1170 Mptr->TWR_VSBY = fracPart(*token);
1189 #pragma subtitle(" ")
1191 #pragma subtitle("subtitle - description ")
1192 /********************************************************************/
1194 /* Title: isSurfaceVsby */
1195 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1196 /* Date: 15 Sep 1994 */
1197 /* Programmer: CARL MCCALLA */
1198 /* Language: C/370 */
1200 /* Abstract: Determine whether or not the current and subsequent */
1201 /* groups from the METAR report make up a valid report */
1202 /* of surface visibility. */
1205 /* Input: string - the addr of a ptr to a character string */
1206 /* that may or may not be the indicator */
1207 /* for surface visibility. */
1209 /* Mptr - a pointer to a structure that has the */
1210 /* data type Decoded_METAR. */
1212 /* NDEX - a pointer to an integer that is the index */
1213 /* into an array that contains the indi- */
1214 /* vidual groups of the METAR report being */
1215 /* decoded. Upon entry, NDEX is the index */
1216 /* of the current group of the METAR report */
1217 /* that is to be indentified. */
1219 /* Output: TRUE - if the input string (and subsequent grps) */
1220 /* are decoded as surface visibility. */
1221 /* FALSE - if the input string (and subsequent grps)*/
1222 /* are not decoded as surface visibility. */
1223 /* External Functions Called: */
1226 /* Modification History: */
1229 /********************************************************************/
1231 static bool isSurfaceVsby( char **token, Decoded_METAR *Mptr,
1235 /***************************/
1236 /* DECLARE LOCAL VARIABLES */
1237 /***************************/
1243 /*************************/
1244 /* START BODY OF ROUTINE */
1245 /*************************/
1248 /****************************************************************/
1249 /* IF THE CURRENT AND NEXT GROUPS ARE "SFC VIS", THEN DETERMINE */
1250 /* WHETHER OR NOT THE GROUP(S) THAT FOLLOWS IS(ARE) A VALID */
1251 /* SURFACE VISIBILITY GROUP. IF IT IS, THEN DECODE THE GROUP */
1252 /* GROUP AND RETURN TRUE. OTHERWISE, RETURN FALSE. */
1253 /****************************************************************/
1255 if( *token == NULL )
1258 if(strcmp(*token,"SFC") != 0)
1263 if( strcmp(*token,"VIS") != 0) {
1271 if( *token == NULL )
1275 if( nisdigit(*token,
1278 Mptr->SFC_VSBY = (float) atoi(*token);
1280 if( *token != NULL )
1282 if( (slash = strchr(*token, '/'))
1285 if( nisdigit(slash+1,strlen(slash+1)) &&
1289 S_vsby = fracPart(*token);
1290 Mptr->SFC_VSBY += S_vsby;
1320 else if( (slash = strchr(*token, '/'))
1323 if( nisdigit(slash+1,strlen(slash+1)) &&
1327 Mptr->SFC_VSBY = fracPart(*token);
1347 #pragma subtitle(" ")
1349 #pragma subtitle("subtitle - description ")
1350 /********************************************************************/
1352 /* Title: isVariableVsby */
1353 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1354 /* Date: 21 Nov 1994 */
1355 /* Programmer: CARL MCCALLA */
1356 /* Language: C/370 */
1358 /* Abstract: Determine whether or not the current and subsequent */
1359 /* groups from the METAR report make up a valid report */
1360 /* of variable prevailing visibility. */
1363 /* Input: string - the addr of a ptr to a character string */
1364 /* that may or may not be the indicator */
1365 /* for variable prevailing visibility. */
1367 /* Mptr - a pointer to a structure that has the */
1368 /* data type Decoded_METAR. */
1370 /* NDEX - a pointer to an integer that is the index */
1371 /* into an array that contains the indi- */
1372 /* vidual groups of the METAR report being */
1373 /* decoded. Upon entry, NDEX is the index */
1374 /* of the current group of the METAR report */
1375 /* that is to be indentified. */
1377 /* Output: TRUE - if the input string (and subsequent grps) */
1378 /* are decoded as variable prevailing vsby. */
1379 /* FALSE - if the input string (and subsequent grps)*/
1380 /* are not decoded as variable prevailing */
1382 /* External Functions Called: */
1385 /* Modification History: */
1388 /********************************************************************/
1390 static bool isVariableVsby( char **string, Decoded_METAR *Mptr,
1394 /***************************/
1395 /* DECLARE LOCAL VARIABLES */
1396 /***************************/
1408 /*************************/
1409 /* START BODY OF ROUTINE */
1410 /*************************/
1413 /***************************************************/
1414 /* IF THE CURRENT GROUP IS "VIS", THEN DETERMINE */
1415 /* WHETHER OR NOT THE GROUPS THAT FOLLOW ARE VALID */
1416 /* VARIABLE PREVAILING VSBY. IF THEY ARE, THEN */
1417 /* DECODE THE GROUPS AND RETURN TRUE. OTHERWISE, */
1419 /***************************************************/
1421 if( *string == NULL )
1424 if( strcmp(*string, "VIS") != 0 )
1429 if( *string == NULL )
1432 if( !((V_char = strchr(*string, 'V')) != NULL ||
1433 nisdigit(*string,strlen(*string))) )
1435 else if( nisdigit(*string,strlen(*string)) ) {
1436 minimumVsby = (float) atoi(*string);
1439 if( *string == NULL )
1442 if( (V_char = strchr(*string,'V')) == NULL )
1445 if( (slash = strchr(*string,'/')) == NULL )
1448 if( nisdigit(*string,(slash - *string)) &&
1449 nisdigit(slash+1,(V_char-(slash+1))) &&
1450 nisdigit(V_char+1,strlen(V_char+1)) ) {
1451 if( (V_char - *string) > 4 )
1455 strncpy(buf,*string,(V_char - *string));
1456 Mptr->minVsby = minimumVsby + fracPart(buf);
1457 maximumVsby = (float) atoi(V_char+1);
1462 if( *string == NULL )
1465 if( (slash = strchr(*string,'/')) == NULL ) {
1466 Mptr->maxVsby = maximumVsby;
1472 else if( nisdigit(*string,(slash - *string)) &&
1473 nisdigit(slash+1, strlen(slash+1)) ) {
1474 Mptr->maxVsby = maximumVsby + fracPart(*string);
1482 Mptr->maxVsby = maximumVsby;
1495 if( (V_char = strchr(*string,'V')) == NULL )
1497 if(nisdigit(*string,(V_char - *string)) &&
1498 nisdigit(V_char+1,strlen(V_char+1)) ) {
1499 Mptr->minVsby = (float) antoi(*string,(V_char - *string));
1500 maximumVsby = (float) atoi(V_char+1);
1504 if( *string == NULL )
1507 if( (slash = strchr(*string,'/')) == NULL ) {
1508 Mptr->maxVsby = maximumVsby;
1513 else if( nisdigit(*string, (slash - *string)) &&
1514 nisdigit(slash+1,strlen(slash+1)) ) {
1515 Mptr->maxVsby = maximumVsby + fracPart( *string );
1522 Mptr->maxVsby = maximumVsby;
1529 if( (slash2 = strchr(V_char+1,'/')) == NULL &&
1530 (slash1 = strchr(*string,'/')) == NULL )
1532 else if( slash1 == NULL )
1534 else if( slash == slash2 )
1536 else if( nisdigit(*string,(slash1 - *string)) &&
1537 nisdigit((slash1+1),(V_char-(slash1+1))) ) {
1538 if( (V_char - *string) > 4 )
1542 strncpy(buf,*string,(V_char - *string));
1543 minimumVsby = fracPart(buf);
1545 if( slash2 == NULL) {
1546 if( nisdigit(V_char+1, strlen(V_char+1)) ) {
1547 maximumVsby = (float) atoi(V_char+1);
1551 if( *string == NULL )
1554 if( (slash = strchr(*string,'/')) == NULL ) {
1555 Mptr->minVsby = minimumVsby;
1556 Mptr->maxVsby = maximumVsby;
1561 else if( nisdigit(*string,(slash-*string)) &&
1562 nisdigit((slash+1),strlen(slash+1)) ) {
1563 Mptr->minVsby = minimumVsby;
1564 Mptr->maxVsby = maximumVsby +
1572 Mptr->minVsby = minimumVsby;
1573 Mptr->maxVsby = maximumVsby;
1583 if( nisdigit(V_char+1,(slash2-V_char+1)) &&
1584 nisdigit((slash2+1),strlen(slash2+1)) ) {
1585 Mptr->minVsby = minimumVsby;
1586 Mptr->maxVsby = fracPart(V_char+1);
1599 #pragma subtitle(" ")
1601 #pragma subtitle("subtitle - description ")
1602 /********************************************************************/
1604 /* Title: isVsby2ndSite */
1605 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1606 /* Date: 15 Sep 1994 */
1607 /* Programmer: CARL MCCALLA */
1608 /* Language: C/370 */
1610 /* Abstract: Determine whether or not the current and subsequent */
1611 /* groups from the METAR report make up a valid report */
1612 /* of visibility at a secondary site. */
1615 /* Input: token - the addr of a ptr to a character string */
1616 /* that may or may not be the indicator */
1617 /* for visibility at a secondary site. */
1619 /* Mptr - a pointer to a structure that has the */
1620 /* data type Decoded_METAR. */
1622 /* NDEX - a pointer to an integer that is the index */
1623 /* into an array that contains the indi- */
1624 /* vidual groups of the METAR report being */
1625 /* decoded. Upon entry, NDEX is the index */
1626 /* of the current group of the METAR report */
1627 /* that is to be indentified. */
1629 /* Output: TRUE - if the input string (and subsequent grps) */
1630 /* are decoded as visibility at a 2ndry site.*/
1631 /* FALSE - if the input string (and subsequent grps)*/
1632 /* are not decoded as visibility at a 2ndry */
1635 /* External Functions Called: */
1641 /* Modification History: */
1644 /********************************************************************/
1646 static bool isVsby2ndSite( char **token, Decoded_METAR *Mptr,
1650 /***************************/
1651 /* DECLARE LOCAL VARIABLES */
1652 /***************************/
1659 /*************************/
1660 /* START BODY OF ROUTINE */
1661 /*************************/
1664 /***************************************************/
1665 /* IF THE CURRENT GROUP IS "VIS", THEN DETERMINE */
1666 /* WHETHER OR NOT THE GROUPS THAT FOLLOW ARE VALID */
1667 /* VSBILITY AT A 2NDRY SITE. IF THEY ARE, THEN */
1668 /* DECODE THE GROUPS AND RETURN TRUE. OTHERWISE, */
1670 /***************************************************/
1672 if( *token == NULL )
1675 if(strcmp(*token,"VIS") != 0)
1680 if( *token == NULL )
1683 if( nisdigit(*token,
1686 VSBY_2ndSite = (float) atoi(*token);
1688 if( *token != NULL )
1690 if( (slash = strchr(*token, '/'))
1693 if( nisdigit(slash+1,strlen(slash+1)) &&
1697 S_vsby = fracPart(*token);
1701 if( *token == NULL )
1704 if( strncmp( *token, "RY", 2 ) == 0) {
1705 if( nisalnum( *token, strlen(*token) ) ) {
1706 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1707 Mptr->VSBY_2ndSite = VSBY_2ndSite + S_vsby;
1721 if( strncmp( *token, "RY", 2 ) == 0) {
1722 if( nisalnum( *token, strlen(*token) ) ) {
1723 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1724 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1739 if( strncmp( *token, "RY", 2 ) == 0) {
1740 if( nisalnum( *token, strlen(*token) ) ) {
1741 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1742 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1756 if( strncmp( *token, "RY", 2 ) == 0) {
1757 if( nisalnum( *token, strlen(*token) ) ) {
1758 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1759 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1773 else if( (slash = strchr(*token, '/'))
1776 if( nisdigit(slash+1,strlen(slash+1)) &&
1780 VSBY_2ndSite = fracPart(*token);
1781 if( strncmp( *(++token), "RY", 2 ) == 0) {
1782 if( nisalnum( *token, strlen(*token) ) ) {
1783 Mptr->VSBY_2ndSite = VSBY_2ndSite;
1784 strcpy(Mptr->VSBY_2ndSite_LOC, *token);
1804 #pragma subtitle(" ")
1806 #pragma subtitle("subtitle - description ")
1807 /********************************************************************/
1809 /* Title: isLTGfreq */
1810 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
1811 /* Date: 15 Sep 1994 */
1812 /* Programmer: CARL MCCALLA */
1813 /* Language: C/370 */
1815 /* Abstract: Determine whether or not the current and subsequent */
1816 /* groups from the METAR report make up a valid report */
1820 /* Input: string - the addr of a ptr to a character string */
1821 /* that may or may not be the indicator */
1822 /* for lightning. */
1824 /* Mptr - a pointer to a structure that has the */
1825 /* data type Decoded_METAR. */
1827 /* NDEX - a pointer to an integer that is the index */
1828 /* into an array that contains the indi- */
1829 /* vidual groups of the METAR report being */
1830 /* decoded. Upon entry, NDEX is the index */
1831 /* of the current group of the METAR report */
1832 /* that is to be indentified. */
1834 /* Output: TRUE - if the input string (and subsequent grps) */
1835 /* are decoded as lightning. */
1836 /* FALSE - if the input string (and subsequent grps)*/
1837 /* are not decoded as lightning. */
1839 /* External Functions Called: */
1843 /* Modification History: */
1844 /* 09 May 1996: Software modified to properly */
1845 /* decode lightning types. */
1849 /********************************************************************/
1852 bool static isLTGfreq( char **string, Decoded_METAR *Mptr, int *NDEX )
1855 /***************************/
1856 /* DECLARE LOCAL VARIABLES */
1857 /***************************/
1866 /*************************/
1867 /* START BODY OF ROUTINE */
1868 /*************************/
1872 /***************************************************/
1873 /* IF THE CURRENT GROUP IS "LTG", THEN DETERMINE */
1874 /* WHETHER OR NOT THE PREVIOUS GROUP AS WELL AS */
1875 /* GROUPS THAT FOLLOW ARE VALID LIGHTNING REPORT */
1876 /* PARAMETERS. IF THEY ARE, THEN DECODE THE */
1877 /* GROUPS AND RETURN TRUE. OTHERWISE, RETURN */
1879 /***************************************************/
1881 if( *string == NULL )
1884 if( strcmp(*string,"VCTS") == 0 ) {
1885 Mptr->LightningVCTS = TRUE;
1891 if( *string == NULL )
1894 if( strncmp( *string, "LTG", 3 ) != 0 ) {
1899 if( *string == NULL )
1905 LTG_FREQ_FLAG = FALSE;
1906 /*-- CHECK FOR LIGHTNING FREQUENCY -----------*/
1907 if( strcmp( *string, "OCNL" ) == 0 ) {
1908 Mptr->OCNL_LTG = TRUE;
1909 LTG_FREQ_FLAG = TRUE;
1911 else if( strcmp( *string, "FRQ" ) == 0 ) {
1912 Mptr->FRQ_LTG = TRUE;
1913 LTG_FREQ_FLAG = TRUE;
1915 else if( strcmp( *string, "CNS" ) == 0 ) {
1916 Mptr->CNS_LTG = TRUE;
1917 LTG_FREQ_FLAG = TRUE;
1923 if( *string == NULL )
1927 if( strcmp( *string, "LTG") == 0 ) {
1930 if( *string == NULL )
1935 LTG_LOC_FLAG = FALSE;
1936 /*-- CHECK FOR LIGHTNING LOCATION ------------*/
1937 if( strcmp( *string, "DSNT" ) == 0 ) {
1938 Mptr->DSNT_LTG = TRUE;
1939 LTG_LOC_FLAG = TRUE;
1941 else if( strcmp( *string, "AP" ) == 0 ) {
1942 Mptr->AP_LTG = TRUE;
1943 LTG_LOC_FLAG = TRUE;
1945 else if( strcmp( *string, "VCY" ) == 0 ||
1946 strcmp( *string, "VC" ) == 0 ) {
1947 Mptr->VcyStn_LTG = TRUE;
1948 LTG_LOC_FLAG = TRUE;
1950 else if( strcmp( *string, "OVHD" ) == 0 ||
1951 strcmp( *string, "OHD" ) == 0 ) {
1952 Mptr->OVHD_LTG = TRUE;
1953 LTG_LOC_FLAG = TRUE;
1959 if( *string == NULL ) {
1965 LTG_DIR_FLAG = FALSE;
1966 /*-- CHECK FOR LIGHTNING DIRECTION -----------*/
1967 if( strcmp( *string, "N" ) == 0 ||
1968 strcmp( *string, "NE" ) == 0 ||
1969 strcmp( *string, "NW" ) == 0 ||
1970 strcmp( *string, "S" ) == 0 ||
1971 strcmp( *string, "SE" ) == 0 ||
1972 strcmp( *string, "SW" ) == 0 ||
1973 strcmp( *string, "E" ) == 0 ||
1974 strcmp( *string, "W" ) == 0 ) {
1975 strcpy( Mptr->LTG_DIR, *string);
1976 LTG_DIR_FLAG = TRUE;
1989 LTG_TYPE_FLAG = FALSE;
1990 /*-- CHECK FOR LIGHTNING TYPE ----------------*/
1991 TYPE_NOT_FOUND = FALSE;
1992 temp = (*string) + 3;
1993 while( *temp != '\0' && !TYPE_NOT_FOUND ) {
1994 if( strncmp( temp, "CG", 2 ) == 0 ) {
1995 Mptr->CG_LTG = TRUE;
1996 LTG_TYPE_FLAG = TRUE;
2000 else if( strncmp( temp, "IC", 2 ) == 0 ) {
2001 Mptr->IC_LTG = TRUE;
2002 LTG_TYPE_FLAG = TRUE;
2006 else if( strncmp( temp, "CC", 2 ) == 0 ) {
2007 Mptr->CC_LTG = TRUE;
2008 LTG_TYPE_FLAG = TRUE;
2012 else if( strncmp( temp, "CA", 2 ) == 0 ) {
2013 Mptr->CA_LTG = TRUE;
2014 LTG_TYPE_FLAG = TRUE;
2019 TYPE_NOT_FOUND = TRUE;
2024 if( *string == NULL ) {
2031 LTG_LOC_FLAG = FALSE;
2032 /*-- CHECK FOR LIGHTNING LOCATION ------------*/
2033 if( strcmp( *string, "DSNT" ) == 0 ) {
2034 Mptr->DSNT_LTG = TRUE;
2035 LTG_LOC_FLAG = TRUE;
2037 else if( strcmp( *string, "AP" ) == 0 ) {
2038 Mptr->AP_LTG = TRUE;
2039 LTG_LOC_FLAG = TRUE;
2041 else if( strcmp( *string, "VCY" ) == 0 ||
2042 strcmp( *string, "VC" ) == 0 ) {
2043 Mptr->VcyStn_LTG = TRUE;
2044 LTG_LOC_FLAG = TRUE;
2046 else if( strcmp( *string, "OVHD" ) == 0 ) {
2047 Mptr->OVHD_LTG = TRUE;
2048 LTG_LOC_FLAG = TRUE;
2054 if( *string == NULL ) {
2062 LTG_DIR_FLAG = FALSE;
2063 /*-- CHECK FOR LIGHTNING DIRECTION -----------*/
2064 if( strcmp( *string, "N" ) == 0 ||
2065 strcmp( *string, "NE" ) == 0 ||
2066 strcmp( *string, "NW" ) == 0 ||
2067 strcmp( *string, "S" ) == 0 ||
2068 strcmp( *string, "SE" ) == 0 ||
2069 strcmp( *string, "SW" ) == 0 ||
2070 strcmp( *string, "E" ) == 0 ||
2071 strcmp( *string, "W" ) == 0 ) {
2072 strcpy( Mptr->LTG_DIR, *string);
2073 LTG_DIR_FLAG = TRUE;
2091 #pragma comment (compiler)
2092 //#pragma comment (date)
2093 //#pragma comment (timestamp)
2094 #pragma pagesize(80)
2096 #include "Metar.h" /* standard header file */
2098 #pragma subtitle(" ")
2100 #pragma subtitle("subtitle - description ")
2101 /********************************************************************/
2103 /* Title: isRecentWx */
2104 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2105 /* Date: 15 Sep 1994 */
2106 /* Programmer: CARL MCCALLA */
2107 /* Language: C/370 */
2109 /* Abstract: Determine whether or not the current and subsequent */
2110 /* groups from the METAR report make up a valid report */
2111 /* recent weather. */
2113 /* Input: token - the addr of a ptr to a character token */
2114 /* that may or may not be a recent weather */
2117 /* Mptr - a pointer to a structure that has the */
2118 /* data type Decoded_METAR. */
2120 /* NDEX - a pointer to an integer that is the i*NDEX */
2121 /* into an array that contains the indi- */
2122 /* vidual groups of the METAR report being */
2123 /* decoded. Upon entry, NDEX is the i*NDEX */
2124 /* of the current group of the METAR report */
2125 /* that is to be indentified. */
2127 /* Output: TRUE - if the input token (and possibly subse- */
2128 /* quent groups) are decoded as recent wx. */
2129 /* FALSE - if the input token (and possibly subse- */
2130 /* quent groups) are not decoded as recent */
2133 /* External Functions Called: */
2140 /* Modification History: */
2143 /********************************************************************/
2145 static bool isRecentWX( char **token, Decoded_METAR *Mptr,
2148 static char *phenom[] = {"-DZB", "DZB", "+DZB",
2149 "FZDZB", "-RAB", "RAB", "+RAB",
2150 "SHRAB", "TSRAB", "FZRAB", "-SNB",
2151 "SNB", "+SNB", "DRSNB", "BLSNB",
2152 "SHSNB", "TSSNB", "-SGB", "SGB",
2153 "+SGB", "ICB", "-PEB", "PEB", "+PEB",
2154 "SHPEB", "TSPEB", "GRB", "SHGRB",
2155 "TSGRB", "GSB", "SHGSB", "TSGSB", "-GSB",
2156 "+GSB", "TSB", "VCTSB", "-TSRAB",
2157 "TSRAB", "+TSRAB", "-TSSNB", "TSSNB",
2158 "+TSSNB", "-TSPEB", "TSPEB", "+TSPEB",
2159 "-TSGSB", "TSGSB", "+TSGSB",
2160 "VCSHB", "-SHRAB", "+SHRAB", "-SHSNB",
2161 "+SHSNB", "-SHPEB", "+SHPEB",
2162 "-SHGSB", "+SHGSB", "-FZDZB", "+FZDZB",
2163 "-FZRAB", "+FZRAB", "FZFGB",
2164 "+FZFGB", "BRB", "FGB", "VCFGB", "MIFGB",
2165 "PRFGB", "BCFGB", "FUB",
2166 "VAB", "DUB", "DRDUB", "BLDUB", "SAB",
2167 "DRSAB", "BLSAB", "HZB",
2168 "BLPYB", "BLSNB", "+BLSNB", "VCBLSNB",
2170 "VCBLSAB", "+BLDUB", "VCBLDUB", "POB",
2171 "VCPOB", "SQB", "FCB", "+FCB",
2172 "VCFCB", "SSB", "+SSB", "VCSSB", "DSB",
2176 "-DZE", "DZE", "+DZE",
2177 "FZDZE", "-RAE", "RAE", "+RAE",
2178 "SHRAE", "TSRAE", "FZRAE", "-SNE",
2179 "SNE", "+SNE", "DRSNE", "BLSNE",
2180 "SHSNE", "TSSNE", "-SGE", "SGE",
2181 "+SGE", "ICE", "-PEE", "PEE", "+PEE",
2182 "SHPEE", "TSPEE", "GRE", "SHGRE",
2183 "TSGRE", "GSE", "SHGSE", "TSGSE", "-GSE",
2184 "+GSE", "TSE", "VCTSE", "-TSRAE",
2185 "TSRAE", "+TSRAE", "-TSSNE", "TSSNE",
2186 "+TSSNE", "-TSPEE", "TSPEE", "+TSPEE",
2187 "-TSGSE", "TSGSE", "+TSGSE",
2188 "VCSHE", "-SHRAE", "+SHRAE", "-SHSNE",
2189 "+SHSNE", "-SHPEE", "+SHPEE",
2190 "-SHGSE", "+SHGSE", "-FZDZE", "+FZDZE",
2191 "-FZRAE", "+FZRAE", "FZFGE",
2192 "+FZFGE", "BRE", "FGE", "VCFGE", "MIFGE",
2193 "PRFGE", "BCFGE", "FUE",
2194 "VAE", "DUE", "DRDUE", "BLDUE", "SAE",
2195 "DRSAE", "BLSAE", "HZE",
2196 "BLPYE", "BLSNE", "+BLSNE", "VCBLSNE",
2198 "VCBLSAE", "+BLDUE", "VCBLDUE", "POE",
2199 "VCPOE", "SQE", "FCE", "+FCE",
2200 "VCFCE", "SSE", "+SSE", "VCSSE", "DSE",
2201 "+DSE", "VCDSE", "4-Zs"};
2215 if( *token == NULL )
2218 if( (free_temp = temp = (char *) malloc(sizeof(char) *
2219 (strlen(*token) + 1))) == NULL ) {
2223 strcpy(temp,*token);
2225 while ( *temp != '\0' ) {
2229 beg_hour = beg_min = end_hour = end_min = MAXINT;
2231 while( strncmp(temp, phenom[i],strlen(phenom[i])) != 0 &&
2232 strcmp(phenom[i],"4-Zs") != 0 )
2235 if( strcmp(phenom[i],"4-Zs") != 0 ) {
2237 printf("PHENOM = %s\n",phenom[i]);
2239 C_char = (strlen(phenom[i]) - 1) + temp;
2240 numb_char = C_char + 1;
2242 if( *numb_char == '\0')
2245 if( nisdigit(numb_char,4) && strlen(numb_char) >= 4) {
2246 if( *C_char == 'B' ) {
2247 beg_hour = antoi( numb_char, 2 );
2248 beg_min = antoi( numb_char+2,2 );
2250 printf("BEG_HOUR1 = %d\n",beg_hour);
2251 printf("BEG_MIN1 = %d\n",beg_min );
2256 Mptr->ReWx[*NDEX].Bmm = beg_min;
2257 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2260 if( *(numb_char+4) == 'E' ) {
2262 if( nisdigit(numb_char,4) &&
2263 strlen(numb_char) >= 4 ) {
2264 end_hour = antoi( numb_char, 2 );
2265 end_min = antoi( numb_char+2,2 );
2267 printf("END_HOUR2 = %d\n",end_hour);
2268 printf("END_MIN2 = %d\n",end_min );
2273 Mptr->ReWx[*NDEX].Emm = end_min;
2274 Mptr->ReWx[*NDEX].Ehh = end_hour;
2277 else if( nisdigit(numb_char,2) &&
2278 strlen(numb_char) >= 2 ) {
2279 end_min = antoi( numb_char,2 );
2282 Mptr->ReWx[*NDEX].Emm = end_min;
2284 printf("END_MIN3 = %d\n",end_min );
2293 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2294 phenom[i], (strlen(phenom[i])-1) );
2301 end_hour = antoi( numb_char, 2 );
2302 end_min = antoi( numb_char+2,2 );
2305 Mptr->ReWx[*NDEX].Emm = end_min;
2306 Mptr->ReWx[*NDEX].Ehh = end_hour;
2309 printf("END_HOUR4 = %d\n",end_hour);
2310 printf("END_MIN4 = %d\n",end_min );
2316 if( *(numb_char+4) == 'B' ) {
2318 if( nisdigit(numb_char,4) &&
2319 strlen(numb_char) >= 4 ) {
2320 /* beg_hour = antoi( numb_char, 2 );
2321 beg_min = antoi( numb_char+2,2 ); */
2324 Mptr->ReWx[*NDEX].Bmm = beg_min;
2325 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2328 printf("BEG_HOUR5 = %d\n",beg_hour);
2329 printf("BEG_MIN5 = %d\n",beg_min );
2335 else if( nisdigit(numb_char,2) &&
2336 strlen(numb_char) >= 2 ) {
2337 beg_min = antoi( numb_char,2 );
2340 Mptr->ReWx[*NDEX].Bmm = beg_min;
2342 printf("BEG_MIN6 = %d\n",beg_min );
2352 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2353 phenom[i], (strlen(phenom[i])-1) );
2361 else if(nisdigit(numb_char,2) && strlen(numb_char) >= 2 ) {
2362 if( *C_char == 'B' ) {
2363 beg_min = antoi( numb_char,2 );
2366 Mptr->ReWx[*NDEX].Bmm = beg_min;
2368 printf("BEG_MIN7 = %d\n",beg_min );
2374 if( *(numb_char+2) == 'E' ) {
2376 if( nisdigit(numb_char,4) &&
2377 strlen(numb_char) >= 4 ) {
2378 end_hour = antoi( numb_char,2 );
2379 end_min = antoi( numb_char+2,2 );
2382 Mptr->ReWx[*NDEX].Emm = end_min;
2383 Mptr->ReWx[*NDEX].Ehh = end_hour;
2386 printf("END_HOUR8 = %d\n",end_hour);
2387 printf("END_MIN8 = %d\n",end_min );
2393 else if( nisdigit(numb_char,2) &&
2394 strlen(numb_char) >= 2 ) {
2395 end_min = antoi( numb_char,2 );
2398 Mptr->ReWx[*NDEX].Emm = end_min;
2400 printf("END_MIN9 = %d\n",end_min );
2409 end_min = antoi( numb_char, 2 );
2412 Mptr->ReWx[*NDEX].Emm = end_min;
2414 printf("END_MIN10 = %d\n",end_min );
2420 if( *(numb_char+2) == 'B' ) {
2422 if( nisdigit(numb_char,4) &&
2423 strlen(numb_char) >= 4 ) {
2424 beg_hour = antoi( numb_char,2 );
2425 beg_min = antoi( numb_char+2,2 );
2428 Mptr->ReWx[*NDEX].Bmm = beg_min;
2429 Mptr->ReWx[*NDEX].Bhh = beg_hour;
2432 printf("BEG_HOUR11 = %d\n",beg_hour);
2433 printf("BEG_MIN11 = %d\n",beg_min );
2439 else if( nisdigit(numb_char,2) &&
2440 strlen(numb_char) >= 2 ) {
2441 beg_min = antoi( numb_char,2 );
2444 Mptr->ReWx[*NDEX].Bmm = beg_min;
2446 printf("BEG_MIN12 = %d\n",beg_min );
2458 strncpy(Mptr->ReWx[*NDEX].Recent_weather,
2459 phenom[i], (strlen(phenom[i])-1) );
2481 #pragma subtitle(" ")
2483 #pragma subtitle("subtitle - description ")
2484 /********************************************************************/
2486 /* Title: isVariableCIG */
2487 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2488 /* Date: 21 Nov 1994 */
2489 /* Programmer: CARL MCCALLA */
2490 /* Language: C/370 */
2492 /* Abstract: isVariableCIG determines whether or not the */
2493 /* current group in combination with the next */
2494 /* one or more groups is a report of variable */
2497 /* External Functions Called: */
2500 /* Input: token - a pointer to an array of METAR report */
2502 /* Mptr - a pointer to a decoded_METAR structure */
2503 /* NDEX - the index value of the current METAR */
2504 /* report group array element. */
2506 /* Output: TRUE, if the token is currently pointing to */
2507 /* METAR report group(s) that a report of vari- */
2510 /* Modification History: */
2513 /********************************************************************/
2515 static bool isVariableCIG( char **token, Decoded_METAR *Mptr,
2520 if( *token == NULL )
2523 if( strcmp(*token, "CIG") != 0 )
2528 if( *token == NULL )
2531 if( (V_char = strchr(*token,'V')) != NULL ) {
2532 if( nisdigit(*token, (V_char - *token)) &&
2533 nisdigit( V_char+1, strlen(V_char+1)) ) {
2534 Mptr->minCeiling = antoi(*token, (V_char - *token));
2535 Mptr->maxCeiling = atoi(V_char+1);
2547 #pragma subtitle(" ")
2549 #pragma subtitle("subtitle - description ")
2550 /********************************************************************/
2552 /* Title: isCeil2ndSite */
2553 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2554 /* Date: 15 Sep 1994 */
2555 /* Programmer: CARL MCCALLA */
2556 /* Language: C/370 */
2558 /* Abstract: isCeil2ndSite determines whether or not the */
2559 /* current group in combination with the next */
2560 /* one or more groups is a report of a ceiling */
2561 /* at a secondary site. */
2563 /* External Functions Called: */
2566 /* Input: token - a pointer to an array of METAR report */
2568 /* Mptr - a pointer to a decoded_METAR structure */
2569 /* NDEX - the index value of the current METAR */
2570 /* report group array element. */
2572 /* Output: TRUE, if the token is currently pointing to */
2573 /* METAR report group(s) that are reporting */
2574 /* ceiling at a secondary site. */
2576 /* External Functions Called: */
2580 /* Modification History: */
2583 /********************************************************************/
2585 static bool isCIG2ndSite( char **token, Decoded_METAR *Mptr,
2590 if( (*token) == NULL )
2593 if(strcmp(*token,"CIG") != 0)
2598 if( (*token) == NULL )
2601 if( strlen(*token) != 3 )
2604 if( nisdigit(*token,3) )
2606 CIG2ndSite = atoi(*token ) * 10;
2608 if( strncmp(*(++token),"RY",2) != 0)
2611 strcpy(Mptr->CIG_2ndSite_LOC, *token );
2612 Mptr->CIG_2ndSite_Meters = CIG2ndSite;
2623 #pragma subtitle(" ")
2625 #pragma subtitle("subtitle - description ")
2626 /********************************************************************/
2628 /* Title: isPRESFR */
2629 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2630 /* Date: 20 Nov 1994 */
2631 /* Programmer: CARL MCCALLA */
2632 /* Language: C/370 */
2645 /* External Functions Called: */
2670 /* Modification History: */
2673 /********************************************************************/
2676 static bool isPRESFR( char *string, Decoded_METAR *Mptr, int *NDEX)
2679 if( string == NULL )
2682 if( strcmp(string, "PRESFR") != 0 )
2685 Mptr->PRESFR = TRUE;
2691 #pragma subtitle(" ")
2693 #pragma subtitle("subtitle - description ")
2694 /********************************************************************/
2696 /* Title: isPRESRR */
2697 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2698 /* Date: 20 Nov 1994 */
2699 /* Programmer: CARL MCCALLA */
2700 /* Language: C/370 */
2713 /* External Functions Called: */
2738 /* Modification History: */
2741 /********************************************************************/
2744 static bool isPRESRR( char *string, Decoded_METAR *Mptr, int *NDEX)
2747 if( string == NULL )
2750 if( strcmp(string, "PRESRR") != 0 )
2753 Mptr->PRESRR = TRUE;
2760 #pragma subtitle(" ")
2762 #pragma subtitle("subtitle - description ")
2763 /********************************************************************/
2766 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2767 /* Date: 15 Sep 1994 */
2768 /* Programmer: CARL MCCALLA */
2769 /* Language: C/370 */
2773 /* External Functions Called: */
2780 /* Modification History: */
2783 /********************************************************************/
2786 static bool isSLP( char **token, Decoded_METAR *Mptr, int *NDEX )
2789 /***************************/
2790 /* DECLARE LOCAL VARIABLES */
2791 /***************************/
2796 /*************************/
2797 /* BEGIN BODY OF ROUTINE */
2798 /*************************/
2800 if( *token == NULL )
2803 if( strcmp(*token, "SLPNO") == 0 ) {
2810 if( strncmp(*token, "SLP", 3) != 0 )
2814 if( strncmp(*token, "SLP", 3) == 0 &&
2815 strcmp(*token,"SLP") != 0 )
2817 if( nisdigit( *token+3, 3) )
2819 pressure = atoi(*token+3);
2821 if(pressure >= 550 )
2822 Mptr->SLP = ((float) pressure)/10. + 900.;
2824 Mptr->SLP = ((float) pressure)/10. + 1000.;
2835 if( *token == NULL )
2838 if( nisdigit( *token, 3) )
2840 pressure = atoi(*token);
2842 if(pressure >= 550 )
2843 Mptr->SLP = ((float) pressure)/10. + 900.;
2845 Mptr->SLP = ((float) pressure)/10. + 1000.;
2859 static bool isSectorVsby( char **string, Decoded_METAR *Mptr,
2862 /***************************/
2863 /* DECLARE LOCAL VARIABLES */
2864 /***************************/
2870 /*************************/
2871 /* START BODY OF ROUTINE */
2872 /*************************/
2874 if( *string == NULL )
2877 memset( dd, '\0', 3 );
2879 if( strcmp(*string, "VIS") != 0 )
2884 if( *string == NULL )
2887 if( strncmp(*string,"NE", 2) == 0 )
2888 strncpy(dd,*string,2);
2889 else if( strncmp(*string,"SE",2) == 0 )
2890 strncpy(dd,*string,2);
2891 else if( strncmp(*string,"NW",2) == 0 )
2892 strncpy(dd,*string,2);
2893 else if( strncmp(*string,"SW",2) == 0 )
2894 strncpy(dd,*string,2);
2895 else if( strncmp(*string,"N",1) == 0 )
2896 strncpy(dd,*string,1);
2897 else if( strncmp(*string,"E",1) == 0 )
2898 strncpy(dd,*string,1);
2899 else if( strncmp(*string,"S",1) == 0 )
2900 strncpy(dd,*string,1);
2901 else if( strncmp(*string,"W",1) == 0 )
2902 strncpy(dd,*string,1);
2906 if(nisdigit((*string+strlen(dd)),(strlen(*string)-strlen(dd))))
2907 vsby = atoi((*string+strlen(dd)));
2910 if( *string == NULL )
2913 if( (slash = strchr(*string,'/')) == NULL ) {
2914 strcpy(Mptr->SectorVsby_Dir,dd);
2915 Mptr->SectorVsby = vsby;
2920 else if( nisdigit(*string,(slash-*string)) &&
2921 nisdigit(slash+1,strlen(slash+1)) ) {
2922 vsby += fracPart(*string);
2923 strcpy( Mptr->SectorVsby_Dir, dd );
2924 Mptr->SectorVsby = vsby;
2936 #pragma subtitle(" ")
2938 #pragma subtitle("subtitle - description ")
2939 /********************************************************************/
2942 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
2943 /* Date: 20 Nov 1994 */
2944 /* Programmer: CARL MCCALLA */
2945 /* Language: C/370 */
2958 /* External Functions Called: */
2983 /* Modification History: */
2986 /********************************************************************/
2988 static bool isGR( char **string, Decoded_METAR *Mptr, int *NDEX)
2992 if( *string == NULL )
2995 if( strcmp(*string, "GS") == 0 ) {
3002 if( strcmp(*string, "GR") != 0 )
3007 if( *string == NULL )
3010 if( (slash = strchr( *string, '/' )) != NULL ) {
3011 if( strcmp( *string, "M1/4" ) == 0 ) {
3012 Mptr->GR_Size = 1./8.;
3018 else if( nisdigit( *string, (slash - *string) ) &&
3019 nisdigit( slash+1, strlen(slash+1)) ) {
3020 Mptr->GR_Size = fracPart( *string );
3032 else if( nisdigit( *string, strlen(*string) ) ) {
3033 Mptr->GR_Size = antoi( *string, strlen(*string) );
3038 if( *string == NULL )
3041 if( (slash = strchr( *string, '/' )) != NULL ) {
3042 if( nisdigit( *string, (slash - *string) ) &&
3043 nisdigit( slash+1, strlen(slash+1)) ) {
3044 Mptr->GR_Size += fracPart( *string );
3070 #pragma subtitle(" ")
3072 #pragma subtitle("subtitle - description ")
3073 /********************************************************************/
3075 /* Title: isVIRGA */
3076 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3077 /* Date: 20 Nov 1994 */
3078 /* Programmer: CARL MCCALLA */
3079 /* Language: C/370 */
3092 /* External Functions Called: */
3117 /* Modification History: */
3120 /********************************************************************/
3123 static bool isVIRGA( char **string, Decoded_METAR *Mptr, int *NDEX)
3126 if( *string == NULL )
3129 if( strcmp(*string, "VIRGA") != 0 )
3137 if( *string == NULL )
3141 if( strcmp( *string, "N" ) == 0 ||
3142 strcmp( *string, "S" ) == 0 ||
3143 strcmp( *string, "E" ) == 0 ||
3144 strcmp( *string, "W" ) == 0 ||
3145 strcmp( *string, "NE" ) == 0 ||
3146 strcmp( *string, "NW" ) == 0 ||
3147 strcmp( *string, "SE" ) == 0 ||
3148 strcmp( *string, "SW" ) == 0 ) {
3149 strcpy(Mptr->VIRGA_DIR, *string);
3158 static bool isSfcObscuration( char *string, Decoded_METAR *Mptr,
3161 /***************************/
3162 /* DECLARE LOCAL VARIABLES */
3163 /***************************/
3165 static char *WxSymbols[] = {"BCFG", "BLDU", "BLSA", "BLPY",
3166 "DRDU", "DRSA", "DRSN", "DZ", "DS", "FZFG", "FZDZ", "FZRA",
3167 "FG", "FC", "FU", "GS", "GR", "HZ", "IC", "MIFG",
3168 "PE", "PO", "RA", "SHRA", "SHSN", "SHPE", "SHGS",
3169 "SHGR", "SN", "SG", "SQ", "SA", "SS", "TSRA",
3170 "TSSN", "TSPE", "TSGS", "TSGR", "TS",
3171 "VCSH", "VCPO", "VCBLDU", "VCBLSA", "VCBLSN",
3172 "VCFG", "VCFC","VA", NULL};
3181 /*************************/
3182 /* START BODY OF ROUTINE */
3183 /*************************/
3185 if( string == NULL )
3188 memset( ww, '\0', sizeof(ww) );
3190 if( strlen(string) < 4 )
3193 if( strncmp(string, "-X",2 ) != 0 )
3196 if( !(nisdigit(string+(strlen(string)-1), 1)) )
3200 strncpy( ww, temp, (strlen(string)-2) );
3204 numLoc = temp + (strlen(temp) - 1 );
3206 while( temp < numLoc && ndex < 6 ) {
3209 IS_NOT_FOUND = TRUE;
3211 while( WxSymbols[i] != NULL && IS_NOT_FOUND ) {
3212 if( strncmp( WxSymbols[i], temp, strlen(WxSymbols[i]))
3216 IS_NOT_FOUND = FALSE;
3219 if( WxSymbols[i] == NULL ) {
3224 strcpy(&(Mptr->SfcObscuration[ndex][0]),WxSymbols[i]);
3225 temp += strlen(WxSymbols[i]);
3232 Mptr->Num8thsSkyObscured = antoi( numLoc,1 );
3246 static bool isCeiling( char *string, Decoded_METAR *Mptr, int *NDEX )
3249 if( string == NULL )
3252 if( !(strncmp(string,"CIG",3) == 0 && strlen(string) >= 5) )
3255 if( strcmp(string, "CIGNO") == 0 ) {
3260 else if( strlen( string+3 ) == 3 ) {
3261 if( nisdigit(string+3, strlen(string+3)) &&
3262 strlen(string+3) == 3 ) {
3263 Mptr->Ceiling = atoi(string+3) * 100;
3270 else if( strlen(string+3) == 4 ) {
3271 if( *(string+3) == 'E' && nisdigit(string+4,3) ) {
3272 Mptr->Estimated_Ceiling = antoi(string+4,3) * 100;
3286 static bool isVrbSky( char **string, Decoded_METAR *Mptr, int *NDEX )
3288 static char *cldPtr[] = {"FEW", "SCT", "BKN", "OVC", NULL };
3291 char SKY1[ SKY1_len ];
3294 if( *string == NULL )
3298 memset( SKY1, '\0', SKY1_len );
3300 IS_NOT_FOUND = TRUE;
3302 while( cldPtr[i] != NULL && IS_NOT_FOUND ) {
3304 printf("isVrbSky: *string = %s cldPtr[%d] = %s\n",
3305 *string,i,cldPtr[i]);
3307 if( strncmp(*string, cldPtr[i], strlen(cldPtr[i])) != 0 )
3310 IS_NOT_FOUND = FALSE;
3313 if( cldPtr[i] == NULL )
3317 printf("isVrbSky: *string = %s = cldPtr[%d] = %s\n",
3318 *string,i,cldPtr[i]);
3320 strcpy( SKY1, cldPtr[i] );
3324 if( *string == NULL )
3328 if( strcmp(*string, "V") != 0 )
3333 if( *string == NULL )
3337 IS_NOT_FOUND = TRUE;
3338 while( cldPtr[i] != NULL && IS_NOT_FOUND ) {
3340 printf("isVrbSky: *string = %s cldPtr[%d] = %s\n",
3341 *string,i,cldPtr[i]);
3343 if( strncmp(*string, cldPtr[i], strlen(cldPtr[i])) != 0 )
3346 IS_NOT_FOUND = FALSE;
3349 if( cldPtr[i] == NULL ) {
3355 if(strlen(SKY1) == 6 ) {
3356 if( nisdigit(SKY1+3,3)) {
3357 strncpy(Mptr->VrbSkyBelow,SKY1,3);
3358 strcpy(Mptr->VrbSkyAbove,cldPtr[i]);
3359 Mptr->VrbSkyLayerHgt = antoi(SKY1+3,3)*100;
3373 strcpy(Mptr->VrbSkyBelow,SKY1);
3374 strcpy(Mptr->VrbSkyAbove,cldPtr[i]);
3390 static bool isObscurAloft( char **string, Decoded_METAR *Mptr,
3394 /***************************/
3395 /* DECLARE LOCAL VARIABLES */
3396 /***************************/
3398 static char *WxSymbols[] = {"BCFG", "BLDU", "BLSA", "BLPY",
3399 "DRDU", "DRSA", "DRSN", "DZ", "DS", "FZFG", "FZDZ", "FZRA",
3400 "FG", "FC", "FU", "GS", "GR", "HZ", "IC", "MIFG",
3401 "PE", "PO", "RA", "SHRA", "SHSN", "SHPE", "SHGS",
3402 "SHGR", "SN", "SG", "SQ", "SA", "SS", "TSRA",
3403 "TSSN", "TSPE", "TSGS", "TSGR", "TS",
3404 "VCSH", "VCPO", "VCBLDU", "VCBLSA", "VCBLSN",
3405 "VCFG", "VCFC","VA", NULL};
3412 /*************************/
3413 /* START BODY OF ROUTINE */
3414 /*************************/
3416 if( *string == NULL )
3419 saveTemp = temp = *string;
3424 while( *temp != '\0' ) {
3427 IS_NOT_FOUND = TRUE;
3429 while( WxSymbols[i] != NULL && IS_NOT_FOUND ) {
3430 if( strncmp(temp,WxSymbols[i],strlen(WxSymbols[i])) != 0 )
3433 IS_NOT_FOUND = FALSE;
3436 if( WxSymbols[i] == NULL ) {
3440 temp += strlen(WxSymbols[i]);
3445 if( *string == NULL )
3448 if( strlen(*string) != 6 )
3451 if((strncmp(*string,"FEW",3) == 0 ||
3452 strncmp(*string,"SCT",3) == 0 ||
3453 strncmp(*string,"BKN",3) == 0 ||
3454 strncmp(*string,"OVC",3) == 0 ) &&
3455 (nisdigit(*string+3,3) &&
3456 strcmp(*string+3,"000") != 0 )) {
3457 strcpy(Mptr->ObscurAloft,saveTemp);
3458 strncpy(Mptr->ObscurAloftSkyCond, *string,3);
3459 Mptr->ObscurAloftHgt = atoi(*string+3)*100;
3474 static bool isNOSPECI( char *string, Decoded_METAR *Mptr, int *NDEX )
3477 if( string == NULL )
3480 if( strcmp(string,"NOSPECI") != 0 )
3483 Mptr->NOSPECI = TRUE;
3489 static bool isLAST( char *string, Decoded_METAR *Mptr, int *NDEX )
3492 if( string == NULL )
3495 if( strcmp(string,"LAST") != 0 )
3503 #pragma subtitle(" ")
3505 #pragma subtitle("subtitle - description ")
3506 /********************************************************************/
3508 /* Title: isSynopClouds */
3509 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3510 /* Date: 15 Sep 1994 */
3511 /* Programmer: CARL MCCALLA */
3512 /* Language: C/370 */
3516 /* External Functions Called: */
3523 /* Modification History: */
3526 /********************************************************************/
3528 static bool isSynopClouds( char *token, Decoded_METAR *Mptr,
3536 if(strlen(token) != 5)
3539 if( *token == '8' &&
3540 *(token+1) == '/' &&
3541 ((*(token+2) <= '9' && *(token+2) >= '0') || *(token+2) == '/')
3543 ((*(token+3) <= '9' && *(token+3) >= '0') || *(token+3) == '/')
3545 ((*(token+4) <= '9' && *(token+4) >= '0') || *(token+4) == '/'))
3547 strcpy(Mptr->synoptic_cloud_type,token);
3549 Mptr->CloudLow = *(token+2);
3550 Mptr->CloudMedium = *(token+3);
3551 Mptr->CloudHigh = *(token+4);
3561 static bool isSNINCR( char **string, Decoded_METAR *Mptr, int *NDEX )
3566 if( *string == NULL )
3569 if( strcmp( *string, "SNINCR") != 0 )
3574 if( *string == NULL )
3578 if( (slash = strchr(*string,'/')) == NULL ) {
3582 else if( nisdigit (*string,(slash-*string)) &&
3583 nisdigit(slash+1,strlen(slash+1)) ) {
3584 Mptr->SNINCR = antoi(*string,(slash-*string));
3585 Mptr->SNINCR_TotalDepth = antoi(slash+1,strlen(slash+1));
3599 #pragma subtitle(" ")
3601 #pragma subtitle("subtitle - description ")
3602 /********************************************************************/
3604 /* Title: isSnowDepth */
3605 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3606 /* Date: 15 Sep 1994 */
3607 /* Programmer: CARL MCCALLA */
3608 /* Language: C/370 */
3612 /* External Functions Called: */
3619 /* Modification History: */
3622 /********************************************************************/
3624 static bool isSnowDepth( char *token, Decoded_METAR *Mptr,
3631 if(strlen(token) != 5)
3634 if( *token == '4' &&
3635 *(token+1) == '/' &&
3636 nisdigit( (token+2),3) )
3638 strcpy(Mptr->snow_depth_group,token);
3639 Mptr->snow_depth = antoi(token+2,3);
3648 static bool isWaterEquivSnow( char *string,
3649 Decoded_METAR *Mptr,
3653 if( string == NULL )
3656 if( strlen(string) != 6 )
3658 else if( !(nisdigit(string,6)) )
3660 else if( strncmp(string, "933", 3) != 0 )
3663 Mptr->WaterEquivSnow = ((float) atoi(string+3))/10.;
3670 static bool isSunshineDur( char *string, Decoded_METAR *Mptr,
3674 if( string == NULL )
3677 if( strlen(string) != 5 )
3679 else if( strncmp(string, "98", 2) != 0 )
3681 else if(nisdigit(string+2,3)) {
3682 Mptr->SunshineDur = atoi(string+2);
3686 else if( strncmp(string+2, "///", 3) == 0 ) {
3687 Mptr->SunSensorOut = TRUE;
3695 #pragma subtitle(" ")
3697 #pragma subtitle("subtitle - description ")
3698 /********************************************************************/
3700 /* Title: isHourlyPrecip */
3701 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3702 /* Date: 20 Nov 1994 */
3703 /* Programmer: CARL MCCALLA */
3704 /* Language: C/370 */
3717 /* External Functions Called: */
3742 /* Modification History: */
3745 /********************************************************************/
3748 static bool isHourlyPrecip( char **string, Decoded_METAR *Mptr,
3753 if( *string == NULL )
3756 if( !(strcmp(*string, "P") == 0 || charcmp(*string, "'P'dddd") ||
3757 charcmp(*string, "'P'ddd") ) )
3759 else if( strcmp(*string, "P") != 0 ) {
3760 if( nisdigit((*string+1), strlen(*string+1)) ) {
3761 Mptr->hourlyPrecip = ((float)
3762 atoi(*string+1)) * 0.01;
3775 if( *string == NULL )
3779 if( nisdigit(*string,strlen(*string)) ) {
3780 Mptr->hourlyPrecip = ((float)
3781 atoi(*string)) * 0.01;
3793 #pragma subtitle(" ")
3795 #pragma subtitle("subtitle - description ")
3796 /********************************************************************/
3798 /* Title: isP6Precip */
3799 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3800 /* Date: 20 Nov 1994 */
3801 /* Programmer: CARL MCCALLA */
3802 /* Language: C/370 */
3815 /* External Functions Called: */
3840 /* Modification History: */
3843 /********************************************************************/
3846 static bool isP6Precip( char *string, Decoded_METAR *Mptr,
3850 if( string == NULL )
3853 if( *string == '6' && (nisdigit(string+1,4) ||
3854 strcmp(string+1,"////") == 0) ) {
3855 if( strcmp(string+1, "////") == 0 ) {
3856 Mptr->precip_amt = (float) MAXINT;
3857 Mptr->Indeterminant3_6HrPrecip = TRUE;
3862 Mptr->precip_amt = ((float) atoi(string+1)) / 100;
3872 #pragma subtitle(" ")
3874 #pragma subtitle("subtitle - description ")
3875 /********************************************************************/
3877 /* Title: isP24Precip */
3878 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3879 /* Date: 20 Nov 1994 */
3880 /* Programmer: CARL MCCALLA */
3881 /* Language: C/370 */
3894 /* External Functions Called: */
3919 /* Modification History: */
3922 /********************************************************************/
3925 static bool isP24Precip( char *string, Decoded_METAR *Mptr,
3929 if( string == NULL )
3932 if( *string == '7' && (nisdigit(string+1,4) ||
3933 strcmp(string+1,"////") == 0) ) {
3934 if( strcmp(string+1, "////") == 0 ) {
3935 Mptr->precip_24_amt = (float) MAXINT;
3940 Mptr->precip_24_amt = ((float) atoi(string+1)) / 100.;
3949 #pragma subtitle(" ")
3951 #pragma subtitle("subtitle - description ")
3952 /********************************************************************/
3954 /* Title: isTTdTenths */
3955 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
3956 /* Date: 16 Nov 1994 */
3957 /* Programmer: CARL MCCALLA */
3958 /* Language: C/370 */
3971 /* External Functions Called: */
3996 /* Modification History: */
3999 /********************************************************************/
4002 static bool isTTdTenths( char *token, Decoded_METAR *Mptr, int *NDEX)
4005 /***************************/
4006 /* DECLARE LOCAL VARIABLES */
4007 /***************************/
4009 bool returnFlag = FALSE;
4017 else if( !(strlen(token) == 5 || strlen(token) == 9) )
4021 if( (*(token+1) == '0' || *(token+1) == '1') &&
4022 nisdigit(token+2,3) )
4024 if( *(token+1) == '0' )
4029 Mptr->Temp_2_tenths = sign * ((float) antoi(token+2,3));
4035 if( (*(token+5) == '0' || *(token+5) == '1') &&
4036 nisdigit(token+6,3) )
4038 if( *(token+5) == '0' )
4043 Mptr->DP_Temp_2_tenths = sign * ((float) atoi(token+6));
4061 #pragma subtitle(" ")
4063 #pragma subtitle("subtitle - description ")
4064 /********************************************************************/
4066 /* Title: isMaxTemp */
4067 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4068 /* Date: 15 Sep 1994 */
4069 /* Programmer: CARL MCCALLA */
4070 /* Language: C/370 */
4074 /* External Functions Called: */
4081 /* Modification History: */
4084 /********************************************************************/
4086 static bool isMaxTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
4090 if( string == NULL )
4093 if(strlen(string) != 5 )
4095 else if(*string == '1' && (*(string+1) == '0' ||
4096 *(string+1) == '1' ||
4097 *(string+1) == '/' ) &&
4098 (nisdigit((string+2),3) ||
4099 strncmp(string+2,"///",3) == 0) )
4101 if(nisdigit(string+2,3))
4104 strncpy(buf,string+2,3);
4105 Mptr->maxtemp = ( (float) atoi(buf))/10.;
4107 if( *(string+1) == '1' )
4108 Mptr->maxtemp *= (-1.0);
4115 Mptr->maxtemp = (float) MAXINT;
4125 #pragma subtitle(" ")
4127 #pragma subtitle("subtitle - description ")
4128 /********************************************************************/
4130 /* Title: isMinTemp */
4131 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4132 /* Date: 15 Sep 1994 */
4133 /* Programmer: CARL MCCALLA */
4134 /* Language: C/370 */
4138 /* External Functions Called: */
4145 /* Modification History: */
4148 /********************************************************************/
4150 static bool isMinTemp(char *string, Decoded_METAR *Mptr, int *NDEX)
4154 if( string == NULL )
4157 if(strlen(string) != 5 )
4159 else if(*string == '2' && (*(string+1) == '0' ||
4160 *(string+1) == '1' ||
4161 *(string+1) == '/' ) &&
4162 (nisdigit((string+2),3) ||
4163 strncmp(string+2,"///",3) == 0) )
4165 if(nisdigit(string+2,3))
4168 strncpy(buf,string+2,3);
4169 Mptr->mintemp = ( (float) atoi(buf) )/10.;
4171 if( *(string+1) == '1' )
4172 Mptr->mintemp *= (-1.0);
4178 Mptr->mintemp = (float) MAXINT;
4188 #pragma subtitle(" ")
4190 #pragma subtitle("subtitle - description ")
4191 /********************************************************************/
4193 /* Title: isT24MaxMinTemp */
4194 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4195 /* Date: 15 Sep 1994 */
4196 /* Programmer: CARL MCCALLA */
4197 /* Language: C/370 */
4201 /* External Functions Called: */
4208 /* Modification History: */
4211 /********************************************************************/
4213 static bool isT24MaxMinTemp( char *string, Decoded_METAR *Mptr,
4218 if( string == NULL )
4221 if( strlen(string) != 9 )
4223 else if( (*string == '4' && (*(string+1) == '0' ||
4224 *(string+1) == '1' ||
4225 *(string+1) == '/') &&
4226 (nisdigit((string+2),3) || strncmp(string+2,"///",3)))
4228 ((*(string+5) == '0' || *(string+5) == '1' ||
4229 *(string+5) == '/') &&
4230 (nisdigit((string+6),3) ||
4231 strncmp(string+6,"///",3) == 0 )) )
4233 if(nisdigit(string+1,4) && (*(string+1) == '0' ||
4234 *(string+1) == '1') )
4236 memset(buf, '\0', 6);
4237 strncpy(buf, string+2, 3);
4238 Mptr->max24temp = ( (float) atoi( buf ) )/10.;
4240 if( *(string+1) == '1' )
4241 Mptr->max24temp *= -1.;
4244 Mptr->max24temp = (float) MAXINT;
4247 if(nisdigit(string+5,4) && (*(string+5) == '0' ||
4248 *(string+5) == '1' ) )
4250 memset(buf, '\0', 6);
4251 strncpy(buf, string+6, 3);
4252 Mptr->min24temp = ( (float) atoi(buf) )/10.;
4254 if( *(string+5) == '1' )
4255 Mptr->min24temp *= -1.;
4258 Mptr->min24temp = (float) MAXINT;
4268 #pragma subtitle(" ")
4270 #pragma subtitle("subtitle - description ")
4271 /********************************************************************/
4273 /* Title: isPtendency */
4274 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4275 /* Date: 15 Sep 1994 */
4276 /* Programmer: CARL MCCALLA */
4277 /* Language: C/370 */
4281 /* External Functions Called: */
4288 /* Modification History: */
4291 /********************************************************************/
4294 static bool isPtendency(char *string, Decoded_METAR *Mptr, int *NDEX)
4298 if( string == NULL )
4301 if(strlen(string) != 5)
4303 else if(*string == '5' && ('0' <= *(string+1) <= '8') &&
4304 (nisdigit(string+2,3) || strncmp(string+2,"///",3)
4307 if( !(nisdigit(string+2,3)) )
4310 strncpy(buf,(string+1),1);
4311 Mptr->char_prestndcy = atoi(buf);
4318 strncpy(buf,(string+1),1);
4319 Mptr->char_prestndcy = atoi(buf);
4321 Mptr->prestndcy = ((float) atoi(string+2)) * 0.1;
4333 #pragma subtitle(" ")
4335 #pragma subtitle("subtitle - description ")
4336 /********************************************************************/
4338 /* Title: isPWINO */
4339 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4340 /* Date: 20 Nov 1994 */
4341 /* Programmer: CARL MCCALLA */
4342 /* Language: C/370 */
4346 /* External Functions Called: */
4353 /* Modification History: */
4356 /********************************************************************/
4359 static bool isPWINO( char *string, Decoded_METAR *Mptr, int *NDEX)
4362 if( string == NULL )
4366 if( strcmp(string, "PWINO") != 0 )
4376 #pragma subtitle(" ")
4378 #pragma subtitle("subtitle - description ")
4379 /********************************************************************/
4382 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4383 /* Date: 20 Nov 1994 */
4384 /* Programmer: CARL MCCALLA */
4385 /* Language: C/370 */
4389 /* External Functions Called: */
4396 /* Modification History: */
4399 /********************************************************************/
4402 static bool isPNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4406 if( string == NULL )
4409 if( strcmp(string, "PNO") != 0 )
4419 #pragma subtitle(" ")
4421 #pragma subtitle("subtitle - description ")
4422 /********************************************************************/
4424 /* Title: isRVRNO */
4425 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4426 /* Date: 20 Nov 1994 */
4427 /* Programmer: CARL MCCALLA */
4428 /* Language: C/370 */
4432 /* External Functions Called: */
4439 /* Modification History: */
4442 /********************************************************************/
4445 static bool isRVRNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4448 if( string == NULL )
4451 if( strcmp(string, "RVRNO") != 0 )
4461 #pragma subtitle(" ")
4463 #pragma subtitle("subtitle - description ")
4464 /********************************************************************/
4466 /* Title: isCHINO */
4467 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4468 /* Date: 20 Nov 1994 */
4469 /* Programmer: CARL MCCALLA */
4470 /* Language: C/370 */
4474 /* External Functions Called: */
4481 /* Modification History: */
4484 /********************************************************************/
4487 static bool isCHINO( char **string, Decoded_METAR *Mptr, int *NDEX)
4491 if( *string == NULL )
4494 if( strcmp(*string, "CHINO") != 0 )
4499 if( *string == NULL )
4502 if( strlen(*string) <= 2 ) {
4507 if( strncmp( *string, "RY", 2 ) == 0 &&
4508 nisdigit(*string+2,strlen(*string+2)) ) {
4510 strcpy(Mptr->CHINO_LOC, *string);
4523 #pragma subtitle(" ")
4525 #pragma subtitle("subtitle - description ")
4526 /********************************************************************/
4528 /* Title: isVISNO */
4529 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4530 /* Date: 20 Nov 1994 */
4531 /* Programmer: CARL MCCALLA */
4532 /* Language: C/370 */
4536 /* External Functions Called: */
4543 /* Modification History: */
4546 /********************************************************************/
4549 static bool isVISNO( char **string, Decoded_METAR *Mptr, int *NDEX)
4552 if( *string == NULL )
4555 if( strcmp(*string, "VISNO") != 0 )
4560 if( *string == NULL )
4563 if( strlen(*string) <= 2 ) {
4568 if( strncmp( *string, "RY", 2 ) == 0 &&
4569 nisdigit(*string+2,strlen(*string+2))) {
4571 strcpy(Mptr->VISNO_LOC, *string);
4584 #pragma subtitle(" ")
4586 #pragma subtitle("subtitle - description ")
4587 /********************************************************************/
4589 /* Title: isFZRANO */
4590 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4591 /* Date: 20 Nov 1994 */
4592 /* Programmer: CARL MCCALLA */
4593 /* Language: C/370 */
4597 /* External Functions Called: */
4604 /* Modification History: */
4607 /********************************************************************/
4610 static bool isFZRANO( char *string, Decoded_METAR *Mptr, int *NDEX)
4614 if( string == NULL )
4617 if( strcmp(string, "FZRANO") != 0 )
4620 Mptr->FZRANO = TRUE;
4627 #pragma subtitle(" ")
4629 #pragma subtitle("subtitle - description ")
4630 /********************************************************************/
4633 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4634 /* Date: 20 Nov 1994 */
4635 /* Programmer: CARL MCCALLA */
4636 /* Language: C/370 */
4649 /* External Functions Called: */
4674 /* Modification History: */
4677 /********************************************************************/
4680 static bool isTSNO( char *string, Decoded_METAR *Mptr, int *NDEX)
4683 if( string == NULL )
4686 if( strcmp(string, "TSNO") != 0 )
4696 #pragma subtitle(" ")
4698 #pragma subtitle("subtitle - description ")
4699 /********************************************************************/
4701 /* Title: isDollarSign */
4702 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4703 /* Date: 15 Sep 1994 */
4704 /* Programmer: CARL MCCALLA */
4705 /* Language: C/370 */
4709 /* External Functions Called: */
4716 /* Modification History: */
4719 /********************************************************************/
4722 static bool isDollarSign( char *indicator, Decoded_METAR *Mptr,
4726 if( indicator == NULL )
4729 if( strcmp(indicator,"$") != 0 )
4734 Mptr->DollarSign = TRUE;
4740 #pragma subtitle(" ")
4741 #pragma subtitle("subtitle - description ")
4742 /********************************************************************/
4744 /* Title: DcdMTRmk */
4745 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
4746 /* Date: 15 Sep 1994 */
4747 /* Programmer: CARL MCCALLA */
4748 /* Language: C/370 */
4750 /* Abstract: DcdMTRmk takes a pointer to a METAR */
4751 /* report and parses/decodes data elements from */
4752 /* the remarks section of the report. */
4756 /* External Functions Called: */
4759 /* Input: token - the address of a pointer to a METAR */
4760 /* report character string. */
4761 /* Mptr - a pointer to a structure of the vari- */
4762 /* able type Decoded_METAR. */
4767 /* Modification History: */
4770 /********************************************************************/
4772 void DcdMTRmk( char **token, Decoded_METAR *Mptr )
4775 /***************************/
4776 /* DECLARE LOCAL VARIABLES */
4777 /***************************/
4779 int TornadicActvty = 0, A0indicator = 0,
4780 peakwind = 0, windshift = 0, towerVsby = 0, surfaceVsby = 0,
4781 variableVsby = 0, LTGfreq = 0,
4783 recentWX = 0, variableCIG = 0, PRESFR = 0,
4784 Vsby2ndSite = 0, CIG2ndSite = 0,
4785 PRESRR = 0, SLP = 0, PartObscur = 0,
4786 SectorVsby = 0, GR = 0, Virga = 0,
4787 SfcObscur = 0, Ceiling = 0, VrbSkyCond = 0, ObscurAloft = 0,
4788 NoSPECI = 0, Last = 0, SynopClouds = 0, Snincr = 0,
4789 SnowDepth = 0, WaterEquivSnow = 0, SunshineDur = 0,
4790 hourlyPrecip = 0, P6Precip = 0, P24Precip = 0,
4791 TTdTenths = 0, MaxTemp = 0, MinTemp = 0, T24MaxMinTemp = 0,
4792 Ptendency = 0, PWINO = 0,
4793 FZRANO = 0, TSNO = 0, maintIndicator = 0, CHINO = 0, RVRNO = 0,
4794 VISNO = 0, PNO = 0, DVR = 0;
4802 // char *temp_token;
4804 // bool extra_token;
4809 /*************************/
4810 /* START BODY OF ROUTINE */
4811 /*************************/
4815 /*************************************************/
4816 /* LOCATE THE START OF THE METAR REMARKS SECTION */
4817 /*************************************************/
4821 while( token[ NDEX ] != NULL && IS_NOT_RMKS) {
4823 printf("DcdMTRmk: token[%d] = %s\n",NDEX,token[NDEX]);
4825 if( strcmp(token[ NDEX ], "RMK") != 0 )
4828 IS_NOT_RMKS = FALSE;
4831 /***********************************************/
4832 /* IF THE METAR REPORT CONTAINS NO REMARKS */
4833 /* SECTION, THEN RETURN TO THE CALLING ROUTINE */
4834 /***********************************************/
4836 if( token[ NDEX ] != NULL ) {
4838 printf("DcdMTRmk: RMK found, token[%d] = %s\n",
4843 printf("DcdMTRmk: Bump NDEX, token[%d] = %s\n",
4849 printf("DcdMTRmk: No RMK found. NULL ptr encountered\n");
4853 /*****************************************/
4854 /* IDENTIFY AND VALIDATE REMARKS SECTION */
4855 /* DATA GROUPS FOR PARSING/DECODING */
4856 /*****************************************/
4858 while(token[NDEX] != NULL) {
4861 printf("DcdMTRmk: DECODE RMKS: token[%d] = %s\n",NDEX,token[NDEX]);
4865 if( isTornadicActiv( &(token[NDEX]), Mptr, &NDEX ) ) {
4867 if( TornadicActvty > 1 ) {
4868 memset(Mptr->TornadicType,'\0',15);
4869 memset(Mptr->TornadicLOC,'\0',10);
4870 memset(Mptr->TornadicDIR,'\0',4);
4871 Mptr->BTornadicHour = MAXINT;
4872 Mptr->BTornadicMinute = MAXINT;
4873 Mptr->ETornadicHour = MAXINT;
4874 Mptr->ETornadicMinute = MAXINT;
4877 else if( isA0indicator( token[NDEX], Mptr, &NDEX ) ) {
4879 if( A0indicator > 1 )
4880 memset(Mptr->autoIndicator,'\0',5);
4882 else if( isPeakWind( &(token[NDEX]), Mptr, &NDEX ) ) {
4884 if( peakwind > 1 ) {
4885 Mptr->PKWND_dir = MAXINT;
4886 Mptr->PKWND_speed = MAXINT;
4887 Mptr->PKWND_hour = MAXINT;
4888 Mptr->PKWND_minute = MAXINT;
4891 else if( isWindShift( &(token[NDEX]), Mptr, &NDEX ) ) {
4893 if( windshift > 1 ) {
4894 Mptr->WshfTime_hour = MAXINT;
4895 Mptr->WshfTime_minute = MAXINT;
4898 else if( isTowerVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4901 Mptr->TWR_VSBY = (float) MAXINT;
4903 else if( isSurfaceVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4905 if( surfaceVsby > 1 )
4906 Mptr->TWR_VSBY = (float) MAXINT;
4908 else if( isVariableVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
4910 if( variableVsby > 1 ) {
4911 Mptr->minVsby = (float) MAXINT;
4912 Mptr->maxVsby = (float) MAXINT;
4915 else if( isVsby2ndSite( &(token[NDEX]), Mptr, &NDEX ) ) {
4917 if( Vsby2ndSite > 1 ) {
4918 Mptr->VSBY_2ndSite = (float) MAXINT;
4919 memset(Mptr->VSBY_2ndSite_LOC,'\0',10);
4922 else if( isLTGfreq( &(token[NDEX]), Mptr, &NDEX ) ) {
4925 Mptr->OCNL_LTG = FALSE;
4926 Mptr->FRQ_LTG = FALSE;
4927 Mptr->CNS_LTG = FALSE;
4928 Mptr->CG_LTG = FALSE;
4929 Mptr->IC_LTG = FALSE;
4930 Mptr->CC_LTG = FALSE;
4931 Mptr->CA_LTG = FALSE;
4932 Mptr->DSNT_LTG = FALSE;
4933 Mptr->OVHD_LTG = FALSE;
4934 Mptr->VcyStn_LTG = FALSE;
4935 Mptr->LightningVCTS = FALSE;
4936 Mptr->LightningTS = FALSE;
4937 memset(Mptr->LTG_DIR,'\0',3 );
4940 else if( isTS_LOC( &(token[NDEX]), Mptr, &NDEX ) ) {
4943 memset(Mptr->TS_LOC, '\0', 3);
4944 memset(Mptr->TS_MOVMNT, '\0', 3);
4947 else if( isRecentWX( &(token[NDEX]), Mptr, &recentWX ) ) {
4949 /* if( recentWX > 3 ) {
4950 for( i = 0; i < 3; i++ ) {
4951 memset(Mptr->ReWx[i].Recent_weather, '\0', 5);
4953 Mptr->ReWx[i].Bhh = MAXINT;
4954 Mptr->ReWx[i].Bmm = MAXINT;
4956 Mptr->ReWx[i].Ehh = MAXINT;
4957 Mptr->ReWx[i].Emm = MAXINT;
4965 else if( isVariableCIG( &(token[NDEX]), Mptr, &NDEX ) ) {
4967 if( variableCIG > 1) {
4968 Mptr->minCeiling = MAXINT;
4969 Mptr->maxCeiling = MAXINT;
4972 else if( isCIG2ndSite( &(token[NDEX]), Mptr, &NDEX ) ) {
4974 if( CIG2ndSite > 1) {
4975 Mptr->CIG_2ndSite_Meters = MAXINT;
4976 memset( Mptr->CIG_2ndSite_LOC, '\0', 10);
4979 else if( isPRESFR( token[NDEX], Mptr, &NDEX ) ) {
4982 Mptr->PRESFR = FALSE;
4984 else if( isPRESRR( token[NDEX], Mptr, &NDEX ) ) {
4987 Mptr->PRESRR = FALSE;
4989 else if( isSLP( &(token[NDEX]), Mptr, &NDEX ) ) {
4992 Mptr->SLP = (float) MAXINT;
4994 else if( isPartObscur( &(token[NDEX]), Mptr, PartObscur,
4997 if( PartObscur > 2 ) {
4998 memset(&(Mptr->PartialObscurationAmt[0][0]), '\0', 7 );
4999 memset(&(Mptr->PartialObscurationPhenom[0][0]),'\0',12 );
5001 memset(&(Mptr->PartialObscurationAmt[1][0]), '\0', 7 );
5002 memset(&(Mptr->PartialObscurationPhenom[1][0]),'\0',12 );
5005 else if( isSectorVsby( &(token[NDEX]), Mptr, &NDEX ) ) {
5007 if( SectorVsby > 1 ) {
5008 Mptr->SectorVsby = (float) MAXINT;
5009 memset(Mptr->SectorVsby_Dir, '\0', 3);
5012 else if( isGR( &(token[NDEX]), Mptr, &NDEX ) ) {
5015 Mptr->GR_Size = (float) MAXINT;
5019 else if( isVIRGA( &(token[NDEX]), Mptr, &NDEX ) ) {
5022 Mptr->VIRGA = FALSE;
5023 memset(Mptr->VIRGA_DIR, '\0', 3);
5026 else if( isSfcObscuration( token[NDEX], Mptr, &NDEX ) ) {
5028 if( SfcObscur > 1 ) {
5029 for( i = 0; i < 6; i++ ) {
5030 memset(&(Mptr->SfcObscuration[i][0]), '\0', 10);
5031 Mptr->Num8thsSkyObscured = MAXINT;
5035 else if( isCeiling( token[NDEX], Mptr, &NDEX ) ) {
5038 Mptr->CIGNO = FALSE;
5039 Mptr->Ceiling = MAXINT;
5040 Mptr->Estimated_Ceiling = FALSE;
5043 else if( isVrbSky( &(token[NDEX]), Mptr, &NDEX ) ) {
5045 if( VrbSkyCond > 1 ) {
5046 memset(Mptr->VrbSkyBelow, '\0', 4);
5047 memset(Mptr->VrbSkyAbove, '\0', 4);
5048 Mptr->VrbSkyLayerHgt = MAXINT;
5051 else if( isObscurAloft( &(token[NDEX]), Mptr, &NDEX ) ) {
5053 if( ObscurAloft > 1 ) {
5054 Mptr->ObscurAloftHgt = MAXINT;
5055 memset( Mptr->ObscurAloft, '\0', 12 );
5056 memset( Mptr->ObscurAloftSkyCond, '\0', 12 );
5059 else if( isNOSPECI( token[NDEX], Mptr, &NDEX ) ) {
5062 Mptr->NOSPECI = FALSE;
5064 else if( isLAST( token[NDEX], Mptr, &NDEX ) ) {
5069 else if( isSynopClouds( token[NDEX], Mptr, &NDEX ) ) {
5071 if( SynopClouds > 1 ) {
5072 memset( Mptr->synoptic_cloud_type, '\0', 6 );
5073 Mptr->CloudLow = '\0';
5074 Mptr->CloudMedium = '\0';
5075 Mptr->CloudHigh = '\0';
5078 else if( isSNINCR( &(token[NDEX]), Mptr, &NDEX ) ) {
5081 Mptr->SNINCR = MAXINT;
5082 Mptr->SNINCR_TotalDepth = MAXINT;
5085 else if( isSnowDepth( token[NDEX], Mptr, &NDEX ) ) {
5087 if( SnowDepth > 1 ) {
5088 memset( Mptr->snow_depth_group, '\0', 6 );
5089 Mptr->snow_depth = MAXINT;
5092 else if( isWaterEquivSnow( token[NDEX], Mptr, &NDEX ) ) {
5094 if( WaterEquivSnow > 1 )
5095 Mptr->WaterEquivSnow = (float) MAXINT;
5097 else if( isSunshineDur( token[NDEX], Mptr, &NDEX ) ) {
5099 if( SunshineDur > 1 ) {
5100 Mptr->SunshineDur = MAXINT;
5101 Mptr->SunSensorOut = FALSE;
5104 else if( isHourlyPrecip( &(token[NDEX]), Mptr, &NDEX ) ) {
5106 if( hourlyPrecip > 1 )
5107 Mptr->hourlyPrecip = (float) MAXINT;
5109 else if( isP6Precip( token[NDEX], Mptr, &NDEX ) ) {
5112 Mptr->precip_amt = (float) MAXINT;
5114 else if( isP24Precip( token[NDEX], Mptr, &NDEX ) ) {
5117 Mptr->precip_24_amt = (float) MAXINT;
5119 else if( isTTdTenths( token[NDEX], Mptr, &NDEX ) ) {
5121 if( TTdTenths > 1 ) {
5122 Mptr->Temp_2_tenths = (float) MAXINT;
5123 Mptr->DP_Temp_2_tenths = (float) MAXINT;
5126 else if( isMaxTemp( token[NDEX], Mptr, &NDEX ) ) {
5129 Mptr->maxtemp = (float) MAXINT;
5131 else if( isMinTemp( token[NDEX], Mptr, &NDEX ) ) {
5134 Mptr->mintemp = (float) MAXINT;
5136 else if( isT24MaxMinTemp( token[NDEX],
5139 if( T24MaxMinTemp > 1 ) {
5140 Mptr->max24temp = (float) MAXINT;
5141 Mptr->min24temp = (float) MAXINT;
5144 else if( isPtendency( token[NDEX], Mptr, &NDEX ) ) {
5146 if( Ptendency > 1 ) {
5147 Mptr->char_prestndcy = MAXINT;
5148 Mptr->prestndcy = (float) MAXINT;
5151 else if( isPWINO( token[NDEX], Mptr, &NDEX ) ) {
5154 Mptr->PWINO = FALSE;
5156 else if( isFZRANO( token[NDEX], Mptr, &NDEX ) ) {
5159 Mptr->FZRANO = FALSE;
5161 else if( isTSNO( token[NDEX], Mptr, &NDEX ) ) {
5166 else if( isDollarSign( token[NDEX], Mptr, &NDEX ) ) {
5168 if( maintIndicator > 1 )
5169 Mptr->DollarSign = FALSE;
5171 else if( isRVRNO( token[NDEX], Mptr, &NDEX ) ) {
5174 Mptr->RVRNO = FALSE;
5176 else if( isPNO( token[NDEX], Mptr, &NDEX ) ) {
5181 else if( isVISNO( &(token[NDEX]), Mptr, &NDEX ) ) {
5184 Mptr->VISNO = FALSE;
5185 memset(Mptr->VISNO_LOC, '\0', 6);
5188 else if( isCHINO( &(token[NDEX]), Mptr, &NDEX ) ) {
5191 Mptr->CHINO = FALSE;
5192 memset(Mptr->CHINO_LOC, '\0', 6);
5195 else if( isDVR( token[NDEX], Mptr, &NDEX ) ) {
5198 Mptr->DVR.Min_visRange = MAXINT;
5199 Mptr->DVR.Max_visRange = MAXINT;
5200 Mptr->DVR.visRange = MAXINT;
5201 Mptr->DVR.vrbl_visRange = FALSE;
5202 Mptr->DVR.below_min_DVR = FALSE;
5203 Mptr->DVR.above_max_DVR = FALSE;