Index: /palm/trunk/SCRIPTS/NCL/cross_sections.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 1558)
+++ /palm/trunk/SCRIPTS/NCL/cross_sections.ncl	(revision 1559)
@@ -6,5 +6,5 @@
 
 ;***************************************************
-; load .ncl.config or .ncl.config.default
+; Checking the kind of the script
 ;***************************************************
 
@@ -12,14 +12,45 @@
 local script 
 begin 
-   script="cross_section"
+   script = "cross_section"
    return(script)
 end
 
-if (isfilepresent("$PALM_BIN/../../.ncl.config")) then
+;***************************************************
+; Retrieving the NCL version used
+;***************************************************
+   
+ncl_version_ch = systemfunc("ncl -V") 
+ncl_version    = stringtofloat(ncl_version_ch)
+
+;***************************************************
+; Function for checking file existence in dependence
+; on NCL version
+;***************************************************
+
+function file_exists(version:string,file_name:string)
+begin
+   if( version .EQ. "6.2.1" ) then
+      existing = fileexists(file_name)
+   else
+      existing = isfilepresent(file_name)
+   end if
+   return(existing)
+end
+  
+;***************************************************
+; load .ncl.config or .ncl.config.default
+;***************************************************
+   
+file_name ="$PALM_BIN/../../.ncl.config"
+existing_file = file_exists(ncl_version_ch,file_name)
+
+if (existing_file) then
    loadscript("$PALM_BIN/../../.ncl.config")
 else
-  if (isfilepresent("$PALM_BIN/NCL/.ncl.config.default")) then
-     loadscript( "$PALM_BIN/NCL/.ncl.config.default")
-  else
+   file_name = "$PALM_BIN/NCL/.ncl.config.default"
+   existing_file = file_exists(ncl_version_ch,file_name)
+   if (existing_file) then
+      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
+   else
       palm_bin_path = getenv("PALM_BIN")
       print(" ")
@@ -32,14 +63,7 @@
       exit
    end if
-end if    
+end if 
 
 begin
-
-   ;***************************************************
-   ; Retrieving the NCL version used
-   ;***************************************************
-   
-   ncl_version_ch = systemfunc("ncl -V") 
-   ncl_version    = stringtofloat(ncl_version_ch)
 
    ; ***************************************************
Index: /palm/trunk/SCRIPTS/NCL/profiles.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 1558)
+++ /palm/trunk/SCRIPTS/NCL/profiles.ncl	(revision 1559)
@@ -4,5 +4,5 @@
 
 ;***************************************************
-; load .ncl.config or .ncl.config.default
+; Checking the kind of the script
 ;***************************************************
 
@@ -10,14 +10,45 @@
 local script 
 begin 
-   script="profiles"
+   script = "profiles"
    return(script)
 end
+
+;***************************************************
+; Retrieving the NCL version used
+;***************************************************
    
-if (isfilepresent("$PALM_BIN/../../.ncl.config")) then
+ncl_version_ch = systemfunc("ncl -V") 
+ncl_version    = stringtofloat(ncl_version_ch)
+
+;***************************************************
+; Function for checking file existence in dependence
+; on NCL version
+;***************************************************
+
+function file_exists(version:string,file_name:string)
+begin
+   if( version .EQ. "6.2.1" ) then
+      existing = fileexists(file_name)
+   else
+      existing = isfilepresent(file_name)
+   end if
+   return(existing)
+end
+  
+;***************************************************
+; load .ncl.config or .ncl.config.default
+;***************************************************
+   
+file_name ="$PALM_BIN/../../.ncl.config"
+existing_file = file_exists(ncl_version_ch,file_name)
+
+if (existing_file) then
    loadscript("$PALM_BIN/../../.ncl.config")
 else
-  if (isfilepresent("$PALM_BIN/NCL/.ncl.config.default")) then
-     loadscript( "$PALM_BIN/NCL/.ncl.config.default")
-  else
+   file_name = "$PALM_BIN/NCL/.ncl.config.default"
+   existing_file = file_exists(ncl_version_ch,file_name)
+   if (existing_file) then
+      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
+   else
       palm_bin_path = getenv("PALM_BIN")
       print(" ")
@@ -30,15 +61,8 @@
       exit
    end if
-end if    
+end if 
 
     
 begin
-
-   ;***************************************************
-   ; Retrieving the NCL version used
-   ;***************************************************
-   
-   ncl_version_ch = systemfunc("ncl -V") 
-   ncl_version    = stringtofloat(ncl_version_ch)
 
    ;***************************************************
Index: /palm/trunk/SCRIPTS/NCL/spectra.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 1558)
+++ /palm/trunk/SCRIPTS/NCL/spectra.ncl	(revision 1559)
@@ -4,5 +4,5 @@
 
 ;***************************************************
-; load .ncl.config or .ncl.config.default
+; Checking the kind of the script
 ;***************************************************
 
@@ -10,14 +10,45 @@
 local script 
 begin 
-   script="spectra"
+   script = "spectra"
    return(script)
 end
-   
-if (isfilepresent("$PALM_BIN/../../.ncl.config")) then
+
+;***************************************************
+; Retrieving the NCL version used
+;***************************************************
+   
+ncl_version_ch = systemfunc("ncl -V") 
+ncl_version    = stringtofloat(ncl_version_ch)
+
+;***************************************************
+; Function for checking file existence in dependence
+; on NCL version
+;***************************************************
+
+function file_exists(version:string,file_name:string)
+begin
+   if( version .EQ. "6.2.1" ) then
+      existing = fileexists(file_name)
+   else
+      existing = isfilepresent(file_name)
+   end if
+   return(existing)
+end
+  
+;***************************************************
+; load .ncl.config or .ncl.config.default
+;***************************************************
+   
+file_name ="$PALM_BIN/../../.ncl.config"
+existing_file = file_exists(ncl_version_ch,file_name)
+
+if (existing_file) then
    loadscript("$PALM_BIN/../../.ncl.config")
 else
-  if (isfilepresent("$PALM_BIN/NCL/.ncl.config.default")) then
-     loadscript( "$PALM_BIN/NCL/.ncl.config.default")
-  else
+   file_name = "$PALM_BIN/NCL/.ncl.config.default"
+   existing_file = file_exists(ncl_version_ch,file_name)
+   if (existing_file) then
+      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
+   else
       palm_bin_path = getenv("PALM_BIN")
       print(" ")
@@ -30,14 +61,7 @@
       exit
    end if
-end if    
+end if 
 
 begin
-
-   ;***************************************************
-   ; Retrieving the NCL version used
-   ;***************************************************
-   
-   ncl_version_ch = systemfunc("ncl -V") 
-   ncl_version    = stringtofloat(ncl_version_ch)
 
    ;***************************************************
Index: /palm/trunk/SCRIPTS/NCL/timeseries.ncl
===================================================================
--- /palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 1558)
+++ /palm/trunk/SCRIPTS/NCL/timeseries.ncl	(revision 1559)
@@ -3,22 +3,53 @@
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
- 
+
+;***************************************************
+; Checking the kind of the script
+;***************************************************
+
+function which_script()
+local script 
+begin 
+   script = "timeseries"
+   return(script)
+end
+
+;***************************************************
+; Retrieving the NCL version used
+;***************************************************
+   
+ncl_version_ch = systemfunc("ncl -V") 
+ncl_version    = stringtofloat(ncl_version_ch)
+
+;***************************************************
+; Function for checking file existence in dependence
+; on NCL version
+;***************************************************
+
+function file_exists(version:string,file_name:string)
+begin
+   if( version .EQ. "6.2.1" ) then
+      existing = fileexists(file_name)
+   else
+      existing = isfilepresent(file_name)
+   end if
+   return(existing)
+end
+  
 ;***************************************************
 ; load .ncl.config or .ncl.config.default
 ;***************************************************
-
-function which_script()
-local script 
-begin 
-   script="timeseries"
-   return(script)
-end
-
-if (isfilepresent("$PALM_BIN/../../.ncl.config")) then
+   
+file_name ="$PALM_BIN/../../.ncl.config"
+existing_file = file_exists(ncl_version_ch,file_name)
+
+if (existing_file) then
    loadscript("$PALM_BIN/../../.ncl.config")
 else
-  if (isfilepresent("$PALM_BIN/NCL/.ncl.config.default")) then
-     loadscript( "$PALM_BIN/NCL/.ncl.config.default")
-  else
+   file_name = "$PALM_BIN/NCL/.ncl.config.default"
+   existing_file = file_exists(ncl_version_ch,file_name)
+   if (existing_file) then
+      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
+   else
       palm_bin_path = getenv("PALM_BIN")
       print(" ")
@@ -31,14 +62,7 @@
       exit
    end if
-end if    
-   
+end if
+
 begin
-
-   ;***************************************************
-   ; Retrieving the NCL version used
-   ;***************************************************
-   
-   ncl_version_ch = systemfunc("ncl -V") 
-   ncl_version    = stringtofloat(ncl_version_ch)
 
    ;***************************************************
