Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile with -std=f2008 #228

Merged
merged 32 commits into from
Nov 6, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2632887
updated make rule for F77 and F90 with std=f2008
ewu63 Aug 2, 2022
61d86fa
fixed tabs
ewu63 Aug 2, 2022
2bce52d
swapping around variable declaration orders
ewu63 Aug 2, 2022
2aa711c
use myisnan instead of non-standard isnan function from GCC
ewu63 Aug 3, 2022
ef3524a
fixed some string and format issues
ewu63 Aug 3, 2022
b716695
fixed some warnings
ewu63 Aug 3, 2022
3e55fa5
fix real/complex types
ewu63 Aug 3, 2022
92eb34b
Fixing type issues for t0
eirikurj Sep 12, 2022
7555d52
Fixing previously fixed string continuation
eirikurj Sep 12, 2022
6a343f8
Update obsolete string definitions
eirikurj Sep 12, 2022
0d4588b
Update myisnan to handle different types and to use more modern modul…
eirikurj Sep 12, 2022
cedeebd
More fixes
eirikurj Sep 12, 2022
d698477
Remove old Makefile
eirikurj Sep 12, 2022
92506e8
Update intel fortran flags
eirikurj Sep 12, 2022
886283f
More fixes for the intel compiler
eirikurj Sep 13, 2022
537ae3c
Updating linker flags
eirikurj Sep 13, 2022
51b61d5
Make new module compile without optimization
eirikurj Sep 20, 2022
e53ed50
Add new file
eirikurj Sep 20, 2022
cdbd7e2
Removing debug flags from config and unused flags
eirikurj Sep 27, 2022
38c72f3
Remove line continuation
eirikurj Sep 27, 2022
cb8c08c
Merge remote-tracking branch 'mdolab/modernize-fortran' into moderniz…
eirikurj Sep 28, 2022
06753a6
Merge remote-tracking branch 'mdolab/main' into modernize-fortran-noopt
eirikurj Oct 3, 2022
ce7e173
Updating build system build certain files without optimization
eirikurj Oct 3, 2022
daf8f36
Merge remote-tracking branch 'mdolab/main' into modernize-fortran
eirikurj Oct 3, 2022
6166bd8
get myisnan from the new module
sseraj Oct 3, 2022
8f6d8c0
Updating build files for complex
eirikurj Oct 3, 2022
20a353e
Merge pull request #233 from eirikurj/modernize-fortran-noopt
sseraj Oct 3, 2022
1a8fc3a
ran tapenade
sseraj Oct 3, 2022
986a5ec
remove whitespace
eirikurj Oct 7, 2022
f091a0d
Merge branch 'modernize-fortran' of github.com:mdolab/adflow into mod…
eirikurj Oct 7, 2022
5276d68
Merge branch 'main' into modernize-fortran
eirikurj Oct 11, 2022
2698301
Merge branch 'main' into modernize-fortran
ewu63 Nov 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion config/defaults/config.LINUX_GFORTRAN.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ CGNS_INCLUDE_FLAGS=-I$(CGNS_HOME)/include
CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns

# ------- Define Compiler Flags ----------------------------------------
FF90_FLAGS = -DHAS_ISNAN -fPIC -fdefault-real-8 -fdefault-double-8 -g -O3 -march=native -ffast-math
FF77_FLAGS = -DHAS_ISNAN -fPIC -fdefault-real-8 -fdefault-double-8 -g -O3 -march=native -ffast-math
FF90_FLAGS = $(FF77_FLAGS) -std=f2008
C_FLAGS = -DHAS_ISNAN -O -fPIC -g

# ------- Define Archiver and Flags -----------------------------------
Expand Down
3 changes: 2 additions & 1 deletion config/defaults/config.LINUX_INTEL.mk
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ CGNS_INCLUDE_FLAGS=-I$(CGNS_HOME)/include
CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns

# ------- Define Compiler Flags ----------------------------------------
FF90_FLAGS = -DHAS_ISNAN -fPIC -r8 -O2 -g
FF77_FLAGS = -DHAS_ISNAN -fPIC -r8 -O2 -g
FF90_FLAGS = $(FF77_FLAGS) -std=f2008
sseraj marked this conversation as resolved.
Show resolved Hide resolved
C_FLAGS = -DHAS_ISNAN -O -fPIC

# ------- Define Archiver and Flags -----------------------------------
Expand Down
3 changes: 2 additions & 1 deletion config/defaults/config.LINUX_INTEL_SAFE.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ CGNS_INCLUDE_FLAGS=-I$(CGNS_HOME)/include
CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns

# ------- Define Compiler Flags ----------------------------------------
FF90_FLAGS = -DHAS_ISNAN -fPIC -r8 -O1 -g
FF77_FLAGS = -DHAS_ISNAN -fPIC -r8 -O1 -g
FF90_FLAGS = $(FF77_FLAGS) -std=f2008
C_FLAGS = -DHAS_ISNAN -O -fPIC

# ------- Define Archiver and Flags -----------------------------------
Expand Down
3 changes: 2 additions & 1 deletion config/defaults/config.OSX_GFORTRAN.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ CGNS_INCLUDE_FLAGS=-I$(CGNS_HOME)/include
CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns

# ------- Define Compiler Flags ----------------------------------------
FF90_FLAGS = -DHAS_ISNAN -fPIC -fdefault-real-8 -fdefault-double-8 -g -O3 -march=native -ffast-math
FF77_FLAGS = -DHAS_ISNAN -fPIC -fdefault-real-8 -fdefault-double-8 -g -O3 -march=native -ffast-math
FF90_FLAGS = $(FF77_FLAGS) -std=f2008
C_FLAGS = -DHAS_ISNAN -O -fPIC -g

# ------- Define Archiver and Flags -----------------------------------
Expand Down
52 changes: 26 additions & 26 deletions src/NKSolver/NKSolvers.F90
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,10 @@ subroutine LSCubic(x, f, g, y, w, fnorm, ynorm, gnorm, nfevals, flag, lambda)

! Input/Output
Vec x, f, g, y, w
!x - current iterate
!f - residual evaluated at x
!y - search direction
!w - work vector -> On output, new iterate
!x - current iterate
!f - residual evaluated at x
!y - search direction
!w - work vector -> On output, new iterate
!g - residual evaluated at new iterate y

real(kind=alwaysrealType) :: fnorm, gnorm, ynorm
Expand Down Expand Up @@ -768,10 +768,10 @@ subroutine LSCubic(x, f, g, y, w, fnorm, ynorm, gnorm, nfevals, flag, lambda)
! order of magnitude or more.

hadANan = .False.
if (isnan(gnorm) .or. turbRes2 > 2.0*turbRes1) then
if (myisnan(gnorm) .or. turbRes2 > 2.0*turbRes1) then
! Special testing for nans

if (isnan(gnorm)) then
if (myisnan(gnorm)) then
hadANan = .True.
call setUniformFlow()
lambda = 0.5
Expand All @@ -798,7 +798,7 @@ subroutine LSCubic(x, f, g, y, w, fnorm, ynorm, gnorm, nfevals, flag, lambda)

nfevals = nfevals + 1

if (isnan(gnorm)) then
if (myisnan(gnorm)) then
! Just reset the flow, adjust the step back and keep
! going
call setUniformFlow()
Expand Down Expand Up @@ -914,7 +914,7 @@ subroutine LSCubic(x, f, g, y, w, fnorm, ynorm, gnorm, nfevals, flag, lambda)
lambda = lambdatemp
end if

if (isnan(lambda)) then
if (myisnan(lambda)) then
flag = .False.
exit cubic_loop
end if
Expand Down Expand Up @@ -954,10 +954,10 @@ subroutine LSNone(x, f, g, y, w, nfevals, flag, step)

! Input/Output
Vec x, f, g, y, w
!x - current iterate
!f - residual evaluated at x
!y - search direction
!w - work vector -> On output, new iterate
!x - current iterate
!f - residual evaluated at x
!y - search direction
!w - work vector -> On output, new iterate
!g - residual evaluated at new iterate y

integer(kind=intType) :: nfevals
Expand Down Expand Up @@ -990,10 +990,10 @@ subroutine LSNM(x, f, g, y, w, fnorm, ynorm, gnorm, nfevals, flag, step)

! Input/Output
Vec x, f, g, y, w
!x - current iterate
!f - residual evaluated at x
!y - search direction
!w - work vector -> On output, new iterate
!x - current iterate
!f - residual evaluated at x
!y - search direction
!w - work vector -> On output, new iterate
!g - residual evaluated at new iterate y

real(kind=alwaysRealType) :: fnorm, gnorm, ynorm
Expand Down Expand Up @@ -1520,8 +1520,8 @@ subroutine setInfo(info, iSize)
use utils, only : setPointers
implicit none

real(kind=realType), intent(in), dimension(iSize) :: info
integer(kind=intType), intent(in) :: iSize
real(kind=realType), intent(in), dimension(iSize) :: info
integer(kind=intType) :: nn, counter, i, j, k, l, sps
! Determine the size of a flat array needed to store w, P, ( and
! rlv, rev if necessary) with full double halos.
Expand Down Expand Up @@ -1566,8 +1566,8 @@ subroutine getInfo(info, iSize)

implicit none

real(kind=realType), intent(out), dimension(iSize) :: info
integer(kind=intType), intent(in) :: iSize
real(kind=realType), intent(out), dimension(iSize) :: info
integer(kind=intType) :: nn, counter, i, j, k, l, sps
! Determine the size of a flat array needed to store w, P, ( and
! rlv, rev if necessary) with full double halos.
Expand Down Expand Up @@ -3234,7 +3234,7 @@ subroutine physicalityCheckANK(lambdaP)
call EChk(ierr,__FILE__,__LINE__)

! Make sure that we did not get any NaN's in the process
if (isnan(lambdaL)) then
if (myisnan(lambdaL)) then
lambdaL = zero
end if

Expand Down Expand Up @@ -3358,7 +3358,7 @@ subroutine physicalityCheckANKTurb(lambdaP)
call EChk(ierr,__FILE__,__LINE__)

! Make sure that we did not get any NaN's in the process
if (isnan(lambdaL)) then
if (myisnan(lambdaL)) then
lambdaL = zero
end if

Expand Down Expand Up @@ -3555,7 +3555,7 @@ subroutine ANKTurbSolveKSP
! initialize this outside the ls
LSFailed = .False.

if ((unsteadyNorm > totalRTurb*ANK_unstdyLSTol .or. isnan(unsteadyNorm))) then
if ((unsteadyNorm > totalRTurb*ANK_unstdyLSTol .or. myisnan(unsteadyNorm))) then
! The unsteady residual is too high or we have a NAN. Do a
! backtracking line search until we get a residual that is lower.

Expand Down Expand Up @@ -3585,7 +3585,7 @@ subroutine ANKTurbSolveKSP
call VecNorm(rVecTurb, NORM_2, unsteadyNorm, ierr)
call EChk(ierr, __FILE__, __LINE__)

if (unsteadyNorm > totalRTurb*ANK_unstdyLSTol .or. isnan(unsteadyNorm)) then
if (unsteadyNorm > totalRTurb*ANK_unstdyLSTol .or. myisnan(unsteadyNorm)) then

! Restore back to the original wVec
call VecAXPY(wVecTurb, lambdaTurb, deltaWTurb, ierr)
Expand All @@ -3600,7 +3600,7 @@ subroutine ANKTurbSolveKSP
end if
end do backtrack

if (LSFailed .or. isnan(unsteadyNorm)) then
if (LSFailed .or. myisnan(unsteadyNorm)) then
! the line search wasn't much help.

if (ANK_CFL > ANK_CFLMin) then
Expand Down Expand Up @@ -3976,7 +3976,7 @@ subroutine ANKStep(firstCall)
! initialize this outside the ls
LSFailed = .False.

if ((unsteadyNorm > unsteadyNorm_old*ANK_unstdyLSTol .or. isnan(unsteadyNorm))) then
if ((unsteadyNorm > unsteadyNorm_old*ANK_unstdyLSTol .or. myisnan(unsteadyNorm))) then
! The unsteady residual is too high or we have a NAN. Do a
! backtracking line search until we get a residual that is lower.

Expand Down Expand Up @@ -4006,7 +4006,7 @@ subroutine ANKStep(firstCall)
call VecNorm(rVec, NORM_2, unsteadyNorm, ierr)
call EChk(ierr, __FILE__, __LINE__)

if (unsteadyNorm > unsteadyNorm_old*ANK_unstdyLSTol .or. isnan(unsteadyNorm)) then
if (unsteadyNorm > unsteadyNorm_old*ANK_unstdyLSTol .or. myisnan(unsteadyNorm)) then

! Restore back to the original wVec
call VecAXPY(wVec, lambda, deltaW, ierr)
Expand All @@ -4021,7 +4021,7 @@ subroutine ANKStep(firstCall)
end if
end do backtrack

if (LSFailed .or. isnan(unsteadyNorm)) then
if (LSFailed .or. myisnan(unsteadyNorm)) then
! the line search wasn't much help.

if (ANK_CFL > ANK_CFLMin) then
Expand Down
82 changes: 0 additions & 82 deletions src/adjoint/ADFirstAidKit/Makefile

This file was deleted.

24 changes: 12 additions & 12 deletions src/adjoint/ADFirstAidKit/adBuffer.f
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ FUNCTION SMALLSTACKSIZE()
c COMMON /adc32fbuf/adc32buf,adc32lbuf,
c + adc32ibuf,adc32ilbuf,adc32inlbuf
integer*4 smallstacksize
c
c
smallstacksize = 0
smallstacksize = smallstacksize + (ads1ibuf-1)*1
c smallstacksize = smallstacksize + (adl4ibuf-1)*4
Expand Down Expand Up @@ -1237,7 +1237,7 @@ SUBROUTINE PRINTALLBUFFERS()
c + adc32ibuf,adc32ilbuf,adc32inlbuf
integer*4 bsize,lookbsize
integer*4 cblocks, csize, lookcblocks, lookcsize
c
c
call getbigcsizes(cblocks,csize,lookcblocks,lookcsize)
write (6,'(a,i8,a,i5,a,i8,a,i5,a)')
+ 'MAIN C stack size :',cblocks,'B +',csize,
Expand Down Expand Up @@ -1404,7 +1404,7 @@ SUBROUTINE SHOWALLSTACKS()
c adi16ibuf = adi16ibuf+1
c ENDIF
c END
c
c
c SUBROUTINE LOOKINTEGER16(x)
c INTEGER*16 x, adi16buf(512), adi16lbuf(512)
c INTEGER adi16ibuf,adi16ilbuf
Expand Down Expand Up @@ -1435,7 +1435,7 @@ SUBROUTINE SHOWALLSTACKS()
c ENDIF
c ENDIF
c END
c
c
c SUBROUTINE POPINTEGER16(x)
c INTEGER*16 x, adi16buf(512), adi16lbuf(512)
c INTEGER adi16ibuf,adi16ilbuf
Expand Down Expand Up @@ -1497,7 +1497,7 @@ SUBROUTINE SHOWALLSTACKS()
c adr32ibuf = adr32ibuf+1
c ENDIF
c END
c
c
c SUBROUTINE LOOKREAL32(x)
c REAL*32 x, adr32buf(512), adr32lbuf(512)
c INTEGER adr32ibuf,adr32ilbuf
Expand Down Expand Up @@ -1528,7 +1528,7 @@ SUBROUTINE SHOWALLSTACKS()
c ENDIF
c ENDIF
c END
c
c
c SUBROUTINE POPREAL32(x)
c REAL*32 x, adr32buf(512), adr32lbuf(512)
c INTEGER adr32ibuf,adr32ilbuf
Expand Down Expand Up @@ -1590,7 +1590,7 @@ SUBROUTINE SHOWALLSTACKS()
c adc4ibuf = adc4ibuf+1
c ENDIF
c END
c
c
c SUBROUTINE LOOKCOMPLEX4(x)
c COMPLEX*4 x, adc4buf(512), adc4lbuf(512)
c INTEGER adc4ibuf,adc4ilbuf
Expand Down Expand Up @@ -1621,7 +1621,7 @@ SUBROUTINE SHOWALLSTACKS()
c ENDIF
c ENDIF
c END
c
c
c SUBROUTINE POPCOMPLEX4(x)
c COMPLEX*4 x, adc4buf(512), adc4lbuf(512)
c INTEGER adc4ibuf,adc4ilbuf
Expand Down Expand Up @@ -1683,7 +1683,7 @@ SUBROUTINE SHOWALLSTACKS()
c adc32ibuf = adc32ibuf+1
c ENDIF
c END
c
c
c SUBROUTINE LOOKCOMPLEX32(x)
c COMPLEX*32 x, adc32buf(512), adc32lbuf(512)
c INTEGER adc32ibuf,adc32ilbuf
Expand Down Expand Up @@ -1714,7 +1714,7 @@ SUBROUTINE SHOWALLSTACKS()
c ENDIF
c ENDIF
c END
c
c
c SUBROUTINE POPCOMPLEX32(x)
c COMPLEX*32 x, adc32buf(512), adc32lbuf(512)
c INTEGER adc32ibuf,adc32ilbuf
Expand Down Expand Up @@ -1791,7 +1791,7 @@ SUBROUTINE SHOWALLSTACKS()
c adz9ibuf = adz9ibuf+1
c ENDIF
c END
c
c
c SUBROUTINE LOOKTTTT9(x)
c TTTT*9 x, adz9buf(512), adz9lbuf(512)
c INTEGER adz9ibuf,adz9ilbuf
Expand Down Expand Up @@ -1822,7 +1822,7 @@ SUBROUTINE SHOWALLSTACKS()
c ENDIF
c ENDIF
c END
c
c
c SUBROUTINE POPTTTT9(x)
c TTTT*9 x, adz9buf(512), adz9lbuf(512)
c INTEGER adz9ibuf,adz9ilbuf
Expand Down
Loading