Getting a build error when modifying the Fortran example

Viewed 33

I downloaded the example from the database here: https://emt-tools.com/#example-1

I want to modify the example to include an output integer. I am basically just copying the real output to add an integer output. When I did that, I got this build error message in PSCAD:

Build error.png

Here is the code I modified from the example:

subroutine mySub(MyReal, MyInt, MyName, MyRealOut)

implicit none

real, intent(in)             :: MyReal    ! Used in some dummy math below, just as an example
integer, intent(in)          :: MyInt     ! Not used, but it is here as an example
character(len=*), intent(in) :: MyName    ! Not used, but it is here as an example
real, intent(out)            :: MyRealOut ! Output some variable back to PSCAD

! Some math ... doesn't matter
MyRealOut = 2.0 * MyReal

MyIntOut = 2 * MyInt

end subroutine

Thanks for the help.

1 Answers

You need to declare the integer output variable MyIntOut in the same manner that the real output variable is declared. Addd this line

integer, intent(out) :: MyIntOut

To the top of the parameter declaration. Try again and let us know. Make sure to clean the Build folder when trying again.

--
MP