# Recompile DISCON.f90 file

**URL:** <https://forums.nlr.gov/t/recompile-discon-f90-file/1270>\
**Category:** Computer-Aided Engineering Software Tools\
**Created:** [January 18, 2016, 5:26pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270 "2016-01-18T17:26:19Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pablo.Hernandez](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@Pablo.Hernandez](https://forums.nlr.gov/u/Pablo.Hernandez)\
**Post date:** [January 18, 2016, 5:26pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/1 "2016-01-18T17:26:19Z")

</div>

Hello,

I’m trying to learn how to modify the DISCON.f90 file. As a start, I have tryed to change only the power from 5MW to 8MW, but the problem is that I cannot recompile the file to create a “.dll” file because I don’t have neither gfortram or Visual Fortran.

Is there any free software with which I could recompile the “.f90” file to “.dll”?  
I have never worked with Fortran and I don’t know how to deal with this.

Thank you all in advance,

---

<div class="post-metadata">

**Author:** ![Bonnie.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/bonnie.jonkman/32/3230_2.png) [@Bonnie.Jonkman](https://forums.nlr.gov/u/Bonnie.Jonkman)\
**Post date:** [January 19, 2016, 7:13pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/2 "2016-01-19T19:13:10Z")

</div>

You will need a Fortran compiler if you want to make changes to source code. gfortran is free, so if you don’t want to pay for something, I suggest you use that one. If you’re on Windows, you can download the MinGW binaries of gfortran (and other compilers): [mingw.org/](http://www.mingw.org/)

---

<div class="post-metadata">

**Author:** ![Pablo.Hernandez](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@Pablo.Hernandez](https://forums.nlr.gov/u/Pablo.Hernandez)\
**Post date:** [January 25, 2016, 12:01pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/3 "2016-01-25T12:01:46Z")

</div>

Thank you very much for your help, I will try to download a Fortran compiler from that link.

---

<div class="post-metadata">

**Author:** ![Pablo.Hernandez](https://avatars.discourse-cdn.com/v4/letter/p/a183cd/32.png) [@Pablo.Hernandez](https://forums.nlr.gov/u/Pablo.Hernandez)\
**Post date:** [February 19, 2016, 11:25am UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/4 "2016-02-19T11:25:20Z")

</div>

Hello,

I’m trying to recompile the file DISCON.f90. I downloaded gfortran and I used the following command:

$gfortran -c DISCON.f90

And I found the following error:

SUBROUTINE DISCON\_sub ( avrSWAP, aviFAIL, accINFILE, avcOUTNAME, avcMSG ) BIND (C, NAME=‘DISCON’)  
^  
gfortran: error trying to exec ‘as’: execvp: No such file or directory

Could someone help me with this error? I just want to recompile DISCON.f90 to create a .dll file.

Thank you all in advance,  
regards

---

<div class="post-metadata">

**Author:** ![Bonnie.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/bonnie.jonkman/32/3230_2.png) [@Bonnie.Jonkman](https://forums.nlr.gov/u/Bonnie.Jonkman)\
**Post date:** [February 19, 2016, 5:08pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/5 "2016-02-19T17:08:31Z")

</div>

In the compiling directory of the FAST v8 archive is a makefile you can use to compile the DISCON dlls (see makefile\_DISCON\_DLL). Otherwise, you can just compile with some additional compiling options, such as:`
gfortran -shared -O2 -m32 -fbacktrace -ffree-line-length-none -x f95-cpp-input -C DISCON.f90
`

---

<div class="post-metadata">

**Author:** ![Martin.Dana](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Martin.Dana](https://forums.nlr.gov/u/Martin.Dana)\
**Post date:** [August 28, 2020, 6:04pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/6 "2020-08-28T18:04:39Z")

</div>

I have compiled the DISCON.f90 using the -m64 instead of -m32 compile option with the gfortran compiler, and now have a DISCON.dll. However, when I run the compiled DISCON with OpenFAST, it fails to find or load the file. Additionally, I have used the CompileDiscon.bat file to generate a 64 -bit DISCON.dll and have run into the same issue when attempting to run it with OpenFAST\_x64.exe. Could one of the options be incorrect?

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [August 28, 2020, 10:12pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/7 "2020-08-28T22:12:55Z")

</div>

Dear Martin,

Is the path to the DISCON.dll you compiled set correctly in your ServoDyn input file (DLL\_FileName)?

Do you have any trouble running OpenFAST with the compiled DISCON.dlls provided for Windows?

Best regards,

---

<div class="post-metadata">

**Author:** ![Martin.Dana](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Martin.Dana](https://forums.nlr.gov/u/Martin.Dana)\
**Post date:** [September 15, 2020, 9:33pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/8 "2020-09-15T21:33:52Z")

</div>

Jason,

I believe the path to be correct, and I have been using dll’s compiled via a CMake, VisualStudio, MATLAB2015B (32-bit) procedure. I have never used gfortran before to compile a 64-bit version, as the command string shown above does not work with -m32 option, but does with -m64 option. The compiling process seems to complete just fine, but openFAST is unable to utilize the file.

---

<div class="post-metadata">

**Author:** ![Jason.Jonkman](https://dub1.discourse-cdn.com/nrel/user_avatar/forums.nlr.gov/jason.jonkman/32/3086_2.png) [@Jason.Jonkman](https://forums.nlr.gov/u/Jason.Jonkman)\
**Post date:** [September 15, 2020, 9:50pm UTC](https://forums.nlr.gov/t/recompile-discon-f90-file/1270/9 "2020-09-15T21:50:43Z")

</div>

Dear Martin,

Do you have any trouble running OpenFAST with the compiled DISCON.dlls provided for Windows?

Best regards,
