The question sounds trivial - you can find the definition of the ERF function even on Wikipedia :) Implementing it in the code is not the most difficult task either if you are familiar with programming. If not, I would recommend you to ask a programmer. Depending on the speed/accuracy requirement you may need to use on of the approximations of the function.
In order to write the code you need to define a function, like that:
function erf_function(x)
!here put declaration of the argument and the function and local variables
!and here put the algorithm computing the function
end function
If you want to apply the function to a vector/matrix and you use at least Fortran 90 it is convenient to use elemental function.
Using such created function is not difficult either. Once you wrote it you just call it by name, i.e.:
x=2
y=erf_function(x) !define y as the value of the function
For more complex code, where you split the code over number of files you may employ interface or module.
Thanks for the answer. Yes, I realized that question is trivial. I just was trying to use in-built function in Visual studio and got stuck. Thanks for the information.
I would note that ERF and ERFC are both elemental intrinsic functions in Fortran. I'm guessing you have an older compiler that is not up to to date with the current language definition.
Yes. I have solved the question long back using intrinsic functions. Actually, I had not included MSIMSL and MSIMSLMD subroutines in the code. Thanks for replying.
We build erf function of complex argument and plot some real and imaginary part based on Abramowitz and Stegun (http://people.math.sfu.ca/~cbm/aands/page_299.htm) method. We are doubtfull about our results. Do someone have done this kind of plot?