c %Z% %M% %I% (IDS) %G%

C+
C*
C*   This file contains the following routines in the host part 
C*   of the host-node program (only one subroutine is active -
C*   not commented out at a time. This enables performance 
C*   measurements to be made easily.) :
C*   
C*   1) subroutine bic1nu - not used
C*   2) subroutine bill   - stub for bilinear interpolation.
C*                              
C-

CC      subroutine bic1nu (wina, woua,faclama,facphia,
CC     *                   winb, woub,faclamb,facphib,
CC     *                            rlatitude, rlongitude,ja,jb)
CC
CC      include "slgcm.slgprm"
CC      include "slgcm.mp"
CC
CC
CC      real   wina ( imp3 ,jmp3 )   !first input field
CC      real   woua ( imp3 ,jm   )   !first output field
CC      real   winb ( imp3 ,jmp3 )   !second input field
CC      real   woub ( imp3 ,jm   )   !second output field
CC      real   rlatitude  ( imp3 ,jm   ) ! arrays with coordinates on
CC      real   rlongitude  ( imp3 ,jm   ) ! which the subroutine interpolates
CC      real   faclama
CC      real   faclamb
CC      real   facphia
CC      real   facphib
CC      integer ja, jb
CC
CD
CC      integer icount
CC      common /serial/ icount
CD
CC      integer k,j
CC
CC      print *, "Calling hnint for bic"
CC      icount = icount + 1
CC      call hnint  (wina, woua,faclama,facphia,
CC     *             winb, woub,faclamb,facphib,
CC     *             rlatitude, rlongitude,ja,jb, MPBIC)
CC
CC      call wrap(ja,jb,woua)
CC      call wrap(ja,jb,woub)
CD
CC 109  format ( 4F18.13 )
CC      print *, "Writing results 0"
CC      open (unit = 14, file = 'woua64_n.out', status = 'scratch' )
CC      close(14)
CC      open (unit = 14, file = 'woua64_n.out', status = 'new' )
CC      write (14,*), "ICOUNT : ", icount
CC      write (14,*), "WOUA"
CC      write (14,109), ((woua(k,j), k = 1, imp3), j = 1, jm)
CC      close(14)
CC      if (icount .eq. 1) then
CC      do j = 1, jm
CC         do k = 1, imp3
CC            print *, woua(k,j)
CC         enddo
CC      enddo
CC      endif
CC      print *, "Writing results 2"
CC      open (unit = 15, file = 'woub64_n.out', status = 'scratch' )
CC      close(15)
CC      open (unit = 15, file = 'woub64_n.out', status = 'new' )
CC      write (15,*), "ICOUNT : ", icount
CC      write (15,*), "WOUB"
CC      write (15, 109), ((woub(k,j), k = 1, imp3), j = 1, jm)
CC      close (15)
CC
CC      if (icount .eq. 4) then
CC         open (unit = 13, file = 'wou64_4.out', status = 'scratch' )
CC         close(13)
CC         open (unit = 13, file = 'wou64_4.out', status = 'new' )
CC         write(13,*), "WOUA"
CC         write (13, 109), ((woua(k,j), k = 1, imp3), j = 1, jm)
CC         write(13,*), "WOUB"
CC         write (13, 109), ((woub(k,j), k = 1, imp3), j = 1, jm)
CC         close (13)
CC      endif
CC         
CC      return
CC      end

C+
C  subroutine bill - This is a stub for the bilinear interpolation.    
C  It calls the routine hnint (host-node interface) which passes the      
C  input parameters to the nodes and fetches the output parameters
C  from the nodes.
C
C  Inputs : wina corresponds to ust
C           winb    "        "  vst 
C           rlatitude "      "  spuh 
C           rlongitude "     "  sluh 
C           faclama   
C           faclamb    
C           facphia
C           facphib 
C           ja, jb      - range of indices
C           interpol    - bilinear 
C  
C  Outputs : woua corresponds to c1a 
C            woub     "       "  c2a 
C  
C  For further details about the quantities one is referred to Yong Li's 
C  notes.
C-

      subroutine bill(wina, woua,faclama, facphia,
     *                winb, woub,faclamb, facphib, 
     *                rlatitude,rlongitude, ja, jb)

      include "slgcm.slgprm"
      include "slgcm.mp"

      real   wina ( imp3 ,jmp3 )   !first input field
      real   woua ( imp3 ,jm   )   !first output field
      real   winb ( imp3 ,jmp3 )   !second input field
      real   woub ( imp3 ,jm   )   !second output field
      real   rlatitude  ( imp3 ,jm   ) ! arrays with coordinates on
      real   rlongitude  ( imp3 ,jm   ) ! which the subroutine interpolates
      real   faclama
      real   faclamb
      real   facphia
      real   facphib
      integer ja, jb

CD
      integer icount
      common /serial/ icount
CD
      integer k,j

      print *, "Calling hnint for bill"
      icount = icount + 1
      call hnint  (wina, woua,faclama,facphia,
     *             winb, woub,faclamb,facphib,
     *             rlatitude, rlongitude,ja,jb, MPBILL)


CD
 109  format ( 4F18.13 )
      print *, "Writing results 0"
      open (unit = 14, file = 'woua64_n.out', status = 'scratch' )
      close(14)
      open (unit = 14, file = 'woua64_n.out', status = 'new' )
      write (14,*), "ICOUNT : ", icount
      write (14,*), "WOUA"
      write (14,109), ((woua(k,j), k = 1, imp3), j = 1, jm)
      close(14)
CC      if (icount .eq. 1) then
CC      do j = 1, jm
CC         do k = 1, imp3
CC            print *, woua(k,j)
CC         enddo
CC      enddo
CC      endif
CC      print *, "Writing results 2"
      open (unit = 15, file = 'woub64_n.out', status = 'scratch' )
      close(15)
      open (unit = 15, file = 'woub64_n.out', status = 'new' )
      write (15,*), "ICOUNT : ", icount
      write (15,*), "WOUB"
      write (15, 109), ((woub(k,j), k = 1, imp3), j = 1, jm)
      close (15)
CC
CC      if (icount .eq. 4) then
CC         open (unit = 13, file = 'wou64_4.out', status = 'scratch' )
CC         close(13)
CC         open (unit = 13, file = 'wou64_4.out', status = 'new' )
CC         write(13,*), "WOUA"
CC         write (13, 109), ((woua(k,j), k = 1, imp3), j = 1, jm)
CC         write(13,*), "WOUB"
CC         write (13, 109), ((woub(k,j), k = 1, imp3), j = 1, jm)
CC         close (13)
CC      endif
         
      return
      end







