Index: LMDZ6/trunk/libf/phylmd/StratAer/miecalc_aer.F90
===================================================================
--- LMDZ6/trunk/libf/phylmd/StratAer/miecalc_aer.F90	(revision 3526)
+++ LMDZ6/trunk/libf/phylmd/StratAer/miecalc_aer.F90	(revision 3667)
@@ -1,5 +1,2 @@
-!
-! $Id$
-!
 SUBROUTINE MIECALC_AER(tau_strat, piz_strat, cg_strat, tau_strat_wave, tau_lw_abs_rrtm, paprs, debut)
 
@@ -157,88 +154,90 @@
   REAL ss_g(nbands_sw_rrtm+nbands_lw_rrtm+nwave_sw+nwave_lw)
 
+  !-- fichier h2so4_0.75_300.00_hummel_1988_p_q.dat
+  ! -- wavenumber (cm-1), wavelength (um), n_r, n_i
   INTEGER, PARAMETER :: nb_lambda_h2so4=62
   REAL, DIMENSION (nb_lambda_h2so4,4) :: ref_ind
-  !-- fichier h2so4_0.75_300.00_hummel_1988_p_q.dat
-  ! -- wavenumber (cm-1), wavelength (um), n_r, n_i
-  DATA ref_ind /                                &
-   200.000,   50.0000,   2.01000,   6.5000E-01, &
-   250.000,   40.0000,   1.94000,   6.3000E-01, & 
-   285.714,   35.0000,   1.72000,   5.2000E-01, & 
-   333.333,   30.0000,   1.73000,   2.9000E-01, & 
-   358.423,   27.9000,   1.78000,   2.5000E-01, & 
-   400.000,   25.0000,   1.84000,   2.4000E-01, &
-   444.444,   22.5000,   1.82000,   2.9000E-01, &
-   469.484,   21.3000,   1.79000,   2.5000E-01, &
-   500.000,   20.0000,   1.81000,   2.3000E-01, &
-   540.541,   18.5000,   1.92700,   3.0200E-01, &
-   555.556,   18.0000,   1.95000,   4.1000E-01, &
-   581.395,   17.2000,   1.72400,   5.9000E-01, &
-   609.756,   16.4000,   1.52000,   4.1400E-01, &
-   666.667,   15.0000,   1.59000,   2.1100E-01, &
-   675.676,   14.8000,   1.61000,   2.0500E-01, &
-   714.286,   14.0000,   1.64000,   1.9500E-01, &
-   769.231,   13.0000,   1.69000,   1.9500E-01, &
-   800.000,   12.5000,   1.74000,   1.9800E-01, &
-   869.565,   11.5000,   1.89000,   3.7400E-01, &
-   909.091,   11.0000,   1.67000,   4.8500E-01, &
-   944.198,   10.5910,   1.72000,   3.4000E-01, &
-  1000.000,   10.0000,   1.89000,   4.5500E-01, &
-  1020.408,    9.8000,   1.91000,   6.8000E-01, &
-  1052.632,    9.5000,   1.67000,   7.5000E-01, &
-  1086.957,    9.2000,   1.60000,   5.8600E-01, &
-  1111.111,    9.0000,   1.65000,   6.3300E-01, &
-  1149.425,    8.7000,   1.53000,   7.7200E-01, &
-  1176.471,    8.5000,   1.37000,   7.5500E-01, &
-  1219.512,    8.2000,   1.20000,   6.4500E-01, &
-  1265.823,    7.9000,   1.14000,   4.8800E-01, &
-  1388.889,    7.2000,   1.21000,   1.7600E-01, &
-  1538.462,    6.5000,   1.37000,   1.2800E-01, &
-  1612.903,    6.2000,   1.42400,   1.6500E-01, &
-  1666.667,    6.0000,   1.42500,   1.9500E-01, &
-  1818.182,    5.5000,   1.33700,   1.8300E-01, &
-  2000.000,    5.0000,   1.36000,   1.2100E-01, &
-  2222.222,    4.5000,   1.38500,   1.2000E-01, &
-  2500.000,    4.0000,   1.39800,   1.2600E-01, &
-  2666.667,    3.7500,   1.39600,   1.3100E-01, &
-  2857.143,    3.5000,   1.37600,   1.5800E-01, &
-  2948.113,    3.3920,   1.35200,   1.5900E-01, &
-  3125.000,    3.2000,   1.31100,   1.3500E-01, &
-  3333.333,    3.0000,   1.29300,   9.5500E-02, &
-  3703.704,    2.7000,   1.30300,   5.7000E-03, &
-  4000.000,    2.5000,   1.34400,   3.7600E-03, &
-  4444.444,    2.2500,   1.37000,   1.8000E-03, &
-  5000.000,    2.0000,   1.38400,   1.2600E-03, &
-  5555.556,    1.8000,   1.39000,   5.5000E-04, &
-  6510.417,    1.5360,   1.40300,   1.3700E-04, &
-  7692.308,    1.3000,   1.41000,   1.0000E-05, &
-  9433.962,    1.0600,   1.42000,   1.5000E-06, &
- 11627.907,    0.8600,   1.42500,   1.7900E-07, &
- 14409.222,    0.6940,   1.42800,   1.9900E-08, &
- 15797.788,    0.6330,   1.42900,   1.4700E-08, &
- 18181.818,    0.5500,   1.43000,   1.0000E-08, &
- 19417.476,    0.5150,   1.43100,   1.0000E-08, &
- 20491.803,    0.4880,   1.43200,   1.0000E-08, &
- 25000.000,    0.4000,   1.44000,   1.0000E-08, &
- 29673.591,    0.3370,   1.45900,   1.0000E-08, &
- 33333.333,    0.3000,   1.46900,   1.0000E-08, &
- 40000.000,    0.2500,   1.48400,   1.0000E-08, &
- 50000.000,    0.2000,   1.49800,   1.0000E-08 /
+
 !---------------------------------------------------------
 
   IF (debut) THEN   
 
+     ref_ind = RESHAPE( (/ &
+      200.000,   50.0000,   2.01000,   6.5000E-01, &
+      250.000,   40.0000,   1.94000,   6.3000E-01, & 
+      285.714,   35.0000,   1.72000,   5.2000E-01, & 
+      333.333,   30.0000,   1.73000,   2.9000E-01, & 
+      358.423,   27.9000,   1.78000,   2.5000E-01, & 
+      400.000,   25.0000,   1.84000,   2.4000E-01, &
+      444.444,   22.5000,   1.82000,   2.9000E-01, &
+      469.484,   21.3000,   1.79000,   2.5000E-01, &
+      500.000,   20.0000,   1.81000,   2.3000E-01, &
+      540.541,   18.5000,   1.92700,   3.0200E-01, &
+      555.556,   18.0000,   1.95000,   4.1000E-01, &
+      581.395,   17.2000,   1.72400,   5.9000E-01, &
+      609.756,   16.4000,   1.52000,   4.1400E-01, &
+      666.667,   15.0000,   1.59000,   2.1100E-01, &
+      675.676,   14.8000,   1.61000,   2.0500E-01, &
+      714.286,   14.0000,   1.64000,   1.9500E-01, &
+      769.231,   13.0000,   1.69000,   1.9500E-01, &
+      800.000,   12.5000,   1.74000,   1.9800E-01, &
+      869.565,   11.5000,   1.89000,   3.7400E-01, &
+      909.091,   11.0000,   1.67000,   4.8500E-01, &
+      944.198,   10.5910,   1.72000,   3.4000E-01, &
+     1000.000,   10.0000,   1.89000,   4.5500E-01, &
+     1020.408,    9.8000,   1.91000,   6.8000E-01, &
+     1052.632,    9.5000,   1.67000,   7.5000E-01, &
+     1086.957,    9.2000,   1.60000,   5.8600E-01, &
+     1111.111,    9.0000,   1.65000,   6.3300E-01, &
+     1149.425,    8.7000,   1.53000,   7.7200E-01, &
+     1176.471,    8.5000,   1.37000,   7.5500E-01, &
+     1219.512,    8.2000,   1.20000,   6.4500E-01, &
+     1265.823,    7.9000,   1.14000,   4.8800E-01, &
+     1388.889,    7.2000,   1.21000,   1.7600E-01, &
+     1538.462,    6.5000,   1.37000,   1.2800E-01, &
+     1612.903,    6.2000,   1.42400,   1.6500E-01, &
+     1666.667,    6.0000,   1.42500,   1.9500E-01, &
+     1818.182,    5.5000,   1.33700,   1.8300E-01, &
+     2000.000,    5.0000,   1.36000,   1.2100E-01, &
+     2222.222,    4.5000,   1.38500,   1.2000E-01, &
+     2500.000,    4.0000,   1.39800,   1.2600E-01, &
+     2666.667,    3.7500,   1.39600,   1.3100E-01, &
+     2857.143,    3.5000,   1.37600,   1.5800E-01, &
+     2948.113,    3.3920,   1.35200,   1.5900E-01, &
+     3125.000,    3.2000,   1.31100,   1.3500E-01, &
+     3333.333,    3.0000,   1.29300,   9.5500E-02, &
+     3703.704,    2.7000,   1.30300,   5.7000E-03, &
+     4000.000,    2.5000,   1.34400,   3.7600E-03, &
+     4444.444,    2.2500,   1.37000,   1.8000E-03, &
+     5000.000,    2.0000,   1.38400,   1.2600E-03, &
+     5555.556,    1.8000,   1.39000,   5.5000E-04, &
+     6510.417,    1.5360,   1.40300,   1.3700E-04, &
+     7692.308,    1.3000,   1.41000,   1.0000E-05, &
+     9433.962,    1.0600,   1.42000,   1.5000E-06, &
+    11627.907,    0.8600,   1.42500,   1.7900E-07, &
+    14409.222,    0.6940,   1.42800,   1.9900E-08, &
+    15797.788,    0.6330,   1.42900,   1.4700E-08, &
+    18181.818,    0.5500,   1.43000,   1.0000E-08, &
+    19417.476,    0.5150,   1.43100,   1.0000E-08, &
+    20491.803,    0.4880,   1.43200,   1.0000E-08, &
+    25000.000,    0.4000,   1.44000,   1.0000E-08, &
+    29673.591,    0.3370,   1.45900,   1.0000E-08, &
+    33333.333,    0.3000,   1.46900,   1.0000E-08, &
+    40000.000,    0.2500,   1.48400,   1.0000E-08, &
+    50000.000,    0.2000,   1.49800,   1.0000E-08 /), (/nb_lambda_h2so4,4/), order=(/2,1/) )
+
   !--initialising dry diameters to geometrically spaced mass/volume (see Jacobson 1994)
-      mdw(1)=mdwmin
-      IF (V_rat.LT.1.62) THEN ! compensate for dip in second bin for lower volume ratio
-        mdw(2)=mdw(1)*2.**(1./3.)
-        DO it=3, nbtr_bin
-          mdw(it)=mdw(it-1)*V_rat**(1./3.)
-        ENDDO 
-      ELSE
-        DO it=2, nbtr_bin
-          mdw(it)=mdw(it-1)*V_rat**(1./3.)
-        ENDDO
-      ENDIF
-      PRINT *,'init mdw=', mdw
+    mdw(1)=mdwmin
+    IF (V_rat.LT.1.62) THEN ! compensate for dip in second bin for lower volume ratio
+      mdw(2)=mdw(1)*2.**(1./3.)
+      DO it=3, nbtr_bin
+        mdw(it)=mdw(it-1)*V_rat**(1./3.)
+      ENDDO 
+    ELSE
+      DO it=2, nbtr_bin
+        mdw(it)=mdw(it-1)*V_rat**(1./3.)
+      ENDDO
+    ENDIF
+    WRITE(lunout,*) 'init mdw=', mdw
 
     !--compute particle radius for a composition of 75% H2SO4 / 25% H2O at T=293K
@@ -286,5 +285,5 @@
 
       IF (refr_ind_interpol) THEN
-
+ 
         ilambda_max=ref_ind(1,2)/1.e6 !--in m
         ilambda_min=ref_ind(nb_lambda_h2so4,2)/1.e6 !--in m
@@ -381,5 +380,5 @@
         Nmax=INT(x+4*x**(1./3.)+2.)+1
       ELSE
-        PRINT *, 'x out of bound, x=', x
+        WRITE(lunout,*) 'x out of bound, x=', x
         STOP
       ENDIF
@@ -461,6 +460,7 @@
       omegatot=omegatot+r**2*Q_ext*omega*number
       gtot    =gtot+r**2*Q_sca*g*number
-
+ 
       ENDDO   !---bin
+
     !------------------------------------------------------------------
 
