The GWB plug-in is implemented as a Dynamic-Link Library (DLL) that you link to using its export library (GWBplugin.lib) and a Fortran interface (GWBplugin.f90). This page answers common queries about how to use the Fortran version of the plug-in feature.
Using the GWB plug-in feature:
The GWB plug-in has been tested on Fortran compilers from Intel and GCC. The interface file GWBplugin.f90 you need is installed to your computer in the "src" directory of the GWB directory. The library you need to link to GWBplugin.lib is installed in the GWB directory (in earlier version of GWB the library file was also in the "src" directory). For step-by-step instructions on setting up your build environment and examples using the Intel command line, Visual Studio, and MinGW/MSYS/gfortran please see the Quickstart tutorials and examples.
This is a synopsis of the Fortran wrapper interface provided in GWBplugin.f90 in the "src" directory of the GWB installation folder.
// GWBplugin.f90 MODULE GWBpluginModule INTEGER, PARAMETER :: ANULL = -999999 ! marker for undefined value INTEGER, PARAMETER :: GWB_MAX_RESPONSE = 32 TYPE GWBplugin FUNCTION initialize(plugin, app_name, file_name, cmds) RESULT(retval) TYPE(GWBplugin), INTENT(out), TARGET :: plugin CHARACTER (LEN = *), INTENT(in) :: app_name CHARACTER (LEN = *), INTENT(in), OPTIONAL :: file_name, cmds INTEGER(C_INT) :: retval FUNCTION exec_cmd(plugin, uline) RESULT(retval) TYPE(GWBplugin), INTENT(in), TARGET :: plugin CHARACTER (LEN = *), INTENT(in) :: uline INTEGER(C_INT) :: retval FUNCTION results(plugin, f_data, f_value, f_units, ix, jy) RESULT(retval) TYPE(GWBplugin), INTENT(in), TARGET :: plugin ! f_data : CHARACTER(LEN = GWB_MAX_RESPONSE), INTENT(out), OPTIONAL :: f_data(:) !or REAL(8), INTENT(out), OPTIONAL :: f_data(:) !or INTEGER, INTENT(out), OPTIONAL :: f_data(:) CHARACTER(LEN = *), INTENT(in) :: f_value CHARACTER(LEN = *), INTENT(in), OPTIONAL :: f_units INTEGER, INTENT(in), OPTIONAL :: ix, jy INTEGER(C_INT) :: retval SUBROUTINE destroy(plugin) TYPE(GWBplugin), INTENT(in), TARGET :: plugin
Within your code you must first create a "GWBplugin" object. Next, use the "initialize" function to start the GWB application of interest by passing the application name, a optional file name for the GWB application to write output to, and any command-line type arguments.
The "exec_cmd" function can be used to transmit commands to the plug-in. Each application has a chapter in the reference manual of the documentation on what commands are available. You use these commands to configure the application and then send a "go" command to trigger the calculations.
Retrieving the results using the GWB plug-in feature can be accomplished using the "results" function. The keywords, default units, and return types are the same as those listed in the Report Command chapter of the reference manual in the documentation. To use the "results" function you provide the address of a data block to fill, along with the desired report command and keywords, optional desired units, and the node location of choice (X1t and X2t only).
The "destroy" function can be used to free up the underlying memory associated with the GWBplugin object.
What Fortran compilers are supported by the GWB plug-in?
The plug-in has been tested using compilers from Intel and GCC.
Why does it say it can't find the GWBplugin.dll when I try to run my program?
In order to locate the GWB DLLs that the GWBplugin class uses you must add the GWB installation directory to the PATH environment variable.
Where are the GWBplugin files that I need to link against located?
The GWBplugin export library (GWBplugin.lib) is installed to the GWB directory and the interface file (GWBplugin.f90) is installed to the "src" folder in the GWB directory.
In some previous versions of GWB the export library was also in the "src" folder.
Why does my compiler say that it can't find the GWBplugin library to link against even though I am using the full path to link?
This result is commonly caused by using a 32-bit compiler to link against a 64-bit library, or vice versa. Check to ensure the version of the compiler you are using is the same as the version of GWB you installed.
For answers to additional questions please check the plug-in section of the reference manual in the documentation, our main support FAQ, or contact us.