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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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   ;***************************************************
Note: See TracChangeset for help on using the changeset viewer.