3d2
< 
9c8
< C*   1) subroutine bill_mp - Calculates the indices at which interpolation
---
> C*   1) subroutine bic_mp - Calculates the indices at which interpolation
14c13
< C  Subroutine - bill_mp 
---
> C  Subroutine - bic_mp 
18,19c17,20
< C  'lobill' to perform the interpolation. The same is repeated
< C   for the next component.  The major difference
---
> C  'locubit' to perform the interpolation. The same is repeated
> C   for the next component.  This code is essentially the same
> C   as the sequential version, except the wrap subroutine is
> C   called in the host program.  The other major difference
24c25
< C   a single point. See also bill.f (original code)
---
> C   a single point. See also bic1nu.f (original code)
27,30c28,31
< C  Inputs : wina_d corresponds to ust
< C           winb_d    "        "  vst
< C           rlatitude_d "      "  spuh
< C           rlongitude_d "     "  sluh
---
> C  Inputs : wina_d corresponds to yuupt
> C           winb_d    "        "  yvvpt
> C           rlatitude_d "      "  sphi
> C           rlongitude_d "     "  slam
38,39c39,40
< C  Outputs : woua corresponds to c1a
< C            woub     "       "  c2a
---
> C  Outputs : woua corresponds to yuupts or yvvpts
> C            woub     "       "  yvupts or yuvpts
44c45
<       subroutine bill_mp(wina_d, woua_d,faclama, facphia,
---
>       subroutine bic_mp(wina_d, woua_d,faclama, facphia,
60a62,68
>          real*8 gcbtime, lcbtime, cabtime, llitime, loitime,
>      &          brtime, cstime, cntime, reatime, fbtime, intime
>          common /ntime/ cabtime, gcbtime, lcbtime, llitime, 
>      &          loitime, brtime, cstime, cntime, reatime, fbtime,
>      &          intime
> 
> 
93c101
< C***    Timing Code 
---
> CT    Timing Code 
97c105
< C***    Timing Code 
---
> CT    Timing Code 
102,109c110,117
< C***    Timing Code 
< C1      integer mp_timer_clear
< C1      integer mp_timer_start
< C1      integer mp_timer_stop
< C1      real*8 mp_elapsed_time
< C1      real*8 mp_busy_time
< C1      real*8 mp_idle_time
< C***    Timing Code 
---
> CT    Timing Code 
>       integer mp_timer_clear
>       integer mp_timer_start
>       integer mp_timer_stop
>       real*8 mp_elapsed_time
>       real*8 mp_busy_time
>       real*8 mp_idle_time
> CT    Timing Code 
115,142d122
<       
<       print *, "In bill mp"
< C1              drange = up -lo + 1
< C1              if (ny0 .eq. 0) then
< C1                 print *, '+WINA'
< C1              endif
< C1
< C1              do j = 1, drange
< C1                 do i = 1, imp3
< C1                    dny0 = 100000 + ny0 * 1000 + j * 10 + i
< C1                    print 108, dny0, wina_d(i,j)
< C1                 end do
< C1              end do
< C1              call mp_sync()
< C1
< C1              if (ny0 .eq. 0) then
< C1                 print *, '+RLAT'
< C1              endif
< C1              if (ny0 .eq. (ny-1)) then
< C1                 drange = jm - lo + 1
< C1              endif
< C1              do j = 1, drange
< C1                 do i = 1, imp3
< C1                    dny0 = 100000 + ny0 * 1000 + j * 10 + i
< C1                    print 108, dny0, rlatitude_d(i,j)
< C1                 end do
< C1              end do
< C1              call mp_sync()
143a124,141
> D      print *, "I am in subroutine bic mp"
> CT    Timing Code for measuring ii(i,j), jj(i,j) calculation 
> 	tmp = mp_timer_clear(3)
>         if (tmp .eq. -1) then
>            print *, 'Failure in clearing timer'
>            stop
>         end if
>         tmp = mp_timer_start(3)
>         if (tmp .eq. -1) then
>            print *, 'Failure in starting timer'
>            stop
>         end if
> CT    Timing Code 
>     
> C
> C     Find the local indices which form the bound for
> C     iterations on each node
> C
158,171d155
< C***    Timing Code - Part 1
< C1	tmp = mp_timer_clear(0)
< C1        if (tmp .eq. -1) then
< C1           print *, 'Failure in clearing timer'
< C1           stop
< C1        end if
< C1        tmp = mp_timer_start(0)
< C1        if (tmp .eq. -1) then
< C1           print *, 'Failure in starting timer'
< C1           stop
< C1        end if
< C***    Timing Code - Part 1
< 
< 
179,184d162
< CD
< CD        print '(I4, "Lo", I4, " Up", I4, " Lo1", I4, " Up1", 
< CD     &          I4, " Range"
< CD     &          I4, " Ja", I4, " Jb", I4)', ny0, lo, up, lo1, up1,
< CD     &          range, ja, jb
< CD
186d163
< C        do j = 1, range 
193,199d169
< CD
< CD          if (ny0 .eq. 1) then
< CD             print '(" ITER : J ", I4, " I ", I4)', j, i
< CD             print '(" rlon", F16.8, " facdlma", F4.2,
< CD     &       " r", F16.8)', rlongitude_d(i,j), facdlma, r
< CD          endif
< CD
202,205d171
< CD
< CD          if (ny0 .eq. 1) print '(" tem1", F16.8, " II", I4)',
< CD     &      tem1_d(i,j), ii_d(i,j)
< CD
210,212d175
< CD
< CD         if (ny0 .eq. 1) PRINT *, 'Second Time ii ', ii_d(i,j)
< CD
216,219d178
< CD
< CD          if (ny0 .eq. 1) print '(" tem1", F16.8, " II ", I4)',
< CD     &      tem1_d(i,j), ii_d(i,j)
< CD
224,227d182
< CD
< CD          if (ny0 .eq. 1) print '(" tem1", F16.8, " II", I4)',
< CD     &      tem1_d(i,j), ii_d(i,j)
< CD
239,242d193
< C1        call circulate(wina_d, tem1_d,  tem2_d, 
< C1     &                 woua_d, ii_d,    jj_d,
< C1     &                 svdlo,     svdup,     
< C1     &                 ja,     jb)
244,245c195,205
< C*** Debug Code      
< CD        comm_a  = 1
---
> CT    Timing Code 
>         tmp = mp_timer_stop(3)
>         if (tmp .eq. -1) then
>            print *, 'Failure in stopping timer'
>            stop
>         end if
> C
> C       Accumulate ii(i,j), jj(i,j) calculation times for bicubic.
> C
>         llitime = llitime + mp_busy_time(3) 
> CT    Timing Code 
247,300c207,211
< CD              drange = up -lo + 1
< CD              if (ny0 .eq. 0) then
< CD                 print *, '+II'
< CD              endif
< CD              call mp_sync()
< CD
< CD              do j = lo1, range
< CD                 do i = 1, imp3
< CD                    dny0 = 100000 + ny0 * 1000 + j * 10 + i
< CD                    print 109, dny0, ii_d(i,j)
< CD                 end do
< CD              end do
< CD              call mp_sync()
< CD
< CD              if (ny0 .eq. 0) then
< CD                 print *, '+JJ'
< CD              endif
< CD              call mp_sync()
< CD
< CD              do j = lo1, range
< CD                 do i = 1, imp3
< CD                    dny0 = 200000 + ny0 * 1000 + j * 10 + i
< CD                    print 109, dny0, jj_d(i,j)
< CD                 end do
< CD              end do
< CD              call mp_sync()
< CD
< CD              if (ny0 .eq. 0) then
< CD                 print *, '+TEM1D'
< CD              endif
< CD
< CD              do j = lo1, range
< CD                 do i = 1, imp3
< CD                    dny0 = 300000 + ny0 * 1000 + j * 10 + i
< CD                    print 108, dny0, tem1_d(i,j)
< CD                 end do
< CD              end do
< CD
< CD              call mp_sync()
< CD              if (ny0 .eq. 0) then
< CD                 print *, '+TEM2D'
< CD              endif
< CD
< CD              do j = lo1, range
< CD                 do i = 1, imp3
< CD                    dny0 = 400000 + ny0 * 1000 + j * 10 + i
< CD                    print 108, dny0, tem2_d(i,j)
< CD                 end do
< CD              end do
< CD
< CD              call mp_sync()
< 
< 
<         call lobill(wina_d, tem1_d, tem2_d,  woua_d,
---
> C
> C       Perform interpolation 
> C
> D        print *, "Calling Locubit"
>         call locubit(wina_d, tem1_d, tem2_d,  woua_d,
305,312c216,228
< CD        print '(I4, "Lo", I4, " Up", I4, " Lo1", I4, " Up1", 
< CD     &          I4, " Range",
< CD     &          I4, " Ja", I4, " Jb", I4)', ny0, lo, up, lo1, up1,
< CD     &          range, ja, jb
< 
< 
<            
< C1        do j = 1, range 
---
> CT    Timing Code for measuring ii(i,j), jj(i,j) calculations
> 	tmp = mp_timer_clear(3)
>         if (tmp .eq. -1) then
>            print *, 'Failure in clearing timer'
>            stop
>         end if
>         tmp = mp_timer_start(3)
>         if (tmp .eq. -1) then
>            print *, 'Failure in starting timer'
>            stop
>         end if
> CT    Timing Code 
>     
319,323d234
< CD          if (ny0 .eq. 1) then
< CD             print '(" ITER : J ", I4, " I ", I4)', j, i
< CD             print '(" rlon", F16.8, " facdlma", F4.2,
< CD     &       " r", F16.8)', rlongitude_d(i,j), facdlma, r
< CD          endif
328,331d238
< CD
< CD          if (ny0 .eq. 1) print '(" tem1", F16.8, " II", I4)',
< CD     &      tem1_d(i,j), ii_d(i,j)
< CD
334,335d240
< CD          if (ny0 .eq. 1) PRINT *, 'Second Time ii ', ii_d(i,j)
< 
339,341d243
< CD          if (ny0 .eq. 1) print '(" tem1", F16.8, " II ", I4)',
< CD     &      tem1_d(i,j), ii_d(i,j)
< 
346,348d247
< CD          if (ny0 .eq. 1) print '(" tem1", F16.8, " II", I4)',
< CD     &      tem1_d(i,j), ii_d(i,j)
< 
350,358d248
< CD
< CD          if (ny0 .eq. 1) then
< CD              print '(" rlat", F16.8, " facphib", F16.8)',
< CD     &        rlatitude_d(i,j), facphib
< CD              print '(" rdph", F16.8, " pio2", F16.8)', rdph, pio2
< CD            core1 = (rlatitude(i,j) + pio2) * rdph
< CD            print '(" core1", F16.8)', core1_d(i,j)
< CD         endif
< CD
361,364d250
< CD
< CD          if (ny0 .eq. 1) print '(" tem2", F16.8, 
< CD     &     " JJ ", I4)', tem2_d(i,j), jj_d(i,j)
< CD
367,370d252
< CD
< CD          if (ny0 .eq. 1) print '(" tem2", F16.8)',
< CD     &     tem2_d(i,j)
< CD
376,379d257
< C1        call circulate(winb_d, tem1_d,  tem2_d, 
< C1     &                 woub_d, ii_d,    jj_d,
< C1     &                 svdlo,     svdup,      
< C1     &                 ja,     jb)
380a259,270
> CT    Timing Code 
>         tmp = mp_timer_stop(3)
>         if (tmp .eq. -1) then
>            print *, 'Failure in stopping timer'
>            stop
>         end if
> C
> C       Accumulate ii(i,j), jj(i,j) calculation times for bicubic.
> C
>         llitime = llitime + mp_busy_time(3) 
> CT    Timing Code 
> 
383c273,278
<         call lobill(winb_d, tem1_d, tem2_d,  woub_d,
---
> C
> C       Perform interpolation 
> C
>         call mp_sync()
> D        print *, "Calling Locubit", ny0
>         call locubit(winb_d, tem1_d, tem2_d,  woub_d,
388,402d282
< C1
< CD             range = up - lo + 1
< CD              if (ny0 .eq. 0) then
< CD                 print *, '+WOU'
< CD              endif
< CD              if (ny0 .eq. (ny-1)) then
< CD                 range = jm - lo + 1
< CD              endif
< CD              do j = 1, range
< CD                 do i = 1, imp3
< CD                    dny0 = 100000 + ny0 * 1000 + j * 10 + i
< CD                    print 107, dny0, woua_d(i,j), woub_d(i,j)
< CD                 end do
< CD              end do
< CD              call mp_sync()
404,423d283
< C***    Timing Code - Part 2
<         
< C1        tmp = mp_timer_stop(0)
< C1        if (tmp .eq. -1) then
< C1           print *, 'Failure in stopping timer'
< C1           stop
< C1        end if
< C1
< C1        etime = mp_elapsed_time(0)
< C1        btime = mp_busy_time(0)
< C1        itime = mp_idle_time(0)
< C1
< C1      if (ny0 .eq. 15) then
< C1        print 200, ">Node : ",ny0, " , Circul elapse time: ", etime
< C1      endif
< C1 200    format (A, I3, A, E22.15.3)
< C1
< C1        print 200, ">Node : ",ny0, " , Circul elapse time: ", etime
< C1        print 200, ">Node : ",ny0, " , Circul calcn. time: ", btime
< C***    Timing Code - Part 2
425c285
< C       End of routine bill_mp
---
> C       End of routine bic_mp
427a288,290
> 
> 
> 
