Skip to content

Commit

Permalink
Warnings fix (#52)
Browse files Browse the repository at this point in the history
Co-authored-by: Neil Wu <[email protected]>
  • Loading branch information
anilyil and ewu63 authored Jun 8, 2020
1 parent f5fd4b7 commit 405370d
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 37 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ python/reg_tests/*.dat
python/reg_tests/*.txt
python/reg_tests/*.zipper
python/inputFiles.tar.gz
python/adflow_input_files.tar.gz

# also ignore the input files to regtests after we extract from archine
python/inputFiles/*.cgns
python/inputFiles/split_file
python/inputFiles/tecplot.phy


# optimization reports from intel compilers
*.optrpt
Expand Down
2 changes: 2 additions & 0 deletions python/inputFiles/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ The input files for test need to be downloaded.

From the command line, navigate to the `adflow/python` directory and download and extract the archive

```
wget http://mdolab.engin.umich.edu/sites/default/files/mdolabwebsite/repos/adflow/adflow_input_files.tar.gz
tar -xzvf adflow_input_files.tar.gz
```

The above should extract the files to the `adflow/python/inputFiles` directory.
4 changes: 2 additions & 2 deletions src/adjoint/ADFirstAidKit/debugAD.f
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ SUBROUTINE DEBUG_TGT_INIT2(epsilon, ezero, errmax)
dbad_epszero = ezero
dbad_errormax = errmax
write (*,'("Starting TGT test, epsilon=",e7.1,
+ ", zero=",e7.1,", errmax=",f6.1,"%")'),
+ ", zero=",e7.1,", errmax=",f6.1,"%")')
+ epsilon,ezero,(100.0*errmax)
write (*,
+'("===========================================================")')
Expand Down Expand Up @@ -585,7 +585,7 @@ SUBROUTINE DEBUG_FWD_INIT(ezero, errmax, incr)
dbad_incr = incr
dbad_nberrors = 0
write (*,'("Starting ADJ test, zero=",e7.1,
+ ", errmax=",f4.1,"%, random_incr=",e8.2)'),
+ ", errmax=",f4.1,"%, random_incr=",e8.2)')
+ ezero,(100.0*errmax),incr
write (*,
+'("===========================================================")')
Expand Down
6 changes: 3 additions & 3 deletions src/adjoint/ADFirstAidKit/dpStack.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void dppushN(char *x, unsigned int nbChars) {
void dppopN(char *x, unsigned int nbChars) {
dpcheckBack() ;
if (dpcurStackTop-dpcurStackBottom < nbChars) {
printf("Help! DP stack corrupted, height:%i !!",dpcurStackTop-dpcurStackBottom-nbChars) ;
printf("Help! DP stack corrupted, height:%li !!",dpcurStackTop-dpcurStackBottom-nbChars) ;
exit(0) ;
}
dpcurStackTop-=nbChars ;
Expand Down Expand Up @@ -436,7 +436,7 @@ void dpprinttopplace_() {
stack = stack->prev ;
nbBlocks++ ;
}
printf("DP Stack top: %i+%i\n",nbBlocks,dpcurStackTop - dpcurStackBottom) ;
printf("DP Stack top: %i+%li\n",nbBlocks,dpcurStackTop - dpcurStackBottom) ;
}

void dpprintlookingplace_() {
Expand All @@ -449,7 +449,7 @@ void dpprintlookingplace_() {
stack = stack->prev ;
nbBlocks++ ;
}
printf("DP Stack look: %i+%i\n",nbBlocks,dplookStackTop - dplookStackBottom) ;
printf("DP Stack look: %i+%li\n",nbBlocks,dplookStackTop - dplookStackBottom) ;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/adjoint/initPETScWrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void initPETScWrap(void)
int argc;

argc=0;
ierr = PetscInitialize(&argc, (char *)0, (char *)0, (char *)0);
ierr = PetscInitialize(&argc, (char ***)0, (char *)0, (char *)0);

}

Expand Down
12 changes: 11 additions & 1 deletion src/build/fort_depend.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,17 @@ def get_depends(fob=[],m2f=[]):
if m2f[j.lower()] != i.file_name:
tmp.append(m2f[j.lower()])
except:
print("\033[031mError\033[039m module \033[032m"+j+"\033[039m not defined in any files. Skipping...")
if j in ['petsc', 'mpi', 'iso_fortran_env', 'cgns']:
# these dependence will be resolved through the included libraries
# there is no need to scare the user with the error message
continue
elif j[-2:] == "_b" or j[-2:] == "_d":
# these are AD routines
continue
else:
# actual missing dependencies
print("\033[031mError\033[039m module \033[032m"+j+"\033[039m not defined in any files. Skipping...")

deps[i.file_name]=tmp

return deps
Expand Down
1 change: 0 additions & 1 deletion src/initFlow/variableReading.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1958,7 +1958,6 @@ subroutine readZvelocity(nTypeMismatch)
! It is assumed that the pointers in blockPointers already
! point to the correct block.
!
use blockPointers
use constants
use cgnsNames
use blockPointers, only : w, nbklocal
Expand Down
1 change: 0 additions & 1 deletion src/inputParam/inputParamRoutines.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2761,7 +2761,6 @@ subroutine checkInputParam
use inputADjoint
use inputTSStabDeriv
! ------------------------------------------------
use inputPhysics, only : velDirFreeStream, liftDirection, dragDirection
use communication, only : myid, adflow_comm_world
use iteration, only : coefTime, coefTimeALE, coefMeshALE, &
oldSolWritten, nALEMeshes, nALESteps, nOldLevels
Expand Down
16 changes: 8 additions & 8 deletions src/metis-4.0/metis.c
Original file line number Diff line number Diff line change
Expand Up @@ -15213,7 +15213,7 @@ void SplitGraphPart(CtrlType *ctrl, GraphType *graph, GraphType *lgraph, GraphTy
svwgt[0] = lgraph->vwgt;
snvwgt[0] = lgraph->nvwgt;
sadjwgtsum[0] = lgraph->adjwgtsum;
sadjncy[0] = lgraph->adjncy;
sadjncy[0] = lgraph->adjncy;
sadjwgt[0] = lgraph->adjwgt;
slabel[0] = lgraph->label;

Expand All @@ -15222,7 +15222,7 @@ void SplitGraphPart(CtrlType *ctrl, GraphType *graph, GraphType *lgraph, GraphTy
svwgt[1] = rgraph->vwgt;
snvwgt[1] = rgraph->nvwgt;
sadjwgtsum[1] = rgraph->adjwgtsum;
sadjncy[1] = rgraph->adjncy;
sadjncy[1] = rgraph->adjncy;
sadjwgt[1] = rgraph->adjwgt;
slabel[1] = rgraph->label;

Expand Down Expand Up @@ -16417,7 +16417,7 @@ void FM_2WayNodeRefine(CtrlType *ctrl, GraphType *graph, float ubfactor, int npa
idxtype *mptr, *mind, *moved, *swaps, *perm;
PQueueType parts[2];
NRInfoType *rinfo;
int higain, oldgain, mincut, initcut, mincutorder;
int higain, oldgain, mincut, initcut, mincutorder;
int pass, to, other, limit;
int badmaxpwgt, mindiff, newdiff;
int u[2], g[2];
Expand Down Expand Up @@ -16652,7 +16652,7 @@ void FM_2WayNodeRefine2(CtrlType *ctrl, GraphType *graph, float ubfactor, int np
idxtype *mptr, *mind, *moved, *swaps, *perm;
PQueueType parts[2];
NRInfoType *rinfo;
int higain, oldgain, mincut, initcut, mincutorder;
int higain, oldgain, mincut, initcut, mincutorder;
int pass, to, other, limit;
int badmaxpwgt, mindiff, newdiff;
int u[2], g[2];
Expand Down Expand Up @@ -16889,7 +16889,7 @@ void FM_2WayNodeRefineEqWgt(CtrlType *ctrl, GraphType *graph, int npasses)
idxtype *mptr, *mind, *moved, *swaps, *perm;
PQueueType parts[2];
NRInfoType *rinfo;
int higain, oldgain, mincut, initcut, mincutorder;
int higain, oldgain, mincut, initcut, mincutorder;
int pass, to, other, limit;
int mindiff, newdiff;
int u[2], g[2];
Expand Down Expand Up @@ -17113,7 +17113,7 @@ void FM_2WayNodeRefine_OneSided(CtrlType *ctrl, GraphType *graph, float ubfactor
idxtype *mptr, *mind, *swaps, *perm;
PQueueType parts;
NRInfoType *rinfo;
int higain, oldgain, mincut, initcut, mincutorder;
int higain, oldgain, mincut, initcut, mincutorder;
int pass, to, other, limit;
int badmaxpwgt, mindiff, newdiff;

Expand Down Expand Up @@ -17314,7 +17314,7 @@ void FM_2WayNodeBalance(CtrlType *ctrl, GraphType *graph, float ubfactor)
idxtype *perm, *moved;
PQueueType parts;
NRInfoType *rinfo;
int higain, oldgain;
int higain, oldgain;
int to, other;

nvtxs = graph->nvtxs;
Expand Down Expand Up @@ -19315,7 +19315,7 @@ void errexit(char *f_str,...)

sprintf(out2, "Error! %s", out1);

fprintf(stdout, out2);
fprintf(stdout, "%s", out2);
fflush(stdout);

abort();
Expand Down
2 changes: 1 addition & 1 deletion src/output/writeCGNSSurface.F90
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ subroutine writeCGNSSurfaceSol(famList)
call computeIsoVariable(isoSurfaceNames(iSurf), ll, isoValues(iSurf))

11 format(A,A,A,F7.4)
write(contourName, 11), "Contour ", trim(isoSurfaceNames(iSurf)), "=", isoValues(iSurf)
write(contourName, 11) "Contour ", trim(isoSurfaceNames(iSurf)), "=", isoValues(iSurf)
call writeIsoSurface(contourName, ll, nIsoSurfVar, isoSurfSolNames)
end do

Expand Down
10 changes: 5 additions & 5 deletions src/overset/oversetUtilities.F90
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,19 @@ subroutine printOverlapMatrix(overlap)
if (myid == 0) then
! Now dump out who owns what:
do i=1, overlap%nrow
write(*, "(a,I4, a)", advance='no'), 'Row:', i, " "
write(*, "(a,I4, a)", advance='no') 'Row:', i, " "
do jj=overlap%rowPtr(i), overlap%rowPtr(i+1)-1
write(*, "(a,I2, a, e10.5)", advance='no'), "(", overlap%colInd(jj), ")", overlap%data(jj)
write(*, "(a,I2, a, e10.5)", advance='no') "(", overlap%colInd(jj), ")", overlap%data(jj)
end do
write(*, *) " "
end do

print *, '--------------------------------------'
! Now dump out who owns what:
do i=1, overlap%nRow
write(*, "(a,I4, a)", advance='no'), 'Row:', i, " "
write(*, "(a,I4, a)", advance='no') 'Row:', i, " "
do jj=overlap%rowPtr(i), overlap%rowPtr(i+1)-1
write(*, "(a,I2, a, I8)", advance='no'), "(", overlap%colInd(jj), ")", int(overlap%assignedProc(jj))
write(*, "(a,I2, a, I8)", advance='no') "(", overlap%colInd(jj), ")", int(overlap%assignedProc(jj))
end do
write(*, *) " "
end do
Expand Down Expand Up @@ -2314,7 +2314,7 @@ subroutine dumpIblank(level, sps)
x(i-1, j , k , :) + &
x(i , j , k , :))

write(19, "(E18.10, E18.10, E18.10, I3)"), xp(1), xp(2), xp(3), iblank(i, j, k)
write(19, "(E18.10, E18.10, E18.10, I3)") xp(1), xp(2), xp(3), iblank(i, j, k)
end do
end do
end do
Expand Down
12 changes: 6 additions & 6 deletions src/overset/stringOps.F90
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ subroutine reduceGapString(string)
end do
deallocate(normCounter, uniqueNorms)
! Averageing is complete

! Update the connectivity to use the new set of nodes
do i=1, string%nElems
string%conn(1, i) = link(string%conn(1, i))
Expand Down Expand Up @@ -2944,7 +2944,7 @@ subroutine writeOversetMaster(str,fileID)

end subroutine writeOversetMaster


subroutine writeOversetTriangles(string, fileName, startTri, endTri)

use constants
Expand Down Expand Up @@ -2994,8 +2994,8 @@ subroutine writeZipperDebug(str)
integer(kind=intType) :: i, j

open(unit=101, file="debug.zipper", form='formatted')
write(101, *), str%nNodes
write(101, *), str%nElems
write(101, *) str%nNodes
write(101, *) str%nElems
do i=1, str%nNodes
do j=1, 10
write (101,*) str%nodeData(j, i)
Expand Down Expand Up @@ -3029,8 +3029,8 @@ subroutine loadZipperDebug(fileName, str)
integer(kind=intType) :: i, j

open(unit=101, file=fileName, form='formatted')
read(101, *), str%nNodes
read(101, *), str%nElems
read(101, *) str%nNodes
read(101, *) str%nElems
call nullifyString(str)

allocate(str%nodeData(10, str%nNodes))
Expand Down
7 changes: 3 additions & 4 deletions src/overset/zipperMesh.F90
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ subroutine zipperCore(master, pocketMaster, debugZipper)
call writeOversetMaster(master, 101)
close(101)
end if

call createOrderedStrings(master, strings, nStrings)


Expand Down Expand Up @@ -1231,14 +1231,13 @@ end function checkDeviation
subroutine writeWalls(famList)


use communication
!use oversetData
use constants
use blockPointers
use utils, only : setPointers, setBCPointers
use BCPointers, only : xx
use sorting, only : famInList
use communication, only : myid, adflow_comm_world
use communication, only : myid, adflow_comm_world, nProc
use utils, only : EChk
implicit none
integer(kind=intType), intent(in), dimension(:) :: famList
Expand Down Expand Up @@ -1419,7 +1418,7 @@ subroutine writeZone(iBeg, iEnd, jBeg, jEnd, nBkGlobal, xx, iblank)

write(zoneName, "(a,I5.5)") "Zone_", nBkGlobal
110 format('ZONE T=',a, " I=", i5, " J=", i5)
write(101, 110), trim(zoneName), iEnd-iBeg+1, jEnd-jBeg+1
write(101, 110) trim(zoneName), iEnd-iBeg+1, jEnd-jBeg+1
write (101,*) "DATAPACKING=BLOCK, VARLOCATION=([1,2,3]=NODAL, [4]=CELLCENTERED)"
13 format (E20.12)

Expand Down
2 changes: 1 addition & 1 deletion src/preprocessing/preprocessingAPI.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ subroutine setSurfaceFamilyInfo
if (trim(cgnsDoms(i)%bocoInfo(j)%wallBCName) == "") then
if (myid == 0) then
! Tell the user we are adding an automatic family name
write(*, 101), i, j, trim(BCTypeName(cgnsDoms(i)%bocoInfo(j)%BCTypeCGNS)), &
write(*, 101) i, j, trim(BCTypeName(cgnsDoms(i)%bocoInfo(j)%BCTypeCGNS)), &
trim(defaultFamName(cgnsDoms(i)%bocoInfo(j)%BCTypeCGNS))
end if
cgnsDoms(i)%bocoInfo(j)%wallBCName = trim(defaultFamName(cgnsDoms(i)%bocoInfo(j)%BCTypeCGNS))
Expand Down
5 changes: 2 additions & 3 deletions src/warping/getForces.F90
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ subroutine getForces_b(forcesd, npts, sps)
use blockPointers, only : nDom, nBocos, BCData, BCType, nBocos, BCDatad
use inputPhysics, only : forcesAsTractions
use surfaceFamilies, only: BCFamExchange, familyExchange
use communication
use utils, only : EChk, setPointers, setPointers_d
use oversetData, only : zipperMeshes, zipperMesh, oversetPresent
use surfaceFamilies, only : familyExchange, BCFamExchange
Expand Down Expand Up @@ -1393,10 +1392,10 @@ subroutine computeNodalForces_b(sps)
if(BCType(mm) == EulerWall.or.BCType(mm) == NSWallAdiabatic .or. &
BCType(mm) == NSWallIsothermal) then
do j=jBeg, jEnd
do i=iBeg, iEnd
do i=iBeg, iEnd
qf_b = fourth*(BCDatad(mm)%F(i, j, :) + BCdatad(mm)%F(i-1, j, :) + &
BCDatad(mm)%F(i, j-1, :) + BCDatad(mm)%F(i-1, j-1, :))

! Fp and Fv are face-based values
BCDatad(mm)%Fp(i, j, :) = BCDatad(mm)%Fp(i, j, :) + qf_b
BCDatad(mm)%Fv(i, j, :) = BCDatad(mm)%Fv(i, j, :) + qf_b
Expand Down

0 comments on commit 405370d

Please sign in to comment.