Changeset 2837 for palm/trunk/SCRIPTS


Ignore:
Timestamp:
Feb 26, 2018 2:04:53 PM (6 years ago)
Author:
gronemeier
Message:

palmplot: config file of ncl scripts can be chosen in shell command

Location:
palm/trunk/SCRIPTS
Files:
5 edited

Legend:

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

    r2147 r2837  
    4141; load .ncl.config or .ncl.config.default
    4242;***************************************************
    43    
    44 file_name ="$PALM_BIN/../../.ncl.config"
    45 existing_file = file_exists(ncl_version_ch,file_name)
    46 
     43
     44existing_file = file_exists(ncl_version_ch,file_config)
    4745if (existing_file) then
    48    loadscript("$PALM_BIN/../../.ncl.config")
     46   loadscript(file_config)
    4947else
    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
    55       palm_bin_path = getenv("PALM_BIN")
    56       print(" ")
    57       print("Neither the personal configuration file '.ncl.config' exists in")
    58       print("~/palm/current_version")
    59       print("nor the default configuration file '.ncl.config.default' "+\
    60             "exists in")
    61       print(palm_bin_path + "/NCL")
    62       print(" ")
    63       exit
    64    end if
    65 end if
     48   palm_bin_path = getenv("PALM_BIN")
     49   print(" ")
     50   print("Neither the personal configuration file '.ncl.config' exists in")
     51   print("~/palm/current_version")
     52   print("nor the default configuration file '.ncl.config.default' "+\
     53         "exists in")
     54   print(palm_bin_path + "/NCL")
     55   print(" ")
     56   exit
     57end if
     58
    6659
    6760begin
  • palm/trunk/SCRIPTS/NCL/profiles.ncl

    r2297 r2837  
    3939; load .ncl.config or .ncl.config.default
    4040;***************************************************
    41    
    42 file_name ="$PALM_BIN/../../.ncl.config"
    43 existing_file = file_exists(ncl_version_ch,file_name)
    44 
     41
     42existing_file = file_exists(ncl_version_ch,file_config)
    4543if (existing_file) then
    46    loadscript("$PALM_BIN/../../.ncl.config")
     44   loadscript(file_config)
    4745else
    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
    53       palm_bin_path = getenv("PALM_BIN")
    54       print(" ")
    55       print("Neither the personal configuration file '.ncl.config' exists in")
    56       print("~/palm/current_version")
    57       print("nor the default configuration file '.ncl.config.default' "+\
    58             "exists in")
    59       print(palm_bin_path + "/NCL")
    60       print(" ")
    61       exit
    62    end if
    63 end if
     46   palm_bin_path = getenv("PALM_BIN")
     47   print(" ")
     48   print("Neither the personal configuration file '.ncl.config' exists in")
     49   print("~/palm/current_version")
     50   print("nor the default configuration file '.ncl.config.default' "+\
     51         "exists in")
     52   print(palm_bin_path + "/NCL")
     53   print(" ")
     54   exit
     55end if
    6456
    6557   
  • palm/trunk/SCRIPTS/NCL/spectra.ncl

    r2563 r2837  
    3939; load .ncl.config or .ncl.config.default
    4040;***************************************************
    41    
    42 file_name ="$PALM_BIN/../../.ncl.config"
    43 existing_file = file_exists(ncl_version_ch,file_name)
    44 
     41
     42existing_file = file_exists(ncl_version_ch,file_config)
    4543if (existing_file) then
    46    loadscript("$PALM_BIN/../../.ncl.config")
     44   loadscript(file_config)
    4745else
    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
    53       palm_bin_path = getenv("PALM_BIN")
    54       print(" ")
    55       print("Neither the personal configuration file '.ncl.config' exists in")
    56       print("~/palm/current_version")
    57       print("nor the default configuration file '.ncl.config.default' "+\
    58             "exists in")
    59       print(palm_bin_path + "/NCL")
    60       print(" ")
    61       exit
    62    end if
    63 end if
     46   palm_bin_path = getenv("PALM_BIN")
     47   print(" ")
     48   print("Neither the personal configuration file '.ncl.config' exists in")
     49   print("~/palm/current_version")
     50   print("nor the default configuration file '.ncl.config.default' "+\
     51         "exists in")
     52   print(palm_bin_path + "/NCL")
     53   print(" ")
     54   exit
     55end if
     56
    6457
    6558begin
  • palm/trunk/SCRIPTS/NCL/timeseries.ncl

    r2030 r2837  
    4040; load .ncl.config or .ncl.config.default
    4141;***************************************************
    42    
    43 file_name ="$PALM_BIN/../../.ncl.config"
    44 existing_file = file_exists(ncl_version_ch,file_name)
    45 
     42
     43existing_file = file_exists(ncl_version_ch,file_config)
    4644if (existing_file) then
    47    loadscript("$PALM_BIN/../../.ncl.config")
     45   loadscript(file_config)
    4846else
    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
    54       palm_bin_path = getenv("PALM_BIN")
    55       print(" ")
    56       print("Neither the personal configuration file '.ncl.config' exists in")
    57       print("~/palm/current_version")
    58       print("nor the default configuration file '.ncl.config.default' "+\
    59             "exists in")
    60       print(palm_bin_path + "/NCL")
    61       print(" ")
    62       exit
    63    end if
     47   palm_bin_path = getenv("PALM_BIN")
     48   print(" ")
     49   print("Neither the personal configuration file '.ncl.config' exists in")
     50   print("~/palm/current_version")
     51   print("nor the default configuration file '.ncl.config.default' "+\
     52         "exists in")
     53   print(palm_bin_path + "/NCL")
     54   print(" ")
     55   exit
    6456end if
     57
    6558
    6659begin
  • palm/trunk/SCRIPTS/palmplot

    r2718 r2837  
    1919# Current revisions:
    2020# -----------------
    21 #
     21# assign configuration file within palmplot call
    2222#
    2323# Former revisions:
     
    9191 # CS: cross_sections.ncl PR: profiles.ncl SP: spectra.ncl TS: timeseries.ncl
    9292 # VA: PARAMETERS WHICH CONTAIN LISTS OF VARIABLE NAMES
    93  STRINGPARAMS_CO="file_1 format_out file_out var "
     93 STRINGPARAMS_CO="file_1 format_out file_out var file_config "
    9494 STRINGPARAMS_CS="sort mode fill_mode unit_x unit_y unit_z vec1 vec2 plotvec"
    9595 STRINGPARAMS_PR="file_2 file_3 file_4 file_5 file_6 name_legend_1 name_legend_2 name_legend_3 name_legend_4 name_legend_5 name_legend_6 c_var"
     
    149149       value=$PWD/$value
    150150    fi
    151      
     151
     152    # USE CONFIG FILE SPECIFIED BY USER
     153    if [ "$key" = "file_config" ]
     154    then
     155       if [ -f $value ]
     156       then
     157          use_user_config=true
     158       else
     159          printf "\n  configuration file \"$value\" not found."
     160          printf "\n  trying to use one of the standard configuraion files...\n"
     161       fi
     162    fi
     163
    152164    # PROCESSING STRINGS
    153165    for a in $STRINGPARAMS
     
    193205 done
    194206
     207 # SET CONFIGURATION FILE TO ONE OF THE DEFAULT FILES IF NOT SPECIFIED BY USER
     208 if [ "$use_user_config" != true ]
     209 then
     210    key="file_config"
     211
     212    if [ -f $PALM_BIN/../../.ncl.config ]
     213    then
     214       value="\"$PALM_BIN/../../.ncl.config\""
     215    else
     216       value="\"$PALM_BIN/NCL/.ncl.config.default\""
     217    fi
     218
     219    CMDLINE=$CMDLINE"$key=$value "
     220 fi
     221
    195222 # EXECUTING THE PARTICULAR NCL SCRIPT
    196223 cd $PALM_BIN/NCL
    197224 ncl 'dq=str_get_dq()' $script $CMDLINE
    198 
    199 
    200 
    201 
    202 
    203 
Note: See TracChangeset for help on using the changeset viewer.