Skip to content

Commit

Permalink
Merge branch 'develop' into feature/ECC-2013-typeOfLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
shahramn committed Feb 26, 2025
2 parents 7ea6b22 + bfa1800 commit 8b12e4d
Show file tree
Hide file tree
Showing 103 changed files with 388 additions and 157 deletions.
4 changes: 1 addition & 3 deletions definitions/boot.def
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ transient preferLocalConcepts = preferLocalConceptsEnvVar : hidden;
constant defaultTypeOfLevel="unknown" : hidden;

gribDataQualityChecks = getenv("ECCODES_GRIB_DATA_QUALITY_CHECKS","0") : hidden;
if (gribDataQualityChecks) {
template LIMITS "param_limits.def";
}
template GRIB_LIMITS "param_limits.def";

# GRIBEX special boustrophedonic mode. See GRIB-472
# If the environment variable is not defined, the key will be 0
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_attributes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


#Define a common label for all the tmp files
label="bufr_attributes_test_c"
label="examples_c_bufr_attributes"

#Define tmp file
fTmp=${label}.tmp.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_clone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
. ./include.ctest.sh

# Define a common label for all the tmp files
label="bufr_clone_test_c"
label="examples_c_bufr_clone"

fBufrTmp1=${label}.cloned1.bufr
fBufrTmp2=${label}.cloned2.bufr
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_copy_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
. ./include.ctest.sh

#Define a common label for all the tmp files
label="bufr_copy_data_c"
label="examples_c_bufr_copy_data"

TEMP_BUFR=$label.out.bufr
TEMP_TEXT=$label.out.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_expanded.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
. ./include.ctest.sh

#Define a common label for all the tmp files
label="bufr_expanded_test_c"
label="examples_c_bufr_expanded"

#Prepare tmp file
fTmp=${label}.tmp.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_get_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


#Define a common label for all the tmp files
label="bufr_get_keys_test_c"
label="examples_c_bufr_get_keys"

#Define tmp file
fTmp=${label}.tmp.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_get_string_array.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
. ./include.ctest.sh

# Define a common label for all the tmp files
label="bufr_get_string_array_test_c"
label="examples_c_bufr_get_string_array"

# Define tmp file
fTmp=${label}.tmp.txt
Expand Down
3 changes: 1 addition & 2 deletions examples/C/bufr_keys_iterator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#

set -x
. ./include.ctest.sh


# Define a common label for all the tmp files
label="bufr_keys_iterator_test_c"
label="examples_c_bufr_keys_iterator"

# Define tmp file
fTmp=${label}".tmp.txt"
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_missing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


#Define a common label for all the tmp files
label="bufr_missing_test_c"
label="examples_c_bufr_missing"

#Define tmp file
fTmp=${label}.tmp.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_read_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
. ./include.ctest.sh

#Define a common label for all the tmp files
label="bufr_read_header_test_c"
label="examples_c_bufr_read_header"

#Prepare tmp file
fTmp=${label}.tmp.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_read_scatterometer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


# Define a common label for all the tmp files
label="bufr_read_scatterometer_c"
label="examples_c_bufr_read_scatterometer"

# Define tmp file
fTmp=${label}.tmp.txt
Expand Down
3 changes: 1 addition & 2 deletions examples/C/bufr_read_synop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

. ./include.ctest.sh


#Define a common label for all the tmp files
label="bufr_read_synop_test_c"
label="examples_c_bufr_read_synop_test"

#Define tmp file
fTmp=${label}".tmp.txt"
Expand Down
3 changes: 1 addition & 2 deletions examples/C/bufr_read_temp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

. ./include.ctest.sh


#Define a common label for all the tmp files
label="bufr_read_temp_c"
label="examples_c_bufr_read_temp"

#Define tmp file
fTmp=${label}.tmp.txt
Expand Down
3 changes: 1 addition & 2 deletions examples/C/bufr_read_tempf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@

. ./include.ctest.sh


#Define a common label for all the tmp files
label="bufr_read_tempf_c"
label="examples_c_bufr_read_tempf"
tempOut=temp.${label}.txt
tempRef=temp.${label}.ref
rm -f $tempRef $tempOut
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_set_keys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
. ./include.ctest.sh

# Define a common label for all the tmp files
label="bufr_set_keys_test_c"
label="examples_c_bufr_set_keys"
REDIRECT=/dev/null
fBufrTmp=${label}.tmp.bufr
rm -f $fBufrTmp
Expand Down
2 changes: 1 addition & 1 deletion examples/C/bufr_subset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
. ./include.ctest.sh

#Define a common label for all the tmp files
label="bufr_subset_test_c"
label="examples_c_bufr_subset"

#Prepare tmp file
fTmp=${label}.tmp.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/C/get_product_kind.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

. ./include.ctest.sh

label="get_product_kind_c"
label="examples_c_get_product_kind"
fTmp=${label}.tmp
fOut=${label}.tmp.out
fRef=${label}.tmp.ref
Expand Down
2 changes: 1 addition & 1 deletion examples/C/get_product_kind_samples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

. ./include.ctest.sh

label="get_product_kind_samples_c"
label="examples_c_get_product_kind_samples"
fTmp=${label}.tmp

sample_grib1=${ECCODES_SAMPLES_PATH}/GRIB1.tmpl
Expand Down
2 changes: 1 addition & 1 deletion examples/C/grib_index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

. ./include.ctest.sh

label="grib_index_c"
label="examples_c_grib_index"
tempIndex=temp.$label.idx
tempText=temp.$label.txt

Expand Down
2 changes: 1 addition & 1 deletion examples/C/grib_mars_param.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

. ./include.ctest.sh

label="grib_mars_param_c"
label="examples_c_grib_mars_param"
fTmp=${label}.tmp
fOut=${label}.tmp.out
fRef=${label}.tmp.ref
Expand Down
2 changes: 1 addition & 1 deletion examples/C/grib_multi_write.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

. ./include.ctest.sh

label="grib_multi_write_c"
label="examples_c_grib_multi_write"
tempGrib=temp.$label.grib
tempText=temp.$label.txt

Expand Down
2 changes: 1 addition & 1 deletion examples/C/grib_nearest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if [ $HAVE_GEOGRAPHY -eq 0 ]; then
exit 0
fi

label="grib_nearest_c"
label="examples_c_grib_nearest"
tempTxt=temp.$label.txt
tempRef=temp.$label.ref

Expand Down
2 changes: 1 addition & 1 deletion examples/C/grib_nearest_multiple.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ $HAVE_GEOGRAPHY -eq 0 ]; then
exit 0
fi

label="grib_nearest_multiple_c"
label="examples_c_grib_nearest_multiple"
temp1=$label.temp1.$$
temp2=$label.temp2.$$
tempRef=$label.ref.$$
Expand Down
2 changes: 1 addition & 1 deletion examples/C/grib_values_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
. ./include.ctest.sh

# Define a common label for all the tmp files
label="grib_values_check_c"
label="examples_c_grib_values_check"
tempErr=${label}.tmp.err
tempRef=${label}.tmp.ref

Expand Down
103 changes: 88 additions & 15 deletions examples/F90/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,80 @@
# Configure the file which all CMake tests will include
configure_file( include.ctest.sh.in include.ctest.sh @ONLY )

list( APPEND test_bins
bufr_attributes
bufr_clone
bufr_copy_data
bufr_copy_keys
bufr_copy_message
bufr_ecc-1019
bufr_ecc-1284
bufr_expanded
bufr_get_keys
bufr_get_string_array
bufr_keys_iterator
bufr_read_header
bufr_read_scatterometer
bufr_read_synop
bufr_read_temp
bufr_read_tempf
bufr_read_tropical_cyclone
bufr_set_keys
bufr_subset
codes_datetime_julian
codes_dump
codes_ecc-1392
codes_f90_misc
codes_load_file
codes_scan_file
codes_set_paths
get_native_type
get_product_kind
grib_clone
grib_copy_message
grib_copy_namespace
grib_count_messages
grib_count_messages_multi
grib_ecc-1316
grib_ecc-671
grib_elements
grib_get_data
grib_get_data_real4
grib_get_keys
grib_get_pl
grib_get_pv
grib_get_set_uuid
grib_index
grib_keys_iterator
grib_keys_iterator_skip
grib_multi
grib_multi_write
grib_nearest
grib_nearest_four_single
grib_nearest_single
grib_precision
grib_print_data
grib_read_bytes
grib_read_from_file
grib_read_message
grib_samples
grib_sections_copy
grib_set_bitmap
grib_set_data
grib_set_data_force
grib_set_keys
grib_set_missing
grib_set_pv
key_is_computed)

foreach( tool ${test_bins} )
ecbuild_add_executable( TARGET f_${tool}
NOINSTALL
SOURCES ${tool}.f90
LINKER_LANGUAGE Fortran
CONDITION HAVE_FORTRAN
LIBS eccodes_f90 eccodes )
endforeach()

# Add all the tests
####################
Expand Down Expand Up @@ -123,9 +197,7 @@ endif()

foreach( atest ${tests_sanity} )
ecbuild_add_test( TARGET eccodes_f_${atest}
SOURCES ${atest}.f90
LINKER_LANGUAGE Fortran
LIBS eccodes_f90 eccodes
TYPE SCRIPT
CONDITION HAVE_FORTRAN
LABELS "sanity"
RESOURCES bufr_read_scatterometer_f.ref
Expand All @@ -139,37 +211,38 @@ endif()

foreach( atest ${tests_extra} )
ecbuild_add_test( TARGET eccodes_f_${atest}
SOURCES ${atest}.f90
LINKER_LANGUAGE Fortran
LIBS eccodes_f90 eccodes
CONDITION HAVE_FORTRAN AND ENABLE_EXTRA_TESTS
RESOURCES bufr_read_scatterometer_f.ref
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${atest}.sh
TEST_DEPENDS eccodes_download_gribs eccodes_download_bufrs eccodes_download_bufr_refs )
endforeach()

# Test for CCSDS (AEC) packing
ecbuild_add_test( TARGET eccodes_f_grib_set_packing
SOURCES grib_set_packing.f90
LINKER_LANGUAGE Fortran
LIBS eccodes_f90 eccodes
CONDITION HAVE_BUILD_TOOLS AND HAVE_AEC AND HAVE_FORTRAN
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_set_packing.sh )
if( HAVE_BUILD_TOOLS AND HAVE_AEC AND HAVE_FORTRAN )
ecbuild_add_executable( TARGET f_grib_set_packing
NOINSTALL
SOURCES grib_set_packing.f90
LINKER_LANGUAGE Fortran
LIBS eccodes_f90 eccodes )

ecbuild_add_test( TARGET eccodes_f_grib_set_packing
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_set_packing.sh )
endif()

# Executables without a shell script
#ecbuild_add_executable( TARGET eccodes_f_new_from_file
#ecbuild_add_executable( TARGET f_new_from_file
# NOINSTALL
# SOURCES new_from_file.f90
# CONDITION HAVE_FORTRAN
# LINKER_LANGUAGE Fortran
# LIBS eccodes_f90 eccodes )
ecbuild_add_executable( TARGET eccodes_f_grib_set_gvc
ecbuild_add_executable( TARGET f_grib_set_gvc
NOINSTALL
SOURCES grib_set_gvc.f90
CONDITION HAVE_FORTRAN
LINKER_LANGUAGE Fortran
LIBS eccodes_f90 eccodes )
ecbuild_add_executable( TARGET eccodes_f_grib_print_data_static
ecbuild_add_executable( TARGET f_grib_print_data_static
NOINSTALL
SOURCES grib_print_data_static.f90
CONDITION HAVE_FORTRAN
Expand Down
4 changes: 2 additions & 2 deletions examples/F90/bufr_attributes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@


# Define a common label for all the tmp files
label="bufr_attributes_test_f"
label="examples_f_bufr_attributes"

# Define tmp file
fTmp=${label}.tmp.txt
rm -f ${fTmp}

# We check "syno_multi.bufr". The path is hard coded in the example
${examples_dir}/eccodes_f_bufr_attributes > $fTmp
${examples_dir}/f_bufr_attributes > $fTmp

# Check the results
grep -q 'airTemperatureAt2M->percentConfidence->code: *33007' $fTmp
Expand Down
2 changes: 1 addition & 1 deletion examples/F90/bufr_clone.f90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ program bufr_clone
call codes_open_file(infile, '../../data/bufr/syno_multi.bufr', 'r')

! Open target file
call codes_open_file(outfile, 'bufr_clone_test_f.clone.bufr', 'w')
call codes_open_file(outfile, 'examples_f_bufr_clone.clone.bufr', 'w')

! The first bufr message is loaded from file,
! ibufr is the bufr id to be used in subsequent calls
Expand Down
Loading

0 comments on commit 8b12e4d

Please sign in to comment.