NWTC Subroutine Library v1 (old)

A library of general-use Fortran 2003 routines used in many NWTC computer-aided engineering tools 

by Marshall Buhl and Bonnie Jonkman 
National Wind Technology Center

For the version of the library that works with the new FAST Modularization Framework, please visit the NWTC Subroutine Library v2 page.

Over the years, the staff at the NWTC have written many general-purpose routines that we use in many of our codes.  In the past, we would copy those needed for any given program from the source of another code.  These routines were generally kept in a separate file of the code's archive and had names such as GenSubsGenUse, and SysVF.  We decided that doing it that way was just too much work—especially when we wanted to change one of the routines and have it affect all the codes.  So, we decided to create a central set of routines and include their source files in our Fortran projects.  Thus, the NWTC Subroutine Library was born.

The NWTC Subroutine Library consists of several Fortran MODULES, each contained in its own source file. If you wish to access any of the data or routines from the library, add the statement USE NWTC_Library to the program unit requiring access. All of the modules in the NWTC Subroutine Library will be accessible through this statement. The library's NWTC_Init subroutine must also be called before using any of the other routines or parameters in the library.

The library is written in standard Fortran 2003, with the exception of some of the routines and data in the Sys*.f90 files. We currently have several compiler-specific files available to choose from, including SysIVF.f90 for the Intel Visual Fortran compiler for Windows and SysGnuLinux.f90 for the GNU Fortran compiler for Linux. If you want to port our programs to a different compiler, you should only have to modify one of the Sys*.f90 files to get it to compile.  (You should rename the Sys*.f90 file when you make changes.) This should require only minutes (or hours at the most).

To compile the library, see the instructions and source-file compilation order described in the heading of the NWTC_Library.f90 file. Add the fileSingPrec.f90 to your project to use single-precision (four-byte) arithmetic or the file DoubPrec.f90 to use double-precision (eight-byte) arithmetic.

If you have written other general-use routines and would like us to include them in our library, please email them and we will consider adding them to the library.  We also welcome suggestions for desirable routines.

You may download the following files from our server:

  • NWTC Subroutine Library Change Log (v1.07.02a-mlb, 23 KB, 21-May-2013)

    This is a list of changes made to the code.  Look at this text file to see if we've made worthwhile changes since you received your previous version of the NWTC Subroutine Library.

  • NWTC Subroutine Library Archive for Windows (426 KB) (v1.07.02a-mlb, 426 KB, 28-May-2013)

    This is a self-extracting archive of NWTC Subroutine Library.  Simply execute it in an appropriate directory to extract the files.  It contains the change log, the source code, and some archive/web support files.

  • NWTC Subroutine Library Archive for Linux (254 KB) (v1.07.02a-mlb, 254 KB, 28-May-2013)

    This is a compressed archive of NWTC Subroutine Library.  It contains the same files as NWTC Subroutine Library Archive for Windows, but is stored in tar.gz format for non-Windows users.

You may download older versions of NWTC Subroutine Library v1 here.

Programming Language:     Wind and Water Tools:

You must log in to download this software.

If you want to refer to this website in a report, here is a reference you can use:
NWTC Information Portal (NWTC Subroutine Library v1 (old)).  https://nwtc.nrel.gov/nwtc_subs. Last modified 27-September-2014 ; Accessed 21-June-2018