Compiling GOTM developer version in Windows (without makefiles)
Faculty of Earth & Life Sciences
Department of Theoretical Biology
de Boelelaan 1085
1081 HV Amsterdam, The Netherlands
Obtain/extract the GOTM source code.
Obtain/extract the NetCDF library (ensure you have lib/netcdf.lib, bin/netcdf.dll, include/netcdf.inc).
Preprocess the source with the following settings:
specify the 'include' directories of both GOTM and NetCDF as source of files to be included.
set the following preprocessor definitions: REAL_4B=real(4), FORTRAN95 (if your compiler is Fortran95-capable), NUDGE_VEL, NETCDF_FMT. Add DEBUG=STATIC if you want to compile a debug version, SEAGRASS if you want support for the seagrass module, BIO if you want support for the biogeochemical models, LAGRANGE if you want support for Langrangian tracers.
Compile the source (*.F90, except airsea_tst.F90) with the following settings:
add the NetCDF 'lib' directory as additional library path.
add 'netcdf.lib' as a dependency (i.e. required library).
ensure that you use a calling convention that matches the conventions with which your version of NetCDF was compiled. At least one version of NetCDF for Windows out on the web uses a calling convention that matches Compaq Visual Fortran. With that version of NetCDF, the Intel Visual Fortran requires the calling convention to be set to 'Compaq Visual Fortran compatibility'.
Run the GOTM executable after ensuring the NetCDF 'bin' directory (with netcdf.dll) is in the system path.
Intel Visual Fortran compiler 8.0 or higher
Above are generic settings, not specific to any compiler. I use the Intel Fortran
compiler in combination with Visual Studio .NET 2003; for that platform, these settings
come down to the following:
add all GOTM source files (except tst_airsea.F90) to the Visual Studio project.
add the NetCDF 'bin' directory to the system path (to run/debug GOTM - not needed for compilation only).
Preprocessor: add the 'include' directories of both GOTM and NetCDF to 'Additional IncludeDirectories'.
Preprocessor: set the following 'Preprocessor Definitions': REAL_4B=real(4);FORTRAN95;NUDGE_VEL;NETCDF_FMT;DEBUG=STATIC. Add SEAGRASS, BIO and LAGRANGE if you need support for those modules.
External procedures: adjust the 'Calling Convention' to match your version of NetCDF. If you do not know which calling convention your version of NetCDF is using, experiment with different conventions. A common calling convention is 'CVF' (Compaq Visual Fortran compatibility).
Optimization should not be used for debug builds, as debug information/options decrease with increasing
optimization. However, for a 'release' build, optimization can significantly speed up GOTM. I use the settings
set 'Optimization' to 'Maximize Speed plus Higher Level Optimizations'.
set 'Inline Function Expansion' to 'Any Suitable'.
set 'Use Intel(R) Processor Extensions' to 'Intel Pentium(R) 4 Processor with Streaming SIMD Extensions 3 (SSE3)'. This is important for vectorization of algorithms.
set 'Require Intel(R) Processor Extensions' to the highest level supported by your target system. This eliminates run-time processor checks.