Index: LMDZ5/trunk/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90	(revision 2538)
+++ LMDZ5/trunk/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90	(revision 2539)
@@ -22,4 +22,5 @@
 
     include "YOMCST.h"
+    INCLUDE "clesphys.h"
 
     CHARACTER (len = 80) :: abort_message
@@ -71,9 +72,9 @@
 !--------------------------------------------------------
 
-    IF (.not.ALLOCATED(tau_aer_strat)) ALLOCATE(tau_aer_strat(klon,klev,nbands_sw_rrtm))
-    IF (.not.ALLOCATED(piz_aer_strat)) ALLOCATE(piz_aer_strat(klon,klev,nbands_sw_rrtm))
-    IF (.not.ALLOCATED(cg_aer_strat))  ALLOCATE(cg_aer_strat(klon,klev,nbands_sw_rrtm))
-
-    IF (.not.ALLOCATED(taulw_aer_strat)) ALLOCATE(taulw_aer_strat(klon,klev,nbands_lw_rrtm))
+    IF (.not.ALLOCATED(tau_aer_strat)) ALLOCATE(tau_aer_strat(klon,klev,NSW))
+    IF (.not.ALLOCATED(piz_aer_strat)) ALLOCATE(piz_aer_strat(klon,klev,NSW))
+    IF (.not.ALLOCATED(cg_aer_strat))  ALLOCATE(cg_aer_strat(klon,klev,NSW))
+
+    IF (.not.ALLOCATED(taulw_aer_strat)) ALLOCATE(taulw_aer_strat(klon,klev,NLW))
 
 !--we only read monthly strat aerosol data
@@ -92,8 +93,4 @@
 
 !--Starts with SW optical properties
-    IF (nbands_sw_rrtm.NE.6) THEN 
-       abort_message='nbands_sw_rrtm doit etre egal a 6 dans readaerosolstrat_rrtm'
-       CALL abort_physic(modname,abort_message,1)
-    ENDIF
 
     CALL nf95_open("tauswstrat.2D.nc", nf90_nowrite, ncid_in)
@@ -128,5 +125,5 @@
     n_wav = size(wav)
     print *, 'WAV aerosol strato=', n_wav, wav
-    IF (n_wav.NE.nbands_sw_rrtm) THEN 
+    IF (n_wav.NE.NSW) THEN 
        abort_message='Le nombre de wav n est pas egal a NSW'
        CALL abort_physic(modname,abort_message,1)
@@ -176,5 +173,5 @@
 
 !---reduce to a klon_glo grid 
-    DO band=1, nbands_sw_rrtm
+    DO band=1, NSW
       CALL grid2dTo1d_glo(tauaerstrat_mois(:,:,:,band),tauaerstrat_mois_glo(:,:,band))
       CALL grid2dTo1d_glo(pizaerstrat_mois(:,:,:,band),pizaerstrat_mois_glo(:,:,band))
@@ -184,9 +181,4 @@
 !--Now LW optical properties
 !
-    IF (nbands_lw_rrtm .NE. NLW) then
-      abort_message='different values for NLW and nbands_lw_rrtm'
-      CALL abort_physic(modname,abort_message,1)
-    ENDIF 
-
     CALL nf95_open("taulwstrat.2D.nc", nf90_nowrite, ncid_in)
 
@@ -219,5 +211,5 @@
     n_wav = size(wav)
     print *, 'WAV aerosol strato=', n_wav, wav
-    IF (n_wav.NE.nbands_lw_rrtm) THEN 
+    IF (n_wav.NE.NLW) THEN 
        abort_message='Le nombre de wav n est pas egal a NLW'
        CALL abort_physic(modname,abort_message,1)
@@ -244,5 +236,5 @@
 
 !---reduce to a klon_glo grid 
-    DO band=1, nbands_lw_rrtm
+    DO band=1, NLW
       CALL grid2dTo1d_glo(taulwaerstrat_mois(:,:,:,band),taulwaerstrat_mois_glo(:,:,band))
     ENDDO
@@ -289,7 +281,7 @@
 
 !--weighted average for cg, piz and tau, adding strat aerosols on top of tropospheric ones
-    DO band=1, nbands_sw_rrtm
+    DO band=1, NSW
     WHERE (stratomask.GT.0.999999)
-!--anthropogenic aerosols bands 1 to nbands_sw_rrtm 
+!--anthropogenic aerosols bands 1 to NSW 
     cg_aero_sw_rrtm(:,:,2,band)  = ( cg_aero_sw_rrtm(:,:,2,band)*piz_aero_sw_rrtm(:,:,2,band)*tau_aero_sw_rrtm(:,:,2,band) + &
                                      cg_aer_strat(:,:,band)*piz_aer_strat(:,:,band)*tau_aer_strat(:,:,band) ) /              &
@@ -300,5 +292,5 @@
                                 MAX( tau_aero_sw_rrtm(:,:,2,band) + tau_aer_strat(:,:,band), 1.e-15 )
     tau_aero_sw_rrtm(:,:,2,band)  = tau_aero_sw_rrtm(:,:,2,band) + tau_aer_strat(:,:,band)
-!--natural aerosols bands 1 to nbands_sw_rrtm
+!--natural aerosols bands 1 to NSW
     cg_aero_sw_rrtm(:,:,1,band)  = ( cg_aero_sw_rrtm(:,:,1,band)*piz_aero_sw_rrtm(:,:,1,band)*tau_aero_sw_rrtm(:,:,1,band) + &
                                      cg_aer_strat(:,:,band)*piz_aer_strat(:,:,band)*tau_aer_strat(:,:,band) ) /              &
@@ -316,5 +308,5 @@
     ENDDO
 
-    DO band=1, nbands_lw_rrtm
+    DO band=1, NLW
     WHERE (stratomask.GT.0.999999)
     tau_aero_lw_rrtm(:,:,2,band)  = tau_aero_lw_rrtm(:,:,2,band) + taulw_aer_strat(:,:,band)
