Index: LMDZ4/branches/LMDZ4-dev/libf/phylmd/calcul_STDlev.h
===================================================================
--- LMDZ4/branches/LMDZ4-dev/libf/phylmd/calcul_STDlev.h	(revision 1074)
+++ LMDZ4/branches/LMDZ4-dev/libf/phylmd/calcul_STDlev.h	(revision 1090)
@@ -56,13 +56,102 @@
 cIM on interpole sur les niveaux STD de pression a chaque pas de temps de la physique
 c
-       DO k=1, nlevSTD
-c
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .              t_seri,tlevSTD(:,k))
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             u_seri,ulevSTD(:,k))
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             v_seri,vlevSTD(:,k))
-c
+c-------------------------------------------------------c
+c positionnement de l'argument logique a .false.        c
+c pour ne pas recalculer deux fois la meme chose !      c
+c a cet effet un appel a plevel_new a ete deplace       c
+c a la fin de la serie d'appels                         c
+c la boucle 'DO k=1, nlevSTD' a ete internalisee        c
+c dans plevel_new, d'ou la creation de cette routine... c
+c-------------------------------------------------------c
+c
+        CALL plevel_new(klon,klev,nlevSTD,.true.,pplay,rlevSTD,
+     &              t_seri,tlevSTD)
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             u_seri,ulevSTD)
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             v_seri,vlevSTD)
+c
+
+c
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zphi/RG,philevSTD)
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             qx(:,:,ivap),qlevSTD)
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_rh*100.,rhlevSTD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=u_seri(i,l)*v_seri(i,l)
+         ENDDO !i
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,uvSTD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=v_seri(i,l)*q_seri(i,l)
+         ENDDO !i
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,vqSTD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=v_seri(i,l)*t_seri(i,l)
+         ENDDO !i
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,vTSTD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=omega(i,l)*qx(i,l,ivap)
+         ENDDO !i 
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,wqSTD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=v_seri(i,l)*zphi(i,l)/RG
+         ENDDO !i
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,vphiSTD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=omega(i,l)*t_seri(i,l)
+         ENDDO !i
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,wTSTD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=u_seri(i,l)*u_seri(i,l)
+         ENDDO !i
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,u2STD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=v_seri(i,l)*v_seri(i,l)
+         ENDDO !i
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,v2STD)
+c
+        DO l=1, klev
+         DO i=1, klon
+          zx_tmp_fi3d(i,l)=t_seri(i,l)*t_seri(i,l)
+         ENDDO !i
+        ENDDO !l
+        CALL plevel_new(klon,klev,nlevSTD,.false.,pplay,rlevSTD,
+     &             zx_tmp_fi3d,T2STD)
+
+
         DO l=1, klev
         DO i=1, klon
@@ -70,87 +159,7 @@
         ENDDO !i
         ENDDO !l
-        CALL plevel(klon,klev,.true.,zx_tmp_fi3d,rlevSTD(k),
-     .             omega,wlevSTD(:,k))
-c
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zphi/RG,philevSTD(:,k))
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             qx(:,:,ivap),qlevSTD(:,k))
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_rh*100.,rhlevSTD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=u_seri(i,l)*v_seri(i,l)
-         ENDDO !i
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,uvSTD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=v_seri(i,l)*q_seri(i,l)
-         ENDDO !i
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,vqSTD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=v_seri(i,l)*t_seri(i,l)
-         ENDDO !i
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,vTSTD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=omega(i,l)*qx(i,l,ivap)
-         ENDDO !i 
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,wqSTD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=v_seri(i,l)*zphi(i,l)/RG
-         ENDDO !i
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,vphiSTD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=omega(i,l)*t_seri(i,l)
-         ENDDO !i
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,wTSTD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=u_seri(i,l)*u_seri(i,l)
-         ENDDO !i
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,u2STD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=v_seri(i,l)*v_seri(i,l)
-         ENDDO !i
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,v2STD(:,k))
-c
-        DO l=1, klev
-         DO i=1, klon
-          zx_tmp_fi3d(i,l)=t_seri(i,l)*t_seri(i,l)
-         ENDDO !i
-        ENDDO !l
-        CALL plevel(klon,klev,.true.,pplay,rlevSTD(k),
-     .             zx_tmp_fi3d,T2STD(:,k))
-c
-       ENDDO !k=1,nlevSTD
+        CALL plevel_new(klon,klev,nlevSTD,.true.,zx_tmp_fi3d,rlevSTD,
+     &             omega,wlevSTD)
+
 c
 cIM on somme les valeurs definies a chaque pas de temps de la physique ou 
