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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.