wiki:PDAF_parse

Version 1 (modified by lnerger, 4 days ago) ( diff )

--

PDAF_parse

This page documents the routine PDAF_parse of PDAF, which was introduced with PDAF V3.1.

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.

The interface is:

  SUBROUTINE PDAF_parse(handle, value)

    CHARACTER(len=32), INTENT(in) :: handle     ! String defining variable to be parsed
    VARIABLETYPE, INTENT(inout) :: value        ! Value of the variable, where VARIABLETYPE can be
                                                ! INTEGER, REAL, CHARACTER(len=*), INTEGER

The typical use in the source code is to e.g. parse the ensemble size dim_ens

   handle='dim_ens'
   CALL PDAF_parse(handle, dim_ens)

where the specification on the command line would be, to e.g. set the ensemble size to 4:

   -dim_ens 4

(The template and tutorial codes use this in the file init_pdaf_parse.F90)

Notes:

  • The subroutine can parse variables of different types
  • Only single values or strings canbe parse; there is no parsing for arrays
  • The general syntax on the command line is -HANDLE VALUE
Note: See TracWiki for help on using the wiki.