Fortran: grib_sections_copy

This commit is contained in:
Shahram Najm 2024-01-21 14:34:54 +00:00
parent b08ee05f37
commit fd0f41ef64
3 changed files with 11 additions and 10 deletions

View File

@ -25,6 +25,7 @@ if( HAVE_BUILD_TOOLS )
codes_scan_file codes_scan_file
codes_load_file codes_load_file
grib_copy_message grib_copy_message
grib_sections_copy
bufr_copy_message bufr_copy_message
grib_get_keys grib_get_keys
grib_get_data grib_get_data

View File

@ -21,7 +21,6 @@ integer, external :: grib_f_keys_iterator_get_name, &
grib_f_keys_iterator_rewind grib_f_keys_iterator_rewind
integer, external :: grib_f_new_from_message, & integer, external :: grib_f_new_from_message, &
grib_f_new_from_message_int, & grib_f_new_from_message_int, &
grib_f_new_from_message_copy, &
grib_f_new_from_samples, & grib_f_new_from_samples, &
codes_bufr_f_new_from_samples, & codes_bufr_f_new_from_samples, &
grib_f_read_any_from_file, & grib_f_read_any_from_file, &

View File

@ -1366,6 +1366,7 @@ int grib_f_new_from_message_int_(int* gid, int* buffer , size_t* bufsize)
return grib_f_new_from_message_(gid, (void*)buffer, bufsize); return grib_f_new_from_message_(gid, (void*)buffer, bufsize);
} }
/*****************************************************************************/ /*****************************************************************************/
#if 0
int grib_f_new_from_message_copy_(int* gid, void* buffer, size_t* bufsize) int grib_f_new_from_message_copy_(int* gid, void* buffer, size_t* bufsize)
{ {
grib_handle *h = NULL; grib_handle *h = NULL;
@ -1377,7 +1378,7 @@ int grib_f_new_from_message_copy_(int* gid, void* buffer, size_t* bufsize)
*gid = -1; *gid = -1;
return GRIB_INTERNAL_ERROR; return GRIB_INTERNAL_ERROR;
} }
#endif
/*****************************************************************************/ /*****************************************************************************/
int grib_f_new_from_samples_(int* gid, char* name, int lname) int grib_f_new_from_samples_(int* gid, char* name, int lname)
{ {
@ -1443,16 +1444,16 @@ int grib_f_copy_key_(int* gidsrc, char* key, int* giddest, int len)
} }
/*****************************************************************************/ /*****************************************************************************/
int grib_f_util_sections_copy_(int* gidfrom,int* gidto,int* what,int *gidout) int grib_f_util_sections_copy_(int* gidfrom, int* gidto, int* what, int* gidout)
{ {
int err=0; int err = 0;
grib_handle *hfrom = get_handle(*gidfrom); grib_handle* hfrom = get_handle(*gidfrom);
grib_handle *hto = get_handle(*gidto); grib_handle* hto = get_handle(*gidto);
grib_handle *out =0; grib_handle* out = 0;
if(hfrom && hto) out=grib_util_sections_copy(hfrom,hto,*what,&err); if (hfrom && hto) out = grib_util_sections_copy(hfrom, hto, *what, &err);
if(out){ if (out) {
push_handle(out,gidout); push_handle(out, gidout);
return GRIB_SUCCESS; return GRIB_SUCCESS;
} }