Precomp Airfoil data upper bound

Hello everyone,

I’m trying to obtain the properties of the 5MW NREL Wind turbine blades (I’ve read all the threads about that and I contacted Sandia Lab). I was playing around putting the airfoil data of the 5MW wind turbine in the sample input file of PreComp, after arranging the airfoil data such as PreComp recognize it, and when I run the PreComp this error comes out.

“Subscript #1 of the array ISUR has value 151 which is greater than the upper bound of 150”
Captura de pantalla 2014-05-16 12.54.22.jpg

Does PreComp has a limitation which don’t allow it to read airfoil data with more than 150 lines? I’ve read the whole User’s guide and didn’t find anything related to it.

Thanks in advance


yes PreComp has upper limits for the number of segments, number of airfoil points etc.
Please look into mods_precomp.f90, change max_af_nodes to the number of airfoil points you have,
recompile, and it should work,


Hi Rick,

I’ve found the line where the number can be changed, my problem now is recompiling, I’ve never done this before and I have no knowledge of Fortran, shall I follow the instructions on the “How To recompile FAST” post? Or in this case is much easier to recompile the file? I don’t see any Batch file on the Source folder.


Dear Oriol,

I’ve never used PreComp, but I suspect it is pretty easy to compile–probably easier than FAST. You will need to use the correct version of the NWTC Library. My guess is that v1.05.00 is the proper one because it is dated 24-October-2012 and PreComp is dated 19-November-2012. You do not need all the files in the Library. For instance, there are files for single and double precision and you should choose the one you want. There are also several Sys*.f90 files and you should use only the one that matches your compiler.

If you still need help, please let us know what compiler you intend to use. We do our work primarily with the Intel compiler, but we often check our builds with gfortran. The gfortran compiler is usually much slower than the Intel compiler, but that may not matter much with PreComp. You may want to look at the FAST instructions to see the order of compilation of the Library files if you use gfortran. The Intel compiler is smart enough to figure it out for you.


Thanks for your help Marshall, at the end we have reduced the number of nodes in the airfoil data to fit the 150 nodes upper bound. We do not fill very confident with Fortran and the results still ok since the definition is still enough. If in the near future I need help I will let you know, since the INtel fortran is not free I may use the Gfortran. Thanks!


to compile PreComp you should use NWTC library version v1.04.01. as suggested on the PreComp website.
It doesn’t work with newer versions.

I use Intel Compiler (my IDE is Visual Studio 2010).

The PreComp executable that you can download was compiled with double precision.
In the DoublePrec.f90 there is a note :
! NOTE: Use compile option “/real_size:64” (or “/4R8”) when using ReKi = 8 with the Visual Fortran compilers.

This is very important - include this option when you are compiling ; the program will compile, but won’t work properly if you skip this.

If you are using Visual Studio - go to Project Properties → Configuration Properties → Fortran → Command Line
here in the Additional Options write /real_size:64

Also, I have an issue with compiling the whole project at once so I first compile mods_precomp.f90 and then the rest of the project as a whole.
I don’t have an explanation for that.


I recently helped another user compile PreComp with gfortran on Linux, and also ran across the issue you are noticing with having to compile twice. It is a result of the order of the modules, and you can fix it by moving the Paras module to the top of the mods_precomp.f90 file.

If you’d like to use the last version of NWTC Library v1 with PreComp or need to compile with gfortran (there were some other issues with non-standard code), you can use the source I modified: … 04-bjj.tar