Index: trunk/LMDZ.MARS/changelog.txt
===================================================================
--- trunk/LMDZ.MARS/changelog.txt	(revision 3017)
+++ trunk/LMDZ.MARS/changelog.txt	(revision 3018)
@@ -4146,2 +4146,8 @@
 Optimization for adaptative subtimestep of water-ice clouds : should now be
 much faster. + small cleanup
+
+== 28/07/2023 == EM
+Further code cleanup with NLTE routines; converted nlte_paramdef.h to module
+nlte_paramdef_h.F90 and nlte_commons.h to module nlte_commons_h.F90
+(could not turn nlte_aux.F, nlte_setup.F and nlte_calc.F into modules due
+to circular dependencies; would require further code reorganization).
Index: trunk/LMDZ.MARS/libf/phymars/nlte_aux.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_aux.F	(revision 3017)
+++ trunk/LMDZ.MARS/libf/phymars/nlte_aux.F	(revision 3018)
@@ -1,2 +1,7 @@
+!      MODULE nlte_aux_mod
+      
+!      IMPLICIT NONE
+      
+!      CONTAINS      
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! Fast scheme for NLTE cooling rates at 15um by CO2 in a Martian GCM !
@@ -98,8 +103,6 @@
       function planckdp(tp,xnu)
 c***********************************************************************
-
-      implicit none
-
-      include 'nlte_paramdef.h'
+      use nlte_paramdef_h, only: gamma, ee
+      implicit none
 
       real*8 planckdp
@@ -110,7 +113,5 @@
                                 !erg cm-2.sr-1/cm-1.
 
-c     end
-      return
-      end
+      end function planckdp
 
 c***********************************************************************
@@ -118,9 +119,8 @@
 
 c***********************************************************************
-
-      implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
+      use nlte_paramdef_h, only: nl, nzy
+      use nlte_commons_h, only: zy, ty, zl
+      use nlte_commons_h, only: v626t1, v628t1, v636t1, v627t1
+      implicit none
 
 c     local variables
@@ -146,7 +146,5 @@
 
 
-c     end
-      return
-      end
+      end subroutine leetvt
 
 
@@ -158,9 +156,6 @@
 
 c     ****************************************************************
-
-      implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
+      use nlte_commons_h, only: eqw, aa, cc, dd, nbox, ccbox, ddbox
+      implicit none
 
 c     local variables
@@ -179,6 +174,5 @@
       end do
 
-      return
-      end
+      end subroutine initial
 
 c     **********************************************************************
@@ -187,9 +181,7 @@
 
 c     **********************************************************************
-
-      implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
+      use nlte_paramdef_h, only: nbox_max, nhist
+      use nlte_commons_h, only: nbox, thist, xls1, xld1
+      implicit none
 
 c     arguments
@@ -237,6 +229,5 @@
  1    continue
 
-      return
-      end
+      end subroutine intershphunt
 
 c     **********************************************************************
@@ -245,9 +236,7 @@
 
 c     **********************************************************************
-
-      implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
+      use nlte_paramdef_h, only: nbox_max, nhist
+      use nlte_commons_h, only: nbox, thist, no, sk1
+      implicit none
 
 c     arguments
@@ -327,7 +316,5 @@
       end do
 
-
-      return
-      end
+      end subroutine interstrhunt
 
 c     **********************************************************************
@@ -338,8 +325,7 @@
 c     que esto represente una aceleracion real.
 c     **********************************************************************
-
-      implicit none
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
+      use nlte_paramdef_h, only: nzy
+      use nlte_commons_h, only: zy, py, ty, mr
+      implicit none
 
 c     arguments
@@ -362,7 +348,5 @@
       amr = dble( mr(k) + (mr(k+1)-mr(k)) * factor )
 
-
-      return
-      end
+      end subroutine intzhunt
 
 c     **********************************************************************
@@ -374,8 +358,7 @@
 c     que esto represente una aceleracion real.
 c     **********************************************************************
-
-      implicit none
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
+      use nlte_paramdef_h, only: nzy_cts
+      use nlte_commons_h, only: zy_cts, py_cts, ty_cts, mr_cts
+      implicit none
 
 c     arguments
@@ -400,7 +383,5 @@
       amr = dble( mr_cts(k) + (mr_cts(k+1)-mr_cts(k)) * factor )
 
-
-      return
-      end
+      end subroutine intzhunt_cts
 
 
@@ -410,8 +391,5 @@
 
 c     **********************************************************************
-
-      implicit none
-
-      include 'nlte_paramdef.h'
+      implicit none
 
 c     arguments
@@ -481,7 +459,5 @@
       we_clean = sqrt( wvoigt )
 
-
-      return
-      end
+      end function we_clean
 
 
@@ -491,9 +467,7 @@
 
 c     ***********************************************************************
-
-      implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
+      use nlte_paramdef_h, only: nzy, nl, ee, nu
+      use nlte_commons_h, only: nu11, v626t1, zy, zl, ty, elow
+      implicit none
 
 c     arguments
@@ -545,7 +519,5 @@
       end do
 
-
-      return
-      end
+      end subroutine mztf_correccion
 
 
@@ -555,7 +527,6 @@
 
 c     ***********************************************************************
-
-      implicit none
-      include 'nlte_paramdef.h'
+      use nlte_paramdef_h, only: nl
+      implicit none
 
 c     arguments
@@ -596,7 +567,5 @@
 
 
-c     end
-      return
-      end
+      end subroutine mzescape_normaliz
 
 c     ***********************************************************************
@@ -646,7 +615,5 @@
 
 
-c     end
-      return
-      end
+      end subroutine mzescape_normaliz_02
 
 
@@ -658,9 +625,10 @@
 
 c***********************************************************************
-
-      implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
+      use nlte_paramdef_h, only: nl, nztabul
+      use nlte_commons_h, only: pl, taustar21, taustar31, taustar41
+      use nlte_commons_h, only: tstar21tab, tstar31tab, tstar41tab
+      use nlte_commons_h, only: lnpnbtab, vc210, vc310, vc410
+      use nlte_commons_h, only: vc210tab, vc310tab, vc410tab
+      implicit none
 
 c     local variables
@@ -687,6 +655,6 @@
 
 c     end
-      return
-      end
+
+      end subroutine interdp_ESCTVCISO
 
 
@@ -757,5 +725,5 @@
       goto 3  
 c     
-      END  
+      END SUBROUTINE hunt_cts
 
       
@@ -817,5 +785,5 @@
       goto 3  
 c     
-      END  
+      END SUBROUTINE huntdp
 
       
@@ -883,5 +851,5 @@
       goto 3  
 c     
-      END  
+      END SUBROUTINE hunt
 
       
@@ -977,6 +945,6 @@
          end if
  1    continue
-      return
-      end
+
+      end subroutine interdp_limits
 
 
@@ -1043,6 +1011,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhunt2veces
 
 
@@ -1113,6 +1080,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhunt5veces
 
 
@@ -1178,6 +1144,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhuntdp3veces
 
 
@@ -1247,6 +1212,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhuntdp4veces
 
 
@@ -1310,6 +1274,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhuntdp
 
 
@@ -1374,6 +1337,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhunt
 
 
@@ -1465,6 +1427,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhuntlimits2veces
 
 
@@ -1567,6 +1528,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhuntlimits5veces
 
 
@@ -1652,6 +1612,5 @@
  1    continue
 
-      return
-      end
+      end subroutine interhuntlimits
 
 
@@ -1693,6 +1652,6 @@
          b(i)=sum/a(i,i)             
  14   continue                      
-      return   
-      end      
+
+      end subroutine lubksb_dp
 
 
@@ -1771,6 +1730,6 @@
  19   continue                    
       if(a(n,n).eq.0.0)a(n,n)=tiny               
-      return                      
-      end   
+
+      end subroutine ludcmp_dp
 
 
@@ -1828,6 +1787,5 @@
       enddo
 
-      return
-      end
+      end subroutine LUdec
 
 
@@ -1858,6 +1816,6 @@
          a(k,n) = 0.0d0
       end do
-      return
-      end
+
+      end subroutine unit
 
 c     ***********************************************************************
@@ -1885,6 +1843,6 @@
          a(k,n) = 0.0d0
       end do
-      return
-      end  
+
+      end subroutine diago
 
 c     ***********************************************************************
@@ -1912,6 +1870,6 @@
          a(k,n) = 0.0d0
       end do
-      return
-      end
+
+      end subroutine invdiag
 
 
@@ -1934,6 +1892,6 @@
          a(k,n) = 0.0d0
       end do
-      return
-      end 
+
+      end subroutine samem
 
 
@@ -1956,6 +1914,6 @@
       a(1) = 0.0d0
       a(n) = 0.0d0
-      return
-      end
+
+      end subroutine mulmv
 
 
@@ -1986,6 +1944,6 @@
          a(k,n) = 0.0d0
       end do
-      return
-      end
+
+      end subroutine trucodiag
 
 
@@ -2011,6 +1969,6 @@
       v(1) = 0.d0
       v(n) = 0.d0
-      return
-      end
+
+      end subroutine trucommvv
 
 
@@ -2029,6 +1987,6 @@
       v(1) = 0.0d0
       v(n) = 0.0d0
-      return
-      end
+
+      end subroutine sypvmv
 
 
@@ -2047,6 +2005,6 @@
       a(1) = 0.0d0
       a(n) = 0.0d0
-      return
-      end
+
+      end subroutine sumvv
 
 
@@ -2063,6 +2021,6 @@
       a(1) = 0.0d0
       a(n) = 0.0d0
-      return
-      end
+
+      end subroutine sypvvv
 
 
@@ -2103,6 +2061,6 @@
 ! 2       continue
 ! 1    continue
-      return
-      end
+
+      end subroutine zero4m
 
 
@@ -2124,6 +2082,6 @@
 ! 2       continue
 ! 1    continue
-      return
-      end
+
+      end subroutine zero3m
 
 
@@ -2143,6 +2101,5 @@
 ! 2       continue
 ! 1    continue
-      return
-      end
+      end subroutine zero2m
 
 
@@ -2178,6 +2135,6 @@
 !         d(i) = 0.0d0
 ! 1    continue
-      return
-      end
+
+      end subroutine zero4v
 
 
@@ -2197,6 +2154,5 @@
 !         c(i) = 0.0d0
 ! 1    continue
-      return
-      end
+      end subroutine zero3v
 
 
@@ -2214,6 +2170,6 @@
 !         b(i) = 0.0d0
 ! 1    continue
-      return
-      end
+
+      end subroutine zero2v
 
 c     ***********************************************************************
@@ -2304,6 +2260,5 @@
       end do
 
-      return
-      end
+      end subroutine suaviza
 
 
@@ -2321,6 +2276,5 @@
       a(:,n)=0.d0
 
-      return
-      end
+      end subroutine mulmmf90
 
 
@@ -2338,6 +2292,5 @@
       a(:,n)=0.d0
 
-      return
-      end
+      end subroutine resmmf90
 
 
@@ -2347,10 +2300,9 @@
 
 c*******************************************************************
-
-      implicit none
-
-      include	'nlte_paramdef.h'
-      include	'nlte_commons.h'
-
+      use nlte_commons_h, only: nbox, nbox_stored, mm_stored, thist
+      use nlte_commons_h, only: thist_stored, no, no_stored, sk1
+      use nlte_commons_h, only: sk1_stored, xls1, xls1_stored, xld1
+      use nlte_commons_h, only: xld1_stored
+      implicit none
 
 c     arguments 
@@ -2373,7 +2325,5 @@
       enddo
 
-
-      return
-      end
+      end subroutine gethist_03
 
 
@@ -2385,10 +2335,9 @@
 
 c     *******************************************************************
-
-      implicit none
-
-      include	'nlte_paramdef.h'
-      include	'nlte_commons.h'
-
+      use nlte_paramdef_h, only: nbox_max
+      use nlte_commons_h, only: mm_stored, nbox_stored, nbox_stored
+      use nlte_commons_h, only: thist_stored, no_stored, sk1_stored
+      use nlte_commons_h, only: xls1_stored, xld1_stored, hisfile
+      implicit none
 
 c     arguments 
@@ -2443,4 +2392,5 @@
       call bcast(xld1_stored)
 
-      return
-      end
+      end subroutine rhist_03
+
+!      END MODULE nlte_aux_mod
Index: trunk/LMDZ.MARS/libf/phymars/nlte_calc.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_calc.F	(revision 3017)
+++ trunk/LMDZ.MARS/libf/phymars/nlte_calc.F	(revision 3018)
@@ -1,2 +1,9 @@
+!      MODULE nlte_calc_mod
+      
+!      USE nlte_aux_mod
+      
+!      IMPLICIT NONE
+      
+!      CONTAINS
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 ! Fast scheme for NLTE cooling rates at 15um by CO2 in a Martian GCM !
@@ -29,8 +36,12 @@
 c***********************************************************************
       use nlte_tcool_mod, only: errors
+      use nlte_paramdef_h, only: nl_cts, nzy_cts, nbox_max, nhist
+      use nlte_paramdef_h, only: ee, imr
+      use nlte_commons_h, only: elow, deltanu, eqw, aa, cc, dd
+      use nlte_commons_h, only: deltaz_cts, taustar11_cts, ibcode1
+      use nlte_commons_h, only: pp, ta, w, ka, alsa, alda, kr, nbox
+      use nlte_commons_h, only: ty_cts, py_cts, nty_cts, co2y_cts
+      use nlte_commons_h, only: ddbox, ccbox, mr_cts, zl_cts, no
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
 
 c     arguments 
@@ -214,7 +225,5 @@
       call mzescape_normaliz_02 ( taustar11_cts, nl_cts_real, 2 )
 
-c     end
-      return
-      end
+      end subroutine MZESC110
 
 
@@ -224,10 +233,12 @@
       subroutine MZTUD110( ierr, varerr )
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nl, nzy, nbox_max, nhist, imr, ee
+      use nlte_commons_h, only: ibcode1, deltanu, deltaz
+      use nlte_commons_h, only: eqw, aa, cc, dd, nbox, pp, ta, w
+      use nlte_commons_h, only: ka, alsa ,alda , kr
+      use nlte_commons_h, only: ddbox, ccbox, mr
+      use nlte_commons_h, only: v626t1, zy, zl, co2y, nty, elow, no
+      
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 
 c     arguments
@@ -606,7 +617,5 @@
       call MZCUD110 ( tauinf,tau )
 
-c     end
-      return
-      end
+      end subroutine MZTUD110
 
 
@@ -618,9 +627,7 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nl
+      use nlte_commons_h, only: deltanu, deltaz, c110, vc110
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
 
 c     arguments
@@ -699,7 +706,5 @@
       end do
 
-c     end
-      return
-      end
+      end subroutine MZCUD110
 
 
@@ -712,12 +717,9 @@
 c***********************************************************************
       use nlte_tcool_mod, only: errors
+      use nlte_paramdef_h, only: nl, nu, nu12_0200, nu12_1000, ee
+      use nlte_commons_h, only: t, c121, vc121
       implicit none
 
-                                ! common variables & constants
-      
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
-                                ! local variables
+      ! local variables
 
       real*8  cax1(nl,nl)
@@ -779,6 +781,5 @@
  11   continue
 
-      return
-      end
+      end subroutine MZMC121
 
 
@@ -788,10 +789,10 @@
       subroutine MZTUD121 ( cf,vc, ib, ierr, varerr )
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nl, nzy, nbox_max, nhist, imr, ee
+      use nlte_commons_h, only: ibcode1, deltanu, deltaz, zl, zy 
+      use nlte_commons_h, only: eqw, aa, cc, dd, ddbox, ccbox, nbox
+      use nlte_commons_h, only: ka, alsa, alda, kr, pp, ta, w
+      use nlte_commons_h, only: v626t1, elow, co2y, mr, nty, no
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-      
 
 c     arguments
@@ -1144,7 +1145,5 @@
 
 
-c     end
-      return
-      end
+      end subroutine MZTUD121 
 
 
@@ -1157,10 +1156,7 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nl
+      use nlte_commons_h, only: deltanu, deltaz
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 
 c     arguments
@@ -1246,8 +1242,5 @@
       end do
 
-
-c     end
-      return
-      end
+      end subroutine MZCUD121
 
 
@@ -1259,9 +1252,7 @@
 c***********************************************************************
       use nlte_tcool_mod, only: errors
+      use nlte_paramdef_h, only: nl, nu, nu12_0200, nu12_1000
+      use nlte_commons_h, only: taustar12
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 
 c     local variables
@@ -1300,7 +1291,6 @@
       call mzescape_normaliz ( taustar12, 2 )
 
-c     end
-      return
-      end
+
+      end subroutine MZESC121
 
 
@@ -1312,10 +1302,11 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nhist, nl, nzy, imr, ee 
+      use nlte_commons_h, only: ibcode1, deltanu, deltaz
+      use nlte_commons_h, only: eqw, aa, cc, dd, ddbox, ccbox
+      use nlte_commons_h, only: v626t1, pp, ta, w, nbox
+      use nlte_commons_h, only: ka, alsa, alda, kr
+      use nlte_commons_h, only: zy, zl, co2y, nty, mr, elow, no
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 
 c     arguments
@@ -1505,8 +1496,5 @@
 
 
-
-c     end
-      return
-      end
+      end subroutine MZESC121sub
 
 
@@ -1518,13 +1506,7 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nl, nu, nu12_0200, nu12_1000
+      use nlte_commons_h, only: vc121
       implicit none
-
-!!!!!!!!!!!!!!!!!!!!!!!
-!     common variables & constants
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 
       integer ierr
@@ -1566,7 +1548,5 @@
  11   continue
 
-
-      return
-      end
+      end subroutine MZTVC121
 
 
@@ -1578,10 +1558,11 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nhist, nl, nzy, imr, ee
+      use nlte_commons_h, only: ibcode1, deltanu, deltaz
+      use nlte_commons_h, only: eqw, aa, cc, dd, ddbox, ccbox
+      use nlte_commons_h, only: v626t1, pp, ta, w, nbox
+      use nlte_commons_h, only: ka, alsa, alda, kr
+       use nlte_commons_h, only: zy, zl, co2y, nty, mr, elow, no
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 
 c     arguments
@@ -1799,14 +1780,12 @@
       endif
 
-c     end
-      return
-      end
-
-
-
-
-
-
-
-
-
+      end subroutine MZTVC121sub
+
+
+!      END MODULE nlte_calc_mod
+
+
+
+
+
+
Index: trunk/LMDZ.MARS/libf/phymars/nlte_commons.h
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_commons.h	(revision 3017)
+++ 	(revision )
@@ -1,260 +1,0 @@
-c****************************************************************************
-c
-c       Merging of different common blocks used in the new NLTE 15um param
-c
-c       jan 2012    fgg+malv
-c****************************************************************************
-c *** Old datitos.cmn ***
-c
-	common /spectralv11/ elow, deltanu
-!$OMP THREADPRIVATE(/spectralv11/)
-	real elow(nisot,nb), deltanu(nisot,nb)
-
-
-	common/nu_levs_bands_v11/ nu11, nu12, nu121,  
-     @  	nu21, nu31, nu41
-!$OMP THREADPRIVATE(/nu_levs_bands_v11/)
-	real*8 nu11, nu12, nu121
-	real*8 nu21
-	real*8 nu31
-	real*8 nu41
-
-
-	common /aeinstein1v11/ a1_010_000, a1_020_010
-!$OMP THREADPRIVATE(/aeinstein1v11/)
-	common /aeinstein2v11/ a2_010_000    
-!$OMP THREADPRIVATE(/aeinstein2v11/)    
-	common /aeinstein3v11/ a3_010_000        
-!$OMP THREADPRIVATE(/aeinstein3v11/)
-	common /aeinstein4v11/ a4_010_000        
-!$OMP THREADPRIVATE(/aeinstein4v11/)
-
-	real*8 a1_010_000, a1_020_010
-	real*8 a2_010_000        
-	real*8 a3_010_000        
-	real*8 a4_010_000
-
-
-c *** Old tabulation.cmn ***
-
-	common/input_tab_v11/ lnpnbtab, 
-     @  	tstar11tab, tstar21tab, tstar31tab, tstar41tab,
-     @  	vc210tab, vc310tab, vc410tab
-!$OMP THREADPRIVATE(/input_tab_v11/)
-
-	real*8 lnpnbtab(nztabul)
-	real*8 vc210tab(nztabul), vc310tab(nztabul), vc410tab(nztabul)
-	real*8 tstar11tab(nztabul), tstar21tab(nztabul), 
-     @         tstar31tab(nztabul), tstar41tab(nztabul)
-
-
-c *** Old nlte_results.cmn ***
-
-	common/input_avilable_from/ input_cza
-!$OMP THREADPRIVATE(/input_avilable_from/)
-	integer input_cza 
-
-c temperatura vibracional de entrada:
-	common/temp626/ v626t1
-!$OMP THREADPRIVATE(/temp626/)
-	common/temp628/ v628t1 
-!$OMP THREADPRIVATE(/temp628/)
-	common/temp636/ v636t1 
-!$OMP THREADPRIVATE(/temp636/)
-	common/temp627/ v627t1 
-!$OMP THREADPRIVATE(/temp627/)
-	real*8 v626t1(nl)
-	real*8 v628t1(nl)
-	real*8 v636t1(nl)
-	real*8 v627t1(nl)
-
-c output de cza.for
-	common /tv15um/	vt11, vt12, vt21, vt31, vt41
-!$OMP THREADPRIVATE(/tv15um/)
-	real*8  vt11(nl), vt12(nl), vt21(nl), vt31(nl), vt41(nl)
-
-	common /hr15um/	hr110,hr210,hr310,hr410,hr121
-!$OMP THREADPRIVATE(/hr15um/)
-	real*8  hr110(nl),hr121(nl), 
-     @      	hr210(nl),hr310(nl),hr410(nl)
-
-        common/sf15um/ el11,el12, el21, el31, el41
-!$OMP THREADPRIVATE(/sf15um/)
-        real*8 el11(nl), el12(nl)
-        real*8 el21(nl)
-        real*8 el31(nl)
-        real*8 el41(nl)
-
-        common/sl15um/ sl110,sl121, sl210,sl310,sl410
-!$OMP THREADPRIVATE(/sl15um/)
-        real*8 sl110(nl), sl121(nl)
-        real*8 sl210(nl)
-        real*8 sl310(nl)
-        real*8 sl410(nl)
-
-
-c *** Old matrices.cmn ***
-
-
-c curtis matrix de cza:
-	common/curtis_matrixes_15um/ c110,c121, c210,
-     @  	c310,c410,
-     @  	vc110,vc121,vc210,vc310,vc410
-!$OMP THREADPRIVATE(/curtis_matrixes_15um/)
-	real*8 c110(nl,nl), c121(nl,nl)
-	real*8 c210(nl,nl)
-	real*8 c310(nl,nl)
-	real*8 c410(nl,nl)
-	real*8 vc110(nl), vc121(nl)
-	real*8 vc210(nl), vc310(nl), vc410(nl)
- 
-! for the cool-to-space formulation:
-!
-	common/taustar_15um/ taustar11, taustar21, taustar31, 
-     @         taustar41, taustar12, taustar11_cts
-!$OMP THREADPRIVATE(/taustar_15um/)
-	real*8 taustar11(nl), taustar21(nl), taustar31(nl)
-	real*8 taustar41(nl), taustar12(nl)
-	real*8 taustar11_cts(nl_cts)
-
-
-c *** Old atmref.cmn ***
-
-
-c NLTE Subgrid 
-c
-        common /atm_nl/ zl, t, pl, nt, co2, n2, co, o3p, 
-     @    co2vmr, n2vmr, covmr, o3pvmr, 
-     @    hrkday_factor
-!$OMP THREADPRIVATE(/atm_nl/)
-
-        real zl(nl), t(nl), pl(nl), nt(nl),  
-     @    co2(nl), n2(nl), co(nl), o3p(nl), 
-     @    co2vmr(nl), n2vmr(nl), covmr(nl), o3pvmr(nl), 
-     @    hrkday_factor(nl)
-
-
-c Subgrid Transmittances 
-c
-        common /atm_ny/ zy, ty, py, nty, co2y
-!$OMP THREADPRIVATE(/atm_ny/)
-        real zy(nzy), ty(nzy), py(nzy), nty(nzy), co2y(nzy)
-
-c Grids and indexes
-	common/deltazetas/ deltaz, deltazy, deltaz_cts, deltazy_cts, 
-     @        jlowerboundary, jtopboundary, jtopCTS
-!$OMP THREADPRIVATE(/deltazetas/)
-	real    deltaz, deltazy, deltaz_cts, deltazy_cts
-	integer jlowerboundary, jtopboundary, jtopCTS
-
-
-c NLTE-CTS Subgrid 
-c
-        common /atm_nl_cts/ zl_cts, t_cts, pl_cts, nt_cts, 
-     @    co2_cts, n2_cts, co_cts, o3p_cts, 
-     @    co2vmr_cts, n2vmr_cts, covmr_cts, o3pvmr_cts, 
-     @    hrkday_factor_cts,mmean_cts,cpnew_cts
-!$OMP THREADPRIVATE(/atm_nl_cts/)
-
-        real zl_cts(nl_cts), t_cts(nl_cts), pl_cts(nl_cts), 
-     @    nt_cts(nl_cts), co2_cts(nl_cts), 
-     @    n2_cts(nl_cts), co_cts(nl_cts),
-     @    o3p_cts(nl_cts), co2vmr_cts(nl_cts), n2vmr_cts(nl_cts), 
-     @    covmr_cts(nl_cts), o3pvmr_cts(nl_cts), 
-     @    hrkday_factor_cts(nl_cts),mmean_cts(nl_cts),
-     @    cpnew_cts(nl_cts)
-
-
-c CTS Subgrid Transmittances 
-c
-        common /atm_ny_cts/ zy_cts, ty_cts, py_cts, nty_cts, co2y_cts
-!$OMP THREADPRIVATE(/atm_ny_cts/)
-        real zy_cts(nzy_cts), ty_cts(nzy_cts), py_cts(nzy_cts), 
-     @          nty_cts(nzy_cts), co2y_cts(nzy_cts)
-
-
-c *** Old rates.cmn ***
-
-	common/rates_vt/ 
-     @      k19ba(4),k19bb(4),k19bc(4), k19bap(4),k19bbp(4),k19bcp(4),
-     @      k19ca(4),k19cb(4),k19cc(4), k19cap(4),k19cbp(4),k19ccp(4),
-     @      k20b(4),k20c(4), k20bp(4),k20cp(4)
-!$OMP THREADPRIVATE(/rates_vt/)
-
-	real*8 k19ba,k19bb,k19bc, k19bap,k19bbp,k19bcp
-	real*8 k19ca,k19cb,k19cc, k19cap,k19cbp,k19ccp
-	real*8 k20b,k20c, k20bp,k20cp
-
-	common/rates_vv/ 
-     @      	k21b(4),k21c(4), k21bp(4),k21cp(4),
-     @      	k33c, k33cp(2:4)
-!$OMP THREADPRIVATE(/rates_vv/)
-
-	real*8 k21b,k21c, k21bp,k21cp
-	real*8 k33c, k33cp
-
-	common/rates_last/ k23k21c, k24k21c, k34k21c, 
-     @      	k23k21cp, k24k21cp, k34k21cp
-!$OMP THREADPRIVATE(/rates_last/)
-
-	real*8 k23k21c,k24k21c,k34k21c, k23k21cp,k24k21cp,k34k21cp 
-
-
-
-c *** Old curtis.cmn ***
-
-        common /ini_file/ ibcode1
-!$OMP THREADPRIVATE(/ini_file/)
-	character ibcode1*1
-
-	common/block1/ alsa,alda,ka,kr
-!$OMP THREADPRIVATE(/block1/)
-	real*8 ka(nbox_max),alsa(nbox_max),alda(nbox_max)
-	integer kr   
-
-	common/block2/ hisfile
-!$OMP THREADPRIVATE(/block2/)
-	character hisfile*75
-
-	common/block3/ pp,ta,w
-!$OMP THREADPRIVATE(/block3/)
-	real*8 pp,ta(nbox_max),w
-
-	common/block4/ no,sk1,xls1,xld1,thist,nbox
-!$OMP THREADPRIVATE(/block4/)
-	real*8	sk1(nhist,nbox_max)
-	real*8  xls1(nhist,nbox_max)	
-	real*8 	xld1(nhist,nbox_max)	
-	real*8	thist(nhist)		
-	real*8	no(nbox_max)		
-	integer nbox		
-
-	common/block5/eqw, aa,  cc, dd, ddbox, ccbox, mr, mr_cts
-!$OMP THREADPRIVATE(/block5/)
-	real*8 eqw, aa, cc, dd
-	real*8 ddbox(nbox_max), ccbox(nbox_max)
-	real*8  mr(nzy), mr_cts(nzy_cts)
-
-        common/blockstore/no_stored, sk1_stored, xls1_stored, 
-     &          xld1_stored, thist_stored, nbox_stored, 
-     &          mm_stored
-!$OMP THREADPRIVATE(/blockstore/)
-         real*8 sk1_stored(nb,nhist,nbox_max)
-	 real*8 xls1_stored(nb,nhist,nbox_max)	
-	 real*8 xld1_stored(nb,nhist,nbox_max)	
-	 real*8 thist_stored(nb,nhist)		
-	 real*8 no_stored(nb,nbox_max)		
-	 integer nbox_stored(nb), mm_stored(nb) 
-
-c*****************************************************
-
-
-c*************************************************************
-
-
-
-
-c****************************************************************************
-
-
-
Index: trunk/LMDZ.MARS/libf/phymars/nlte_commons_h.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_commons_h.F90	(revision 3018)
+++ trunk/LMDZ.MARS/libf/phymars/nlte_commons_h.F90	(revision 3018)
@@ -0,0 +1,247 @@
+MODULE nlte_commons_h
+
+USE nlte_paramdef_h, ONLY: nb, nisot, nztabul, nl, nl_cts, nzy, nzy_cts
+USE nlte_paramdef_h, ONLY: nbox_max, nhist
+
+IMPLICIT NONE
+
+!****************************************************************************
+!
+!       Merging of different common blocks used in the new NLTE 15um param
+!
+!       jan 2012    fgg+malv
+!****************************************************************************
+! *** Old datitos.cmn ***
+!
+!        common /spectralv11/ elow, deltanu
+        real,save :: elow(nisot,nb), deltanu(nisot,nb)
+!$OMP THREADPRIVATE(elow,deltanu)
+
+!        common/nu_levs_bands_v11/ nu11, nu12, nu121,  
+!     @          nu21, nu31, nu41
+        real*8,save :: nu11, nu12, nu121
+        real*8,save :: nu21
+        real*8,save :: nu31
+        real*8,save :: nu41
+!$OMP THREADPRIVATE(nu11,nu12,nu121,nu21,nu31,nu41)
+
+
+!        common /aeinstein1v11/ a1_010_000, a1_020_010
+!        common /aeinstein2v11/ a2_010_000    
+!        common /aeinstein3v11/ a3_010_000        
+!        common /aeinstein4v11/ a4_010_000        
+        real*8,save :: a1_010_000, a1_020_010
+        real*8,save :: a2_010_000        
+        real*8,save :: a3_010_000        
+        real*8,save :: a4_010_000
+!$OMP THREADPRIVATE(a1_010_000,a1_020_010,a2_010_000)
+!$OMP THREADPRIVATE(a3_010_000,a4_010_000)
+
+! *** Old tabulation.cmn ***
+
+!        common/input_tab_v11/ lnpnbtab, 
+!     @          tstar11tab, tstar21tab, tstar31tab, tstar41tab,
+!     @          vc210tab, vc310tab, vc410tab
+
+        real*8,save :: lnpnbtab(nztabul)
+        real*8,save :: vc210tab(nztabul), vc310tab(nztabul), vc410tab(nztabul)
+        real*8,save :: tstar11tab(nztabul), tstar21tab(nztabul)
+        real*8,save :: tstar31tab(nztabul), tstar41tab(nztabul)
+!$OMP THREADPRIVATE(lnpnbtab)
+!$OMP THREADPRIVATE(vc210tab,vc310tab,vc410tab)
+!$OMP THREADPRIVATE(tstar11tab,tstar21tab,tstar31tab,tstar41tab)
+
+! *** Old nlte_results.cmn ***
+
+!        common/input_avilable_from/ input_cza
+        integer,save :: input_cza 
+!$OMP THREADPRIVATE(input_cza)
+
+! temperatura vibracional de entrada:
+!        common/temp626/ v626t1
+!        common/temp628/ v628t1 
+!        common/temp636/ v636t1 
+!        common/temp627/ v627t1 
+        real*8,save :: v626t1(nl)
+        real*8,save :: v628t1(nl)
+        real*8,save :: v636t1(nl)
+        real*8,save :: v627t1(nl)
+!$OMP THREADPRIVATE(v626t1,v628t1,v636t1,v627t1)
+
+! output de cza.for
+!        common /tv15um/        vt11, vt12, vt21, vt31, vt41
+        real*8,save :: vt11(nl), vt12(nl), vt21(nl), vt31(nl), vt41(nl)
+!$OMP THREADPRIVATE(vt11,vt12,vt21,vt31,vt41)
+
+!        common /hr15um/        hr110,hr210,hr310,hr410,hr121
+        real*8,save :: hr110(nl),hr121(nl)
+        real*8,save :: hr210(nl),hr310(nl),hr410(nl)
+!$OMP THREADPRIVATE(hr110,hr121,hr210,hr310,hr410)
+
+!        common/sf15um/ el11,el12, el21, el31, el41
+        real*8,save :: el11(nl), el12(nl)
+        real*8,save :: el21(nl)
+        real*8,save :: el31(nl)
+        real*8,save :: el41(nl)
+!$OMP THREADPRIVATE(el11,el12,el21,el31,el41)
+
+!        common/sl15um/ sl110,sl121, sl210,sl310,sl410
+        real*8,save :: sl110(nl), sl121(nl)
+        real*8,save :: sl210(nl)
+        real*8,save :: sl310(nl)
+        real*8,save :: sl410(nl)
+!$OMP THREADPRIVATE(sl110,sl121,sl210,sl310,sl410)
+
+
+! *** Old matrices.cmn ***
+
+! curtis matrix de cza:
+!        common/curtis_matrixes_15um/ c110,c121, c210,
+!     @          c310,c410,
+!     @          vc110,vc121,vc210,vc310,vc410
+        real*8,save :: c110(nl,nl), c121(nl,nl)
+        real*8,save :: c210(nl,nl)
+        real*8,save :: c310(nl,nl)
+        real*8,save :: c410(nl,nl)
+        real*8,save :: vc110(nl), vc121(nl)
+        real*8,save :: vc210(nl), vc310(nl), vc410(nl)
+!$OMP THREADPRIVATE(c110,c121,c210,c310,c410)
+!$OMP THREADPRIVATE(vc110,vc121,vc210,vc310,vc410)
+
+! for the cool-to-space formulation:
+!
+!        common/taustar_15um/ taustar11, taustar21, taustar31, 
+!     @         taustar41, taustar12, taustar11_cts
+        real*8,save :: taustar11(nl), taustar21(nl), taustar31(nl)
+        real*8,save :: taustar41(nl), taustar12(nl)
+        real*8,save :: taustar11_cts(nl_cts)
+!$OMP THREADPRIVATE(taustar11,taustar21,taustar31)
+!$OMP THREADPRIVATE(taustar41,taustar12,taustar11_cts)
+
+
+! *** Old atmref.cmn ***
+
+! NLTE Subgrid 
+!        common /atm_nl/ zl, t, pl, nt, co2, n2, co, o3p, 
+!     @    co2vmr, n2vmr, covmr, o3pvmr, 
+!     @    hrkday_factor
+        real,save :: zl(nl), t(nl), pl(nl), nt(nl)
+        real,save :: co2(nl), n2(nl), co(nl), o3p(nl)
+        real,save :: co2vmr(nl), n2vmr(nl), covmr(nl), o3pvmr(nl)
+        real,save :: hrkday_factor(nl)
+!$OMP THREADPRIVATE(zl,t,pl,nt,co2,n2,co,o3p)
+!$OMP THREADPRIVATE(co2vmr,n2vmr,covmr,o3pvmr,hrkday_factor)
+
+
+! Subgrid Transmittances 
+!        common /atm_ny/ zy, ty, py, nty, co2y
+        real,save :: zy(nzy), ty(nzy), py(nzy), nty(nzy), co2y(nzy)
+!$OMP THREADPRIVATE(zy,ty,py,nty,co2y)
+
+! Grids and indexes
+!        common/deltazetas/ deltaz, deltazy, deltaz_cts, deltazy_cts, 
+!     @        jlowerboundary, jtopboundary, jtopCTS
+        real,save ::    deltaz, deltazy, deltaz_cts, deltazy_cts
+        integer,save :: jlowerboundary, jtopboundary, jtopCTS
+!$OMP THREADPRIVATE(deltaz,deltazy,deltaz_cts,deltazy_cts)
+!$OMP THREADPRIVATE(jlowerboundary,jtopboundary,jtopCTS)
+
+! NLTE-CTS Subgrid 
+!        common /atm_nl_cts/ zl_cts, t_cts, pl_cts, nt_cts, 
+!     @    co2_cts, n2_cts, co_cts, o3p_cts, 
+!     @    co2vmr_cts, n2vmr_cts, covmr_cts, o3pvmr_cts, 
+!     @    hrkday_factor_cts,mmean_cts,cpnew_cts
+        real,save :: zl_cts(nl_cts), t_cts(nl_cts), pl_cts(nl_cts)
+        real,save :: nt_cts(nl_cts), co2_cts(nl_cts)
+        real,save :: n2_cts(nl_cts), co_cts(nl_cts)
+        real,save :: o3p_cts(nl_cts), co2vmr_cts(nl_cts), n2vmr_cts(nl_cts)
+        real,save :: covmr_cts(nl_cts), o3pvmr_cts(nl_cts)
+        real,save :: hrkday_factor_cts(nl_cts),mmean_cts(nl_cts)
+        real,save :: cpnew_cts(nl_cts)
+!$OMP THREADPRIVATE(zl_cts,t_cts,pl_cts,nt_cts,co2_cts,n2_cts,co_cts)
+!$OMP THREADPRIVATE(o3p_cts,co2vmr_cts,n2vmr_cts,covmr_cts,o3pvmr_cts)
+!$OMP THREADPRIVATE(hrkday_factor_cts,mmean_cts,cpnew_cts)
+
+! CTS Subgrid Transmittances 
+!        common /atm_ny_cts/ zy_cts, ty_cts, py_cts, nty_cts, co2y_cts
+        real,save :: zy_cts(nzy_cts), ty_cts(nzy_cts), py_cts(nzy_cts)
+        real,save :: nty_cts(nzy_cts), co2y_cts(nzy_cts)
+!$OMP THREADPRIVATE(zy_cts,ty_cts,py_cts,nty_cts,co2y_cts)
+
+
+! *** Old rates.cmn ***
+!        common/rates_vt/ 
+!     @      k19ba(4),k19bb(4),k19bc(4), k19bap(4),k19bbp(4),k19bcp(4),
+!     @      k19ca(4),k19cb(4),k19cc(4), k19cap(4),k19cbp(4),k19ccp(4),
+!     @      k20b(4),k20c(4), k20bp(4),k20cp(4)
+        real*8,save :: k19ba(4),k19bb(4),k19bc(4), k19bap(4),k19bbp(4),k19bcp(4)
+        real*8,save :: k19ca(4),k19cb(4),k19cc(4), k19cap(4),k19cbp(4),k19ccp(4)
+        real*8,save :: k20b(4),k20c(4), k20bp(4),k20cp(4)
+!$OMP THREADPRIVATE(k19ba,k19bb,k19bc,k19bap,k19bbp,k19bcp)
+!$OMP THREADPRIVATE(k19ca,k19cb,k19cc,k19cap,k19cbp,k19ccp)
+!$OMP THREADPRIVATE(k20b,k20c,k20bp,k20cp)
+
+!        common/rates_vv/ 
+!     @              k21b(4),k21c(4), k21bp(4),k21cp(4),
+!     @              k33c, k33cp(2:4)
+        real*8,save :: k21b(4),k21c(4), k21bp(4),k21cp(4)
+        real*8,save :: k33c, k33cp(2:4)
+!$OMP THREADPRIVATE(k21b,k21c,k21bp,k21cp,k33c,k33cp)
+
+!        common/rates_last/ k23k21c, k24k21c, k34k21c, 
+!     @              k23k21cp, k24k21cp, k34k21cp
+        real*8,save :: k23k21c,k24k21c,k34k21c, k23k21cp,k24k21cp,k34k21cp 
+!$OMP THREADPRIVATE(k23k21c,k24k21c,k34k21c,k23k21cp,k24k21cp,k34k21cp)
+
+
+! *** Old curtis.cmn ***
+
+!        common /ini_file/ ibcode1
+        character,save :: ibcode1*1
+!$OMP THREADPRIVATE(ibcode1)
+
+!        common/block1/ alsa,alda,ka,kr
+        real*8,save :: ka(nbox_max),alsa(nbox_max),alda(nbox_max)
+        integer,save :: kr   
+!$OMP THREADPRIVATE(ka,alsa,alda,kr)
+
+!        common/block2/ hisfile
+        character,save :: hisfile*75
+!$OMP THREADPRIVATE(hisfile)
+
+!        common/block3/ pp,ta,w
+        real*8,save :: pp,ta(nbox_max),w
+!$OMP THREADPRIVATE(pp,ta,w)
+
+!        common/block4/ no,sk1,xls1,xld1,thist,nbox
+        real*8,save ::        sk1(nhist,nbox_max)
+        real*8,save ::  xls1(nhist,nbox_max)        
+        real*8,save ::         xld1(nhist,nbox_max)        
+        real*8,save ::        thist(nhist)                
+        real*8,save ::        no(nbox_max)                
+        integer,save :: nbox                
+!$OMP THREADPRIVATE(sk1,xls1,xld1,thist,no,nbox)
+
+!        common/block5/eqw, aa,  cc, dd, ddbox, ccbox, mr, mr_cts
+        real*8,save :: eqw, aa, cc, dd
+        real*8,save :: ddbox(nbox_max), ccbox(nbox_max)
+        real*8,save ::  mr(nzy), mr_cts(nzy_cts)
+!$OMP THREADPRIVATE(eqw,aa,cc,dd,ddbox,ccbox,mr,mr_cts)
+
+!        common/blockstore/no_stored, sk1_stored, xls1_stored, 
+!     &          xld1_stored, thist_stored, nbox_stored, 
+!     &          mm_stored
+         real*8,save :: sk1_stored(nb,nhist,nbox_max)
+         real*8,save :: xls1_stored(nb,nhist,nbox_max)        
+         real*8,save :: xld1_stored(nb,nhist,nbox_max)        
+         real*8,save :: thist_stored(nb,nhist)                
+         real*8,save :: no_stored(nb,nbox_max)                
+         integer,save :: nbox_stored(nb), mm_stored(nb) 
+!$OMP THREADPRIVATE(sk1_stored,xls1_stored,xld1_stored)
+!$OMP THREADPRIVATE(thist_stored,no_stored,nbox_stored,mm_stored)
+
+!****************************************************************************
+
+END MODULE nlte_commons_h
+
+
Index: trunk/LMDZ.MARS/libf/phymars/nlte_paramdef.h
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_paramdef.h	(revision 3017)
+++ 	(revision )
@@ -1,89 +1,0 @@
-c****************************************************************************
-c
-c       Merging of different parameters definitions for new NLTE 15um param
-c
-c       jul 2012    fgg+malv
-c****************************************************************************
-c *** Old mz1d.par ***
-! Grids parameters :
-
-	integer nztabul          ! # points in tabulation of Tesc & VC (ISO)
-	parameter ( nztabul=79 ) 
-
-! NLTE parameters:
-
-	integer nltot		! incluye el actual # alt in NLTE module 
-	parameter ( nltot=20 )  ! y el # alturas del Tstar110
-
-	integer nl		! actual # alt in NLTE module & C.Matrix 
-	parameter ( nl=12 )
-	integer nl2		! = nl-2, needed for matrix inversion (mmh2)
-	parameter ( nl2=nl-2 )	
-
-	integer nzy
-	parameter ( nzy = (nl-1)*4 + 1 )  ! Fine grid for C.Matrix
-
-	integer nl_cts         ! actual # alt para Tstar110
-	parameter ( nl_cts = 2 + nltot-nl )
-	integer nzy_cts         ! fine grid for transmit calculation
-	parameter ( nzy_cts = (nl_cts-1)*4 + 1 ) 
-
-
-!  Other NLTE parameters:
-	integer 	nisot		! number of isotopes considered
-	integer 	nb 		! number of bands included
-	parameter ( nisot=4, nb=41 )
-
-	integer 	nhist			! # of temps in histogr.
-	parameter 	( nhist = 36 )          ! (get it from histograms!)
-
-	integer         nbox_max
-	parameter       ( nbox_max = 4 )       ! max.# boxes in histogram
-
-
-c *** Old tcr_15um.h ***
-
-        integer itt_cza                        ! Selection of NLTE scheme
-        parameter       ( itt_cza = 13 )
-
-        real    Ptop_atm, Pbottom_atm          ! Upper and lower limits of
-                                               ! NLTE model
-        parameter       ( Ptop_atm = 3.e-10 , Pbottom_atm = 2.e-5 ) 
-        
-
-        real*8  rf19,rf20,rf21a,rf21b,rf21c,rf33bc
-        parameter       ( rf19 = 1.d0, rf20 = 1.d0, rf21a = 1.d0)
-        parameter       ( rf21b = 1.d0, rf21c = 1.d0, rf33bc = 1.d0 )
-
-
-c *** Old bloque_dlvr11.f ***
-
-        real nu(nisot,8)
-c data
-        data nu(1,1),nu(1,2) /667.3801, 1335.1317/
-        data nu(2,1)/662.3734/
-        data nu(3,1)/648.4784/
-        data nu(4,1)/664.7289/
-
-        real nu12_0200,nu12_1000
-        parameter      (nu12_0200 = 1285.4087)
-	parameter      (nu12_1000 = 1388.1847) 
-
-        integer indexisot(nisot)
-        data indexisot/26,28,36,27/
-
-	! ctes en el sistema cgs
-        real*8  vlight, ee, hplanck, gamma
-        parameter (vlight       = 2.9979245e10)
-        parameter (ee           = 1.43876866)
-        parameter (hplanck      = 6.6260755e-27)
-        parameter (gamma        = 1.191043934e-5)
-
-
-	! datos de marte
-        real imr(nisot)
-        data imr / 0.987, 0.00408, 0.0112, 0.000742 /
-
-
-
-
Index: trunk/LMDZ.MARS/libf/phymars/nlte_paramdef_h.F90
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_paramdef_h.F90	(revision 3018)
+++ trunk/LMDZ.MARS/libf/phymars/nlte_paramdef_h.F90	(revision 3018)
@@ -0,0 +1,80 @@
+MODULE nlte_paramdef_h
+
+IMPLICIT NONE
+
+!****************************************************************************
+!
+!       Merging of different parameters definitions for new NLTE 15um param
+!
+!       jul 2012    fgg+malv
+!****************************************************************************
+! *** Old mz1d.par ***
+! Grids parameters :
+
+integer,parameter :: nztabul=79 ! # points in tabulation of Tesc & VC (ISO)
+
+! NLTE parameters:
+
+integer,parameter :: nltot=20   ! incluye el actual # alt in NLTE module 
+                                ! y el # alturas del Tstar110
+
+integer,parameter :: nl=12     ! actual # alt in NLTE module & C.Matrix 
+integer,parameter :: nl2=nl-2  ! = nl-2, needed for matrix inversion (mmh2)
+
+integer,parameter :: nzy = (nl-1)*4 + 1  ! Fine grid for C.Matrix
+
+integer,parameter :: nl_cts = 2 + nltot-nl ! actual # alt para Tstar110
+integer,parameter :: nzy_cts = (nl_cts-1)*4 + 1 ! fine grid for transmit calculation
+
+
+!  Other NLTE parameters:
+integer,parameter :: nisot=4    ! number of isotopes considered
+integer,parameter :: nb=41      ! number of bands included
+
+integer,parameter :: nhist=36    ! # of temps in histogr.
+                                 ! (get it from histograms!)
+
+integer,parameter :: nbox_max = 4  ! max.# boxes in histogram
+
+
+! *** Old tcr_15um.h ***
+
+integer,parameter :: itt_cza = 13  ! Selection of NLTE scheme
+
+real,parameter :: Ptop_atm = 3.e-10     ! Upper and lower limits of
+real,parameter :: Pbottom_atm = 2.e-5   ! NLTE model
+
+real*8,parameter :: rf19 = 1.d0, rf20 = 1.d0, rf21a = 1.d0
+real*8,parameter :: rf21b = 1.d0, rf21c = 1.d0, rf33bc = 1.d0
+
+! *** Old bloque_dlvr11.f ***
+
+real,parameter :: nu(nisot,8) = reshape([&
+                      667.3801, 1335.1317, 0., 0., 0., 0., 0., 0., &
+                      662.3734,        0., 0., 0., 0., 0., 0., 0., &
+                      648.4784,        0., 0., 0., 0., 0., 0., 0., &
+                      664.7289,        0., 0., 0., 0., 0., 0., 0.  &
+                                ],shape(nu),order=[2,1])
+!        data nu(1,1),nu(1,2) /667.3801, 1335.1317/
+!        data nu(2,1)/662.3734/
+!        data nu(3,1)/648.4784/
+!        data nu(4,1)/664.7289/
+
+real,parameter :: nu12_0200 = 1285.4087
+real,parameter :: nu12_1000 = 1388.1847
+
+integer,parameter :: indexisot(nisot) = [26,28,36,27]
+
+! ctes en el sistema cgs
+real*8,parameter :: vlight   = 2.9979245e10
+real*8,parameter :: ee       = 1.43876866
+real*8,parameter :: hplanck  = 6.6260755e-27
+real*8,parameter :: gamma    = 1.191043934e-5
+
+
+! datos de marte
+real,parameter :: imr(nisot) = [ 0.987, 0.00408, 0.0112, 0.000742 ]
+
+
+END MODULE nlte_paramdef_h
+
Index: trunk/LMDZ.MARS/libf/phymars/nlte_setup.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_setup.F	(revision 3017)
+++ trunk/LMDZ.MARS/libf/phymars/nlte_setup.F	(revision 3018)
@@ -1,2 +1,9 @@
+!      MODULE nlte_setup_mod
+      
+!      USE nlte_aux_mod
+      
+!      IMPLICIT NONE
+      
+!      CONTAINS
 c***********************************************************************
 
@@ -20,10 +27,11 @@
       USE mod_phys_lmdz_para, ONLY: is_master
       USE mod_phys_lmdz_transfert_para, ONLY: bcast
-      
+      use nlte_paramdef_h, only: nztabul, nb, nisot, indexisot
+      use nlte_commons_h, only: elow, deltanu, lnpnbtab, tstar11tab
+      use nlte_commons_h, only: tstar21tab, tstar31tab, tstar41tab
+      use nlte_commons_h, only: a1_010_000, a2_010_000, a3_010_000
+      use nlte_commons_h, only: a4_010_000, a1_020_010
+      use nlte_commons_h, only: vc210tab, vc310tab, vc410tab
       implicit none
-
-      include	'nlte_paramdef.h'
-      include	'nlte_commons.h'
-
 
 c***************
@@ -119,8 +127,5 @@
       call LeeHISTOGRMS
 
-c     end subroutine
-
-      return
-      end
+      end subroutine nlte_setup
 
 
@@ -131,10 +136,6 @@
 
       use datafile_mod, only: datadir
-
+      use nlte_commons_h, only: hisfile
       implicit none
-
-      include	'nlte_paramdef.h'
-      include	'nlte_commons.h'
-
 
 c     local variables and constants
@@ -171,7 +172,5 @@
 
 
-
-      return
-      end
+      end subroutine LeeHISTOGRMS
 
 
@@ -183,9 +182,14 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: rf19, rf20, rf21a, rf21b, rf21c, rf33bc
+      use nlte_paramdef_h, only: nisot, ee, nu
+      use nlte_commons_h, only: k23k21c, k24k21c ,k34k21c, k23k21cp
+      use nlte_commons_h, only: k24k21cp, k34k21cp
+      use nlte_commons_h, only: k19ba, k19bb, k19bc, k19bap
+      use nlte_commons_h, only: k19bbp, k19bcp, k19ca, k19cb, k19cc
+      use nlte_commons_h, only: k19cap, k19cbp, k19ccp
+      use nlte_commons_h, only: k20b, k20c, k20bp, k20cp
+      use nlte_commons_h, only: k21b, k21c, k21bp, k21cp, k33c, k33cp
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
 
 c     arguments
@@ -293,12 +297,11 @@
       end do
 
-
-      return
-      end
-
-
-
-
-
-
-
+      end subroutine GETK_dlvr11
+
+
+!      END MODULE nlte_setup_mod
+
+
+
+
+
Index: trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F	(revision 3017)
+++ trunk/LMDZ.MARS/libf/phymars/nlte_tcool.F	(revision 3018)
@@ -1,4 +1,4 @@
       MODULE nlte_tcool_mod
-      
+            
       IMPLICIT NONE
       
@@ -36,9 +36,11 @@
 
       use conc_mod, only: cpnew, mmean
+      use nlte_paramdef_h, only: nl, nltot, nl_cts
+      use nlte_commons_h, only: input_cza, jlowerboundary, jtopcts
+      use nlte_commons_h, only: c110, taustar11, vc110, hr121
+      use nlte_commons_h, only: hr110, hr210, hr310, hr410
+      use nlte_commons_h, only: pl, pl_cts
+      
       implicit none
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 
 c     Arguments
@@ -211,10 +213,20 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nl, nzy, nl_cts, nzy_cts
+      use nlte_paramdef_h, only: Pbottom_atm, Ptop_atm
+      use nlte_commons_h, only: jlowerboundary, jtopboundary, jtopCTS
+      use nlte_commons_h, only: deltaz, deltazy, deltaz_cts, deltazy_cts
+      use nlte_commons_h, only: zl, t, pl, nt, co2, n2, co, o3p
+      use nlte_commons_h, only: co2vmr, n2vmr, covmr, o3pvmr
+      use nlte_commons_h, only: hrkday_factor, zy, ty, py, nty, co2y
+      use nlte_commons_h, only: zy_cts, ty_cts, py_cts, nty_cts
+      use nlte_commons_h, only: co2y_cts, zl_cts, t_cts, pl_cts, nt_cts
+      use nlte_commons_h, only: co2_cts, n2_cts, co_cts, o3p_cts
+      use nlte_commons_h, only: co2vmr_cts, n2vmr_cts, covmr_cts
+      use nlte_commons_h, only: o3pvmr_cts, hrkday_factor_cts
+      use nlte_commons_h, only: mmean_cts, cpnew_cts
+      use nlte_commons_h, only: mm_stored, thist_stored
       implicit none
       
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 c     Arguments
       integer n_gcm             ! I
@@ -488,12 +500,27 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: hplanck, vlight, ee, gamma, itt_cza
+      use nlte_paramdef_h, only: Ptop_atm, Pbottom_atm, nl, nl2, nltot
+      use nlte_paramdef_h, only: nl, nu, imr
+      use nlte_commons_h, only: v626t1, v628t1, v636t1, v627t1
+      use nlte_commons_h, only: a1_020_010, a2_010_000, a3_010_000
+      use nlte_commons_h, only: a4_010_000, input_cza
+      use nlte_commons_h, only: k23k21c, k24k21c, k34k21c, k23k21cp
+      use nlte_commons_h, only: k24k21cp, k34k21cp
+      use nlte_commons_h, only: k19ba, k19bb, k19bc, k19bap, k19bbp
+      use nlte_commons_h, only: k19bcp, k19ca, k19cb, k19cc, k19cap
+      use nlte_commons_h, only: k19cbp, k19ccp, k20b, k20c, k20bp, k20cp
+      use nlte_commons_h, only: k21b, k21c, k21bp, k21cp, k33c, k33cp
+      use nlte_commons_h, only: nu11, nu12, nu121, nu21, nu31, nu41
+      use nlte_commons_h, only: hr110, hr121, hr210, hr310, hr410
+      use nlte_commons_h, only: c110, c121, c210, c310, c410
+      use nlte_commons_h, only: vc110, vc121, vc210, vc310, vc410
+      use nlte_commons_h, only: taustar11, taustar21, taustar31
+      use nlte_commons_h, only: taustar41, taustar12, hrkday_factor
+      use nlte_commons_h, only: t, nt, co2,n2, co, o3p
+      use nlte_commons_h, only: el11, el12, el21, el31, el41
+      use nlte_commons_h, only: sl110, sl121, sl210, sl310, sl410
+      use nlte_commons_h, only: vt11, vt12, vt21, vt31, vt41
       implicit none
-
-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!common variables and constants
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-
 
 c     Arguments
@@ -1269,12 +1296,13 @@
 
 c***********************************************************************
-
+      use nlte_paramdef_h, only: nl_cts, nu, imr, hplanck, vlight
+      use nlte_commons_h, only: nu11, t_cts, nt_cts, taustar11_cts
+      use nlte_commons_h, only: co2_cts, n2_cts, co_cts, o3p_cts
+      use nlte_commons_h, only: hrkday_factor_cts, a1_010_000
+      use nlte_commons_h, only: k19ba, k19bb, k19bc, k19bap, k19bbp
+      use nlte_commons_h, only: k19bcp, k19ca, k19cb, k19cc, k19cap
+      use nlte_commons_h, only: k19cbp, k19ccp
+      use nlte_commons_h, only: k20c, k20cp
       implicit none
-
-!!!!!!!!!!!!!!!!!! common variables and constants
-
-      include 'nlte_paramdef.h'
-      include 'nlte_commons.h'
-	
 
 c Arguments 
