Skip to content

Commit

Permalink
correct error messages, quiet pkg-config
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Mar 19, 2020
1 parent c56030b commit 91ac516
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
build/
build*/

# Prerequisites
*.d
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
project(nc4fortran
LANGUAGES Fortran
VERSION 0.4.1
VERSION 0.4.2
DESCRIPTION "thin, light, easy NetCDF4 Fortran interface"
HOMEPAGE_URL https://github.com/scivision/nc4fortran)
enable_testing()
Expand Down
6 changes: 3 additions & 3 deletions cmake/Modules/FindNetCDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

function(netcdf_c)

pkg_check_modules(NC netcdf) # C / CXX
pkg_check_modules(NC netcdf QUIET) # C / CXX

find_path(NetCDF_INCLUDE_DIR
NAMES netcdf.h
Expand Down Expand Up @@ -36,9 +36,9 @@ if(NOT CMAKE_Fortran_COMPILER)
return()
endif()

pkg_check_modules(NC netcdf-fortran)
pkg_check_modules(NC netcdf-fortran QUIET)
if(NOT NC_FOUND) # homebrew
pkg_check_modules(NC netcdf)
pkg_check_modules(NC netcdf QUIET)
endif()

find_path(NetCDF_Fortran_INCLUDE_DIR
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project('nc4fortran', 'fortran',
meson_version : '>=0.52.0',
version: '0.4.1',
version: '0.4.2',
default_options : ['default_library=static', 'buildtype=release', 'warning_level=3'])

subdir('meson')
Expand Down
8 changes: 5 additions & 3 deletions src/interface.f90
Original file line number Diff line number Diff line change
Expand Up @@ -278,22 +278,24 @@ logical function check_error(code, dname)
select case (code)
case (NF90_NOERR)
check_error = .false.
case (NF90_EHDFERR)
m = 'ERROR: ' // dname // ' an error was reported by the HDF5 layer.'
case (NF90_EBADNAME)
m = 'ERROR: ' // dname // ' is the name of another existing variable'
m = 'ERROR: ' // dname // ' Name contains illegal characters.'
case (NF90_EBADTYPE)
m = 'ERROR: ' // dname // ' specified type is not a valid netCDF type'
case (NF90_EBADDIM)
m = 'ERROR: ' // dname // ' invalid dimension ID or Name'
case (NF90_EBADGRPID)
m = 'ERROR: ' // dname // ' bad group ID in ncid'
case (NF90_EBADID)
m = 'ERROR: ' // dname // ' type ID not found'
m = 'ERROR: ' // dname // ' Bad group id or ncid invalid'
case (NF90_ENOTVAR)
m = 'ERROR: ' // dname // ' variable not found'
case (NF90_ENOTNC)
m = 'ERROR: ' // dname // ' not a NetCDF file'
case (NF90_ENAMEINUSE)
m = 'ERROR: ' // dname // ' string match to name in use'
m = 'ERROR: ' // dname // ' That name is in use. Compound type names must be unique in the data file.'
case (NF90_ECHAR)
m = 'ERROR: ' // dname // ' attempt to convert between text & numbers'
case (NF90_EEDGE)
Expand Down

0 comments on commit 91ac516

Please sign in to comment.