fengyanshi / FUNWAVE-TVD

45 stars 51 forks source link

Execution control with command line arguments #11

Closed floquet closed 6 years ago

floquet commented 8 years ago

harvest_command_line.tar.gz (opens in a folder name command_line_arguments)

Fortran standards-compliant module for reading arguments passed on the command line. This allows users to supply specifications at run time, an alternative to using a namelist.

In the following snippet, the execution command has three arguments which can used to specify paths, filenames, or data tags:

$ ./harvest_command_line mydata thesemodules title_for_run

The launch command was ./harvest_command_line mydata thesemodules title_for_run.
There are 3 arguments.
command line argument 1 is "mydata", length = 6
command line argument 2 is "thesemodules", length = 12
command line argument 3 is "title_for_run", length = 13

A prudent code has default actions specified for the cases where no arguments are supplied.