mirror of https://github.com/ecmwf/eccodes.git
Examples: Spelling
This commit is contained in:
parent
5745e74a9f
commit
3f42622ee9
|
@ -40,7 +40,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -40,14 +40,14 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
filename = argv[1];
|
filename = argv[1];
|
||||||
|
|
||||||
/* open bufr file */
|
/* open BUFR file */
|
||||||
in = fopen(filename, "rb");
|
in = fopen(filename, "rb");
|
||||||
if (!in) {
|
if (!in) {
|
||||||
fprintf(stderr, "Error: unable to open file %s\n", filename);
|
fprintf(stderr, "Error: unable to open file %s\n", filename);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -40,7 +40,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -33,7 +33,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -36,7 +36,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -43,7 +43,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
@ -53,8 +53,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
printf("message: %d\n", cnt);
|
printf("message: %d\n", cnt);
|
||||||
|
|
||||||
/* get and print some keys form the BUFR header */
|
/* get and print some keys from the BUFR header */
|
||||||
|
|
||||||
CODES_CHECK(codes_get_long(h, "dataCategory", &longVal), 0);
|
CODES_CHECK(codes_get_long(h, "dataCategory", &longVal), 0);
|
||||||
printf(" dataCategory: %ld\n", longVal);
|
printf(" dataCategory: %ld\n", longVal);
|
||||||
|
|
||||||
|
@ -79,7 +78,7 @@ int main(int argc, char* argv[])
|
||||||
CODES_CHECK(codes_get_long(h, "numberOfSubsets", &longVal), 0);
|
CODES_CHECK(codes_get_long(h, "numberOfSubsets", &longVal), 0);
|
||||||
printf(" numberOfSubsets: %ld\n", longVal);
|
printf(" numberOfSubsets: %ld\n", longVal);
|
||||||
|
|
||||||
/* delete handle */
|
/* release memory */
|
||||||
codes_handle_delete(h);
|
codes_handle_delete(h);
|
||||||
|
|
||||||
cnt++;
|
cnt++;
|
||||||
|
|
|
@ -44,7 +44,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop over the messages in the bufr file */
|
/* Loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -42,7 +42,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -51,7 +51,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Loop over the messages in the bufr file */
|
/* Loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -54,7 +54,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -41,7 +41,7 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* loop over the messages in the bufr file */
|
/* loop over the messages in the BUFR file */
|
||||||
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
while ((h = codes_handle_new_from_file(NULL, in, PRODUCT_BUFR, &err)) != NULL || err != CODES_SUCCESS) {
|
||||||
if (h == NULL) {
|
if (h == NULL) {
|
||||||
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
fprintf(stderr, "Error: unable to create handle for message %d\n", cnt);
|
||||||
|
|
|
@ -25,13 +25,13 @@ program bufr_attributes
|
||||||
|
|
||||||
call codes_open_file(ifile, '../../data/bufr/syno_multi.bufr', 'r')
|
call codes_open_file(ifile, '../../data/bufr/syno_multi.bufr', 'r')
|
||||||
|
|
||||||
! the first bufr message is loaded from file
|
! the first BUFR message is loaded from file
|
||||||
! ibufr is the bufr id to be used in subsequent calls
|
! ibufr is the BUFR id to be used in subsequent calls
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
do while (iret /= CODES_END_OF_FILE)
|
do while (iret /= CODES_END_OF_FILE)
|
||||||
|
|
||||||
! Get and print some keys form the BUFR header
|
! Get and print some keys from the BUFR header
|
||||||
write (*, *) 'message: ', count
|
write (*, *) 'message: ', count
|
||||||
|
|
||||||
! We need to instruct ecCodes to expand all the descriptors
|
! We need to instruct ecCodes to expand all the descriptors
|
||||||
|
@ -96,10 +96,10 @@ program bufr_attributes
|
||||||
call codes_get(ibufr, 'airTemperatureAt2M->percentConfidence->width', iVal);
|
call codes_get(ibufr, 'airTemperatureAt2M->percentConfidence->width', iVal);
|
||||||
write (*, *) ' airTemperatureAt2M->percentConfidence->width:', iVal
|
write (*, *) ' airTemperatureAt2M->percentConfidence->width:', iVal
|
||||||
|
|
||||||
! Release the bufr message
|
! Release the BUFR message
|
||||||
call codes_release(ibufr)
|
call codes_release(ibufr)
|
||||||
|
|
||||||
! Load the next bufr message
|
! Load the next BUFR message
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
|
@ -27,13 +27,13 @@ program bufr_get_keys
|
||||||
|
|
||||||
call codes_open_file(ifile, '../../data/bufr/syno_multi.bufr', 'r')
|
call codes_open_file(ifile, '../../data/bufr/syno_multi.bufr', 'r')
|
||||||
|
|
||||||
! The first bufr message is loaded from file,
|
! The first BUFR message is loaded from file,
|
||||||
! ibufr is the bufr id to be used in subsequent calls
|
! ibufr is the BUFR id to be used in subsequent calls
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
do while (iret /= CODES_END_OF_FILE)
|
do while (iret /= CODES_END_OF_FILE)
|
||||||
|
|
||||||
! Get and print some keys form the BUFR header
|
! Get and print some keys from the BUFR header
|
||||||
write (*, *) 'message: ', count
|
write (*, *) 'message: ', count
|
||||||
|
|
||||||
! We need to instruct ecCodes to expand all the descriptors
|
! We need to instruct ecCodes to expand all the descriptors
|
||||||
|
@ -81,10 +81,10 @@ program bufr_get_keys
|
||||||
deallocate (values)
|
deallocate (values)
|
||||||
deallocate (descriptors)
|
deallocate (descriptors)
|
||||||
|
|
||||||
! Release the bufr message
|
! Release the BUFR message
|
||||||
call codes_release(ibufr)
|
call codes_release(ibufr)
|
||||||
|
|
||||||
! Load the next bufr message
|
! Load the next BUFR message
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
|
@ -26,13 +26,13 @@ program bufr_keys_iterator
|
||||||
|
|
||||||
call codes_open_file(ifile, '../../data/bufr/syno_1.bufr', 'r')
|
call codes_open_file(ifile, '../../data/bufr/syno_1.bufr', 'r')
|
||||||
|
|
||||||
! The first bufr message is loaded from file,
|
! The first BUFR message is loaded from file,
|
||||||
! ibufr is the bufr id to be used in subsequent calls
|
! ibufr is the BUFR id to be used in subsequent calls
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
do while (iret /= CODES_END_OF_FILE)
|
do while (iret /= CODES_END_OF_FILE)
|
||||||
|
|
||||||
! Get and print some keys form the BUFR header
|
! Get and print some keys from the BUFR header
|
||||||
write (*, *) 'message: ', count
|
write (*, *) 'message: ', count
|
||||||
|
|
||||||
! We need to instruct ecCodes to expand all the descriptors
|
! We need to instruct ecCodes to expand all the descriptors
|
||||||
|
@ -62,10 +62,10 @@ program bufr_keys_iterator
|
||||||
! Delete key iterator
|
! Delete key iterator
|
||||||
call codes_bufr_keys_iterator_delete(kiter)
|
call codes_bufr_keys_iterator_delete(kiter)
|
||||||
|
|
||||||
! Release the bufr message
|
! Release the BUFR message
|
||||||
call codes_release(ibufr)
|
call codes_release(ibufr)
|
||||||
|
|
||||||
! Load the next bufr message
|
! Load the next BUFR message
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
|
@ -26,13 +26,13 @@ program bufr_read_header
|
||||||
|
|
||||||
call codes_open_file(ifile, '../../data/bufr/syno_multi.bufr', 'r')
|
call codes_open_file(ifile, '../../data/bufr/syno_multi.bufr', 'r')
|
||||||
|
|
||||||
! The first bufr message is loaded from file,
|
! The first BUFR message is loaded from file,
|
||||||
! ibufr is the bufr id to be used in subsequent calls
|
! ibufr is the BUFR id to be used in subsequent calls
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
do while (iret /= CODES_END_OF_FILE)
|
do while (iret /= CODES_END_OF_FILE)
|
||||||
|
|
||||||
! Get and print some keys form the BUFR header
|
! Get and print some keys from the BUFR header
|
||||||
write (*, *) 'message: ', count
|
write (*, *) 'message: ', count
|
||||||
|
|
||||||
call codes_get(ibufr, 'dataCategory', dataCategory);
|
call codes_get(ibufr, 'dataCategory', dataCategory);
|
||||||
|
@ -59,10 +59,10 @@ program bufr_read_header
|
||||||
call codes_get(ibufr, 'numberOfSubsets', numberOfSubsets)
|
call codes_get(ibufr, 'numberOfSubsets', numberOfSubsets)
|
||||||
write (*, *) ' numberOfSubsets:', numberOfSubsets
|
write (*, *) ' numberOfSubsets:', numberOfSubsets
|
||||||
|
|
||||||
! Release the bufr message
|
! Release the BUFR message
|
||||||
call codes_release(ibufr)
|
call codes_release(ibufr)
|
||||||
|
|
||||||
! Load the next bufr message
|
! Load the next BUFR message
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
|
@ -26,13 +26,13 @@ program bufr_subset
|
||||||
|
|
||||||
call codes_open_file(ifile, '../../data/bufr/synop_multi_subset.bufr', 'r')
|
call codes_open_file(ifile, '../../data/bufr/synop_multi_subset.bufr', 'r')
|
||||||
|
|
||||||
! The first bufr message is loaded from file,
|
! The first BUFR message is loaded from file,
|
||||||
! ibufr is the bufr id to be used in subsequent calls
|
! ibufr is the BUFR id to be used in subsequent calls
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
do while (iret /= CODES_END_OF_FILE)
|
do while (iret /= CODES_END_OF_FILE)
|
||||||
|
|
||||||
! Get and print some keys form the BUFR header
|
! Get and print some keys from the BUFR header
|
||||||
write (*, *) 'message: ', count
|
write (*, *) 'message: ', count
|
||||||
|
|
||||||
! We need to instruct ecCodes to expand all the descriptors
|
! We need to instruct ecCodes to expand all the descriptors
|
||||||
|
@ -61,10 +61,10 @@ program bufr_subset
|
||||||
|
|
||||||
end do
|
end do
|
||||||
|
|
||||||
! Release the bufr message
|
! Release the BUFR message
|
||||||
call codes_release(ibufr)
|
call codes_release(ibufr)
|
||||||
|
|
||||||
! Load the next bufr message
|
! Load the next BUFR message
|
||||||
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
call codes_bufr_new_from_file(ifile, ibufr, iret)
|
||||||
|
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
Loading…
Reference in New Issue