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

fixed all the warnings given by the Portland and Cray compilers on a Cra... #12

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions flags.guess
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ case $my_FC in
# Cray Fortran
#
DEF_FFLAGS="-O3 -Onoaggress -Oipa0 -hfp2 -Ovector3 -Oscalar3 -Ocache2 -Ounroll2 -Ofusion2 -M 1438" # turn on optimization; -Oaggress -Oipa4 would make it even more aggressive
# -eC -eD -ec -en -eI -ea -g -G0 -M 1438 # turn on full debugging and range checking
# -eC -eD -ec -en -eI -ea -g -G0 -M 1193 -M 1438 # turn on full debugging and range checking
;;
pgf95|*/pgf95|pgf90|*/pgf90)
#
# Portland PGI
#
DEF_FFLAGS="-fast -Mnobounds -Minline -Mneginfo -Mdclchk -Knoieee -Minform=warn -Mdaz -Mflushz -Mvect -mcmodel=medium"
DEF_FFLAGS="-fast -Mnobounds -Minline -Mneginfo -Mdclchk -Knoieee -Minform=inform -Mdaz -Mflushz -Mvect -mcmodel=medium"
# -Mbounds
# -fastsse -tp amd64e -Msmart
;;
Expand Down
6 changes: 3 additions & 3 deletions src/auxiliaries/combine_surf_data.f90
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ program combine_surf_data

integer,parameter :: MAX_NUM_NODES = 400

integer i,j,k,ispec_surf,ios,it,num_node,njunk,ires,idim,iproc,njunk1,njunk2,njunk3,inx,iny
integer i,j,k,ispec_surf,ios,it,num_node,njunk,ires,idimval,iproc,njunk1,njunk2,njunk3,inx,iny
character(len=150) :: arg(20),sline,filename,surfname,reg_name,belm_name, indir, outdir
character(len=150) :: mesh_file, pt_mesh_file, em_mesh_file, command_name
logical :: HIGH_RESOLUTION_MESH,FILE_ARRAY_IS_3D
Expand Down Expand Up @@ -128,8 +128,8 @@ program combine_surf_data
endif

! file dimension
read(arg(7),*) idim
if (idim == 0) then
read(arg(7),*) idimval
if (idimval == 0) then
FILE_ARRAY_IS_3D = .false.
else
FILE_ARRAY_IS_3D = .true.
Expand Down
2 changes: 1 addition & 1 deletion src/auxiliaries/combine_vol_data.F90
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ program combine_vol_data_vtk
call MPI_Init(ierr)
call MPI_Comm_size(MPI_COMM_WORLD, sizeprocs, ierr)
print *, sizeprocs, "procs"
if (sizeprocs .ne. 1) then
if (sizeprocs /= 1) then
print *, "sequential program. Only mpirun -np 1 ..."
call MPI_Abort(MPI_COMM_WORLD, mpier, ierr)
endif
Expand Down
4 changes: 2 additions & 2 deletions src/auxiliaries/combine_vol_data_adios_impl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ end subroutine read_scalars_adios_mesh
!=============================================================================
subroutine read_coordinates_adios_mesh(mesh_handle, iproc, ir, nglob, nspec, &
xstore, ystore, zstore, ibool)
use constants
implicit none
include 'constants.h'
! Parameters
integer(kind=8), intent(in) :: mesh_handle
integer, intent(in) :: iproc, ir, nglob, nspec
Expand Down Expand Up @@ -199,8 +199,8 @@ end subroutine read_coordinates_adios_mesh
!=============================================================================
subroutine read_values_adios(value_handle, var_name, iproc, ir, &
nspec, data)
use constants
implicit none
include 'constants.h'
! Parameters
integer(kind=8), intent(in) :: value_handle
character(len=*), intent(in) :: var_name
Expand Down
8 changes: 4 additions & 4 deletions src/auxiliaries/combine_vol_data_shared.f90
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ end subroutine prem_density
! copy from intgrl.f90 to avoid compiling issues


subroutine intgrl(sum,r,nir,ner,f,s1,s2,s3)
subroutine intgrl(sumval,r,nir,ner,f,s1,s2,s3)

! Computes the integral of f[i]*r[i]*r[i] from i=nir to i=ner for
! radii values as in model PREM_an640
Expand All @@ -296,7 +296,7 @@ subroutine intgrl(sum,r,nir,ner,f,s1,s2,s3)
! Argument variables
integer ner,nir
double precision f(640),r(640),s1(640),s2(640)
double precision s3(640),sum
double precision s3(640),sumval

! Local variables
double precision, parameter :: third = 1.0d0/3.0d0
Expand All @@ -316,14 +316,14 @@ subroutine intgrl(sum,r,nir,ner,f,s1,s2,s3)

call deriv(f,yprime,n,r,ndis,kdis,s1,s2,s3)
nir1 = nir + 1
sum = 0.0d0
sumval = 0.0d0
do i=nir1,ner
j = i-1
rji = r(i) - r(j)
s1l = s1(j)
s2l = s2(j)
s3l = s3(j)
sum = sum + r(j)*r(j)*rji*(f(j) &
sumval = sumval + r(j)*r(j)*rji*(f(j) &
+ rji*(0.5d0*s1l + rji*(third*s2l + rji*0.25d0*s3l))) &
+ 2.0d0*r(j)*rji*rji*(0.5d0*f(j) + rji*(third*s1l + rji*(0.25d0*s2l + rji*fifth*s3l))) &
+ rji*rji*rji*(third*f(j) + rji*(0.25d0*s1l + rji*(fifth*s2l + rji*sixth*s3l)))
Expand Down
18 changes: 9 additions & 9 deletions src/auxiliaries/convolve_source_timefunction.f90
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ program convolve_source_time_function

integer :: i,j,N_j,number_remove,nlines

double precision :: alpha,dt,tau_j,source,exponent,t1,t2,displ1,displ2,gamma,height,half_duration_triangle
double precision :: alpha,dt,tau_j,source,exponentval,t1,t2,displ1,displ2,gamma,height,half_duration_triangle

logical :: triangle

double precision, dimension(:), allocatable :: time,sem,sem_fil
double precision, dimension(:), allocatable :: timeval,sem,sem_fil

! read file with number of lines in input
open(unit=33,file='input_convolve_code.txt',status='old',action='read')
Expand All @@ -55,18 +55,18 @@ program convolve_source_time_function
close(33)

! allocate arrays
allocate(time(nlines),sem(nlines),sem_fil(nlines))
allocate(timeval(nlines),sem(nlines),sem_fil(nlines))

! read the input seismogram
do i = 1,nlines
read(5,*) time(i),sem(i)
read(5,*) timeval(i),sem(i)
enddo

! define a Gaussian with the right exponent to mimic a triangle of equivalent half duration
alpha = SOURCE_DECAY_MIMIC_TRIANGLE/half_duration_triangle

! compute the time step
dt = time(2) - time(1)
dt = timeval(2) - timeval(1)

! number of integers for which the source wavelet is different from zero
if(triangle) then
Expand Down Expand Up @@ -109,9 +109,9 @@ program convolve_source_time_function
else

! convolve with a Gaussian
exponent = alpha**2 * tau_j**2
if(exponent < 50.d0) then
source = alpha*exp(-exponent)/sqrt(PI)
exponentval = alpha**2 * tau_j**2
if(exponentval < 50.d0) then
source = alpha*exp(-exponentval)/sqrt(PI)
else
source = 0.d0
endif
Expand All @@ -128,7 +128,7 @@ program convolve_source_time_function
! compute number of samples to remove from end of seismograms
number_remove = N_j + 1
do i=1,nlines - number_remove
write(*,*) sngl(time(i)),' ',sngl(sem_fil(i))
write(*,*) sngl(timeval(i)),' ',sngl(sem_fil(i))
enddo

end program convolve_source_time_function
Expand Down
16 changes: 8 additions & 8 deletions src/auxiliaries/create_movie_AVS_DX.f90
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ program xcreate_movie_AVS_DX
! for sorting routine
integer :: npointot,ilocnum,nglob,ielm,ieoff,ispecloc
integer :: NIT
integer, dimension(:), allocatable :: iglob,loc,ireorder
integer, dimension(:), allocatable :: iglob,locval,ireorder
logical, dimension(:), allocatable :: ifseg,mask_point
double precision, dimension(:), allocatable :: xp,yp,zp,xp_save,yp_save,zp_save,field_display

Expand Down Expand Up @@ -266,7 +266,7 @@ program xcreate_movie_AVS_DX
allocate(iglob(npointot),stat=ierror)
if(ierror /= 0) stop 'error while allocating iglob'

allocate(loc(npointot),stat=ierror)
allocate(locval(npointot),stat=ierror)
if(ierror /= 0) stop 'error while allocating loc'

allocate(ifseg(npointot),stat=ierror)
Expand Down Expand Up @@ -610,7 +610,7 @@ program xcreate_movie_AVS_DX

!--- sort the list based upon coordinates to get rid of multiples
print *,'sorting list of points'
call get_global_AVS(nspectot_AVS_max,xp,yp,zp,iglob,loc,ifseg,nglob,npointot)
call get_global_AVS(nspectot_AVS_max,xp,yp,zp,iglob,locval,ifseg,nglob,npointot)

!--- print total number of points found
print *
Expand Down Expand Up @@ -866,7 +866,7 @@ end subroutine read_AVS_DX_parameters
!


subroutine get_global_AVS(nspec,xp,yp,zp,iglob,loc,ifseg,nglob,npointot)
subroutine get_global_AVS(nspec,xp,yp,zp,iglob,locval,ifseg,nglob,npointot)

! this routine MUST be in double precision to avoid sensitivity
! to roundoff errors in the coordinates of the points
Expand All @@ -878,7 +878,7 @@ subroutine get_global_AVS(nspec,xp,yp,zp,iglob,loc,ifseg,nglob,npointot)
implicit none

integer npointot
integer iglob(npointot),loc(npointot)
integer iglob(npointot),locval(npointot)
logical ifseg(npointot)
double precision xp(npointot),yp(npointot),zp(npointot)
integer nspec,nglob
Expand Down Expand Up @@ -913,7 +913,7 @@ subroutine get_global_AVS(nspec,xp,yp,zp,iglob,loc,ifseg,nglob,npointot)
do ispec=1,nspec
ieoff=NGNOD2D_AVS_DX*(ispec-1)
do ilocnum=1,NGNOD2D_AVS_DX
loc(ieoff+ilocnum)=ieoff+ilocnum
locval(ieoff+ilocnum)=ieoff+ilocnum
enddo
enddo

Expand All @@ -935,7 +935,7 @@ subroutine get_global_AVS(nspec,xp,yp,zp,iglob,loc,ifseg,nglob,npointot)
else
call rank(zp(ioff),ind,ninseg(iseg))
endif
call swap_all(loc(ioff),xp(ioff),yp(ioff),zp(ioff),iwork,work,ind,ninseg(iseg))
call swap_all(locval(ioff),xp(ioff),yp(ioff),zp(ioff),iwork,work,ind,ninseg(iseg))
ioff=ioff+ninseg(iseg)
enddo

Expand Down Expand Up @@ -971,7 +971,7 @@ subroutine get_global_AVS(nspec,xp,yp,zp,iglob,loc,ifseg,nglob,npointot)
ig=0
do i=1,npointot
if(ifseg(i)) ig=ig+1
iglob(loc(i))=ig
iglob(locval(i))=ig
enddo

nglob=ig
Expand Down
4 changes: 2 additions & 2 deletions src/auxiliaries/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ all_aux: required $(auxiliaries_TARGETS)

aux: required $(auxiliaries_TARGETS)

${E}/xconvolve_source_timefunction: $O/convolve_source_timefunction.aux.o
${FCCOMPILE_CHECK} -o ${E}/xconvolve_source_timefunction $O/convolve_source_timefunction.aux.o
${E}/xconvolve_source_timefunction: $(auxiliaries_SHARED_OBJECTS) $O/convolve_source_timefunction.aux.o
${FCCOMPILE_CHECK} -o ${E}/xconvolve_source_timefunction $(auxiliaries_SHARED_OBJECTS) $O/convolve_source_timefunction.aux.o

${E}/xcombine_AVS_DX: $(auxiliaries_SHARED_OBJECTS) $O/get_cmt.solver.o $O/combine_AVS_DX.aux.o
${FCCOMPILE_CHECK} -o ${E}/xcombine_AVS_DX $(auxiliaries_SHARED_OBJECTS) $O/get_cmt.solver.o $O/combine_AVS_DX.aux.o
Expand Down
2 changes: 1 addition & 1 deletion src/cuda/initialize_cuda.cu
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void FC_FUNC_(initialize_cuda_device,
fprintf(stderr,"Error after cudaGetDeviceCount: %s\n", cudaGetErrorString(err));
exit_on_error("CUDA runtime error: cudaGetDeviceCount failed\n\nplease check if driver and runtime libraries work together\nor on titan enable environment: CRAY_CUDA_PROXY=1 to use single GPU with multiple MPI processes\n\nexiting...\n");
}

// returns device count to fortran
if (device_count == 0) exit_on_error("CUDA runtime error: there is no device supporting CUDA\n");
*ncuda_devices = device_count;
Expand Down
Loading