Skip to content

Commit

Permalink
extended debug options in makefile, updated win projects files
Browse files Browse the repository at this point in the history
  • Loading branch information
casper-boon committed Dec 23, 2022
1 parent 69b6ed8 commit a75e186
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 90 deletions.
18 changes: 15 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ incdir=include
ifeq ($(F90),)
F90=gfortran
endif
ifeq ($(MDEBUG),true)
DEBUG=true
endif

ifeq ($(SINGLE),true)
TARGET=lib/libaed-water_s.a
Expand All @@ -44,6 +47,7 @@ else
endif

INCLUDES=-I${incdir}
MDBG_FFLAGS=""

ifeq ($(F90),ifort)
INCLUDES+=-I/opt/intel/include
Expand Down Expand Up @@ -76,6 +80,7 @@ else ifeq ($(F90),flang)
FFLAGS+=-r8
else
DEBUG_FFLAGS=-g -fbacktrace
MDBG_FFLAGS=-fsanitize=address
OPT_FFLAGS=-O3
# we use std=f2008ts rather than f2008 because ts removes some type checking
# restrictions on interoperabilty routines (which were wrong anyway...)
Expand Down Expand Up @@ -106,7 +111,14 @@ ifeq ($(SINGLE),true)
endif


FFLAGS+=$(DEBUG_FFLAGS) $(OPT_FFLAGS)
ifeq ($(DEBUG),true)
FFLAGS+=$(DEBUG_FFLAGS)
ifeq ($MDEBUG),true)
FFLAGS+=$(MDBG_FFLAGS
endif
else
FFLAGS+=$(OPT_FFLAGS)
endif
OBJS=${objdir}/aed_core.o \
${objdir}/aed_util.o \
Expand Down Expand Up @@ -163,8 +175,8 @@ distclean: clean
@/bin/rm -rf mod mod_s
${objdir}/%.o: ${srcdir}/%.F90 ${srcdir}/aed_core.F90 ${incdir}/aed.h
$(F90) $(FFLAGS) -g -c $< -o $@
$(F90) $(FFLAGS) -c $< -o $@
${objdir}/aed_external.o: ${srcdir}/aed_external.F90 ${objdir}/aed_core.o ${incdir}/aed.h
$(F90) $(FFLAGS) -DLIBDEF -g -c $< -o $@
$(F90) $(FFLAGS) -DLIBDEF -c $< -o $@
${objdir}/aed_common.o: ${srcdir}/aed_common.F90 ${srcdir}/aed_core.F90 ${objdir}/aed_external.o ${incdir}/aed.h
4 changes: 2 additions & 2 deletions src/aed_common.F90
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,8 @@ SUBROUTINE aed_calculate_column(column, layer_map)
ENDDO
END SUBROUTINE aed_calculate_column
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


!###############################################################################
SUBROUTINE aed_calculate_dry(column, layer_idx)
!-------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/aed_core.F90
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ SUBROUTINE display_var(var, idx)

l2 = line(1:40)
IF ( var%sheet ) THEN
!# IF ( ASSOCIATED(var%model) .and. var%model%aed_model_zone_avg ) THEN
!# IF ( ASSOCIATED(var%model) .and. var%model%aed_model_zone_avg ) THEN
!# The above will segfault if var%model is null - like pascal, it seems fortran
!# also evaluates both conditions regardless
IF ( ASSOCIATED(var%model) ) THEN
Expand Down Expand Up @@ -945,8 +945,8 @@ SUBROUTINE aed_calculate_column(data,column,layer_map)
!print*,"Default aed_calculate_benthic ", TRIM(data%aed_model_name)
END SUBROUTINE aed_calculate_column
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


!###############################################################################
SUBROUTINE aed_calculate_riparian(data,column,layer_idx, pc_wet)
!-------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/aed_pesticides.F90
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ SUBROUTINE aed_calculate_benthic_pesticides(data,column,layer_idx)

IF ( diag_level >= 2 ) &
_DIAG_VAR_S_ (data%id_tot_s(pst_i)) = PSTtot

ENDDO
ELSE
! No sediment pool is resolved, but still predict a generic diss flux
Expand Down
62 changes: 31 additions & 31 deletions win/mods/lib-dummies.sln
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32802.440
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "lib-dummies", "lib-dummies.vfproj", "{71B1A1B7-387A-4D58-8607-F9B24B896995}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Debug|x64.ActiveCfg = Debug|x64
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Debug|x64.Build.0 = Debug|x64
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Debug|x86.ActiveCfg = Debug|Win32
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Debug|x86.Build.0 = Debug|Win32
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Release|x64.ActiveCfg = Release|x64
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Release|x64.Build.0 = Release|x64
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Release|x86.ActiveCfg = Release|Win32
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {844B1BE4-ADAF-48F8-ADF4-75DE9072CF9F}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32802.440
MinimumVisualStudioVersion = 10.0.40219.1
Project("{6989167D-11E4-40FE-8C1A-2192A86A7E90}") = "lib-dummies", "lib-dummies.vfproj", "{71B1A1B7-387A-4D58-8607-F9B24B896995}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Debug|x64.ActiveCfg = Debug|x64
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Debug|x64.Build.0 = Debug|x64
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Debug|x86.ActiveCfg = Debug|Win32
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Debug|x86.Build.0 = Debug|Win32
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Release|x64.ActiveCfg = Release|x64
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Release|x64.Build.0 = Release|x64
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Release|x86.ActiveCfg = Release|Win32
{71B1A1B7-387A-4D58-8607-F9B24B896995}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {844B1BE4-ADAF-48F8-ADF4-75DE9072CF9F}
EndGlobalSection
EndGlobal
100 changes: 50 additions & 50 deletions win/mods/lib-dummies.vfproj
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectType="typeStaticLibrary" ProjectCreator="Intel Fortran" Keyword="Static Library" Version="11.0" ProjectIdGuid="{71B1A1B7-387A-4D58-8607-F9B24B896995}">
<Platforms>
<Platform Name="Win32"/>
<Platform Name="x64"/></Platforms>
<Configurations>
<Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(SolutionDir)\..\$(PlatformName)-$(ConfigurationName)\libaed-water;..\..\include" PreprocessorDefinitions="LIBDEF" F2003Semantics="true" WarnInterfaces="true" RealKIND="realKIND8" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/></Configuration>
<Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(SolutionDir)\..\$(PlatformName)-$(ConfigurationName)\libaed-water;..\..\include" PreprocessorDefinitions="LIBDEF" F2003Semantics="true" RealKIND="realKIND8"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/></Configuration>
<Configuration Name="Debug|x64" OutputDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(SolutionDir)\..\$(PlatformName)-$(ConfigurationName)\libaed-water;..\..\include" PreprocessorDefinitions="LIBDEF" F2003Semantics="true" WarnInterfaces="true" RealKIND="realKIND8" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/></Configuration>
<Configuration Name="Release|x64" OutputDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(SolutionDir)\..\$(PlatformName)-$(ConfigurationName)\libaed-water;..\..\include" PreprocessorDefinitions="LIBDEF" F2003Semantics="true" RealKIND="realKIND8"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/></Configuration></Configurations>
<Files>
<Filter Name="Header Files" Filter="fi;fd">
<File RelativePath="..\..\include\aed2.h"/></Filter>
<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">
<File RelativePath="..\..\src\aed_core.F90"/>
<File RelativePath="..\..\src\aed_external.F90"/></Filter></Files>
<Globals/></VisualStudioProject>
<?xml version="1.0" encoding="UTF-8"?>
<VisualStudioProject ProjectType="typeStaticLibrary" ProjectCreator="Intel Fortran" Keyword="Static Library" Version="11.0" ProjectIdGuid="{71B1A1B7-387A-4D58-8607-F9B24B896995}">
<Platforms>
<Platform Name="Win32"/>
<Platform Name="x64"/></Platforms>
<Configurations>
<Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(SolutionDir)\..\$(PlatformName)-$(ConfigurationName)\libaed-water;..\..\include" PreprocessorDefinitions="LIBDEF" F2003Semantics="true" WarnInterfaces="true" RealKIND="realKIND8" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/></Configuration>
<Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(SolutionDir)\..\$(PlatformName)-$(ConfigurationName)\libaed-water;..\..\include" PreprocessorDefinitions="LIBDEF" F2003Semantics="true" RealKIND="realKIND8"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/></Configuration>
<Configuration Name="Debug|x64" OutputDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(SolutionDir)\..\$(PlatformName)-$(ConfigurationName)\libaed-water;..\..\include" PreprocessorDefinitions="LIBDEF" F2003Semantics="true" WarnInterfaces="true" RealKIND="realKIND8" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/></Configuration>
<Configuration Name="Release|x64" OutputDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)" IntermediateDirectory="$(SolutionDir)\$(PlatformName)-$(ConfigurationName)\$(ProjectName)" ConfigurationType="typeStaticLibrary">
<Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" Preprocess="preprocessYes" AdditionalIncludeDirectories="$(SolutionDir)\..\$(PlatformName)-$(ConfigurationName)\libaed-water;..\..\include" PreprocessorDefinitions="LIBDEF" F2003Semantics="true" RealKIND="realKIND8"/>
<Tool Name="VFLibrarianTool" LinkLibraryDependencies="true"/>
<Tool Name="VFResourceCompilerTool"/>
<Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/>
<Tool Name="VFCustomBuildTool"/>
<Tool Name="VFPreLinkEventTool"/>
<Tool Name="VFPreBuildEventTool"/>
<Tool Name="VFPostBuildEventTool"/></Configuration></Configurations>
<Files>
<Filter Name="Header Files" Filter="fi;fd">
<File RelativePath="..\..\include\aed2.h"/></Filter>
<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">
<File RelativePath="..\..\src\aed_core.F90"/>
<File RelativePath="..\..\src\aed_external.F90"/></Filter></Files>
<Globals/></VisualStudioProject>

0 comments on commit a75e186

Please sign in to comment.