Index: /codes/icosagcm/trunk/src/observable.f90
===================================================================
--- /codes/icosagcm/trunk/src/observable.f90	(revision 435)
+++ /codes/icosagcm/trunk/src/observable.f90	(revision 436)
@@ -101,9 +101,9 @@
     ELSE
        CALL output_field("temp",f_buf_i)
-       CALL vertical_interp(f_ps,f_buf_i,f_buf_s,85000.)
+       CALL vertical_interp(f_pmid,f_buf_i,f_buf_s,85000.)
        CALL output_field("t850",f_buf_s)
-       CALL vertical_interp(f_ps,f_buf_i,f_buf_s,50000.)
+       CALL vertical_interp(f_pmid,f_buf_i,f_buf_s,50000.)
        CALL output_field("t500",f_buf_s)
-       CALL vertical_interp(f_ps,f_buf_i,f_buf_s,preff)
+       CALL vertical_interp(f_pmid,f_buf_i,f_buf_s,preff)
        CALL output_field("SST",f_buf_s)       
     END IF
@@ -135,24 +135,24 @@
        !       CALL output_field("pv",f_qv)
        
-       CALL vertical_interp(f_ps,f_buf_ulon,f_buf_s,85000.)
+       CALL vertical_interp(f_pmid,f_buf_ulon,f_buf_s,85000.)
        CALL output_field("u850",f_buf_s)
-       CALL vertical_interp(f_ps,f_buf_ulon,f_buf_s,50000.)
+       CALL vertical_interp(f_pmid,f_buf_ulon,f_buf_s,50000.)
        CALL output_field("u500",f_buf_s)
        
-       CALL vertical_interp(f_ps,f_buf_ulat,f_buf_s,85000.)
+       CALL vertical_interp(f_pmid,f_buf_ulat,f_buf_s,85000.)
        CALL output_field("v850",f_buf_s)
-       CALL vertical_interp(f_ps,f_buf_ulat,f_buf_s,50000.)
+       CALL vertical_interp(f_pmid,f_buf_ulat,f_buf_s,50000.)
        CALL output_field("v500",f_buf_s)
 
-       CALL vertical_interp(f_ps,f_buf_i,f_buf_s,85000.)
+       CALL vertical_interp(f_pmid,f_buf_i,f_buf_s,85000.)
        CALL output_field("w850",f_buf_s)
-       CALL vertical_interp(f_ps,f_buf_i,f_buf_s,50000.)
+       CALL vertical_interp(f_pmid,f_buf_i,f_buf_s,50000.)
        CALL output_field("w500",f_buf_s)    
 
        CALL w_omega(f_ps, f_u, f_buf_i)
        CALL output_field("omega",f_buf_i)
-       CALL vertical_interp(f_ps,f_buf_i,f_buf_s,85000.)
+       CALL vertical_interp(f_pmid,f_buf_i,f_buf_s,85000.)
        CALL output_field("omega850",f_buf_s)
-       CALL vertical_interp(f_ps,f_buf_i,f_buf_s,50000.)
+       CALL vertical_interp(f_pmid,f_buf_i,f_buf_s,50000.)
        CALL output_field("omega500",f_buf_s)
     END IF
Index: /codes/icosagcm/trunk/src/vertical_interp.f90
===================================================================
--- /codes/icosagcm/trunk/src/vertical_interp.f90	(revision 435)
+++ /codes/icosagcm/trunk/src/vertical_interp.f90	(revision 436)
@@ -3,5 +3,5 @@
   PRIVATE
   
-  TYPE(t_field),SAVE, POINTER :: f_p(:)
+!  TYPE(t_field),SAVE, POINTER :: f_p(:)
   
 
@@ -14,14 +14,14 @@
   IMPLICIT NONE
     
-    CALL allocate_field(f_p,field_t,type_real,llm+1)
+!    CALL allocate_field(f_p,field_t,type_real,llm+1)
     
   END SUBROUTINE init_vertical_interp
     
-  SUBROUTINE vertical_interp(f_ps,f_in,f_out,pval)
+  SUBROUTINE vertical_interp(f_pmid,f_in,f_out,pval)
   USE icosa
   USE pression_mod
   USE omp_para
   IMPLICIT NONE
-    TYPE(t_field),POINTER :: f_ps(:)
+    TYPE(t_field),POINTER :: f_pmid(:)
     TYPE(t_field),POINTER :: f_in(:)
     TYPE(t_field),POINTER :: f_out(:)
@@ -30,30 +30,27 @@
     REAL(rstd),POINTER :: in(:,:)
     REAL(rstd),POINTER :: out(:)
-    REAL(rstd),POINTER :: p(:,:)
+    REAL(rstd),POINTER :: pmid(:,:)
     
     INTEGER :: ind
         
-    CALL pression(f_ps,f_p)
- 
     DO ind=1,ndomain
       IF (.NOT. assigned_domain(ind)) CYCLE
       CALL swap_dimensions(ind)
       CALL swap_geometry(ind)
-      p=f_p(ind)
+      pmid=f_pmid(ind)
       in=f_in(ind)
       out=f_out(ind)
-      CALL compute_vertical_interp(p,in,out,pval)
+      CALL compute_vertical_interp(pmid,in,out,pval)
     ENDDO
     
   END SUBROUTINE  vertical_interp
 
-  SUBROUTINE compute_vertical_interp(p,in,out,pval)
+  SUBROUTINE compute_vertical_interp(pmid,in,out,pval)
   USE omp_para
   IMPLICIT NONE
-    REAL(rstd),INTENT(IN) :: p(iim*jjm,llm+1)
+    REAL(rstd),INTENT(IN) :: pmid(iim*jjm,llm)
     REAL(rstd),INTENT(IN) :: in(iim*jjm,llm)
     REAL(rstd),INTENT(OUT) :: out(iim*jjm)
-    REAL(rstd) :: pval
-    REAL(rstd) :: coeff, pmid,pmidp1
+    REAL(rstd) :: pval, coeff
     INTEGER :: i,j,ij,l
         
@@ -65,19 +62,14 @@
           ij=(j-1)*iim+i
           l=llm-1
-          DO WHILE(0.5*(p(ij,l)+p(ij,l+1))<pval .AND. l>1)
+          DO WHILE(pmid(ij,l)<pval .AND. l>1)
             l=l-1
           ENDDO
-          pmid=0.5*(p(ij,l)+p(ij,l+1))
-          pmidp1=0.5*(p(ij,l+1)+p(ij,l+2))
-
-          coeff=(pval-pmid)/(pmid-pmidp1)
-        
+          coeff=(pval-pmid(ij,l))/(pmid(ij,l)-pmid(ij,l+1))
           out(ij)=in(ij,l)+coeff*(in(ij,l)-in(ij,l+1))
         ENDDO
-      ENDDO
-   
+      ENDDO   
     ENDIF
-!$OMP BARRIER    
-        
+!$OMP BARRIER
+
   END SUBROUTINE compute_vertical_interp
 
