Class NetcdfClibrary


  • public class NetcdfClibrary
    extends Object
    Static methods to load the netcdf C library.
    • Method Detail

      • setLibraryNameAndPath

        public static void setLibraryNameAndPath​(@Nullable
                                                 String jna_path,
                                                 @Nullable
                                                 String lib_name)
        Set the path and name of the netcdf c library. Must be called before load() is called.
        Parameters:
        jna_path - path to shared libraries, may be null. If null, will look for system property "jna.library.path", then environment variable "JNA_PATH". If set, will set the environment variable "JNA_PATH".
        lib_name - library name, may be null. If null, will use "netcdf".
      • isLibraryPresent

        public static boolean isLibraryPresent()
        Test if the netcdf C library is present and loaded
        Returns:
        true if present
      • getForeignFunctionInterface

        public static Nc4prototypes getForeignFunctionInterface()
        Get the interface to the Nectdf C library.
      • getVersion

        @Nullable
        public static String getVersion()
        Get the version of the loaded Nectdf C library. Call isClibraryPresent() first.
      • setLogLevel

        public static int setLogLevel​(int level)
        Set the log level for Netcdf C library. This calls the Netcdf C library nc_set_log_level() method. If the system property "jna.library.loglevel" is set, that is the default, this method overrides it.
        Returns:
        the previous level, as returned from nc_set_log_level().