diff --git a/aph/aphrates.m b/aph/aphrates.m index abd76397..e639bd24 100755 --- a/aph/aphrates.m +++ b/aph/aphrates.m @@ -418,11 +418,11 @@ real function rqa (te, ne, k) Use(Rtdegas) Use(Aphwrk) Use(Timespl) - real(Size4) sec4, gettime, tsval + real tick, tock, tsval c external procedures -- real rsa, svradp, B2VAhL - external rsa, svradp, B2VAhL, gettime + external rsa, svradp, B2VAhL, tick, tock c local variables -- real a @@ -590,10 +590,10 @@ c fractional parts of intervals (je,je+1) and (jd,jd+1) -- nxcoef=nxdata_aph nycoef=nydata_aph - tsval = gettime(sec4) + tsval = tick() w = B2VAhL(xuse, yuse, 0, 0, xknots_aph, yknots_aph, nxcoef, nycoef, . kxords_aph, kyords_aph, rqacoef, ldf_aph, workh, iflag_aph) - totb2val = totb2val + gettime(sec4) - tsval + totb2val = totb2val + tock(tsval) c electron energy loss rate parameter -- rqa = w + 13.6 * ev_aph * rsa(te,ne,0.,k) @@ -626,11 +626,11 @@ real function rra (te, ne, tau, k) Use(Rtdegas) Use(Aphwrk) Use(Timespl) - real(Size4) sec4, gettime, tsval + real tick, tock, tsval c external procedures -- real srecf, B2VAhL - external srecf, B2VAhL, gettime + external srecf, B2VAhL, tick, tock c local variables -- integer ine,ite @@ -767,10 +767,10 @@ c fractional parts of intervals (je,je+1) and (jd,jd+1) -- nxcoef=nxdata_aph nycoef=nydata_aph - tsval = gettime(sec4) + tsval = tick() rra = B2VAhL(xuse, yuse, 0, 0, xknots_aph, yknots_aph, nxcoef, nycoef, . kxords_aph, kyords_aph, rracoef, ldf_aph, workh, iflag_aph) - totb2val = totb2val + gettime(sec4) - tsval + totb2val = totb2val + tock(tsval) c----------------------------------------------------------------------c elseif (istabon .eq. 7) then c use polynomial fit from Bob Campbell - 8/93 @@ -881,11 +881,11 @@ real function rsa (te, ne, tau, k) Use(Rtdegas) Use(Aphwrk) Use(Timespl) - real(Size4) sec4, gettime, tsval + real tick, tock, tsval c external procedures -- real sionf, B2VAhL - external sionf, B2VAhL, gettime + external sionf, B2VAhL, tick, tock c local variables -- real a @@ -1025,10 +1025,10 @@ c fractional parts of intervals (je,je+1) and (jd,jd+1) -- nxcoef=nxdata_aph nycoef=nydata_aph - tsval = gettime(sec4) + tsval = tick() rsa = B2VAhL(xuse, yuse, 0, 0, xknots_aph, yknots_aph, nxcoef, nycoef, . kxords_aph, kyords_aph, rsacoef, ldf_aph, workh, iflag_aph) - totb2val = totb2val + gettime(sec4) - tsval + totb2val = totb2val + tock(tsval) c----------------------------------------------------------------------c elseif (istabon .eq. 7) then c use polynomial fit from Bob Campbell - 8/93 diff --git a/api/apifcn.m b/api/apifcn.m index e1eae7c3..566c4cc8 100755 --- a/api/apifcn.m +++ b/api/apifcn.m @@ -217,7 +217,7 @@ subroutine sapitim (timingsw) write(*,902) 'Impur.: physics w/o bookkeeping = ', ttimpc 902 format(a36,f10.4,20x,' sec') - write(*,*) '(included in above f & Jac numbers)' + write(*,*) '(incl. in above f & Jac numbers)' ttimpc = 0. return diff --git a/api/fmombal.m b/api/fmombal.m index 9fefab1d..a146aea2 100755 --- a/api/fmombal.m +++ b/api/fmombal.m @@ -5,6 +5,8 @@ subroutine coulfric(amu,denz2,dloglam,mntau,zi_api,capm,capn, > ela,elab,tempa) implicit real (a-h,o-z), integer (i-n) + real tick, tock, tsval + external tick, tock Use(Reduced_ion_constants) real capm(KXA,miso,KXA,miso),denz2(miso), > capn(KXA,KXA,miso,miso),mntau(miso,miso), @@ -56,7 +58,6 @@ implicit real (a-h,o-z), integer (i-n) Use(Reduced_ion_constants) Use(Reduced_ion_variables) Use(Timing) # istimingon,ttimpc - real(Size4) sec4, gettime, tsval real amu(misotope), den(misotope*(nchstate+1)), > gradp(misotope*nchstate), gradt(misotope*nchstate), > nurec(misotope*nchstate), nuion(misotope*(nchstate+1)), @@ -198,7 +199,7 @@ integer natomic(misotope) ! c ... Start timing impurity calculations. - if (istimingon .eq. 1 .and. misotope .gt. 1) tsval = gettime(sec4) + if (istimingon .eq. 1 .and. misotope .gt. 1) tsval = tick() c ... Initialize amat array. ndima=KXA*(MXMISO1)*KXA*(MXMISO1) @@ -244,7 +245,7 @@ call getfrict(friction,fricc,caplam,denmass,ela,nuion, c ... End timing impurity calculations. if (istimingon .eq. 1 .and. misotope .gt. 1) - . ttimpc = ttimpc + gettime(sec4) - tsval + . ttimpc = ttimpc + tock(tsval) return end diff --git a/bbb/oderhs.m b/bbb/oderhs.m index 626831db..c170011e 100755 --- a/bbb/oderhs.m +++ b/bbb/oderhs.m @@ -601,7 +601,7 @@ subroutine pandf (xc, yc, neq, time, yl, yldot) real dndym1,dndy0,dndyp1,d2ndy20,d2ndy2p1,d3ndy3 real dtdym1,dtdy0,dtdyp1,d2tdy20,d2tdy2p1,d3tdy3,nhi_nha integer idum, idumaray(1) - real(Size4) sec4, gettime, tsimpfe, tsimp, tsnpg, ueb + real tsimpfe, tsimp, tsnpg, ueb integer impflag # former Aux module variables integer ix,iy,igsp,iv,iv1,iv2,iv3,ix1,ix2,ix3,ix4,ix5,ix6 @@ -611,7 +611,6 @@ subroutine pandf (xc, yc, neq, time, yl, yldot) Use(Dim) # nx,ny,nhsp,nusp,nzspt,nzsp,nisp,ngsp,nxpt Use(Xpoint_indices) # ixlb,ixpt1,ixpt2,ixrb,iysptrx1,iysptrx2 # iysptrx - Use(Math_problem_size) # neqmx,numvar Use(Timing) # istimingon,ttotfe,ttotjf,ttimpfe,ttimpjf,ttnpg Use(Share) # nxpt,nxomit,geometry,nxc,cutlo,islimon,ix_lim,iy_lims # istabon,isudsym @@ -688,10 +687,9 @@ subroutine pandf (xc, yc, neq, time, yl, yldot) external rsa, rra, rqa, rcx, emissbs, erl1, erl2, radneq, radimpmc external radmc, svdiss real tick,tock - external tick,tock + external tick, tock ccc save - * -- procedures -- real ave, etaper, interp_yf, interp_xf ave(t0,t1) = 2*t0*t1 / (cutlo+t0+t1) @@ -861,9 +859,9 @@ c write(*,*) parvis c ... Get initial value of system cpu timer. if(xc .lt. 0) then - tsfe = gettime(sec4) + tsfe = tick() else - tsjf = gettime(sec4) + tsjf = tick() endif if ( (xc .lt. 0) .or. @@ -1580,11 +1578,11 @@ cc if (difnit(ifld) .gt. 1.e-20 .and. zi(ifld) .eq. 1. ix = xc ix1 = ixm1(ix,iy) if (isimpon .eq. 5) then # Hirshmans reduced-ion approx. - if (istimingon .eq. 1) tsimp = gettime(sec4) + if (istimingon .eq. 1) tsimp = tick() call mombal (ix1,ix,iy) if (istimingon .eq. 1) call timimpfj (tsimp, xc) elseif(isimpon .eq. 6 .or. isimpon .eq. 7) then # Force balance without inertia - if (istimingon .eq. 1) tsimp = gettime(sec4) + if (istimingon .eq. 1) tsimp = tick() call mombalni (ix1,ix,iy) if (istimingon .eq. 1) call timimpfj (tsimp, xc) endif @@ -1612,11 +1610,11 @@ call mombalni (ix1,ix,iy) do ix = ixs1, min(ixf6, nx+1-ixmxbcl) ix2 = ixp1(ix,iy) if (isimpon .eq. 5) then - if (istimingon .eq. 1) tsimp = gettime(sec4) + if (istimingon .eq. 1) tsimp = tick() call mombal (ix,ix2,iy) if (istimingon .eq. 1) call timimpfj (tsimp, xc) elseif(isimpon .eq. 6 .or. isimpon .eq. 7) then # Force balance without inertia - if (istimingon .eq. 1) tsimp = gettime(sec4) + if (istimingon .eq. 1) tsimp = tick() call mombalni (ix,ix2,iy) if (istimingon .eq. 1) call timimpfj (tsimp, xc) endif @@ -2093,7 +2091,7 @@ ccc we omit the weak velocity dependence as it brings in ni(ix+1) in Jac do 604 iy = iys1, iyf6 do 603 ix = ixs1, ixf6 - if (istimingon .eq. 1) tsimp = gettime(sec4) + if (istimingon .eq. 1) tsimp = tick() nevol = ne(ix,iy) * vol(ix,iy) ngvol = ng(ix,iy,1) * vol(ix,iy) @@ -2425,10 +2423,10 @@ ccc if (isupgon .eq. 1 .and. zi(ifld) .eq. 0.0) call neudif call neudif elseif (ineudif .eq. 2) then c ..Timing - if(istimingon==1) tsnpg=gettime(sec4) + if(istimingon==1) tsnpg=tick() call neudifpg c ..Timing - if(istimingon==1) ttnpg=ttnpg+(gettime(sec4)-tsnpg) + if(istimingon==1) ttnpg = ttnpg + tock(tsnpg) elseif (ineudif .eq. 3) then call neudifl else @@ -4671,7 +4669,7 @@ ccc call volave(nx, ny, j2, j5, i2, i5, ixp1(0,0), ixm1(0,0), * -- impurity radiation -- if (isimpon .ge. 2) then - if (istimingon .eq. 1) tsimp = gettime(sec4) + if (istimingon .eq. 1) tsimp = tick() do 533 iy = iys1, iyf6 #if Jacobian, only 1 cell done - local sor do 532 ix = ixs1, ixf6 @@ -5062,9 +5060,9 @@ call bouncon (neq, yl, yldot) c ... Accumulate cpu time spent here. if(xc .lt. 0) then - ttotfe = ttotfe + gettime(sec4) - tsfe + ttotfe = ttotfe + tock(tsfe) else - ttotjf = ttotjf + gettime(sec4) - tsjf + ttotjf = ttotjf + tock(tsjf) endif if (TimingPandfOn.gt.0) TotTimePandf=TotTimePandf+tock(TimePandf) return @@ -5461,17 +5459,16 @@ ccc frici(ix,iy,1) = - frice(ix,iy) # needed for hydrogen end c****** end of subroutine mombalni ************ c----------------------------------------------------------------------- - subroutine timimpfj (tsimp, xc) - real(Size4) tsimp + subroutine timimpfj(tick, xc) + real tock, tick integer xc + external tock Use(Timing) # ttimpfe,ttimpjf - real(Size4) sec4, gettime, dtimp - dtimp = gettime(sec4) - tsimp if (xc .lt. 0) then - ttimpfe = ttimpfe + dtimp + ttimpfe = ttimpfe + tock(tick) else - ttimpjf = ttimpjf + dtimp + ttimpjf = ttimpjf + tock(tick) endif return @@ -6070,10 +6067,10 @@ c If we are solving for the neutral parallel momentum (isupgon=1) integer iy1, methgx, methgy, iy2, jx, jfld, ifld integer iym1,iyp1,iyp2,ixm1b,ixp1b,ixp2b logical isxyfl - real(Size4) sec4, gettime # Former Aux module variables integer ix,iy,igsp,iv,iv1,iv2,iv3,ix1,ix2,ix3,ix4,ix5,ix6 - real t,t0,t1,t2,a + real t,t0,t1,t2,a,tick,tock + external tick, tock Use(Dim) # nx,ny,nhsp,nisp,ngsp,nxpt Use(Xpoint_indices) # ixlb,ixpt1,ixpt2,ixrb,iysptrx1 @@ -6122,7 +6119,7 @@ c write (*,*) "neudifpg" c ********************************************* c ..Timing;initialize - if(istimingon==1) tsngxlog = gettime(sec4) + if(istimingon==1) tsngxlog = tick() do 888 iy = j4, j8 do 887 ix = i1, i5 @@ -6228,14 +6225,14 @@ c write (*,*) "neudifpg" 888 continue c ..Timing; add info if timing is on - if(istimingon==1) ttngxlog=ttngxlog+(gettime(sec4)-tsngxlog) + if(istimingon==1) ttngxlog = ttngxlog + tock(tsngxlog) c ******************************************************* c.... Now the flux in the y-direction c ******************************************************* c ..Timing; initiate time for y-direction calc - if(istimingon==1) tsngylog = gettime(sec4) + if(istimingon==1) tsngylog = tick() do 890 iy = j1, j5 do 889 ix = i4, i8 @@ -6330,24 +6327,24 @@ c write (*,*) "neudifpg" 890 continue c ..Timing; add increment if timing is on - if(istimingon==1) ttngylog=ttngylog+(gettime(sec4)-tsngylog) + if(istimingon==1) ttngylog = ttngylog + tock(tsngylog) * -------------------------------------------------------------------- * compute the neutral particle flow * -------------------------------------------------------------------- c ..Timing - if(istimingon==1) tsngfd2 = gettime(sec4) + if(istimingon==1) tsngfd2 = tick() call fd2tra (nx,ny,floxg,floyg,conxg,conyg, . pg(0:nx+1,0:ny+1,igsp),fngx(0:nx+1,0:ny+1,igsp), . fngy(0:nx+1,0:ny+1,igsp),0,methg) c ..Timing - if(istimingon==1) ttngfd2=ttngfd2+(gettime(sec4)-tsngfd2) + if(istimingon==1) ttngfd2 = ttngfd2 + tock(tsngfd2) c... Addition for nonorthogonal mesh if (isnonog .eq. 1) then c ..Timing - if(istimingon==1) tsngfxy = gettime(sec4) + if(istimingon==1) tsngfxy = tick() do 8905 iy = j1, min(j6, ny) iy1 = max(iy-1,0) @@ -6441,7 +6438,7 @@ call fd2tra (nx,ny,floxg,floyg,conxg,conyg, 8904 continue 8905 continue c ..Timing - if(istimingon==1) ttngfxy=ttngfxy+(gettime(sec4)-tsngfxy) + if(istimingon==1) ttngfxy = ttngfxy + tock(tsngfxy) c... Fix the total fluxes; note the loop indices same as fd2tra c... Flux-limit the total poloidal flux here @@ -8583,26 +8580,26 @@ integer ia(neq+1) # pointers to beginning of each row in jac,ja c ... Functions: logical tstguardc - real(Size4) gettime cc real(Size4) ranf c ... Local variables: integer nnz, ii, iv, ii1, ii2, xc, yc, ix, iy real yold, dyl, jacelem - real(Size4) sec4, tsjstor, tsimpjf, dtimpjf + real tick, tock, tsjstor, tsimpjf, dtimpjf + external tick, tock ccc save c ... Get initial value of system cpu timer. - if (istimingon .eq. 1) tsjstor = gettime(sec4) + if (istimingon .eq. 1) tsjstor = tick() c ... Pause from BASIS if a ctrl_c is typed call ruthere ijac(ig) = ijac(ig) + 1 - if ((svrpkg.eq.'nksol') .and. (iprint .ne. 0)) write(*,*) ' Updating Jacobian, npe = ', - . ijac(ig) + if ((svrpkg.eq.'nksol') .and. (iprint .ne. 0)) + . write(*,*) ' Updating Jacobian, npe = ', ijac(ig) c ... Set up diagnostic arrays for debugging do iv = 1, neq @@ -8758,7 +8755,7 @@ call csrcsc (neq, 1, 1, rcsc, icsc, jcsc, jac, ja, ia) ijactot = ijactot + 1 #note: ijactot set 0 in exmain if icntnunk=0 c ... Accumulate cpu time spent here. - if (istimingon .eq. 1) ttjstor = ttjstor + gettime(sec4) - tsjstor + if (istimingon .eq. 1) ttjstor = ttjstor + tock(tsjstor) return end c----------------------------------------------------------------------- @@ -8792,13 +8789,12 @@ integer iwp(*) # sizes and array indices for elements of LU Use(Temporary_work_arrays) # rwk1,rwk2,iwk1,iwk2,iwk3 c ... Function: - real(Size4) gettime c ... Local variables: integer lowd, ierr, i, idum(1) real rcond, dum(1) - real(Size4) sec4 - real tsmatfac + real tsmatfac, tick, tock + external tick, tock c ... Convert compressed sparse row to banded format and use exact c factorization routine sgbco from Linpack/SLATEC. @@ -8811,7 +8807,7 @@ call csrbnd (neq, jac, ja, ia, 0, wp, lowd, lowd, . '*** jac_lu_decomp -- csrbnd returned ierr =', ierr call xerrab("") endif - tsmatfac = gettime(sec4) + tsmatfac = tick() call sgbco (wp, lowd, neq, lbw, ubw, iwp(4), rcond, rwk1) iwp(1) = lowd iwp(2) = lbw @@ -8831,7 +8827,7 @@ call sgbco (wp, lowd, neq, lbw, ubw, iwp(4), rcond, rwk1) call jac_reorder (neq, jac, ja, ia, wp, iwp(neq+2), iwp) c ... Use incomplete factorization routine ilut from SparsKit. - tsmatfac = gettime(sec4) + tsmatfac = tick() call ilut (neq,jac,ja,ia,lfililut,tolilut,wp,iwp(neq+1), . iwp,lenplumx,rwk1,rwk2,iwk1, . iwk2,iwk3,ierr) @@ -8880,13 +8876,13 @@ call cdiagsrt (neq, adiag, ndiag, iwp(3), iwkd1, iwkd2, . rwkd) c ... Finally, calculate approximate LU decomposition. - tsmatfac = gettime(sec4) + tsmatfac = tick() call precond5 (neq, ndiag, ndiagm, adiag, wp, rwk2, rwk1, . iwk3, iwk2, siginel, fmuinel, iwp(3)) endif c ... Accumulate cpu time spent here. - 99 ttmatfac = ttmatfac + (gettime(sec4) - tsmatfac) + 99 ttmatfac = ttmatfac + tock(tsmatfac) return end c----------------------------------------------------------------------- @@ -8913,15 +8909,14 @@ integer iwk(neq+1) Use(Jacreorder) # perm,qperm,levels,nlev,mask,maskval,ireorder c ... Function: - real(Size4) gettime c ... Local variables: - real(Size4) sec4 - real tsjreorder + real tick, tock, tsjreorder integer i, nfirst + external tick, tock c ... Get initial value of system cpu timer. - tsjreorder = gettime(sec4) + tsjreorder = tick() if ((ireorder .eq. 1) .and. (premeth .eq. 'ilut')) then @@ -8955,7 +8950,7 @@ call dperm (neq,awk,jwk,iwk,jac,ja,ia,perm,perm,1) endif c ... Accumulate cpu time spent here. - ttjreorder = ttjreorder + (gettime(sec4) - tsjreorder) + ttjreorder = ttjreorder + tock(tsjreorder) return end c----------------------------------------------------------------------- @@ -8977,20 +8972,19 @@ integer ia(neq+1) # indices of 1st nonzero element in each row Use(Jacaux) # isrnorm,normtype,fnormnw c ... Function: - real(Size4) gettime c ... Local variables: - real(Size4) sec4 - real tsjrnorm + real tsjrnorm, tick, tock + external tick, tock c ... Get initial value of system cpu timer. - tsjrnorm = gettime(sec4) + tsjrnorm = tick() if (isrnorm .eq. 1) call roscal (neq, 0, normtype, jac, ja, ia, . fnormnw, jac, ja, ia) c ... Accumulate cpu time spent here. - ttjrnorm = ttjrnorm + (gettime(sec4) - tsjrnorm) + ttjrnorm = ttjrnorm + tock(tsjrnorm) return end c----------------------------------------------------------------------- @@ -9746,17 +9740,16 @@ real wk(neq) # work space available to this subroutine Use(UEpar) # svrpkg (used to reset usingsu for daspk) c ... Function: - real(Size4) gettime c ... Local variables: integer i integer lowd, lbw, ubw integer ndiag, ndiagm - real(Size4) sec4 - real tsmatsol + real tsmatsol, tick, tock + external tick, tock c ... Get initial value of system cpu timer. - tsmatsol = gettime(sec4) + tsmatsol = tick() c ... Scale c by multiplying by row-normalization factors, if used, c and by column scaling vector su (for svrpkg='nksol' only). @@ -9811,7 +9804,7 @@ call scopy (neq, wk, 1, bl, 1) c ... Accumulate cpu time spent here. ierr = 0 - ttmatsol = ttmatsol + (gettime(sec4) - tsmatsol) + ttmatsol = ttmatsol + tock(tsmatsol) return end c----------------------------------------------------------------------- @@ -12360,19 +12353,3 @@ subroutine PrintTimingPandf() endif end subroutine PrintTimingPandf - real function tick() - implicit none - integer :: now, clock_rate - call system_clock(now,clock_rate) - tick=real(now)/real(clock_rate) - end function tick - - real function tock(t) - implicit none - real, intent(in) :: t - integer :: now, clock_rate - call system_clock(now,clock_rate) - - tock = real(now)/real(clock_rate)-t - end function tock - diff --git a/bbb/odesolve.m b/bbb/odesolve.m index 8e6b2386..59b412f0 100755 --- a/bbb/odesolve.m +++ b/bbb/odesolve.m @@ -51,6 +51,7 @@ Use(Indices_domain_dcl) # ivloc2sdgl Use(Xpoint_indices) Use(Indices_domain_dcg) + Use(Cdv) c_mpi Use(MpiVars) #module defined in com/mpivarsmod.F.in @@ -67,23 +68,22 @@ c_mpi Use(MpiVars) #module defined in com/mpivarsmod.F.in external ffun, jacnw, psolnw, resid, jacd2, psold, jacd1 external rhsvd, jacvd, psolvd, rhsnk, psetnk, psolnk, jacvnk - external gettime real vnormnk,r1mach9 c local variables real tbout, dtreal_sav, initguess(neq), snesans(neq), snesminusnksol - real fnrm, fnew + real fnrm, fnew, tick, tock + external tick, tock integer i,ifld,lid,ilg #Former Aux module variables integer ix,iy,igsp,iv - real(Size4) gettime, sec4 c **- For parallel mpi case, set up preliminary mpi stuff if (ismpion .eq. 1) call uedriv_pll c ... Save initial time and set accumulated times to zero. - tstart = gettime(sec4) + tstart = tick() ttotfe = 0. ttotjf = 0. ttimpfe = 0. @@ -582,7 +582,7 @@ c_mpi write(6,1267) iopt(4), iopt(11), iopt(5), write(*,*) ng endif - tend = gettime(sec4) + tend = tock(tstart) if (iprinttim .eq. 1) call wtottim # write out timing information return @@ -979,17 +979,18 @@ real yl(neq), ylold(neq) Use(Timing) # tend,tstart,ttotfe,... write(*,*) ' ' - write(*,900) 'Total time for last solution = ', tend-tstart + write(*,900) 'Total time for last solution = ', tend write(*,901) 'Total full f evaluation = ', ttotfe write(*,902) 'Impur. part of full f evaluation = ', ttimpfe - write(*,901) 'Total Jacobian f evaluation = ', ttotjf + write(*,901) 'Total CPU Jacobian f evaluation = ', ttotjf + write(*,901) 'Total Wall-Clock Jacobian f eval. = ', ttjstor write(*,902) 'Impur. part of Jacobian eval. = ', ttimpjf if (nisp .gt. nhsp) call wapitim write(*,901) 'Total Matrix factorization = ', ttmatfac write(*,901) 'Total Matrix backsolve = ', ttmatsol write(*,901) 'Total row normalization = ', ttjrnorm write(*,901) 'Total row and column reordering = ', ttjreorder - write(*,901) 'Total in other Jacobian work = ', ttjstor-ttotjf +c write(*,901) 'Total in other Jacobian work = ', ttjstor-ttotjf 900 format(a36,20x,f10.4,' sec') 901 format(a36,10x,f10.4,10x,' sec') 902 format(a36,f10.4,20x,' sec') diff --git a/com/comutil.m b/com/comutil.m index 1aed0001..23d88d27 100755 --- a/com/comutil.m +++ b/com/comutil.m @@ -40,7 +40,7 @@ write(*,900) 'Total in B2VAhL spline routine = ', totb2val write(*,900) 'Total in INTRhV spline routine = ', totintrv - 900 format(a36,f10.4,' sec') + 900 format(a36,f10.4,20x,' sec') totb2val = 0.0e0 totintrv = 0.0e0 @@ -3599,7 +3599,8 @@ C See (de Boor, 1978) for a description of the B-spline basis. EXTERNAL INTRhV, B1VAhL, XERMShG Use(Timespl) - real(Size4) sec4, gettime, tsint + real tick, tock, tsint + external tick, tock C C***FIRST EXECUTABLE STATEMENT B2VAhL @@ -3648,9 +3649,9 @@ C basis functions are computed using (2). C ... FIND KNOT INTERVAL CONTAINING YVAL C INY = 1 - tsint = gettime(sec4) + tsint = tick() CALL INTRhV(TY,NY+KY,YVAL,INY,LEFTY,MFLAG) - totintrv = totintrv + gettime(sec4) - tsint + totintrv = totintrv + tock(tsint) IF (MFLAG .NE. 0) THEN C C ... YVAL .EQ. T(NY+KY), ADJUST TO GET LEFT LIMITING VALUE @@ -3867,7 +3868,8 @@ real T(N+K), A(N), X, WORK(3*K) EXTERNAL INTRhV, XERMShG Use(Timespl) - real(Size4) sec4, gettime, tsint + real tick, tock, tsint + external tick, tock C C***FIRST EXECUTABLE STATEMENT B1VAhL @@ -3895,9 +3897,9 @@ real T(N+K), A(N), X, WORK(3*K) C C ... FIND LARGEST I IN (1,N+K) SUCH THAT T(I) .LE. X .LT. T(I+1) C - tsint = gettime(sec4) + tsint = tick() CALL INTRhV(T, NPK, X, INBV, I, MFLAG) - totintrv = totintrv + gettime(sec4) - tsint + totintrv = totintrv + tock(tsint) IF (MFLAG .NE. 0) THEN C C ... X .EQ. T(N+K), USE LEFT LIMITING VALUE diff --git a/com/misc.m b/com/misc.m index 19b9b132..265a9c4f 100755 --- a/com/misc.m +++ b/com/misc.m @@ -88,18 +88,19 @@ real yq1(neq),yq2(neq) # yq1 is closest to solution ys1 end c ****end of subroutine quadsvr********** -c ****Function gettime ****************** + real function tick() + implicit none + integer :: now, clock_rate + call system_clock(now,clock_rate) + tick=real(now)/real(clock_rate) + end function tick + + real function tock(t) + implicit none + real, intent(in) :: t + integer :: now, clock_rate + call system_clock(now,clock_rate) + + tock = real(now)/real(clock_rate)-t + end function tock - real(Size4) function gettime(clk) - real(Size4) clk, rcount, rrate - integer count, rate - gettime = 0 - call system_clock(count, rate) - if (rate .ne. 0) then - rcount = count - rrate = rate - gettime = rcount / rrate - endif - return - end -c ****end of function gettime********** diff --git a/flx/dvshdf5.m b/flx/dvshdf5.m index 770ad0ae..02a48026 100755 --- a/flx/dvshdf5.m +++ b/flx/dvshdf5.m @@ -45,7 +45,6 @@ c_mpi Use(Npes_mpi) real, dimension(:,:,:), allocatable :: vs3d real, dimension(:,:), allocatable :: vs2d integer i,ifld,lid, lenx, leny, ixs, ixe, iys, iye - real(Size4) gettime, sec4 INTEGER(HID_T) :: root_gid,bbbid,fid, runInfoId logical :: dumpPriv, dumpCore, dumpSOL, dumpPrivRite logical :: dumpPrivLeft,dumpCoreLeftCell,dumpCoreRiteCell @@ -577,7 +576,6 @@ c_mpi Use(Npes_mpi) real, dimension(:,:), allocatable :: vs2d integer i,ifld,lid integer lenx, leny, ixs, ixe, iys, iye - real(Size4) gettime, sec4 integer(int4) :: ierr INTEGER(HID_T) :: root_gid,bbbid,fid * --------------------------------------------------------------------- diff --git a/ppp/omp_parallel.F90 b/ppp/omp_parallel.F90 index 23d20be0..9fba339a 100644 --- a/ppp/omp_parallel.F90 +++ b/ppp/omp_parallel.F90 @@ -196,12 +196,11 @@ subroutine jac_calc_omp (neq, t, yl, yldot00, ml, mu, wk,nnzmx, jac, ja, ia) integer:: nnzcumout ! ... Functions logical tstguardc - real(kind=4) gettime real tick,tock external tick,tock ! ... Local variables: - real(kind=4) sec4, tsjstor, tsimpjf, dtimpjf,time0,time1 + real tsjstor, tsimpjf, dtimpjf,time0,time1 integer:: i,thread,ichunk,iv,TID, OMP_GET_THREAD_NUM character(len = 80) :: filename @@ -237,7 +236,7 @@ subroutine jac_calc_omp (neq, t, yl, yldot00, ml, mu, wk,nnzmx, jac, ja, ia) OMPTimeJacCalc= tick() ! Get initial value of system cpu timer. - if (istimingon .eq. 1) tsjstor = gettime(sec4) + if (istimingon .eq. 1) tsjstor = tick() ! Count Jacobian evaluations, both for total and for this case ijactot = ijactot + 1 @@ -299,7 +298,7 @@ subroutine jac_calc_omp (neq, t, yl, yldot00, ml, mu, wk,nnzmx, jac, ja, ia) endif ! Convert Jacobian from compressed sparse column to compressedsparse row format. - time1=gettime(sec4) + time1=tick() call csrcsc (neq, 1, 1, rcsc, icsc, jcsc, jac, ja, ia) !! ... If desired, calculate Jacobian elements for ion continuity @@ -322,7 +321,7 @@ subroutine jac_calc_omp (neq, t, yl, yldot00, ml, mu, wk,nnzmx, jac, ja, ia) ! endif ! endif - if (istimingon .eq. 1) ttjstor = ttjstor + gettime(sec4) - tsjstor + if (istimingon .eq. 1) ttjstor = ttjstor + tock(tsjstor) ! write(*,'(a,i4,a,i6,a,1pe9.2,a)') ' [Nthreads | NchunkcsJac | OMP time] = [', & ! Nthreads,'|',NchunksJac, '|', tock(OMPTimeJacCalc), ']' diff --git a/svr/nksol.m b/svr/nksol.m index ddc1895d..27759359 100755 --- a/svr/nksol.m +++ b/svr/nksol.m @@ -737,8 +737,6 @@ dimension icnstr(n) real zero,one,two,three logical mxtkn Use(Cdv) -cpetsc external gettime -cpetsc real gettime,sec4 c+pnb C C Type declaration for the additional diagnostics set up to inquire ----