Index: trunk/SRC/Interpolation/file_interp.pro
===================================================================
--- trunk/SRC/Interpolation/file_interp.pro	(revision 433)
+++ trunk/SRC/Interpolation/file_interp.pro	(revision 443)
@@ -27,5 +27,5 @@
                         , INIRR = inirr, METHOD = method, SMOOTH = smooth $
                         , WEIG = weig, ADDR = addr, MISSING_VALUE = missing_value $
-                        , DIVX = divx, DIVY = divy $
+                        , DIVX = divx, DIVY = divy, OUTMASK = outmask $
                         , GETHAN = gethan, LETHAN = lethan, _EXTRA = ex
 ;
@@ -75,4 +75,5 @@
 
   if intype LE 3 THEN data = round(temporary(data))
+  IF outmask[0] NE -1 THEN data = temporary(data) * outmask
 
   RETURN, data
@@ -438,6 +439,7 @@
       IF varinq.ndims EQ 0 THEN BEGIN ; scalar variable
         outvarid[i] = ncdf_vardef(outid, varinq.name $
-                                  , BYTE = varinq.datatype EQ 'BYTE', CHAR = varinq.datatype EQ 'CHAR' $
-                                  , SHORT = varinq.datatype EQ 'INT' OR varinq.datatype EQ 'SHORT' $
+;                                  , BYTE = varinq.datatype EQ 'BYTE', CHAR = varinq.datatype EQ 'CHAR' $
+                                  , CHAR = varinq.datatype EQ 'CHAR' $
+                                  , SHORT = varinq.datatype EQ 'INT' OR varinq.datatype EQ 'SHORT' OR varinq.datatype EQ 'BYTE' $
                                   , LONG = varinq.datatype EQ 'LONG' $
                                   , FLOAT = varinq.datatype EQ 'FLOAT', DOUBLE = varinq.datatype EQ 'DOUBLE')
@@ -458,6 +460,7 @@
         IF dimvar[0] NE -1 THEN BEGIN
           outvarid[i] = ncdf_vardef(outid, varinq.name, dimvar $
-                                    , BYTE = varinq.datatype EQ 'BYTE', CHAR = varinq.datatype EQ 'CHAR' $
-                                    , SHORT = varinq.datatype EQ 'INT' OR varinq.datatype EQ 'SHORT' $
+;                                    , BYTE = varinq.datatype EQ 'BYTE', CHAR = varinq.datatype EQ 'CHAR' $
+                                    , CHAR = varinq.datatype EQ 'CHAR' $
+                                    , SHORT = varinq.datatype EQ 'INT' OR varinq.datatype EQ 'SHORT' OR varinq.datatype EQ 'BYTE' $
                                     , LONG = varinq.datatype EQ 'LONG' $
                                     , FLOAT = varinq.datatype EQ 'FLOAT', DOUBLE = varinq.datatype EQ 'DOUBLE')
@@ -511,5 +514,5 @@
                                                   , INIRR = inirr, METHOD = method, SMOOTH = smooth $
                                                   , WEIG = weig, ADDR = addr, MISSING_VALUE = var_missing_value $
-                                                  , DIVX = divx, DIVY = divy $
+                                                  , DIVX = divx, DIVY = divy, OUTMASK = outmask $
                                                   , GETHAN = gethan, LETHAN = lethan, _extra = ex)
               IF interp AND n_elements(data) EQ 1 THEN data = replicate(data, jpiout, jpjout)
@@ -530,5 +533,5 @@
                                                     , INIRR = inirr, METHOD = method, SMOOTH = smooth $
                                                     , WEIG = weig, ADDR = addr, MISSING_VALUE = var_missing_value $
-                                                    , DIVX = divx, DIVY = divy $
+                                                    , DIVX = divx, DIVY = divy, OUTMASK = outmask $
                                                     , GETHAN = gethan, LETHAN = lethan, _extra = ex)
                 IF interp AND n_elements(data) EQ 1 THEN data = replicate(data, jpiout, jpjout)
@@ -550,5 +553,5 @@
                                                       , INIRR = inirr, METHOD = method, SMOOTH = smooth $
                                                       , WEIG = weig, ADDR = addr, MISSING_VALUE = var_missing_value $
-                                                      , DIVX = divx, DIVY = divy $
+                                                      , DIVX = divx, DIVY = divy, OUTMASK = outmask $
                                                       , GETHAN = gethan, LETHAN = lethan, _extra = ex)
                   IF interp AND n_elements(data) EQ 1 THEN data = replicate(data, jpiout, jpjout)
