Subroutine to load and execute a script from a file.
If you are using MPI for parallelization, have a look at the tem_open_distconf routine in the treelm library instead.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(flu_State) | :: | L | Handle to the Lua script |
|||
character(len=*), | intent(in) | :: | filename | Name of file to load the Lua code from |
||
integer, | intent(out), | optional | :: | ErrCode | Error code returned by Lua during loading or executing the file. This optional parameter might be used to react on errors in the calling side. If neither ErrCode nor ErrString are given, this subroutine will stop the program execution and print the error message from Lua to the stdout. |
|
character(len=*), | intent(out), | optional | :: | ErrString | Obtained error description from the Lua stack. This optional argument holds the Lua error message in case somehting went wrong. It can be used to provide some feedback to the user in the calling routine. If neither ErrCode nor ErrString are provided, open_config() will print the error message and stop program execution. |
|
type(cbuf_type), | intent(out), | optional | :: | buffer | Optional argument to return the compiled script after loading it to the caller. It might be handy to reuse the loaded script later on, this argument allows you to obtain the script in compiled form, before it is executed. The buffer will be allocated and filled with the Lua data. It contains the actual string in buffer%buffer which is a character pointer, and the original c_ptr to this |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | err | ||||
integer, | private | :: | length |