Commit a96b57be authored by Jorn Bruggeman's avatar Jorn Bruggeman
Browse files

python driver: use iso_c_binding instead of f2py, follow original FABM API in C interface

parent f466da18
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{AABA89F4-40E4-4269-817F-0E37191728F2}</ProjectGuid>
<RootNamespace>c++</RootNamespace>
<Keyword>Win32Proj</Keyword>
<ProjectName>fabm-python-c++</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(PlatformName)-$(Configuration)\$(ProjectName)</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(PlatformName)-$(Configuration)\$(ProjectName)</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PlatformName)-$(Configuration)\$(ProjectName)</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PlatformName)-$(Configuration)\$(ProjectName)</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(PlatformName)-$(Configuration)\$(ProjectName)</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(PlatformName)-$(Configuration)\$(ProjectName)</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PlatformName)-$(Configuration)\$(ProjectName)</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PlatformName)-$(Configuration)\$(ProjectName)</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(PYTHONDIR)\include;$(PYTHONDIR)\Lib\site-packages\numpy\core\include;$(PYTHONDIR)\Lib\site-packages\numpy\f2py\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;C_EXPORTS;UPPERCASE_FORTRAN;NO_APPEND_FORTRAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>fabm-python-f90.lib;python27.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)fabm.pyd</OutputFile>
<AdditionalLibraryDirectories>$(OutDir)\..\fabm-python-f90;$(PythonDir)\libs;$(IFORT_COMPILER14)\compiler\lib\ia32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)c++.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)c++.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(PYTHON64DIR)\include;$(PYTHON64DIR)\Lib\site-packages\numpy\f2py\src;$(PYTHON64DIR)\Lib\site-packages\numpy\core\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;C_EXPORTS;UPPERCASE_FORTRAN;NO_APPEND_FORTRAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>true</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<OutputFile>$(OutDir)fabm.pyd</OutputFile>
<AdditionalLibraryDirectories>$(OutDir)\..\fabm-python-f90;$(Python64Dir)\libs;$(IFORT_COMPILER14)\compiler\lib\intel64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ProgramDatabaseFile>$(OutDir)c++.pdb</ProgramDatabaseFile>
<SubSystem>Windows</SubSystem>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)c++.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
<AdditionalDependencies>fabm-python-f90.lib;python27.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>$(PYTHONDIR)\include;$(PYTHONDIR)\Lib\site-packages\numpy\core\include;$(PYTHONDIR)\Lib\site-packages\numpy\f2py\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;C_EXPORTS;UPPERCASE_FORTRAN;NO_APPEND_FORTRAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>fabm-python-f90.lib;python27.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)fabm.pyd</OutputFile>
<AdditionalLibraryDirectories>$(OutDir)\..\fabm-python-f90;$(PythonDir)\libs;$(IFORT_COMPILER14)\compiler\lib\ia32;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>true</MapExports>
<SubSystem>Windows</SubSystem>
<StackReserveSize>256000000</StackReserveSize>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<BaseAddress>0x66000000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<FixedBaseAddress>true</FixedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)c++.lib</ImportLibrary>
<TargetMachine>MachineX86</TargetMachine>
<IgnoreSpecificDefaultLibraries>
</IgnoreSpecificDefaultLibraries>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<ClCompile>
<AdditionalIncludeDirectories>$(PYTHON64DIR)\include;$(PYTHON64DIR)\Lib\site-packages\numpy\f2py\src;$(PYTHON64DIR)\Lib\site-packages\numpy\core\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN64;NDEBUG;_WINDOWS;_USRDLL;C_EXPORTS;UPPERCASE_FORTRAN;NO_APPEND_FORTRAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>fabm-python-f90.lib;python27.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)fabm.pyd</OutputFile>
<AdditionalLibraryDirectories>$(OutDir)\..\fabm-python-f90;$(Python64Dir)\libs;$(IFORT_COMPILER14)\compiler\lib\intel64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<MapExports>true</MapExports>
<SubSystem>Windows</SubSystem>
<StackReserveSize>256000000</StackReserveSize>
<OptimizeReferences>true</OptimizeReferences>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<BaseAddress>0x66000000</BaseAddress>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
<FixedBaseAddress>true</FixedBaseAddress>
<DataExecutionPrevention>
</DataExecutionPrevention>
<ImportLibrary>$(OutDir)c++.lib</ImportLibrary>
<TargetMachine>MachineX64</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="fortranobject_wrapped.c" />
<ClCompile Include="fabmmodule_wrapped.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectType="typeStaticLibrary" ProjectCreator="Intel Fortran" Keyword="Static Library" Version="11.0" ProjectIdGuid="{7D63F885-F1D8-469C-A076-488A23EB592B}">
<VisualStudioProject ProjectType="typeDynamicLibrary" ProjectCreator="Intel Fortran" Keyword="Dll" Version="11.0" ProjectIdGuid="{FB313E5B-4571-4F0C-A281-845A24198A59}">
<Platforms>
<Platform Name="Win32"/>
<Platform Name="x64"/></Platforms>
<Configurations>
<Configuration Name="Debug|Win32" OutputDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" IntermediateDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" AdditionalOptions="/Qsave-temps" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\src\drivers\python;$(ProjectDir)\..\..\src\models\aed" PreprocessorDefinitions="_ISO_TR_15581_;_FABM_F2003_" StandardWarnings="standardWarningsF95" WarnDeclarations="true" WarnUnusedVariables="true" WarnInterfaces="true" InitLocalVarToNAN="true" FloatingPointSpeculation="fpSpeculationOff" Traceback="true" NullPointerCheck="true" BoundsCheck="true" UninitializedVariablesCheck="true" DescriptorDataTypeCheck="true" DescriptorDataSizeCheck="true" ArgTempCreatedCheck="true" RuntimeLibrary="rtMultiThreadedDebug" ImproveFloatingPointConsistency="true" Interfaces="true"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(GOTMDIR)\extras\netcdf\win32\3.6.3\lib" GenerateDebugInformation="true" SubSystem="subSystemConsole" AdditionalDependencies="netcdfs.lib"/>
<Tool Name="VFLibrarianTool"/>
<Configuration Name="Debug|Win32" OutputDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" IntermediateDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeDynamicLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\src\drivers\python" WarnInterfaces="true" Traceback="true" BoundsCheck="true" StackFrameCheck="true" RuntimeLibrary="rtMultiThreadedDebugDLL"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" GenerateDebugInformation="true" SubSystem="subSystemWindows" LinkDLL="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool" CommandLine="&quot;$(PythonDir)\Scripts\f2py.exe&quot; &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.F90&quot; -m fabm -h &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.pyf&quot; --no-lower --overwrite-signature&#xA;&quot;$(PythonDir)\Scripts\f2py.exe&quot; &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.pyf&quot;"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
<Configuration Name="Release|Win32" OutputDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" IntermediateDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" UseProcessorExtensions="codeExclusivelyHost" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\src\drivers\python;$(ProjectDir)\..\..\src\models\aed" PreprocessorDefinitions="_ISO_TR_15581_;_FABM_F2003_" VectorizerDiagLevel="vectorizerDiagLevel3" WarnUnusedVariables="true"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(GOTMDIR)\extras\netcdf\win32\3.6.3\lib" SubSystem="subSystemConsole" AdditionalDependencies="netcdfs.lib"/>
<Tool Name="VFLibrarianTool"/>
<Configuration Name="Release|Win32" OutputDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" IntermediateDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeDynamicLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\src\drivers\python" RuntimeLibrary="rtMultiThreadedDLL"/>
<Tool Name="VFLinkerTool" SuppressStartupBanner="true" SubSystem="subSystemWindows" LinkDLL="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool" CommandLine="&quot;$(PythonDir)\Scripts\f2py.exe&quot; &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.F90&quot; -m fabm -h &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.pyf&quot; --no-lower --overwrite-signature&#xA;&quot;$(PythonDir)\Scripts\f2py.exe&quot; &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.pyf&quot;"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
<Configuration Name="Debug|x64" OutputDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" IntermediateDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" AdditionalOptions="/Qsave-temps" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\src\drivers\python;$(ProjectDir)\..\..\src\models\aed" PreprocessorDefinitions="_ISO_TR_15581_;_FABM_F2003_" StandardWarnings="standardWarningsF03" StandardWarningsAsErrors="true" WarnDeclarations="true" WarnUnusedVariables="true" WarnInterfaces="true" InitLocalVarToNAN="true" FloatingPointSpeculation="fpSpeculationOff" Traceback="true" RuntimeChecks="rtChecksAll" NullPointerCheck="true" BoundsCheck="true" UninitializedVariablesCheck="true" DescriptorDataTypeCheck="true" DescriptorDataSizeCheck="true" ArgTempCreatedCheck="true" RuntimeLibrary="rtMultiThreadedDebug" ImproveFloatingPointConsistency="true" Interfaces="true"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(GOTMDIR)\extras\netcdf\win32\3.6.3\lib" GenerateDebugInformation="true" SubSystem="subSystemConsole" AdditionalDependencies="netcdfs.lib"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Configuration Name="Debug|x64" OutputDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" IntermediateDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeDynamicLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\src\drivers\python" WarnInterfaces="true" Traceback="true" BoundsCheck="true" StackFrameCheck="true" RuntimeLibrary="rtMultiThreadedDebugDLL"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ForceSymbolReferences="initialize" GenerateDebugInformation="true" SubSystem="subSystemWindows" LinkDLL="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool" CommandLine="&quot;$(Python64Dir)\Scripts\f2py.exe&quot; &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.F90&quot; -m fabm -h &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.pyf&quot; --no-lower --overwrite-signature&#xA;&quot;$(Python64Dir)\Scripts\f2py.exe&quot; &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.pyf&quot;"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration>
<Configuration Name="Release|x64" OutputDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" IntermediateDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\src\drivers\python;$(ProjectDir)\..\..\src\models\aed" PreprocessorDefinitions="_ISO_TR_15581_;_FABM_F2003_" VectorizerDiagLevel="vectorizerDiagLevel3" WarnUnusedVariables="true"/>
<Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="$(GOTMDIR)\extras\netcdf\win32\3.6.3\lib" SubSystem="subSystemConsole" AdditionalDependencies="netcdfs.lib"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Configuration Name="Release|x64" OutputDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" IntermediateDirectory="$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeDynamicLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\src\drivers\python" RuntimeLibrary="rtMultiThreadedDLL"/>
<Tool Name="VFLinkerTool" SuppressStartupBanner="true" SubSystem="subSystemWindows" LinkDLL="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool" CommandLine="&quot;$(Python64Dir)\Scripts\f2py.exe&quot; &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.F90&quot; -m fabm -h &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.pyf&quot; --no-lower --overwrite-signature&#xA;&quot;$(Python64Dir)\Scripts\f2py.exe&quot; &quot;$(ProjectDir)..\..\src\drivers\python\fabm_python.pyf&quot;"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/>
<Tool Name="VFManifestTool" SuppressStartupBanner="true"/></Configuration></Configurations>
<Files>
<Filter Name="Header Files" Filter="fi;fd">
<File RelativePath="..\..\include\fabm.h"/>
<File RelativePath="..\..\src\drivers\python\fabm_driver.h"/></Filter>
<Filter Name="Make Files">
<Filter Name="models">
<Filter Name="aed"/>
<Filter Name="examples">
<Filter Name="benthic_predator">
<File RelativePath="..\..\src\models\examples\benthic_predator\Makefile"/></Filter>
<File RelativePath="..\..\src\models\examples\Makefile"/></Filter>
<Filter Name="gotm">
<Filter Name="fasham">
<File RelativePath="..\..\src\models\gotm\fasham\Makefile"/></Filter>
<Filter Name="npzd">
<File RelativePath="..\..\src\models\npzd\Makefile"/></Filter>
<File RelativePath="..\..\src\models\gotm\Makefile"/></Filter>
<Filter Name="metu">
<Filter Name="mnemiopsis">
<File RelativePath="..\..\src\models\mnemiopsis\Makefile"/></Filter>
<File RelativePath="..\..\src\models\metu\Makefile"/></Filter>
<Filter Name="pml">
<Filter Name="carbonate">
<File RelativePath="..\..\src\models\pml\carbonate\Makefile"/></Filter>
<Filter Name="ersem">
<File RelativePath="..\..\src\models\pmlersem\Makefile"/></Filter>
<File RelativePath="..\..\src\models\pml\Makefile"/></Filter>
<File RelativePath="..\..\src\models\Makefile"/></Filter>
<File RelativePath="..\..\src\Makefile"/>
<File RelativePath="..\..\src\Rules.make"/></Filter>
<Filter Name="Header Files" Filter="fi;fd"/>
<Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"/>
<Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl">
<Filter Name="config">
<File RelativePath="..\..\src\config\fabm_config.F90"/>
<File RelativePath="..\..\src\config\fabm_config_types.F90"/>
<File RelativePath="..\..\src\config\fabm_yaml.F90"/></Filter>
<Filter Name="driver">
<File RelativePath=".\fabm-f2pywrappers2.f90"/>
<File RelativePath="..\..\src\drivers\python\fabm_python.F90"/>
<File RelativePath="..\..\src\drivers\python\helper.F90"/></Filter></Filter></Files>
<Globals/></VisualStudioProject>
......@@ -24,16 +24,11 @@ Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "turbulence", "%GOTMDIR%\com
{12FF14CF-D057-46BD-8BD3-8C957A1016DC} = {12FF14CF-D057-46BD-8BD3-8C957A1016DC}
EndProjectSection
EndProject
Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "fabm-python-f90", "fabm-python-f90.vfproj", "{30B75A58-40FE-4D39-BCBE-0B50BC95665E}"
Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "fabm-python", "fabm-python.vfproj", "{FB313E5B-4571-4F0C-A281-845A24198A59}"
ProjectSection(ProjectDependencies) = postProject
{7D63F885-F1D8-469C-A076-488A23EB592B} = {7D63F885-F1D8-469C-A076-488A23EB592B}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fabm-python-c++", "fabm-python-c++.vcxproj", "{AABA89F4-40E4-4269-817F-0E37191728F2}"
ProjectSection(ProjectDependencies) = postProject
{30B75A58-40FE-4D39-BCBE-0B50BC95665E} = {30B75A58-40FE-4D39-BCBE-0B50BC95665E}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
......@@ -82,22 +77,14 @@ Global
{195325CC-732D-4F1C-ABAD-A9B118351236}.Release|Win32.Build.0 = Release|Win32
{195325CC-732D-4F1C-ABAD-A9B118351236}.Release|x64.ActiveCfg = Release|x64
{195325CC-732D-4F1C-ABAD-A9B118351236}.Release|x64.Build.0 = Release|x64
{30B75A58-40FE-4D39-BCBE-0B50BC95665E}.Debug|Win32.ActiveCfg = Debug|Win32
{30B75A58-40FE-4D39-BCBE-0B50BC95665E}.Debug|Win32.Build.0 = Debug|Win32
{30B75A58-40FE-4D39-BCBE-0B50BC95665E}.Debug|x64.ActiveCfg = Debug|x64
{30B75A58-40FE-4D39-BCBE-0B50BC95665E}.Debug|x64.Build.0 = Debug|x64
{30B75A58-40FE-4D39-BCBE-0B50BC95665E}.Release|Win32.ActiveCfg = Release|Win32
{30B75A58-40FE-4D39-BCBE-0B50BC95665E}.Release|Win32.Build.0 = Release|Win32
{30B75A58-40FE-4D39-BCBE-0B50BC95665E}.Release|x64.ActiveCfg = Release|x64
{30B75A58-40FE-4D39-BCBE-0B50BC95665E}.Release|x64.Build.0 = Release|x64
{AABA89F4-40E4-4269-817F-0E37191728F2}.Debug|Win32.ActiveCfg = Debug|Win32
{AABA89F4-40E4-4269-817F-0E37191728F2}.Debug|Win32.Build.0 = Debug|Win32
{AABA89F4-40E4-4269-817F-0E37191728F2}.Debug|x64.ActiveCfg = Debug|x64
{AABA89F4-40E4-4269-817F-0E37191728F2}.Debug|x64.Build.0 = Debug|x64
{AABA89F4-40E4-4269-817F-0E37191728F2}.Release|Win32.ActiveCfg = Release|Win32
{AABA89F4-40E4-4269-817F-0E37191728F2}.Release|Win32.Build.0 = Release|Win32
{AABA89F4-40E4-4269-817F-0E37191728F2}.Release|x64.ActiveCfg = Release|x64
{AABA89F4-40E4-4269-817F-0E37191728F2}.Release|x64.Build.0 = Release|x64
{FB313E5B-4571-4F0C-A281-845A24198A59}.Debug|Win32.ActiveCfg = Debug|Win32
{FB313E5B-4571-4F0C-A281-845A24198A59}.Debug|Win32.Build.0 = Debug|Win32
{FB313E5B-4571-4F0C-A281-845A24198A59}.Debug|x64.ActiveCfg = Debug|x64
{FB313E5B-4571-4F0C-A281-845A24198A59}.Debug|x64.Build.0 = Debug|x64
{FB313E5B-4571-4F0C-A281-845A24198A59}.Release|Win32.ActiveCfg = Release|Win32
{FB313E5B-4571-4F0C-A281-845A24198A59}.Release|Win32.Build.0 = Release|Win32
{FB313E5B-4571-4F0C-A281-845A24198A59}.Release|x64.ActiveCfg = Release|x64
{FB313E5B-4571-4F0C-A281-845A24198A59}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
#ifdef _DEBUG
#define _SAVE_DEBUG
#undef _DEBUG
#endif
#include <stdarg.h>
#include "Python.h"
#include "fortranobject.h"
#include <math.h>
// Below we redefine _DEBUG (see above)
#ifdef _SAVE_DEBUG
#define _DEBUG
#undef _SAVE_DEBUG
#endif
#include "fabmmodule.c"
\ No newline at end of file
#ifdef _DEBUG
#define _SAVE_DEBUG
#undef _DEBUG
#endif
#include <stdarg.h>
#include "Python.h"
#include "fortranobject.h"
#include <math.h>
// Below we redefine _DEBUG (see above)
#ifdef _SAVE_DEBUG
#define _DEBUG
#undef _SAVE_DEBUG
#endif
#include <fortranobject.c>
\ No newline at end of file
......@@ -11,11 +11,15 @@
! TODO
!
! !USES:
use iso_c_binding, only: c_double, c_int, C_NULL_CHAR, c_f_pointer, c_loc, c_ptr
!DIR$ ATTRIBUTES DLLEXPORT :: STATE_VARIABLE,DIAGNOSTIC_VARIABLE,CONSERVED_QUANTITY
use fabm
use fabm_config
use fabm_types, only:rk,attribute_length
use fabm_types, only:rk,attribute_length,type_model_list_node
use fabm_driver, only: type_base_driver, driver
use fabm_properties, only: type_property, type_property_dictionary
use fabm_properties, only: type_property, type_property_dictionary, type_real_property
use fabm_python_helper
implicit none
......@@ -23,13 +27,16 @@
! !PUBLIC MEMBER FUNCTIONS:
public
integer,parameter :: BULK_STATE_VARIABLE = 1
integer,parameter :: SURFACE_STATE_VARIABLE = 2
integer,parameter :: BOTTOM_STATE_VARIABLE = 3
integer,parameter :: BULK_DIAGNOSTIC_VARIABLE = 4
integer,parameter :: HORIZONTAL_DIAGNOSTIC_VARIABLE = 5
integer,parameter :: CONSERVED_QUANTITY = 6
type (type_model),private,target,save :: model
real(8),dimension(:),allocatable :: state,environment
character(len=1024),dimension(:),allocatable :: state_names,state_units
real(8),dimension(:),pointer :: state
character(len=1024),dimension(:),allocatable :: environment_names,environment_units
character(len=1024),dimension(:),allocatable :: conserved_quantity_names,conserved_quantity_units
character(len=1024),dimension(:),allocatable :: parameter_long_names,parameter_names,parameter_units
integer, dimension(:),allocatable :: parameter_types
type (type_property_dictionary),save,private :: forced_parameters
......@@ -49,7 +56,8 @@
! !IROUTINE: Initialise the model
!
! !INTERFACE:
subroutine initialize()
subroutine initialize() bind(c)
!DIR$ ATTRIBUTES DLLEXPORT :: initialize
!
! !DESCRIPTION:
!
......@@ -74,156 +82,268 @@
! Send information on spatial domain to FABM (this also allocates memory for diagnostics)
call fabm_set_domain(model)
! Create arrays to hold state variable values, use the initial values specified by the model,
! link state data to FABM.
n = size(model%state_variables) + size(model%bottom_state_variables) + size(model%surface_state_variables)
allocate(state(n))
allocate(state_names(n))
allocate(state_units(n))
n = 0
do i=1,size(model%state_variables)
n = n + 1
state(n) = model%state_variables(i)%initial_value
state_names(n) = model%state_variables(i)%name
state_units(n) = model%state_variables(i)%units
call fabm_link_bulk_state_data(model,i,state(n))
end do
do i=1,size(model%bottom_state_variables)
n = n + 1
state(n) = model%bottom_state_variables(i)%initial_value
state_names(n) = model%bottom_state_variables(i)%name
state_units(n) = model%bottom_state_variables(i)%units
call fabm_link_bulk_state_data(model,i,state(n))
end do
do i=1,size(model%surface_state_variables)
n = n + 1
state(n) = model%surface_state_variables(i)%initial_value
state_names(n) = model%surface_state_variables(i)%name
state_units(n) = model%surface_state_variables(i)%units
call fabm_link_bulk_state_data(model,i,state(n))
! Retrieve arrays to hold values for environmental variables and corresponding metadata.
call get_environment_metadata(model,environment_names,environment_units)
end subroutine initialize
!EOC
subroutine check_ready()
!DIR$ ATTRIBUTES DLLEXPORT :: check_ready
call fabm_check_ready(model)
end subroutine
integer function model_count() bind(c)
!DIR$ ATTRIBUTES DLLEXPORT :: model_count
type (type_model_list_node), pointer :: node
model_count = 0
node => model%root%children%first
do while (associated(node))
model_count = model_count + 1
node => node%next
end do
end function
subroutine get_variable_counts(nstate_bulk,nstate_surface,nstate_bottom,ndiagnostic_bulk,ndiagnostic_horizontal,nconserved,ndependencies,nparameters) bind(c)
!DIR$ ATTRIBUTES DLLEXPORT :: get_variable_counts
integer(c_int),intent(out) :: nstate_bulk,nstate_surface,nstate_bottom
integer(c_int),intent(out) :: ndiagnostic_bulk,ndiagnostic_horizontal
integer(c_int),intent(out) :: nconserved,ndependencies,nparameters
nstate_bulk = size(model%state_variables)
nstate_surface = size(model%surface_state_variables)
nstate_bottom = size(model%bottom_state_variables)
ndiagnostic_bulk = size(model%diagnostic_variables)
ndiagnostic_horizontal = size(model%horizontal_diagnostic_variables)
nconserved = size(model%conserved_quantities)
ndependencies = size(environment_names)
nparameters = model%root%parameters%size()
end subroutine
subroutine get_variable_metadata(category,index,length,name,units,long_name) bind(c)
!DIR$ ATTRIBUTES DLLEXPORT :: get_variable_metadata
integer(c_int),intent(in), value :: category,index,length
character, intent(out),dimension(length) :: name,units,long_name
class (type_external_variable),pointer :: variable
class (type_property),pointer :: property
! Get a pointer to the target variable
select case (category)
case (BULK_STATE_VARIABLE)
variable => model%state_variables(index)
case (SURFACE_STATE_VARIABLE)
variable => model%surface_state_variables(index)
case (BOTTOM_STATE_VARIABLE)
variable => model%bottom_state_variables(index)
case (BULK_DIAGNOSTIC_VARIABLE)
variable => model%diagnostic_variables(index)
case (HORIZONTAL_DIAGNOSTIC_VARIABLE)
variable => model%horizontal_diagnostic_variables(index)
case (CONSERVED_QUANTITY)
variable => model%conserved_quantities(index)
end select
call copy_to_c_string(variable%name, name)
call copy_to_c_string(variable%units, units)
call copy_to_c_string(variable%long_name,long_name)
end subroutine
allocate(conserved_quantity_names(size(model%conserved_quantities)))
allocate(conserved_quantity_units(size(model%conserved_quantities)))
conserved_quantity_names = model%conserved_quantities(:)%name
conserved_quantity_units = model%conserved_quantities(:)%units
! Create arrays for parameter names, units, data types.
call model%root%parameters%keys(parameter_names)
allocate(parameter_types(size(parameter_names)))
allocate(parameter_units(size(parameter_names)))
allocate(parameter_long_names(size(parameter_names)))
do i = 1,size(parameter_names)
property => model%root%parameters%get_property(parameter_names(i))
parameter_types(i) = property%typecode()
parameter_units(i) = property%units
parameter_long_names(i) = property%long_name
subroutine get_parameter_metadata(index,length,name,units,long_name,typecode) bind(c)
!DIR$ ATTRIBUTES DLLEXPORT :: get_parameter_metadata
integer(c_int),intent(in), value :: index,length
character, intent(out),dimension(length) :: name,units,long_name
integer(c_int),intent(out) :: typecode
integer :: i
class (type_property),pointer :: property
i = 1
property => model%root%parameters%first
do while (associated(property))
if (index==i) exit