Index: trunk/LMDZ.GENERIC/libf/phystd/interpolate_continuum.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/interpolate_continuum.F90	(revision 3672)
+++ trunk/LMDZ.GENERIC/libf/phystd/interpolate_continuum.F90	(revision 3693)
@@ -1,2 +1,7 @@
+module interpolate_continuum_mod
+
+implicit none
+
+contains
 
      subroutine interpolate_continuum(filename,igas_X,igas_Y,c_WN,ind_WN,temp,pres_X,pres_Y,abs_coef,firstcall)
@@ -30,16 +35,16 @@
 
       ! input
-      integer ind_WN                      ! wavenumber index 
-      integer igas_X                      ! index of molecule X
-      integer igas_Y                      ! index of molecule Y
-      double precision temp               ! temperature (Kelvin)
-      double precision pres_X             ! partial pressure of molecule X (Pascals)
-      double precision pres_Y             ! partial pressure of molecule Y (Pascals)
-      character*200 filename              ! name of the lookup table
-      character*2 c_WN                    ! wavelength chanel: infrared (IR) or visible (VI)
-      logical firstcall
+      integer,intent(in) :: ind_WN            ! wavenumber index 
+      integer,intent(in) :: igas_X            ! index of molecule X
+      integer,intent(in) :: igas_Y            ! index of molecule Y
+      double precision,intent(in) :: temp     ! temperature (Kelvin)
+      double precision,intent(in) :: pres_X   ! partial pressure of molecule X (Pascals)
+      double precision,intent(in) :: pres_Y   ! partial pressure of molecule Y (Pascals)
+      character(len=*),intent(in) :: filename ! name of the lookup table
+      character(len=2),intent(in) :: c_WN     ! wavelength chanel: infrared (IR) or visible (VI)
+      logical,intent(in) :: firstcall
 
       ! output
-      double precision abs_coef           ! absorption coefficient (m^-1)
+      double precision,intent(out) :: abs_coef ! absorption coefficient (m^-1)
 
       ! intermediate variables
@@ -64,122 +69,138 @@
 
       ! Temperature array, continuum absorption grid for the pair N2-N2
-      integer num_T_N2N2
-      double precision, dimension(:), allocatable :: temp_arr_N2N2
-      double precision, dimension(:,:), allocatable :: abs_arr_N2N2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_N2N2_VI
-      save num_T_N2N2,temp_arr_N2N2,abs_arr_N2N2_IR,abs_arr_N2N2_VI !read by master
+      integer,save :: num_T_N2N2
+      double precision,save,dimension(:),allocatable :: temp_arr_N2N2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_N2N2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_N2N2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair O2-O2
-      integer num_T_O2O2
-      double precision, dimension(:), allocatable :: temp_arr_O2O2
-      double precision, dimension(:,:), allocatable :: abs_arr_O2O2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_O2O2_VI
-      save num_T_O2O2,temp_arr_O2O2,abs_arr_O2O2_IR,abs_arr_O2O2_VI !read by master
+      integer,save :: num_T_O2O2
+      double precision,save,dimension(:),allocatable :: temp_arr_O2O2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_O2O2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_O2O2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair H2-H2
-      integer num_T_H2H2
-      double precision, dimension(:), allocatable :: temp_arr_H2H2
-      double precision, dimension(:,:), allocatable :: abs_arr_H2H2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_H2H2_VI
-      save num_T_H2H2,temp_arr_H2H2,abs_arr_H2H2_IR,abs_arr_H2H2_VI !read by master
+      integer,save :: num_T_H2H2
+      double precision,save,dimension(:),allocatable :: temp_arr_H2H2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2H2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2H2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair CO2-CO2
-      integer num_T_CO2CO2
-      double precision, dimension(:), allocatable :: temp_arr_CO2CO2
-      double precision, dimension(:,:), allocatable :: abs_arr_CO2CO2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_CO2CO2_VI
-      save num_T_CO2CO2,temp_arr_CO2CO2,abs_arr_CO2CO2_IR,abs_arr_CO2CO2_VI !read by master
+      integer,save :: num_T_CO2CO2
+      double precision,save,dimension(:),allocatable :: temp_arr_CO2CO2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CO2CO2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CO2CO2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair CH4-CH4
-      integer num_T_CH4CH4
-      double precision, dimension(:), allocatable :: temp_arr_CH4CH4
-      double precision, dimension(:,:), allocatable :: abs_arr_CH4CH4_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_CH4CH4_VI
-      save num_T_CH4CH4,temp_arr_CH4CH4,abs_arr_CH4CH4_IR,abs_arr_CH4CH4_VI !read by master
+      integer,save :: num_T_CH4CH4
+      double precision,save,dimension(:),allocatable :: temp_arr_CH4CH4
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CH4CH4_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CH4CH4_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair H2O-H2O
-      integer num_T_H2OH2O
-      double precision, dimension(:), allocatable :: temp_arr_H2OH2O
-      double precision, dimension(:,:), allocatable :: abs_arr_H2OH2O_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_H2OH2O_VI
-      save num_T_H2OH2O,temp_arr_H2OH2O,abs_arr_H2OH2O_IR,abs_arr_H2OH2O_VI !read by master
+      integer,save :: num_T_H2OH2O
+      double precision,save,dimension(:),allocatable :: temp_arr_H2OH2O
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2OH2O_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2OH2O_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair H2-He
-      integer num_T_H2He
-      double precision, dimension(:), allocatable :: temp_arr_H2He
-      double precision, dimension(:,:), allocatable :: abs_arr_H2He_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_H2He_VI
-      save num_T_H2He,temp_arr_H2He,abs_arr_H2He_IR,abs_arr_H2He_VI !read by master
+      integer,save :: num_T_H2He
+      double precision,save,dimension(:),allocatable :: temp_arr_H2He
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2He_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2He_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair H2-CH4
-      integer num_T_H2CH4
-      double precision, dimension(:), allocatable :: temp_arr_H2CH4
-      double precision, dimension(:,:), allocatable :: abs_arr_H2CH4_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_H2CH4_VI
-      save num_T_H2CH4,temp_arr_H2CH4,abs_arr_H2CH4_IR,abs_arr_H2CH4_VI !read by master
+      integer,save :: num_T_H2CH4
+      double precision,save,dimension(:),allocatable :: temp_arr_H2CH4
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2CH4_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2CH4_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair CO2-H2
-      integer num_T_CO2H2
-      double precision, dimension(:), allocatable :: temp_arr_CO2H2
-      double precision, dimension(:,:), allocatable :: abs_arr_CO2H2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_CO2H2_VI
-      save num_T_CO2H2,temp_arr_CO2H2,abs_arr_CO2H2_IR,abs_arr_CO2H2_VI !read by master
+      integer,save :: num_T_CO2H2
+      double precision,save,dimension(:),allocatable :: temp_arr_CO2H2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CO2H2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CO2H2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair CO2-CH4
-      integer num_T_CO2CH4
-      double precision, dimension(:), allocatable :: temp_arr_CO2CH4
-      double precision, dimension(:,:), allocatable :: abs_arr_CO2CH4_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_CO2CH4_VI
-      save num_T_CO2CH4,temp_arr_CO2CH4,abs_arr_CO2CH4_IR,abs_arr_CO2CH4_VI !read by master
+      integer,save :: num_T_CO2CH4
+      double precision,save,dimension(:),allocatable :: temp_arr_CO2CH4
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CO2CH4_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CO2CH4_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair N2-H2
-      integer num_T_N2H2
-      double precision, dimension(:), allocatable :: temp_arr_N2H2
-      double precision, dimension(:,:), allocatable :: abs_arr_N2H2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_N2H2_VI
-      save num_T_N2H2,temp_arr_N2H2,abs_arr_N2H2_IR,abs_arr_N2H2_VI !read by master
+      integer,save :: num_T_N2H2
+      double precision,save,dimension(:),allocatable :: temp_arr_N2H2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_N2H2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_N2H2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair N2-CH4
-      integer num_T_N2CH4
-      double precision, dimension(:), allocatable :: temp_arr_N2CH4
-      double precision, dimension(:,:), allocatable :: abs_arr_N2CH4_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_N2CH4_VI
-      save num_T_N2CH4,temp_arr_N2CH4,abs_arr_N2CH4_IR,abs_arr_N2CH4_VI !read by master
+      integer,save :: num_T_N2CH4
+      double precision,save,dimension(:),allocatable :: temp_arr_N2CH4
+      double precision,save,dimension(:,:),allocatable :: abs_arr_N2CH4_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_N2CH4_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair CO2-O2
-      integer num_T_CO2O2
-      double precision, dimension(:), allocatable :: temp_arr_CO2O2
-      double precision, dimension(:,:), allocatable :: abs_arr_CO2O2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_CO2O2_VI
-      save num_T_CO2O2,temp_arr_CO2O2,abs_arr_CO2O2_IR,abs_arr_CO2O2_VI !read by master
+      integer,save :: num_T_CO2O2
+      double precision,save,dimension(:),allocatable :: temp_arr_CO2O2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CO2O2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_CO2O2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair N2-O2
-      integer num_T_N2O2
-      double precision, dimension(:), allocatable :: temp_arr_N2O2
-      double precision, dimension(:,:), allocatable :: abs_arr_N2O2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_N2O2_VI
-      save num_T_N2O2,temp_arr_N2O2,abs_arr_N2O2_IR,abs_arr_N2O2_VI !read by master
+      integer,save :: num_T_N2O2
+      double precision,save,dimension(:), allocatable :: temp_arr_N2O2
+      double precision,save,dimension(:,:), allocatable :: abs_arr_N2O2_IR
+      double precision,save,dimension(:,:), allocatable :: abs_arr_N2O2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair H2O-N2
-      integer num_T_H2ON2
-      double precision, dimension(:), allocatable :: temp_arr_H2ON2
-      double precision, dimension(:,:), allocatable :: abs_arr_H2ON2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_H2ON2_VI
-      save num_T_H2ON2,temp_arr_H2ON2,abs_arr_H2ON2_IR,abs_arr_H2ON2_VI !read by master
+      integer,save :: num_T_H2ON2
+      double precision,save,dimension(:),allocatable :: temp_arr_H2ON2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2ON2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2ON2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair H2O-O2
-      integer num_T_H2OO2
-      double precision, dimension(:), allocatable :: temp_arr_H2OO2
-      double precision, dimension(:,:), allocatable :: abs_arr_H2OO2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_H2OO2_VI
-      save num_T_H2OO2,temp_arr_H2OO2,abs_arr_H2OO2_IR,abs_arr_H2OO2_VI !read by master
+      integer,save :: num_T_H2OO2
+      double precision,save,dimension(:),allocatable :: temp_arr_H2OO2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2OO2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2OO2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
       ! Temperature array, continuum absorption grid for the pair H2O-CO2
-      integer num_T_H2OCO2
-      double precision, dimension(:), allocatable :: temp_arr_H2OCO2
-      double precision, dimension(:,:), allocatable :: abs_arr_H2OCO2_IR
-      double precision, dimension(:,:), allocatable :: abs_arr_H2OCO2_VI
-      save num_T_H2OCO2,temp_arr_H2OCO2,abs_arr_H2OCO2_IR,abs_arr_H2OCO2_VI !read by master
-
+      integer,save :: num_T_H2OCO2
+      double precision,save,dimension(:),allocatable :: temp_arr_H2OCO2
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2OCO2_IR
+      double precision,save,dimension(:,:),allocatable :: abs_arr_H2OCO2_VI
+! None of these saved variables are THREADPRIVATE because read by master
+! and then only accessed but never modified and thus can be shared
 
 
@@ -203,5 +224,5 @@
             write(*,*) 'https://web.lmd.jussieu.fr/~lmdz/planets/LMDZ.GENERIC/datagcm/continuum_data/'
           endif
-          call abort
+          call abort_physic("interpolate_continuum","missing input file",1)
         endif
 
@@ -235,7 +256,7 @@
         close(33)
 
-        if(.not.allocated(temp_arr)) allocate(temp_arr(num_T)) 
-        if(.not.allocated(wn_arr))  allocate(wn_arr(num_wn)) 
-        if(.not.allocated(abs_arr)) allocate(abs_arr(num_wn,num_T)) 
+        allocate(temp_arr(num_T)) 
+        allocate(wn_arr(num_wn)) 
+        allocate(abs_arr(num_wn,num_T)) 
 	
 	! We now open and read the file a second time to extract the temperature array, wavenumber array and continuum absorption data
@@ -273,7 +294,7 @@
         if ((igas_X .eq. igas_CO2) .and. (igas_Y .eq. igas_CO2)) then
           num_T_CO2CO2=num_T
-          if(.not.allocated(temp_arr_CO2CO2)) allocate(temp_arr_CO2CO2(num_T_CO2CO2)) 
-          if(.not.allocated(abs_arr_CO2CO2_VI)) allocate(abs_arr_CO2CO2_VI(L_NSPECTV,num_T_CO2CO2)) 
-          if(.not.allocated(abs_arr_CO2CO2_IR)) allocate(abs_arr_CO2CO2_IR(L_NSPECTI,num_T_CO2CO2)) 
+          allocate(temp_arr_CO2CO2(num_T_CO2CO2)) 
+          allocate(abs_arr_CO2CO2_VI(L_NSPECTV,num_T_CO2CO2)) 
+          allocate(abs_arr_CO2CO2_IR(L_NSPECTI,num_T_CO2CO2)) 
           temp_arr_CO2CO2(:)=temp_arr(:)
           abs_arr_CO2CO2_VI(:,:)=0.
@@ -282,7 +303,7 @@
 	elseif ((igas_X .eq. igas_N2) .and. (igas_Y .eq. igas_N2)) then
           num_T_N2N2=num_T
-          if(.not.allocated(temp_arr_N2N2)) allocate(temp_arr_N2N2(num_T_N2N2)) 
-          if(.not.allocated(abs_arr_N2N2_VI)) allocate(abs_arr_N2N2_VI(L_NSPECTV,num_T_N2N2)) 
-          if(.not.allocated(abs_arr_N2N2_IR)) allocate(abs_arr_N2N2_IR(L_NSPECTI,num_T_N2N2)) 
+          allocate(temp_arr_N2N2(num_T_N2N2)) 
+          allocate(abs_arr_N2N2_VI(L_NSPECTV,num_T_N2N2)) 
+          allocate(abs_arr_N2N2_IR(L_NSPECTI,num_T_N2N2)) 
           temp_arr_N2N2(:)=temp_arr(:)
           abs_arr_N2N2_VI(:,:)=0.
@@ -291,7 +312,7 @@
 	elseif ((igas_X .eq. igas_O2) .and. (igas_Y .eq. igas_O2)) then
           num_T_O2O2=num_T
-          if(.not.allocated(temp_arr_O2O2)) allocate(temp_arr_O2O2(num_T_O2O2)) 
-          if(.not.allocated(abs_arr_O2O2_VI)) allocate(abs_arr_O2O2_VI(L_NSPECTV,num_T_O2O2)) 
-          if(.not.allocated(abs_arr_O2O2_IR)) allocate(abs_arr_O2O2_IR(L_NSPECTI,num_T_O2O2)) 
+          allocate(temp_arr_O2O2(num_T_O2O2)) 
+          allocate(abs_arr_O2O2_VI(L_NSPECTV,num_T_O2O2)) 
+          allocate(abs_arr_O2O2_IR(L_NSPECTI,num_T_O2O2)) 
           temp_arr_O2O2(:)=temp_arr(:)
           abs_arr_O2O2_VI(:,:)=0.
@@ -300,7 +321,7 @@
 	elseif ((igas_X .eq. igas_CH4) .and. (igas_Y .eq. igas_CH4)) then
           num_T_CH4CH4=num_T
-          if(.not.allocated(temp_arr_CH4CH4)) allocate(temp_arr_CH4CH4(num_T_CH4CH4)) 
-          if(.not.allocated(abs_arr_CH4CH4_VI)) allocate(abs_arr_CH4CH4_VI(L_NSPECTV,num_T_CH4CH4)) 
-          if(.not.allocated(abs_arr_CH4CH4_IR)) allocate(abs_arr_CH4CH4_IR(L_NSPECTI,num_T_CH4CH4)) 
+          allocate(temp_arr_CH4CH4(num_T_CH4CH4)) 
+          allocate(abs_arr_CH4CH4_VI(L_NSPECTV,num_T_CH4CH4)) 
+          allocate(abs_arr_CH4CH4_IR(L_NSPECTI,num_T_CH4CH4)) 
           temp_arr_CH4CH4(:)=temp_arr(:)
           abs_arr_CH4CH4_VI(:,:)=0.
@@ -309,7 +330,7 @@
 	elseif ((igas_X .eq. igas_H2) .and. (igas_Y .eq. igas_H2)) then
           num_T_H2H2=num_T
-          if(.not.allocated(temp_arr_H2H2)) allocate(temp_arr_H2H2(num_T_H2H2)) 
-          if(.not.allocated(abs_arr_H2H2_VI)) allocate(abs_arr_H2H2_VI(L_NSPECTV,num_T_H2H2)) 
-          if(.not.allocated(abs_arr_H2H2_IR)) allocate(abs_arr_H2H2_IR(L_NSPECTI,num_T_H2H2)) 
+          allocate(temp_arr_H2H2(num_T_H2H2)) 
+          allocate(abs_arr_H2H2_VI(L_NSPECTV,num_T_H2H2)) 
+          allocate(abs_arr_H2H2_IR(L_NSPECTI,num_T_H2H2)) 
           temp_arr_H2H2(:)=temp_arr(:)
           abs_arr_H2H2_VI(:,:)=0.
@@ -318,7 +339,7 @@
 	elseif ((igas_X .eq. igas_H2O) .and. (igas_Y .eq. igas_H2O)) then
           num_T_H2OH2O=num_T
-          if(.not.allocated(temp_arr_H2OH2O)) allocate(temp_arr_H2OH2O(num_T_H2OH2O)) 
-          if(.not.allocated(abs_arr_H2OH2O_VI)) allocate(abs_arr_H2OH2O_VI(L_NSPECTV,num_T_H2OH2O)) 
-          if(.not.allocated(abs_arr_H2OH2O_IR)) allocate(abs_arr_H2OH2O_IR(L_NSPECTI,num_T_H2OH2O)) 
+          allocate(temp_arr_H2OH2O(num_T_H2OH2O)) 
+          allocate(abs_arr_H2OH2O_VI(L_NSPECTV,num_T_H2OH2O)) 
+          allocate(abs_arr_H2OH2O_IR(L_NSPECTI,num_T_H2OH2O)) 
           temp_arr_H2OH2O(:)=temp_arr(:)
           abs_arr_H2OH2O_VI(:,:)=0.
@@ -327,7 +348,7 @@
 	elseif ((igas_X .eq. igas_N2) .and. (igas_Y .eq. igas_H2)) then
           num_T_N2H2=num_T
-          if(.not.allocated(temp_arr_N2H2)) allocate(temp_arr_N2H2(num_T_N2H2)) 
-          if(.not.allocated(abs_arr_N2H2_VI)) allocate(abs_arr_N2H2_VI(L_NSPECTV,num_T_N2H2)) 
-          if(.not.allocated(abs_arr_N2H2_IR)) allocate(abs_arr_N2H2_IR(L_NSPECTI,num_T_N2H2)) 
+          allocate(temp_arr_N2H2(num_T_N2H2)) 
+          allocate(abs_arr_N2H2_VI(L_NSPECTV,num_T_N2H2)) 
+          allocate(abs_arr_N2H2_IR(L_NSPECTI,num_T_N2H2)) 
           temp_arr_N2H2(:)=temp_arr(:)
           abs_arr_N2H2_VI(:,:)=0.
@@ -336,7 +357,7 @@
 	elseif ((igas_X .eq. igas_N2) .and. (igas_Y .eq. igas_O2)) then
           num_T_N2O2=num_T
-          if(.not.allocated(temp_arr_N2O2)) allocate(temp_arr_N2O2(num_T_N2O2)) 
-          if(.not.allocated(abs_arr_N2O2_VI)) allocate(abs_arr_N2O2_VI(L_NSPECTV,num_T_N2O2)) 
-          if(.not.allocated(abs_arr_N2O2_IR)) allocate(abs_arr_N2O2_IR(L_NSPECTI,num_T_N2O2)) 
+          allocate(temp_arr_N2O2(num_T_N2O2)) 
+          allocate(abs_arr_N2O2_VI(L_NSPECTV,num_T_N2O2)) 
+          allocate(abs_arr_N2O2_IR(L_NSPECTI,num_T_N2O2)) 
           temp_arr_N2O2(:)=temp_arr(:)
           abs_arr_N2O2_VI(:,:)=0.
@@ -345,7 +366,7 @@
 	elseif ((igas_X .eq. igas_N2) .and. (igas_Y .eq. igas_CH4)) then
           num_T_N2CH4=num_T
-          if(.not.allocated(temp_arr_N2CH4)) allocate(temp_arr_N2CH4(num_T_N2CH4)) 
-          if(.not.allocated(abs_arr_N2CH4_VI)) allocate(abs_arr_N2CH4_VI(L_NSPECTV,num_T_N2CH4)) 
-          if(.not.allocated(abs_arr_N2CH4_IR)) allocate(abs_arr_N2CH4_IR(L_NSPECTI,num_T_N2CH4)) 
+          allocate(temp_arr_N2CH4(num_T_N2CH4)) 
+          allocate(abs_arr_N2CH4_VI(L_NSPECTV,num_T_N2CH4)) 
+          allocate(abs_arr_N2CH4_IR(L_NSPECTI,num_T_N2CH4)) 
           temp_arr_N2CH4(:)=temp_arr(:)
           abs_arr_N2CH4_VI(:,:)=0.
@@ -354,7 +375,7 @@
 	elseif ((igas_X .eq. igas_CO2) .and. (igas_Y .eq. igas_O2)) then
           num_T_CO2O2=num_T
-          if(.not.allocated(temp_arr_CO2O2)) allocate(temp_arr_CO2O2(num_T_CO2O2)) 
-          if(.not.allocated(abs_arr_CO2O2_VI)) allocate(abs_arr_CO2O2_VI(L_NSPECTV,num_T_CO2O2)) 
-          if(.not.allocated(abs_arr_CO2O2_IR)) allocate(abs_arr_CO2O2_IR(L_NSPECTI,num_T_CO2O2)) 
+          allocate(temp_arr_CO2O2(num_T_CO2O2)) 
+          allocate(abs_arr_CO2O2_VI(L_NSPECTV,num_T_CO2O2)) 
+          allocate(abs_arr_CO2O2_IR(L_NSPECTI,num_T_CO2O2)) 
           temp_arr_CO2O2(:)=temp_arr(:)
           abs_arr_CO2O2_VI(:,:)=0.
@@ -363,7 +384,7 @@
 	elseif ((igas_X .eq. igas_H2) .and. (igas_Y .eq. igas_CH4)) then
           num_T_H2CH4=num_T
-          if(.not.allocated(temp_arr_H2CH4)) allocate(temp_arr_H2CH4(num_T_H2CH4)) 
-          if(.not.allocated(abs_arr_H2CH4_VI)) allocate(abs_arr_H2CH4_VI(L_NSPECTV,num_T_H2CH4)) 
-          if(.not.allocated(abs_arr_H2CH4_IR)) allocate(abs_arr_H2CH4_IR(L_NSPECTI,num_T_H2CH4)) 
+          allocate(temp_arr_H2CH4(num_T_H2CH4)) 
+          allocate(abs_arr_H2CH4_VI(L_NSPECTV,num_T_H2CH4)) 
+          allocate(abs_arr_H2CH4_IR(L_NSPECTI,num_T_H2CH4)) 
           temp_arr_H2CH4(:)=temp_arr(:)
           abs_arr_H2CH4_VI(:,:)=0.
@@ -372,7 +393,7 @@
 	elseif ((igas_X .eq. igas_H2) .and. (igas_Y .eq. igas_He)) then
           num_T_H2He=num_T
-          if(.not.allocated(temp_arr_H2He)) allocate(temp_arr_H2He(num_T_H2He)) 
-          if(.not.allocated(abs_arr_H2He_VI)) allocate(abs_arr_H2He_VI(L_NSPECTV,num_T_H2He)) 
-          if(.not.allocated(abs_arr_H2He_IR)) allocate(abs_arr_H2He_IR(L_NSPECTI,num_T_H2He)) 
+          allocate(temp_arr_H2He(num_T_H2He)) 
+          allocate(abs_arr_H2He_VI(L_NSPECTV,num_T_H2He)) 
+          allocate(abs_arr_H2He_IR(L_NSPECTI,num_T_H2He)) 
           temp_arr_H2He(:)=temp_arr(:)
           abs_arr_H2He_VI(:,:)=0.
@@ -381,7 +402,7 @@
 	elseif ((igas_X .eq. igas_H2O) .and. (igas_Y .eq. igas_N2)) then
           num_T_H2ON2=num_T
-          if(.not.allocated(temp_arr_H2ON2)) allocate(temp_arr_H2ON2(num_T_H2ON2)) 
-          if(.not.allocated(abs_arr_H2ON2_VI)) allocate(abs_arr_H2ON2_VI(L_NSPECTV,num_T_H2ON2)) 
-          if(.not.allocated(abs_arr_H2ON2_IR)) allocate(abs_arr_H2ON2_IR(L_NSPECTI,num_T_H2ON2)) 
+          allocate(temp_arr_H2ON2(num_T_H2ON2)) 
+          allocate(abs_arr_H2ON2_VI(L_NSPECTV,num_T_H2ON2)) 
+          allocate(abs_arr_H2ON2_IR(L_NSPECTI,num_T_H2ON2)) 
           temp_arr_H2ON2(:)=temp_arr(:)
           abs_arr_H2ON2_VI(:,:)=0.
@@ -390,7 +411,7 @@
 	elseif ((igas_X .eq. igas_H2O) .and. (igas_Y .eq. igas_O2)) then
           num_T_H2OO2=num_T
-          if(.not.allocated(temp_arr_H2OO2)) allocate(temp_arr_H2OO2(num_T_H2OO2)) 
-          if(.not.allocated(abs_arr_H2OO2_VI)) allocate(abs_arr_H2OO2_VI(L_NSPECTV,num_T_H2OO2)) 
-          if(.not.allocated(abs_arr_H2OO2_IR)) allocate(abs_arr_H2OO2_IR(L_NSPECTI,num_T_H2OO2)) 
+          allocate(temp_arr_H2OO2(num_T_H2OO2)) 
+          allocate(abs_arr_H2OO2_VI(L_NSPECTV,num_T_H2OO2)) 
+          allocate(abs_arr_H2OO2_IR(L_NSPECTI,num_T_H2OO2)) 
           temp_arr_H2OO2(:)=temp_arr(:)
           abs_arr_H2OO2_VI(:,:)=0.
@@ -399,7 +420,7 @@
 	elseif ((igas_X .eq. igas_H2O) .and. (igas_Y .eq. igas_CO2)) then
           num_T_H2OCO2=num_T
-          if(.not.allocated(temp_arr_H2OCO2)) allocate(temp_arr_H2OCO2(num_T_H2OCO2)) 
-          if(.not.allocated(abs_arr_H2OCO2_VI)) allocate(abs_arr_H2OCO2_VI(L_NSPECTV,num_T_H2OCO2)) 
-          if(.not.allocated(abs_arr_H2OCO2_IR)) allocate(abs_arr_H2OCO2_IR(L_NSPECTI,num_T_H2OCO2)) 
+          allocate(temp_arr_H2OCO2(num_T_H2OCO2)) 
+          allocate(abs_arr_H2OCO2_VI(L_NSPECTV,num_T_H2OCO2)) 
+          allocate(abs_arr_H2OCO2_IR(L_NSPECTI,num_T_H2OCO2)) 
           temp_arr_H2OCO2(:)=temp_arr(:)
           abs_arr_H2OCO2_VI(:,:)=0.
@@ -408,7 +429,7 @@
 	elseif ((igas_X .eq. igas_CO2) .and. (igas_Y .eq. igas_CO2)) then
           num_T_CO2CO2=num_T
-          if(.not.allocated(temp_arr_CO2CO2)) allocate(temp_arr_CO2CO2(num_T_CO2CO2)) 
-          if(.not.allocated(abs_arr_CO2CO2_VI)) allocate(abs_arr_CO2CO2_VI(L_NSPECTV,num_T_CO2CO2)) 
-          if(.not.allocated(abs_arr_CO2CO2_IR)) allocate(abs_arr_CO2CO2_IR(L_NSPECTI,num_T_CO2CO2)) 
+          allocate(temp_arr_CO2CO2(num_T_CO2CO2)) 
+          allocate(abs_arr_CO2CO2_VI(L_NSPECTV,num_T_CO2CO2)) 
+          allocate(abs_arr_CO2CO2_IR(L_NSPECTI,num_T_CO2CO2)) 
           temp_arr_CO2CO2(:)=temp_arr(:)
           abs_arr_CO2CO2_VI(:,:)=0.
@@ -417,7 +438,7 @@
 	elseif ((igas_X .eq. igas_CO2) .and. (igas_Y .eq. igas_H2)) then
           num_T_CO2H2=num_T
-          if(.not.allocated(temp_arr_CO2H2)) allocate(temp_arr_CO2H2(num_T_CO2H2)) 
-          if(.not.allocated(abs_arr_CO2H2_VI)) allocate(abs_arr_CO2H2_VI(L_NSPECTV,num_T_CO2H2)) 
-          if(.not.allocated(abs_arr_CO2H2_IR)) allocate(abs_arr_CO2H2_IR(L_NSPECTI,num_T_CO2H2)) 
+          allocate(temp_arr_CO2H2(num_T_CO2H2)) 
+          allocate(abs_arr_CO2H2_VI(L_NSPECTV,num_T_CO2H2)) 
+          allocate(abs_arr_CO2H2_IR(L_NSPECTI,num_T_CO2H2)) 
           temp_arr_CO2H2(:)=temp_arr(:)
           abs_arr_CO2H2_VI(:,:)=0.
@@ -426,7 +447,7 @@
 	elseif ((igas_X .eq. igas_CO2) .and. (igas_Y .eq. igas_CH4)) then
           num_T_CO2CH4=num_T
-          if(.not.allocated(temp_arr_CO2CH4)) allocate(temp_arr_CO2CH4(num_T_CO2CH4)) 
-          if(.not.allocated(abs_arr_CO2CH4_VI)) allocate(abs_arr_CO2CH4_VI(L_NSPECTV,num_T_CO2CH4)) 
-          if(.not.allocated(abs_arr_CO2CH4_IR)) allocate(abs_arr_CO2CH4_IR(L_NSPECTI,num_T_CO2CH4)) 
+          allocate(temp_arr_CO2CH4(num_T_CO2CH4)) 
+          allocate(abs_arr_CO2CH4_VI(L_NSPECTV,num_T_CO2CH4)) 
+          allocate(abs_arr_CO2CH4_IR(L_NSPECTI,num_T_CO2CH4)) 
           temp_arr_CO2CH4(:)=temp_arr(:)
           abs_arr_CO2CH4_VI(:,:)=0.
@@ -628,5 +649,4 @@
       !print*,'So the absorption is ',abs_coef,' m^-1'
       
-      return
     end subroutine interpolate_continuum
     
@@ -653,10 +673,10 @@
             
       integer iW, iB, count_norm
-      integer num_T
-      integer num_wn
-      double precision wn_arr(num_wn)
-      double precision abs_arr_in(num_wn,num_T)
-      double precision abs_arr_out_IR(L_NSPECTI,num_T)
-      double precision abs_arr_out_VI(L_NSPECTV,num_T)
+      integer,intent(in) :: num_T
+      integer,intent(in) :: num_wn
+      double precision,intent(in) :: wn_arr(num_wn)
+      double precision,intent(in) :: abs_arr_in(num_wn,num_T)
+      double precision,intent(out) :: abs_arr_out_IR(L_NSPECTI,num_T)
+      double precision,intent(out) :: abs_arr_out_VI(L_NSPECTV,num_T)
 
       ! First visible (VI) chanel
@@ -710,5 +730,4 @@
       endif
 	
-      return
     end subroutine interpolate_wn_abs_coeff
 
@@ -733,8 +752,10 @@
       implicit none
       
-      double precision z_temp
-      double precision temp
-      integer num_T
-      double precision temp_arr(num_T)
+      double precision,intent(out) :: z_temp
+      double precision,intent(in) :: temp
+      integer,intent(in) :: num_T
+      double precision,intent(in) :: temp_arr(num_T)
+      
+      character(len=22) :: rname = "T_boundaries_continuum"
       
       z_temp=temp
@@ -746,5 +767,5 @@
             print*, 'Minimum temperature is ', minval(temp_arr), ' K'
           endif
-          stop
+          call abort_physic(rname,"temperature too low",1)
         else
           z_temp=minval(temp_arr)
@@ -756,5 +777,5 @@
             print*, 'Maximum temperature is ', maxval(temp_arr), ' K'
           endif
-          stop
+          call abort_physic(rname,"temperature too low",1)
         else
           z_temp=maxval(temp_arr)
@@ -762,5 +783,4 @@
       endif
       
-      return
     end subroutine T_boundaries_continuum
 
@@ -806,4 +826,5 @@
 
       
-      return
     end subroutine interpolate_T_abs_coeff
+
+end module interpolate_continuum_mod
Index: trunk/LMDZ.GENERIC/libf/phystd/optci.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/optci.F90	(revision 3672)
+++ trunk/LMDZ.GENERIC/libf/phystd/optci.F90	(revision 3693)
@@ -19,4 +19,5 @@
   use recombin_corrk_mod, only: corrk_recombin, gasi_recomb
   use tpindex_mod, only: tpindex
+  use interpolate_continuum_mod, only: interpolate_continuum
 
   implicit none
Index: trunk/LMDZ.GENERIC/libf/phystd/optcv.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/optcv.F90	(revision 3672)
+++ trunk/LMDZ.GENERIC/libf/phystd/optcv.F90	(revision 3693)
@@ -18,4 +18,5 @@
   use recombin_corrk_mod, only: corrk_recombin, gasv_recomb
   use tpindex_mod, only: tpindex
+  use interpolate_continuum_mod, only: interpolate_continuum
 
   implicit none
Index: trunk/LMDZ.GENERIC/libf/phystd/radcommon_h.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/radcommon_h.F90	(revision 3672)
+++ trunk/LMDZ.GENERIC/libf/phystd/radcommon_h.F90	(revision 3693)
@@ -68,5 +68,5 @@
 !$OMP THREADPRIVATE(WNOI,DWNI,WAVEI,&
 	!$OMP WNOV,DWNV,WAVEV,&
-	!$OMP STELLARF
+	!$OMP STELLARF)
 
       REAL*8 blami(L_NSPECTI+1)
Index: trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90	(revision 3672)
+++ trunk/LMDZ.GENERIC/libf/phystd/sugas_corrk.F90	(revision 3693)
@@ -38,4 +38,5 @@
       use recombin_corrk_mod, only: su_recombin,        &
                 corrk_recombin, use_premix, nrecomb_tot, rcb2tot_idx
+      use interpolate_continuum_mod, only: interpolate_continuum
       implicit none
 
