tools/grib_ls.c
/* This is executed after the last message in the last file is processed */
This is executed after the last message in the last file is processed
This is executed after the last message in the last file is processed
int grib_tool_finalise_action(grib_runtime_options* options)
{
    int i = 0;
    if (options->latlon && options->verbose) {
        printf("Input Point: latitude=%.2f  longitude=%.2f\n", lat, lon);
        if (options->latlon_idx >= 0 && options->latlon_idx < LATLON_SIZE) {
            printf("Grid Point chosen #%d index=%d latitude=%.2f longitude=%.2f distance=%.2f (Km)\n",
                   options->latlon_idx + 1, (int)options->indexes[options->latlon_idx],
                   options->lats[options->latlon_idx],
                   options->lons[options->latlon_idx],
                   options->distances[options->latlon_idx]);
        }
        if (options->latlon_mask) {
            printf("Mask values:\n");
            for (i = 0; i < LATLON_SIZE; i++) {
                printf("- %d - index=%d latitude=%.2f longitude=%.2f distance=%.2f (Km) value=%.2f\n",
                       i + 1, (int)options->indexes[i], options->lats[i], options->lons[i],
                       options->distances[i], options->mask_values[i]);
            }
        }
        else {
            printf("Other grid Points\n");
            for (i = 0; i < LATLON_SIZE; i++) {
                printf("- %d - index=%d latitude=%.2f longitude=%.2f distance=%.2f (Km)\n",
                       i + 1, (int)options->indexes[i], options->lats[i], options->lons[i],
                       options->distances[i]);
            }
        }
    }
    if (!json_latlon && options->json_output)
        fprintf(stdout, "\n]}\n");
    if (nearest)
        grib_nearest_delete(nearest);
    if (json_latlon)
        printf("\n]\n");
    return 0;
}
int grib_tool_finalise_action ( grib_runtime_options * options ) { int i = 0 ; if ( options -> latlon && options -> verbose ) { printf ( " \n " , lat , lon ) ; if ( options -> latlon_idx >= 0 && options -> latlon_idx < LATLON_SIZE ) { printf ( " \n " , options -> latlon_idx + 1 , ( int ) options -> indexes [ options -> latlon_idx ] , options -> lats [ options -> latlon_idx ] , options -> lons [ options -> latlon_idx ] , options -> distances [ options -> latlon_idx ] ) ; } if ( options -> latlon_mask ) { printf ( " \n " ) ; for ( i = 0 ; i < LATLON_SIZE ; i ++ ) { printf ( " \n " , i + 1 , ( int ) options -> indexes [ i ] , options -> lats [ i ] , options -> lons [ i ] , options -> distances [ i ] , options -> mask_values [ i ] ) ; } } else { printf ( " \n " ) ; for ( i = 0 ; i < LATLON_SIZE ; i ++ ) { printf ( " \n " , i + 1 , ( int ) options -> indexes [ i ] , options -> lats [ i ] , options -> lons [ i ] , options -> distances [ i ] ) ; } } } if ( ! json_latlon && options -> json_output ) fprintf ( stdout , " \n \n " ) ; if ( nearest ) grib_nearest_delete ( nearest ) ; if ( json_latlon ) printf ( " \n \n " ) ; return 0 ; }
This is executed after the last message in the last file is processed
This is executed after the last message in the last file is processed