Index: /trunk/src/lwdown_clark.pro
===================================================================
--- /trunk/src/lwdown_clark.pro	(revision 89)
+++ /trunk/src/lwdown_clark.pro	(revision 89)
@@ -0,0 +1,45 @@
+;+
+;-
+;----------------------------------------------
+function lwdown_clark, sst,qair,cld,tair,ps 
+;
+; Net longwave from the Clark et al. (1974) bulk formula
+;    Clark, N. E., L. Eber, R. M. Laurs, J. A. Renner, and J. F. T. Saur, 
+;           1974: Heat exchange between ocean and atmosphere in the
+;           eastern North Pacific for 1961-71. NOAA Tech. Rep. NMRS
+;           SSRF-682, National Oceanic and Atmospheric Administration,
+;           U.S. Department of Commerce, Washington, DC, 108 pp.
+;     See also Gill, p34.
+;
+; INPUTS
+;   sst :    Sea surface temperature (degC)
+;   qair:    specific humidity (g/kg)
+;   cld :    cloud cover
+;   tair:    surface air temperature (degC)
+;   ps  :    surface pressure (mb)
+; OUTPUT
+;   lw :    estimated longwave (W/m2)
+;
+@common
+;----------------------------------------------
+
+eps=.97			; emissivity of sea-water
+sig=5.67e-8		; Stefan-Boltzman constant (W/m2/K4)
+Ts=(sst+273.15) 	; SST in K
+Ta=(tair+273.15)  	; Tair in K
+q=qair/1000.            ; specific humidity (kg/kg)
+r=q/(1-q)		; Mixing ratio
+ea=ps*r/(r+.62197)      ; Specific humidity into vapor pressure
+
+lw=    eps*sig*Ts^4*(.39-.05*ea^.5)*(1.-.51*cld^2) $
+   +4.*eps*sig*Ts^3*(Ts-Ta) 
+
+lwup=eps*sig*Ts^4
+
+lwdown=lwup-lw
+
+return, lwdown
+
+;----------------------------------------------
+end
+;----------------------------------------------
Index: /trunk/src/lwnet_clark.pro
===================================================================
--- /trunk/src/lwnet_clark.pro	(revision 89)
+++ /trunk/src/lwnet_clark.pro	(revision 89)
@@ -0,0 +1,41 @@
+;+
+;-
+;----------------------------------------------
+function lwnet_clark, sst,qair,cld,tair,ps 
+;
+; Net longwave from the Clark et al. (1974) bulk formula
+;    Clark, N. E., L. Eber, R. M. Laurs, J. A. Renner, and J. F. T. Saur, 
+;           1974: Heat exchange between ocean and atmosphere in the
+;           eastern North Pacific for 1961-71. NOAA Tech. Rep. NMRS
+;           SSRF-682, National Oceanic and Atmospheric Administration,
+;           U.S. Department of Commerce, Washington, DC, 108 pp.
+;     See also Gill, p34.
+;
+; INPUTS
+;   sst :    Sea surface temperature (degC)
+;   qair:    specific humidity (g/kg)
+;   cld :    cloud cover
+;   tair:    surface air temperature (degC)
+;   ps  :    surface pressure (mb)
+; OUTPUT
+;   lw :    estimated longwave (W/m2)
+;
+@common
+;----------------------------------------------
+
+eps=.97			; emissivity of sea-water
+sig=5.67e-8		; Stefan-Boltzman constant (W/m2/K4)
+Ts=(sst+273.15) 	; SST in K
+Ta=(tair+273.15)  	; Tair in K
+q=qair/1000.            ; specific humidity (kg/kg)
+r=q/(1-q)		; Mixing ratio
+ea=ps*r/(r+.62197)      ; Specific humidity into vapor pressure
+
+lw=    eps*sig*Ts^4*(.39-.05*ea^.5)*(1.-.51*cld^2) $
+   +4.*eps*sig*Ts^3*(Ts-Ta) 
+
+return, lw
+
+;----------------------------------------------
+end
+;----------------------------------------------
Index: /trunk/src/psit.pro
===================================================================
--- /trunk/src/psit.pro	(revision 89)
+++ /trunk/src/psit.pro	(revision 89)
@@ -0,0 +1,25 @@
+;+
+;-
+;--------------------------------------------------------
+function psit, zet
+;--------------------------------------------------------
+
+x=(1.-15*zet)^.5
+psik=2*alog((1+x)/2)
+x=(1.-34.15*zet)^.3333
+psic=1.5*alog((1+x+x*x)/3)-sqrt(3.)*atan((1+2*x)/sqrt(3.))+4*atan(1.)/sqrt(3.)
+f=zet*zet/(1.+zet*zet)
+psi=(1.-f)*psik+f*psic  
+   
+ii=where(zet ge 0.)
+
+if (ii(0) ne -1) then begin
+  c=min([50,.35*zet])
+  psi(ii)=-((1+2./3*zet(ii))^1.5+.6667*(zet(ii)-14.28)/exp(c(ii))+8.525)
+endif
+
+return, psi
+
+end
+;--------------------------------------------------------
+
Index: /trunk/src/psiu.pro
===================================================================
--- /trunk/src/psiu.pro	(revision 89)
+++ /trunk/src/psiu.pro	(revision 89)
@@ -0,0 +1,25 @@
+;+
+;-
+;--------------------------------------------------------
+function psiu, zet
+;--------------------------------------------------------
+
+x=(1-15*zet)^.25
+psik=2*alog((1+x)/2)+alog((1+x*x)/2)-2*atan(x)+2*atan(1)
+x=(1-10.15*zet)^.3333
+psic=1.5*alog((1+x+x*x)/3)-sqrt(3)*atan((1+2*x)/sqrt(3))+4*atan(1)/sqrt(3)
+f=zet*zet/(1+zet*zet)
+psi=(1-f)*psik+f*psic                                               
+
+ii=where(zet ge 0.)
+
+if (ii(0) ne -1) then begin
+  c=min([50,.35*zet])
+  psi(ii)=-((1+1.*zet(ii))^1.+.667*(zet(ii)-14.28)/exp(c(ii))+8.525)
+endif
+
+return, psi
+
+end
+;--------------------------------------------------------
+
