--- libsrc/minc.h.orig	2004-09-28 15:23:40.000000000 -0500
+++ libsrc/minc.h	2011-03-12 01:44:21.000000000 -0600
@@ -358,7 +358,9 @@
 
 /* Constants for image conversion variable (icv) properties */
 /* Maximum number of icv's allowed */
-#define MI_MAX_NUM_ICV MAX_NC_OPEN
+/* changed to 32 as netcdf 4.x no longer defines MAX_NC_OPEN */
+/* #define MI_MAX_NUM_ICV MAX_NC_OPEN */
+#define MI_MAX_NUM_ICV 32
 /* Default max and min for normalization */
 #define MI_DEFAULT_MAX 1.0
 #define MI_DEFAULT_MIN 0.0
--- libsrc/voxel_loop.c.orig	2004-09-28 15:23:40.000000000 -0500
+++ libsrc/voxel_loop.c	2011-03-12 01:44:57.000000000 -0600
@@ -1946,7 +1946,7 @@
 
    /* Keep track of number of files that we can open */
    num_free_files = loop_options->max_open_files;
-   if (num_free_files > MAX_NC_OPEN) num_free_files = MAX_NC_OPEN;
+   if (num_free_files > MI_MAX_NUM_ICV) num_free_files = MI_MAX_NUM_ICV;
 
    /* Check to see if we can open output files (we must leave room for one
       input file) */
@@ -2661,7 +2661,7 @@
    loop_options->is_signed = TRUE;
    loop_options->valid_range[0] = 0.0;
    loop_options->valid_range[1] = 0.0;
-   loop_options->max_open_files = MAX_NC_OPEN - 2;
+   loop_options->max_open_files = MI_MAX_NUM_ICV - 2;
    loop_options->check_all_input_dim_info = TRUE;
    loop_options->convert_input_to_scalar = FALSE;
    loop_options->output_vector_size = 0;
@@ -2776,7 +2776,7 @@
 @NAME       : set_loop_max_open_files
 @INPUT      : loop_options - user options for looping
               max_open_files - maximum number of open files allowed (between
-                 1 and MAX_NC_OPEN)
+                 1 and MI_MAX_NUM_ICV)
 @OUTPUT     : (none)
 @RETURNS    : (nothing)
 @DESCRIPTION: Routine to set the maximum number of open minc files.
@@ -2789,7 +2789,7 @@
 MNCAPI void set_loop_max_open_files(Loop_Options *loop_options, 
                                     int max_open_files)
 {
-   if ((max_open_files <= 0) || (max_open_files > MAX_NC_OPEN)) {
+   if ((max_open_files <= 0) || (max_open_files > MI_MAX_NUM_ICV)) {
       (void) fprintf(stderr, 
                      "Bad number of files %d in set_loop_max_open_files\n",
                      max_open_files);
