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

Standardize code to F2008 #42

Merged
merged 5 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion config/defaults/config.LINUX_GFORTRAN.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns
CC = gcc
CFLAGS = -O2 -fPIC
FC = gfortran
FFLAGS= -O2 -fdefault-real-8 -g -fPIC
FFLAGS= -O2 -fdefault-real-8 -g -fPIC -std=f2008

# Define potentially different python, python-config and f2py executables:
PYTHON = python
Expand Down
2 changes: 1 addition & 1 deletion config/defaults/config.LINUX_INTEL.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CGNS_LINKER_FLAGS=-L$(CGNS_HOME)/lib -lcgns
CC = gcc
CFLAGS = -O2 -fPIC
FC = ifort
FFLAGS = -O2 -r8 -g -fPIC
FFLAGS = -O2 -r8 -g -fPIC -stand f08

# Define potentially different python, python-config and f2py executables:
PYTHON = python
Expand Down
16 changes: 8 additions & 8 deletions src/cgns_utilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,10 @@ subroutine refine(Xin, Xout, refine_i, refine_j, refine_k, il, jl, kl )
implicit none

! Input/Output
integer, intent(in) :: il, jl ,kl
real(kind=8), intent(in), dimension(il, jl, kl, 3) :: Xin
! either a 0 (don't refine along that axis) or 1 (do refine along the axis)
integer, intent(in) :: refine_i, refine_j, refine_k
integer, intent(in) :: il, jl ,kl
real(kind=8), intent(out), dimension((il-1)*2**refine_i+1, (jl-1)*2**refine_j+1, (kl-1)*2**refine_k+1, 3) :: Xout
! Working
integer :: i, j, k, ii, jj, kk, idim, ill, jll, kll
Expand Down Expand Up @@ -845,8 +845,8 @@ subroutine interpEdge(Xcoarse, Xfine, il)
implicit none

! Input/Output
real(kind=8), intent(in), dimension(il, 3) :: Xcoarse
integer, intent(in) :: il
real(kind=8), intent(in), dimension(il, 3) :: Xcoarse
real(kind=8), intent(inout), dimension((il-1)*2+1, 3) ::Xfine

! Working
Expand All @@ -870,8 +870,8 @@ subroutine interpFace(Xcoarse, Xfine, il, jl)
implicit none

! Input/Output
real(kind=8), intent(in), dimension(il, jl, 3) :: Xcoarse
integer, intent(in) :: il, jl
real(kind=8), intent(in), dimension(il, jl, 3) :: Xcoarse
real(kind=8), intent(inout), dimension((il-1)*2+1, (jl-1)*2+1, 3) ::Xfine

! Working
Expand Down Expand Up @@ -1425,8 +1425,8 @@ subroutine computeConnectivity(inCoords, nCoords, sizes, nBlock, tol)
implicit none

! Input/Output
real(kind=8), dimension(3*nCoords), intent(in):: inCoords
integer, intent(in) :: nCoords, nBlock
real(kind=8), dimension(3*nCoords), intent(in):: inCoords
integer, dimension(3, nBlock), intent(in) :: sizes
real(kind=8), intent(in) :: tol
! Working
Expand Down Expand Up @@ -2150,8 +2150,8 @@ subroutine findBounds(x, xBounds, il, jl, kl)
implicit none

! Subroutine inputs
real(kind=8), dimension(il,jl,kl,3), intent(in) :: x
integer, intent(in) :: il, jl, kl
real(kind=8), dimension(il,jl,kl,3), intent(in) :: x

! Subroutine inputs/outputs.
real(kind=8), dimension(2,3), intent(inout) :: xBounds
Expand Down Expand Up @@ -2246,9 +2246,9 @@ subroutine computeVolumes(x, xBounds, binVolX, binVolY, binVolZ, &
implicit none

! Subroutine inputs
integer, intent(in) :: il, jl, kl, nBinX, nBinY, nBinZ
real(kind=8), dimension(il,jl,kl,3), intent(in) :: x
real(kind=8), dimension(2,3), intent(in) :: xBounds
integer, intent(in) :: il, jl, kl, nBinX, nBinY, nBinZ

! Subroutine inputs/outputs.
real(kind=8), dimension(nBinX), intent(inout) :: binVolX
Expand Down Expand Up @@ -2603,7 +2603,7 @@ subroutine convertPlot3d(pFile, cFile)
integer(kind=4) :: nZones, i, j, k, cg, dims(9), zoneID, ierr, Cx, Cy, Cz, iZone
integer(kind=4), dimension(:, :), allocatable :: sizes
real(kind=8), dimension(:, :, :), allocatable :: coorX, coorY, coorZ
character*12 :: zoneName
character(len=12) :: zoneName
ewu63 marked this conversation as resolved.
Show resolved Hide resolved

! We will be assuming multiblock, unformatted without iblank array.
open (unit=50, form='unformatted', file=pFile)
Expand All @@ -2622,7 +2622,7 @@ subroutine convertPlot3d(pFile, cFile)
zoneLoop: do iZone=1, nZones

! Write the zone itself.
write(zoneName, "((a) (I5))") 'Domain.', izone
write(zoneName, "((a), (I5))") 'Domain.', izone
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comma makes sense to me, but are the parentheses required? I am not sure what they are doing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not familiar with file IO specifications, not really sure :/ maybe @anily knows?

dims(1:3) = sizes(:, iZone)
call writeZone(cg, zoneName, dims, zoneID)

Expand Down