Index: /LMDZ6/trunk/libf/phylmd/ini_COSP.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/ini_COSP.F90	(revision 4527)
+++ /LMDZ6/trunk/libf/phylmd/ini_COSP.F90	(revision 4527)
@@ -0,0 +1,36 @@
+!  A.I avril 2023
+
+  subroutine ini_COSP(ref_liq_cosp0,ref_ice_cosp0,pctsrf_cosp0,zu10m_cosp0,zv10m_cosp0, &
+                      zxtsol_cosp0,zx_rh_cosp0,cldfra_cosp0,rnebcon_cosp0,flwc_cosp0, &
+                      fiwc_cosp0,prfl_cosp0,psfl_cosp0,pmflxr_cosp0,pmflxs_cosp0, &
+                      mr_ozone_cosp0,cldtau_cosp0,cldemi_cosp0,JrNt_cosp0)
+
+! Routine pour initialiser les champs input pour Cosp au  1er appel de celui-ci
+!         Ce 1er appel sert uniquement a definir les axes verticaux pour les 
+!         sortie Cosp
+
+      use dimphy
+      include "ini_COSP.h"
+
+      ! Initialisations pour le 1er passage a Cosp
+        ref_liq_cosp0=1.
+        ref_ice_cosp0=1.
+        pctsrf_cosp0=0.5
+        zu10m_cosp0=1.
+        zv10m_cosp0=1.
+        zxtsol_cosp0=288.
+        zx_rh_cosp0=1.
+        cldfra_cosp0=1.
+        rnebcon_cosp0=0.
+        flwc_cosp0=0.
+        fiwc_cosp0=0.
+        prfl_cosp0(:,1:klev)=0.
+        psfl_cosp0(:,1:klev)=0.
+        pmflxr_cosp0(:,1:klev)=0.
+        pmflxs_cosp0(:,1:klev)=0.
+        mr_ozone_cosp0=0.
+        cldtau_cosp0=0.
+        cldemi_cosp0=0.
+        JrNt_cosp0=0.
+
+     end subroutine ini_COSP
Index: /LMDZ6/trunk/libf/phylmd/ini_COSP.h
===================================================================
--- /LMDZ6/trunk/libf/phylmd/ini_COSP.h	(revision 4527)
+++ /LMDZ6/trunk/libf/phylmd/ini_COSP.h	(revision 4527)
@@ -0,0 +1,24 @@
+! A.I mars 2023
+
+! Declaration des champs inputs a initialiser pour le simulateur d'observable satellite  COSP
+
+    REAL :: zx_rhcosp0(klon,klev), &
+            ref_liq_cosp0(klon,klev), ref_ice_cosp0(klon,klev), &
+            zx_rh_cosp0(klon,klev), cldfra_cosp0(klon,klev), rnebcon_cosp0(klon,klev), &
+            fiwc_cosp0(klon,klev), flwc_cosp0(klon,klev), prfl_cosp0(klon,klev), &
+            psfl_cosp0(klon,klev), pmflxr_cosp0(klon,klev), pmflxs_cosp0(klon,klev), &
+            mr_ozone_cosp0(klon,klev), cldtau_cosp0(klon,klev), cldemi_cosp0(klon,klev), &
+            pctsrf_cosp0(klon),zu10m_cosp0(klon),zv10m_cosp0(klon), &
+            zxtsol_cosp0(klon),JrNt_cosp0(klon)
+
+!   COMMON/iniCOSP/                                                 &
+!            zx_rhcosp0(klon,klev),ref_liq_cosp0(klon,klev), ref_ice_cosp0(klon,klev), &
+!	    zx_rh_cosp0(klon,klev), cldfra_cosp0(klon,klev), rnebcon_cosp0(klon,klev), &
+!            fiwc_cosp0(klon,klev), flwc_cosp0(klon,klev), prfl_cosp0(klon,klev), &
+!            psfl_cosp0(klon,klev), pmflxr_cosp0(klon,klev), pmflxs_cosp0(klon,klev), &
+!            mr_ozone_cosp0(klon,klev), cldtau_cosp0(klon,klev), cldemi_cosp0(klon,klev), &
+!            pctsrf_cosp0(klon),zu10m_cosp0(klon),zv10m_cosp0(klon), &
+!            zxtsol_cosp0(klon),JrNt_cosp0(klon)
+!	save /iniCOSP/
+!!$OMP THREADPRIVATE(/iniCOSP/)
+	
Index: /LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 4526)
+++ /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 4527)
@@ -1155,4 +1155,8 @@
     ! Declarations pour Simulateur COSP
     !============================================================
+    ! AI 10-22
+#ifdef CPP_COSP
+    include "ini_COSP.h"
+#endif
     real :: mr_ozone(klon,klev), phicosp(klon,klev)
 
@@ -1694,11 +1698,12 @@
       IF (.NOT. create_etat0_limit) CALL init_readaerosolstrato(flag_aerosol_strat)  !! initialise aero strato from file for XIOS interpolation (unstructured_grid)
 
+      if (ok_cosp) then
 #ifdef CPP_COSP
-      IF (ok_cosp) THEN
-!           DO k = 1, klev
-!             DO i = 1, klon
-!               phicosp(i,k) = pphi(i,k) + pphis(i)
-!             ENDDO
-!           ENDDO
+        ! A.I : Initialisations pour le 1er passage a Cosp
+        CALL ini_COSP(ref_liq_cosp0,ref_ice_cosp0,pctsrf_cosp0,zu10m_cosp0,zv10m_cosp0, &
+               zxtsol_cosp0,zx_rh_cosp0,cldfra_cosp0,rnebcon_cosp0,flwc_cosp0, &
+               fiwc_cosp0,prfl_cosp0,psfl_cosp0,pmflxr_cosp0,pmflxs_cosp0, &
+               mr_ozone_cosp0,cldtau_cosp0,cldemi_cosp0,JrNt_cosp0)
+
         CALL phys_cosp(itap,phys_tstep,freq_cosp, &
                ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
@@ -1713,14 +1718,7 @@
                pmflxr(:,1:klev),pmflxs(:,1:klev), &
                mr_ozone,cldtau, cldemi)
-      ENDIF
 #endif
 
 #ifdef CPP_COSP2
-        IF (ok_cosp) THEN
-!           DO k = 1, klev
-!             DO i = 1, klon
-!               phicosp(i,k) = pphi(i,k) + pphis(i)
-!             ENDDO
-!           ENDDO
           CALL phys_cosp2(itap,phys_tstep,freq_cosp, &
                ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
@@ -1735,14 +1733,7 @@
                pmflxr(:,1:klev),pmflxs(:,1:klev), &
                mr_ozone,cldtau, cldemi)
-       ENDIF
 #endif
 
 #ifdef CPP_COSPV2
-        IF (ok_cosp) THEN
-           DO k = 1, klev
-             DO i = 1, klon
-               phicosp(i,k) = pphi(i,k) + pphis(i)
-             ENDDO
-           ENDDO
           CALL lmdz_cosp_interface(itap,phys_tstep,freq_cosp, &
                ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, &
@@ -1757,6 +1748,6 @@
                pmflxr(:,1:klev),pmflxs(:,1:klev), &
                mr_ozone,cldtau, cldemi)
-       ENDIF
 #endif
+      ENDIF 
 
        !
