      subroutine ppco2tab(pco2tab,T,S,car,pco2)
 
!  Computes pCO2 in the surface layer and delta pCO2 with the 
!  atmosphere using OCMIP protocols.  Uses pre-computed look-up
!  table to increase computational speed.
!  Var	min 	max 	increment
!  T0	-2	37.5	0.5
!  sal	30	39.5	0.5
!  DIC	1800	2450	2
!  TA	2000	2500	2
 
#include "definebio.h"
      real, parameter :: tabar=2310.0 !mean total alkalinity uE/kg; OCMIP
      real, parameter :: Sbar=34.836  !global mean annual salinity (area-wt)
      integer, parameter :: it0inc=1,nt0=80/it0inc
      integer, parameter :: isalinc=1,nsal=20
      integer, parameter :: idicinc=2,ndic=(650+idicinc)/idicinc
      integer, parameter :: itainc=2,nta=(500+itainc)/itainc
      real*4 pco2tab(nt0,nsal,ndic,nta)
 
!  Get pco2
      pco2 = 0.0
      m = indext2   !index of "past"
      k = 1
      Tsfc = T
      sal = S
      DIC = car      !uM
      TA = tabar*S/Sbar  !adjust alk for salinity
      it0 = nint((Tsfc+2.0)*2.0)/it0inc + 1
      isal = nint((sal-30.0)*2.0) + 1
      idic = (nint(DIC-1800.0))/idicinc + 1
      idic = max(idic,1)
      ita = (nint(TA-2000.0))/itainc + 1
      pco2 = pco2tab(it0,isal,idic,ita)
 
      return
      end
