Changes between Version 1 and Version 2 of doc/app/palm_iofiles


Ignore:
Timestamp:
Aug 27, 2018 2:40:41 PM (6 years ago)
Author:
raasch
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • doc/app/palm_iofiles

    v1 v2  
    1 = '''This page is under construction! ''' =
    2 \\\\\\
    3 
    41= The PALM file configuration file
    52
    6 PALM expect 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 after a PALM run has finished. It generally contains one line per input/output file, the so-called file connection statement.
     3PALM 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.
    74
    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
     8The file is given in ASCII format and it generally contains one line per input/output file, which is called ''file connection statement''.
     9
     10A 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#---------------------------------------------------------------------------------------------
     15PARIN                    in:tr      d3#      $base_data/$jobname/INPUT          _p3d*
     16PARIN                    in:tr      d3r      $base_data/$jobname/INPUT          _p3dr*
     17TOPOGRAPHY_DATA          inopt:tr   d3#:d3r  $base_data/$jobname/INPUT          _topo*
     18DATA_1D_PR_NETCDF        inopt      prr      $base_data/$jobname/OUTPUT         _pr*       nc
     19#
     20#---------------------------------------------------------------------------------------------
     21# List of output-files
     22#---------------------------------------------------------------------------------------------
     23BINOUT*                  out:lnpe   restart  $fast_io_catalog/$jobname/RESTART  _d3d
     24DATA_3D_NETCDF*          out:tr     *        $base_data/$jobname/OUTPUT         _3d        nc
     25}}}
     26
     27The '''first column''' gives the local filename in PALM's temporary working directory. PALM expects all filenames in capital letters.
     28
     29The '''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
     36The '''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
     38The 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
     40The '''fifth column''' gives the appendix of the user's permanent file.
     41
     42The '''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
     47The 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}}}
     51As an example, the file connection statement
     52{{{
     53DATA_3D_NETCDF*    out:tr   *    $base_data/$jobname/OUTPUT   _3d   nc
     54}}}
     55plus entry
     56{{{
     57%base_data         ~/palm/current_version/JOBS
     58}}}
     59in 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
     67In 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{{{
     69PARIN     in:tr   d3#    $base_data/$jobname/INPUT     _p3d*
     70}}}
     71is 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}}}
     83The 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{{{
     85DATA_MASK_NETCDF*   out:tr   *  $base_data/$jobname/OUTPUT   _masked   nc
     86}}}
     87and 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}}}
     103Instead 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
     108If 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}}}
     113and modify the copied file. If existing, {{{palmrun}}} will automatically take the file connection file from the working directory.