| | 1 | = PDAF_parse = |
| | 2 | |
| | 3 | This page documents the routine `PDAF_parse` of PDAF, which was introduced with PDAF V3.1. |
| | 4 | |
| | 5 | The routine provides functionality of common line parsing. Before PDAF V3.1, the template files contained a file `parser_mpi.F90`, which provided this functionality. This file is no longer required with PDAF V3.1. |
| | 6 | |
| | 7 | The interface is: |
| | 8 | {{{ |
| | 9 | SUBROUTINE PDAF_parse(handle, value) |
| | 10 | |
| | 11 | CHARACTER(len=32), INTENT(in) :: handle ! String defining variable to be parsed |
| | 12 | VARIABLETYPE, INTENT(inout) :: value ! Value of the variable, where VARIABLETYPE can be |
| | 13 | ! INTEGER, REAL, CHARACTER(len=*), INTEGER |
| | 14 | }}} |
| | 15 | |
| | 16 | The typical use in the source code is to e.g. parse the ensemble size `dim_ens` |
| | 17 | {{{ |
| | 18 | handle='dim_ens' |
| | 19 | CALL PDAF_parse(handle, dim_ens) |
| | 20 | }}} |
| | 21 | where the specification on the command line would be, to e.g. set the ensemble size to 4: |
| | 22 | {{{ |
| | 23 | -dim_ens 4 |
| | 24 | }}} |
| | 25 | (The template and tutorial codes use this in the file `init_pdaf_parse.F90`) |
| | 26 | |
| | 27 | Notes: |
| | 28 | * The subroutine can parse variables of different types |
| | 29 | * Only single values or strings canbe parse; there is no parsing for arrays |
| | 30 | * The general syntax on the command line is `-HANDLE VALUE` |