Ignore:
Timestamp:
Mar 6, 2015 8:22:12 AM (9 years ago)
Author:
heinze
Message:

Changes to allow for using NCL version 6.2.1 and higher. Backward compatibility is also ensured.

Location:
palm/trunk/SCRIPTS/NCL
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/NCL/cross_sections.ncl

    r1248 r1559  
    66
    77;***************************************************
    8 ; load .ncl.config or .ncl.config.default
     8; Checking the kind of the script
    99;***************************************************
    1010
     
    1212local script
    1313begin
    14    script="cross_section"
     14   script = "cross_section"
    1515   return(script)
    1616end
    1717
    18 if (isfilepresent("$PALM_BIN/../../.ncl.config")) then
     18;***************************************************
     19; Retrieving the NCL version used
     20;***************************************************
     21   
     22ncl_version_ch = systemfunc("ncl -V")
     23ncl_version    = stringtofloat(ncl_version_ch)
     24
     25;***************************************************
     26; Function for checking file existence in dependence
     27; on NCL version
     28;***************************************************
     29
     30function file_exists(version:string,file_name:string)
     31begin
     32   if( version .EQ. "6.2.1" ) then
     33      existing = fileexists(file_name)
     34   else
     35      existing = isfilepresent(file_name)
     36   end if
     37   return(existing)
     38end
     39 
     40;***************************************************
     41; load .ncl.config or .ncl.config.default
     42;***************************************************
     43   
     44file_name ="$PALM_BIN/../../.ncl.config"
     45existing_file = file_exists(ncl_version_ch,file_name)
     46
     47if (existing_file) then
    1948   loadscript("$PALM_BIN/../../.ncl.config")
    2049else
    21   if (isfilepresent("$PALM_BIN/NCL/.ncl.config.default")) then
    22      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
    23   else
     50   file_name = "$PALM_BIN/NCL/.ncl.config.default"
     51   existing_file = file_exists(ncl_version_ch,file_name)
     52   if (existing_file) then
     53      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
     54   else
    2455      palm_bin_path = getenv("PALM_BIN")
    2556      print(" ")
     
    3263      exit
    3364   end if
    34 end if    
     65end if
    3566
    3667begin
    37 
    38    ;***************************************************
    39    ; Retrieving the NCL version used
    40    ;***************************************************
    41    
    42    ncl_version_ch = systemfunc("ncl -V")
    43    ncl_version    = stringtofloat(ncl_version_ch)
    4468
    4569   ; ***************************************************
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r1528 r1559  
    44
    55;***************************************************
    6 ; load .ncl.config or .ncl.config.default
     6; Checking the kind of the script
    77;***************************************************
    88
     
    1010local script
    1111begin
    12    script="profiles"
     12   script = "profiles"
    1313   return(script)
    1414end
     15
     16;***************************************************
     17; Retrieving the NCL version used
     18;***************************************************
    1519   
    16 if (isfilepresent("$PALM_BIN/../../.ncl.config")) then
     20ncl_version_ch = systemfunc("ncl -V")
     21ncl_version    = stringtofloat(ncl_version_ch)
     22
     23;***************************************************
     24; Function for checking file existence in dependence
     25; on NCL version
     26;***************************************************
     27
     28function file_exists(version:string,file_name:string)
     29begin
     30   if( version .EQ. "6.2.1" ) then
     31      existing = fileexists(file_name)
     32   else
     33      existing = isfilepresent(file_name)
     34   end if
     35   return(existing)
     36end
     37 
     38;***************************************************
     39; load .ncl.config or .ncl.config.default
     40;***************************************************
     41   
     42file_name ="$PALM_BIN/../../.ncl.config"
     43existing_file = file_exists(ncl_version_ch,file_name)
     44
     45if (existing_file) then
    1746   loadscript("$PALM_BIN/../../.ncl.config")
    1847else
    19   if (isfilepresent("$PALM_BIN/NCL/.ncl.config.default")) then
    20      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
    21   else
     48   file_name = "$PALM_BIN/NCL/.ncl.config.default"
     49   existing_file = file_exists(ncl_version_ch,file_name)
     50   if (existing_file) then
     51      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
     52   else
    2253      palm_bin_path = getenv("PALM_BIN")
    2354      print(" ")
     
    3061      exit
    3162   end if
    32 end if    
     63end if
    3364
    3465   
    3566begin
    36 
    37    ;***************************************************
    38    ; Retrieving the NCL version used
    39    ;***************************************************
    40    
    41    ncl_version_ch = systemfunc("ncl -V")
    42    ncl_version    = stringtofloat(ncl_version_ch)
    4367
    4468   ;***************************************************
  • palm/trunk/SCRIPTS/NCL/spectra.ncl

    r1527 r1559  
    44
    55;***************************************************
    6 ; load .ncl.config or .ncl.config.default
     6; Checking the kind of the script
    77;***************************************************
    88
     
    1010local script
    1111begin
    12    script="spectra"
     12   script = "spectra"
    1313   return(script)
    1414end
    15    
    16 if (isfilepresent("$PALM_BIN/../../.ncl.config")) then
     15
     16;***************************************************
     17; Retrieving the NCL version used
     18;***************************************************
     19   
     20ncl_version_ch = systemfunc("ncl -V")
     21ncl_version    = stringtofloat(ncl_version_ch)
     22
     23;***************************************************
     24; Function for checking file existence in dependence
     25; on NCL version
     26;***************************************************
     27
     28function file_exists(version:string,file_name:string)
     29begin
     30   if( version .EQ. "6.2.1" ) then
     31      existing = fileexists(file_name)
     32   else
     33      existing = isfilepresent(file_name)
     34   end if
     35   return(existing)
     36end
     37 
     38;***************************************************
     39; load .ncl.config or .ncl.config.default
     40;***************************************************
     41   
     42file_name ="$PALM_BIN/../../.ncl.config"
     43existing_file = file_exists(ncl_version_ch,file_name)
     44
     45if (existing_file) then
    1746   loadscript("$PALM_BIN/../../.ncl.config")
    1847else
    19   if (isfilepresent("$PALM_BIN/NCL/.ncl.config.default")) then
    20      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
    21   else
     48   file_name = "$PALM_BIN/NCL/.ncl.config.default"
     49   existing_file = file_exists(ncl_version_ch,file_name)
     50   if (existing_file) then
     51      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
     52   else
    2253      palm_bin_path = getenv("PALM_BIN")
    2354      print(" ")
     
    3061      exit
    3162   end if
    32 end if    
     63end if
    3364
    3465begin
    35 
    36    ;***************************************************
    37    ; Retrieving the NCL version used
    38    ;***************************************************
    39    
    40    ncl_version_ch = systemfunc("ncl -V")
    41    ncl_version    = stringtofloat(ncl_version_ch)
    4266
    4367   ;***************************************************
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r1248 r1559  
    33load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
    44load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
    5  
     5
     6;***************************************************
     7; Checking the kind of the script
     8;***************************************************
     9
     10function which_script()
     11local script
     12begin
     13   script = "timeseries"
     14   return(script)
     15end
     16
     17;***************************************************
     18; Retrieving the NCL version used
     19;***************************************************
     20   
     21ncl_version_ch = systemfunc("ncl -V")
     22ncl_version    = stringtofloat(ncl_version_ch)
     23
     24;***************************************************
     25; Function for checking file existence in dependence
     26; on NCL version
     27;***************************************************
     28
     29function file_exists(version:string,file_name:string)
     30begin
     31   if( version .EQ. "6.2.1" ) then
     32      existing = fileexists(file_name)
     33   else
     34      existing = isfilepresent(file_name)
     35   end if
     36   return(existing)
     37end
     38 
    639;***************************************************
    740; load .ncl.config or .ncl.config.default
    841;***************************************************
    9 
    10 function which_script()
    11 local script
    12 begin
    13    script="timeseries"
    14    return(script)
    15 end
    16 
    17 if (isfilepresent("$PALM_BIN/../../.ncl.config")) then
     42   
     43file_name ="$PALM_BIN/../../.ncl.config"
     44existing_file = file_exists(ncl_version_ch,file_name)
     45
     46if (existing_file) then
    1847   loadscript("$PALM_BIN/../../.ncl.config")
    1948else
    20   if (isfilepresent("$PALM_BIN/NCL/.ncl.config.default")) then
    21      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
    22   else
     49   file_name = "$PALM_BIN/NCL/.ncl.config.default"
     50   existing_file = file_exists(ncl_version_ch,file_name)
     51   if (existing_file) then
     52      loadscript( "$PALM_BIN/NCL/.ncl.config.default")
     53   else
    2354      palm_bin_path = getenv("PALM_BIN")
    2455      print(" ")
     
    3162      exit
    3263   end if
    33 end if   
    34    
     64end if
     65
    3566begin
    36 
    37    ;***************************************************
    38    ; Retrieving the NCL version used
    39    ;***************************************************
    40    
    41    ncl_version_ch = systemfunc("ncl -V")
    42    ncl_version    = stringtofloat(ncl_version_ch)
    4367
    4468   ;***************************************************
Note: See TracChangeset for help on using the changeset viewer.