Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
chaseshyu committed Oct 6, 2020
2 parents 826db0f + 05f15c6 commit d4caedb
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 13 deletions.
6 changes: 3 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ifeq ($(F90), gfortran)
LDFLAGS += -fopenmp
endif
ifeq ($(debug), 0)
CFLAGS += -O3 -ffast-math
CFLAGS += -O2
else
CFLAGS += -O0 -Wall -fbounds-check -ftrapv -fbacktrace -fdump-core \
-Waliasing -Walign-commons -Wampersand -Wintrinsic-shadow \
Expand Down Expand Up @@ -105,7 +105,7 @@ ifeq ($(F90), pgf90)
LDFLAGS += -acc -ta=tesla:cc70,managed -Mcuda -lnvToolsExt
endif
ifeq ($(debug), 0)
CFLAGS += -O3 -fast
CFLAGS += -O2
else
CFLAGS += -O0 -Mbounds -Mchkstk -traceback
LDFLAGS +=
Expand All @@ -125,7 +125,7 @@ ifeq ($(F90), f90)
# -fpover=yes: Provide run-time overflow check during READ
# -xcheck=%all: Enable all run-time check
ifeq ($(debug), 0)
CFLAGS += -O3 -r8const -fast -xloopinfo -s -xipo
CFLAGS += -O2 -r8const -xloopinfo -s -xipo
else
CFLAGS += -w3 -r8const -C -fpover=yes -xcheck=%all
endif
Expand Down
2 changes: 1 addition & 1 deletion src/dt_mass.f90
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ subroutine dt_mass
enddo

dt = min(dt_elastic, dt_maxwell)

!$ACC update device(dt, dt_elastic, dt_maxwell, dtmax_therm)
return
end

Expand Down
6 changes: 4 additions & 2 deletions src/fl_move.f90
Original file line number Diff line number Diff line change
Expand Up @@ -274,13 +274,15 @@ end subroutine resurface


subroutine add_marker_at_top(i, dz_ratio, time, kph, nmarkers)
use myrandom_mod
use marker_data
use arrays
include 'precision.inc'

iseed = nloop
do while(.true.)
call random_number(r1)
call random_number(r2)
call myrandom(iseed, r1)
call myrandom(iseed, r2)
j = 1

! (x1, y1) and (x2, y2)
Expand Down
15 changes: 13 additions & 2 deletions src/fl_srate.f90
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@

! Calculation of strain rates from velocities
! Mixed of volumetric strain_rates (for incompressible flow)

subroutine fl_srate
use arrays
use params
Expand All @@ -17,6 +16,10 @@ subroutine fl_srate
!$OMP vx1,vy1,vx2,vy2,vx3,vy3,vx4,vy4, &
!$OMP em,eda,edb,s11,s22,s12, &
!$OMP srII,srI,srs2,stII)
!$ACC parallel loop collapse(2) private(i,j,x1,y1,x2,y2,x3,y3,x4,y4, &
!$ACC vx1,vy1,vx2,vy2,vx3,vy3,vx4,vy4, &
!$ACC em,eda,edb,s11,s22,s12, &
!$ACC srII,srI,srs2,stII)
do 2 i = 1,nx-1
do 2 j = 1,nz-1

Expand Down Expand Up @@ -109,10 +112,14 @@ subroutine fl_srate
!$OMP end parallel do
! following block is needed for averaging
dtavg = dtavg + dt

!$ACC update device(dtavg)
! re-initialisation after navgsr steps
if( nsrate .eq. ifreq_avgsr ) then
!$OMP parallel do
!$ACC parallel loop collapse(2) private(i,j,x1,y1,x2,y2,x3,y3,x4,y4, &
!$ACC vx1,vy1,vx2,vy2,vx3,vy3,vx4,vy4, &
!$ACC em,eda,edb,s11,s22,s12, &
!$ACC srII,srI,srs2,stII)
do i = 1,nx-1
do j = 1, nz-1
e2sr(j,i) = se2sr(j,i) / dtavg
Expand All @@ -126,6 +133,10 @@ subroutine fl_srate
nsrate = 0
elseif( nsrate .eq. -1 ) then
!$OMP parallel do
!$ACC parallel loop collapse(2) private(i,j,x1,y1,x2,y2,x3,y3,x4,y4, &
!$ACC vx1,vy1,vx2,vy2,vx3,vy3,vx4,vy4, &
!$ACC em,eda,edb,s11,s22,s12, &
!$ACC srII,srI,srs2,stII)
do i = 1,nx-1
do j = 1, nz-1
e2sr(j,i) = se2sr(j,i) / dtavg
Expand Down
5 changes: 4 additions & 1 deletion src/fl_therm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
! Calculate thermal field in explict form

subroutine fl_therm
!$ACC routine(Eff_cp) seq
!$ACC routine(Eff_conduct) seq
use arrays
use params
include 'precision.inc'
Expand All @@ -25,7 +27,7 @@ subroutine fl_therm
! | / / |
! 2 2---3


!$ACC kernels
! saving old temperature
if (istress_therm.gt.0) temp0(:,:) = temp(:,:)

Expand Down Expand Up @@ -244,6 +246,7 @@ subroutine fl_therm
end do
!$OMP end do
!$OMP end parallel
!$ACC end kernels

return
end
5 changes: 1 addition & 4 deletions src/flac.f90
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ subroutine flac

! Adjust inertial masses or time step due to deformations
call nvtxStartRange('dt_mass')
if( mod(nloop,ifreq_imasses) .eq. 0 ) then
call dt_mass
!$ACC update device(dt)
end if
if( mod(nloop,ifreq_imasses) .eq. 0 ) call dt_mass
call nvtxEndRange()

500 continue
Expand Down

0 comments on commit d4caedb

Please sign in to comment.