8 | | A file connection statement is separated into a maximum of six columns. The first five columns are obligatory. |
| 5 | \\ |
| 6 | == Format of the file configuration file |
| 7 | |
| 8 | The file is given in ASCII format and it generally contains one line per input/output file, which is called ''file connection statement''. |
| 9 | |
| 10 | 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: |
| 11 | {{{ |
| 12 | #--------------------------------------------------------------------------------------------- |
| 13 | # List of input-files |
| 14 | #--------------------------------------------------------------------------------------------- |
| 15 | PARIN in:tr d3# $base_data/$jobname/INPUT _p3d* |
| 16 | PARIN in:tr d3r $base_data/$jobname/INPUT _p3dr* |
| 17 | TOPOGRAPHY_DATA inopt:tr d3#:d3r $base_data/$jobname/INPUT _topo* |
| 18 | DATA_1D_PR_NETCDF inopt prr $base_data/$jobname/OUTPUT _pr* nc |
| 19 | # |
| 20 | #--------------------------------------------------------------------------------------------- |
| 21 | # List of output-files |
| 22 | #--------------------------------------------------------------------------------------------- |
| 23 | BINOUT* out:lnpe restart $fast_io_catalog/$jobname/RESTART _d3d |
| 24 | DATA_3D_NETCDF* out:tr * $base_data/$jobname/OUTPUT _3d nc |
| 25 | }}} |
| 26 | |
| 27 | The '''first column''' gives the local filename in PALM's temporary working directory. PALM expects all filenames in capital letters. |
| 28 | |
| 29 | 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 |
| 30 | * {{{tr}}} |
| 31 | * {{{tra}}} |
| 32 | * {{{pe}}} |
| 33 | * {{{lnpe}}} |
| 34 | * {{{trpe}}} |
| 35 | |
| 36 | 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. |
| 37 | |
| 38 | 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}}}. |
| 39 | |
| 40 | The '''fifth column''' gives the appendix of the user's permanent file. |
| 41 | |
| 42 | 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}}}. |
| 43 | |
| 44 | \\ |
| 45 | == Determination of full file path |
| 46 | |
| 47 | The full path for input and output files is based on columns 4-6 and the argument of {{{palmrun}}} option {{{-d}}}: |
| 48 | {{{ |
| 49 | <column 4>/<-d option><column 5>[.<column 6>] |
| 50 | }}} |
| 51 | As an example, the file connection statement |
| 52 | {{{ |
| 53 | DATA_3D_NETCDF* out:tr * $base_data/$jobname/OUTPUT _3d nc |
| 54 | }}} |
| 55 | plus entry |
| 56 | {{{ |
| 57 | %base_data ~/palm/current_version/JOBS |
| 58 | }}} |
| 59 | in the configuration file, plus the call {{{palmrun -d example_test ...}}} will create the output file |
| 60 | {{{ |
| 61 | ~/palm/current_version/JOBS/example_test/OUTPUT/example_test_3d.nc |
| 62 | }}} |
| 63 | |
| 64 | \\ |
| 65 | == Using wildcards in filenames |
| 66 | |
| 67 | 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 |
| 68 | {{{ |
| 69 | PARIN in:tr d3# $base_data/$jobname/INPUT _p3d* |
| 70 | }}} |
| 71 | is required for this, where the wildcard in {{{_p3d*}}} causes {{{palmrun}}} to copy files with these suffixes too. Assuming an INPUT folder with files |
| 72 | {{{ |
| 73 | example_test_p3d |
| 74 | example_test_p3d_N02 |
| 75 | example_test_p3d_N03 |
| 76 | }}} |
| 77 | {{{palmrun}}} will copy them to local files |
| 78 | {{{ |
| 79 | PARIN |
| 80 | PARIN_N02 |
| 81 | PARIN_N03 |
| 82 | }}} |
| 83 | 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 |
| 84 | {{{ |
| 85 | DATA_MASK_NETCDF* out:tr * $base_data/$jobname/OUTPUT _masked nc |
| 86 | }}} |
| 87 | and following local files that have been created by PALM |
| 88 | {{{ |
| 89 | DATA_MASK_NETCDF_M01 |
| 90 | DATA_MASK_NETCDF_M02 |
| 91 | DATA_MASK_NETCDF_N02_M01 |
| 92 | DATA_MASK_NETCDF_N02_M02 |
| 93 | DATA_MASK_NETCDF_N02_M03 |
| 94 | }}} |
| 95 | {{{palmrun}}} will copy these local temporary files to permanent files |
| 96 | {{{ |
| 97 | ....../OUTPUT/example_test_masked_M01.nc |
| 98 | ....../OUTPUT/example_test_masked_M02.nc |
| 99 | ....../OUTPUT/example_test_masked_N02_M01.nc |
| 100 | ....../OUTPUT/example_test_masked_N02_M02.nc |
| 101 | ....../OUTPUT/example_test_masked_N02_M03.nc |
| 102 | }}} |
| 103 | Instead of using wildcards in filenames, you may use separate file connection statements, one for each possible suffix. |
| 104 | |
| 105 | \\ |
| 106 | == How to modify the file connection file |
| 107 | |
| 108 | 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. |
| 109 | {{{ |
| 110 | cd ~/palm/current_version |
| 111 | cp trunk/SCRIPTS/.palm.iofiles . |
| 112 | }}} |
| 113 | and modify the copied file. If existing, {{{palmrun}}} will automatically take the file connection file from the working directory. |