= The PALM file configuration file PALM expects all input files to be in the temporary working directory from where it is executed. Also, it writes all output data to this directory. The file configuration file tells {{{palmrun}}}, where the user has stored his input files, and where the user likes to have the output files copied after a PALM run has finished. You can find the default file configuration file that is used by {{{palmrun}}} under [source:palm/trunk/SCRIPTS/.palm.iofiles]. In general, the file configuration file does not need to be touched by the user at all. \\ == Format of the file configuration file The file is given in ASCII format and it generally contains one line per input/output file, which is called ''file connection statement''. A file connection statement is separated into a maximum of six columns. The first five columns are obligatory. The meaning of the columns are explained based on the following example, which shows an excerpt of the default file: {{{ #--------------------------------------------------------------------------------------------- # List of input-files #--------------------------------------------------------------------------------------------- PARIN in:tr d3# $base_data/$jobname/INPUT _p3d* PARIN in:tr d3r $base_data/$jobname/INPUT _p3dr* TOPOGRAPHY_DATA inopt:tr d3#:d3r $base_data/$jobname/INPUT _topo* DATA_1D_PR_NETCDF inopt prr $base_data/$jobname/OUTPUT _pr* nc # #--------------------------------------------------------------------------------------------- # List of output-files #--------------------------------------------------------------------------------------------- BINOUT* out:lnpe restart $fast_io_catalog/$jobname/RESTART _d3d DATA_3D_NETCDF* out:tr * $base_data/$jobname/OUTPUT _3d nc }}} The '''first column''' gives the local filename in PALM's temporary working directory. PALM expects all filenames in capital letters. The '''second column''' gives the file attributes, which need to be separated by a colon (":"). Two attributes are allowed. The '''first attribute''' says, whether the file is an input ({{{in}}}) or an output file ({{{out}}}). {{{palmrun}}} immediately terminates, if it cannot find the user's input file, because it assumes that PALM cannot run without files with attribute {{{in}}}. If you do not want {{{palmrun}}} to terminate, you may give the attribute {{{inopt}}}, which says that this file is optional. The '''second attribute''' can be * {{{tr}}} * {{{tra}}} * {{{pe}}} * {{{lnpe}}} * {{{trpe}}} The '''third column''' gives the so-called activation strings. Two or more strings need to be separated by colons (":"). Activation strings are those given in the {{{palmrun}}} option {{{-a}}}. The respective file connection statement is only processed (i.e. the file is copied), if at least one of its activation strings is set with option {{{-a}}}. In case of the above example, {{{-d "d3#"}}} causes {{{palmrun}}} to provide the input files {{{PARIN}}} and {{{TOPOGRAPHY_DATA}}}. Option {{{-d "d3# restart"}}} additional copies/saves the output file {{{BINOUT}}}. Note that activation strings need to be separated by blanks when given with the option {{{-d}}} and that they need to be embraced by {{{"}}}, even if only one string is given (otherwise, a {{{#}}} would cause the shell to interpret the remaining part of the command as a comment). For output files, a wildcard may be given in the third column. Respective local files will then always be copied, in case they exist, independently from the activation strings given with option {{{-d}}}. Wildcards in the third column are not allowed for input files. The path to the user's permanent file is given in the '''fourth column'''. It may contain environment variables that have been defined in the configuration file. {{{$jobname}}} will be replaced with the argument of {{{palmrun}}} option {{{-d}}}. The '''fifth column''' gives the appendix of the user's permanent file. The '''sixth column''' is optional and may only contain the string {{{nc}}}. This string has to be given if the user's permanent file is a NetCDF file with suffix {{{.nc}}}. \\ == Determination of full file path The full path for input and output files is based on columns 4-6 and the argument of {{{palmrun}}} option {{{-d}}}: {{{ /<-d option>[.] }}} As an example, the file connection statement {{{ DATA_3D_NETCDF* out:tr * $base_data/$jobname/OUTPUT _3d nc }}} plus entry {{{ %base_data ~/palm/current_version/JOBS }}} in the configuration file, plus the call {{{palmrun -d example_test ...}}} will create the output file {{{ ~/palm/current_version/JOBS/example_test/OUTPUT/example_test_3d.nc }}} \\ == Using wildcards in filenames In case of nested runs, masked 3d-output and wind turbine model output, PALM expects or creates multiple input/output files with additional suffixes. As an example, a nested run with a parent and one child requires two parameter files for steering the simulation, where the second file is expected to have the suffix {{{_N02}}}. Each additional nest would require another parameter file with suffixes {{{_N03}}}, {{{_N04}}}, etc. In order to simplify the file configuration file, only one file connection statement {{{ PARIN in:tr d3# $base_data/$jobname/INPUT _p3d* }}} is required for this, where the wildcard in {{{_p3d*}}} causes {{{palmrun}}} to copy files with these suffixes too. Assuming an INPUT folder with files {{{ example_test_p3d example_test_p3d_N02 example_test_p3d_N03 }}} {{{palmrun}}} will copy them to local files {{{ PARIN PARIN_N02 PARIN_N03 }}} The same holds for output files. Here the wildcard must be given as part of the local filename (first column). The example given below assumes one nest (root domain plus one child domain), two output masks for the root domain, and three masks for the child. Assuming a file connection statement for an output file {{{ DATA_MASK_NETCDF* out:tr * $base_data/$jobname/OUTPUT _masked nc }}} and following local files that have been created by PALM {{{ DATA_MASK_NETCDF_M01 DATA_MASK_NETCDF_M02 DATA_MASK_NETCDF_N02_M01 DATA_MASK_NETCDF_N02_M02 DATA_MASK_NETCDF_N02_M03 }}} {{{palmrun}}} will copy these local temporary files to permanent files {{{ ....../OUTPUT/example_test_masked_M01.nc ....../OUTPUT/example_test_masked_M02.nc ....../OUTPUT/example_test_masked_N02_M01.nc ....../OUTPUT/example_test_masked_N02_M02.nc ....../OUTPUT/example_test_masked_N02_M03.nc }}} Instead of using wildcards in filenames, you may use separate file connection statements, one for each possible suffix. \\ == How to modify the file connection file If you like to modify the file connection file, e.g. because your user-interface requires or creates additional input/output files, you need to add additional file connection statements to the file connection file. In such a case, just copy the default file to your working directory, e.g. {{{ cd ~/palm/current_version cp trunk/SCRIPTS/.palm.iofiles . }}} and modify the copied file. If existing, {{{palmrun}}} will automatically take the file connection file from the working directory.