Index: trunk/LMDZ.TITAN/libf/phytitan/comm_wrf.F90
===================================================================
--- trunk/LMDZ.TITAN/libf/phytitan/comm_wrf.F90	(revision 3660)
+++ trunk/LMDZ.TITAN/libf/phytitan/comm_wrf.F90	(revision 3661)
@@ -18,11 +18,14 @@
   REAL,SAVE,ALLOCATABLE :: comm_FLUXSURF_LW(:)
   REAL,SAVE,ALLOCATABLE :: comm_FLXGRD(:)
+  REAL,SAVE,ALLOCATABLE :: comm_zqfi_omp(:,:,:)
+  REAL,SAVE,ALLOCATABLE :: comm_zdtlc(:,:)
 
 contains
 
-  subroutine allocate_comm_wrf(ngrid,nlayer)
+  subroutine allocate_comm_wrf(ngrid,nlayer,nq)
   implicit none
-  integer,intent(in) :: ngrid ! number of atmospheric columns
+  integer,intent(in) :: ngrid  ! number of atmospheric columns
   integer,intent(in) :: nlayer ! number of atmospheric layers
+  integer,intent(in) :: nq     ! number of tracers
   allocate(comm_HR_SW(ngrid,nlayer))
   allocate(comm_HR_LW(ngrid,nlayer))
@@ -38,4 +41,6 @@
   allocate(comm_FLUXSURF_LW(ngrid))
   allocate(comm_FLXGRD(ngrid))
+  allocate(comm_zqfi_omp(ngrid,nlayer,nq))
+  allocate(comm_zdtlc(ngrid,nlayer))
 
   end subroutine allocate_comm_wrf
@@ -56,4 +61,6 @@
   deallocate(comm_FLUXSURF_LW)
   deallocate(comm_FLXGRD)
+  deallocate(comm_zqfi_omp)
+  deallocate(comm_zdtlc)
 
   end subroutine deallocate_comm_wrf
Index: trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90
===================================================================
--- trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90	(revision 3660)
+++ trunk/LMDZ.TITAN/libf/phytitan/physiq_mod.F90	(revision 3661)
@@ -46,7 +46,8 @@
 #else
 use comm_wrf, only : comm_HR_SW, comm_HR_LW, &
-                     comm_FLUXTOP_DN,comm_FLUXABS_SW,&
-                     comm_FLUXTOP_LW,comm_FLUXSURF_SW,&
-                     comm_FLUXSURF_LW,comm_FLXGRD
+                     comm_FLUXTOP_DN, comm_FLUXABS_SW,&
+                     comm_FLUXTOP_LW, comm_FLUXSURF_SW,&
+                     comm_FLUXSURF_LW, comm_FLXGRD,&
+                     comm_zqfi_omp, comm_zdtlc
 #endif
 #ifdef CPP_XIOS      
@@ -138,5 +139,5 @@
 !    pdv(ngrid,nlayer)         \  Temporal derivative of the corresponding
 !    pdt(ngrid,nlayer)         /  variables due to physical processes.
-!    pdq(ngrid,nlayer)        /
+!    pdq(ngrid,nlayer,nq)     /
 !    pdpsrf(ngrid)           /
 !
@@ -331,5 +332,5 @@
       character*2 :: str2
 
-#ifndef MESOSCALE
+!#ifndef MESOSCALE
 
 ! Local variables for Titan chemistry and microphysics
@@ -363,5 +364,23 @@
 #endif
 
-      logical file_ok
+#ifdef MESOSCALE
+      LOGICAL, SAVE ::  moyzon_ch ! used for zonal averages in Titan
+      REAL, ALLOCATABLE :: zplevbar(:,:)
+      REAL, ALLOCATABLE :: zplaybar(:,:)
+      REAL, ALLOCATABLE :: ztfibar(:,:)
+      REAL, ALLOCATABLE :: zqfibar(:,:,:)
+      REAL, ALLOCATABLE :: zphibar(:,:)
+      REAL, ALLOCATABLE :: zphisbar(:)
+      REAL, ALLOCATABLE :: zzlevbar(:,:)
+      REAL, ALLOCATABLE :: zzlaybar(:,:)
+!     REAL, DIMENSION(:,:)   :: zplevbar(:,:)
+!     REAL, DIMENSION(:,:)   :: zplaybar(:,:)
+!     REAL, DIMENSION(:,:)   :: ztfibar(:,:)
+!     REAL, DIMENSION(:,:,:) :: zqfibar(:,:,:)
+!     REAL, DIMENSION(:,:)   :: zphibar(:,:)
+!     REAL, DIMENSION(:)     :: zphisbar(:)
+!     REAL, DIMENSION(:,:)   :: zzlevbar(:,:)
+!     REAL, DIMENSION(:,:)   :: zzlaybar(:,:)
+#endif
 
 !-----------------------------------------------------------------------------
@@ -385,6 +404,8 @@
     END INTERFACE
 
-#endif
-      
+!#endif
+      
+      logical file_ok
+
 !==================================================================================================
 
@@ -447,5 +468,5 @@
            int_dtauv(:,:,:) = 0.D0
           
-#ifndef MESOSCALE 
+!#ifndef MESOSCALE 
            IF (callmufi .AND. (.NOT. uncoupl_optic_haze)) THEN
              haze_opt_file=trim(datadir)//'/optical_tables/HAZE_OPTIC_'//trim(adjustl(tmp1))//'x'//trim(adjustl(tmp2))//'.DAT'
@@ -459,12 +480,15 @@
               endif
            ENDIF
-#endif           
+!#endif           
 
          endif
+
+#ifdef MESOSCALE
+         moyzon_ch = .false. !no zonal mean for mesoscale
+#endif
 
 #ifndef MESOSCALE
 !        Initialize names and timestep for chemistry
 !        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
          if (callchim) then
 
@@ -479,4 +503,5 @@
 
          endif
+#endif
 
 !        Initialize microphysics.
@@ -491,5 +516,4 @@
 
          ENDIF
-#endif
 
 #ifdef CPP_XIOS
@@ -717,5 +741,5 @@
       ! JVO 19 : We shall always have correct altitudes in chemistry no matter what's in physics
       ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#ifndef MESOSCALE
+!#ifndef MESOSCALE
       if (moyzon_ch) then ! Zonal averages
          
@@ -748,5 +772,5 @@
 
       else !  if not moyzon
-#endif
+!#endif
       
         DO ig=1,ngrid
@@ -763,7 +787,7 @@
         ENDDO
 
-#ifndef MESOSCALE
+!#ifndef MESOSCALE
       endif  ! moyzon
-#endif
+!#endif
 
       ! -------------------------------------------------------------------------------------
@@ -1065,5 +1089,4 @@
       if (tracer) then
 
-#ifndef MESOSCALE
    ! -------------------
    !   V.1 Microphysics
@@ -1072,5 +1095,4 @@
          ! We must call microphysics before chemistry, for condensation !
          if (callmufi) then
-
             zzlev(:,nlayer+1)=zzlay(:,nlayer)+(zzlay(:,nlayer)-zzlev(:,nlayer)) ! JVO 19 : We assume zzlev isn't reused later on (could be done cleaner)
 
@@ -1148,4 +1170,5 @@
          endif ! callmufi
       
+#ifndef MESOSCALE
   ! -----------------
   !   V.2. Chemistry
@@ -1292,5 +1315,5 @@
          endif ! end of 'callchim'
 
-! END MESOSCALE
+!! END ifndef MESOSCALE
 #endif
 
@@ -2010,4 +2033,6 @@
       comm_FLXGRD(1:ngrid)=fluxgrd(1:ngrid)
       sensibFlux(1:ngrid) = zflubid(1:ngrid) - capcal(1:ngrid)*zdtsdif(1:ngrid)
+      comm_zqfi_omp(1:ngrid,1:nlayer,1:nq) = zq(1:ngrid,1:nlayer,1:nq)
+      comm_zdtlc(1:ngrid,1:nlayer) = zdtlc(1:ngrid,1:nlayer)
 #endif      
 
Index: trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/callphysiq_mod.F
===================================================================
--- trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/callphysiq_mod.F	(revision 3661)
+++ trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/callphysiq_mod.F	(revision 3661)
@@ -0,0 +1,72 @@
+!
+! $Id: $
+!
+MODULE callphysiq_mod
+
+IMPLICIT NONE
+
+CONTAINS
+
+SUBROUTINE call_physiq(planet_type,klon,llm,nqtot,                  &
+                       debut_split,lafin_split)
+ 
+  USE variables_mod
+  USE physiq_mod, ONLY: physiq
+  use phys_state_var_mod , only : qsurf
+  use comm_wrf, only : allocate_comm_wrf
+  use tracer_h, only: noms
+ 
+  IMPLICIT NONE
+  character(len=10),INTENT(IN) :: planet_type ! planet type ('earth','mars',...)
+  INTEGER,INTENT(IN) :: klon ! (local) number of atmospheric columns
+  INTEGER,INTENT(IN) :: llm  ! number of atmospheric layers
+  INTEGER,INTENT(IN) :: nqtot ! number of tracers
+  LOGICAL,INTENT(IN) :: debut_split ! .true. if very first call to physics
+  LOGICAL,INTENT(IN) :: lafin_split ! .true. if last call to physics
+
+  ! Local variables
+!  CHARACTER(len=11) :: modname="call_physiq"
+
+! Sanity check on physics package type
+  IF (debut_split) THEN
+    IF (planet_type.ne."titan") THEN
+     PRINT*,"wrong planet_type for this physics package"
+     STOP
+    ENDIF
+  ENDIF
+
+  !qsurf(:,:)=zqfi_omp(:,1,:)
+  !JL22 what is this, why in the world would we want to put the value of the last layer at the surface
+  ! these two quantities do not even have the same units (kg/kg and kg/m^2)!!!
+  ! seems it is the same for some other physics. It is probably a bug.
+  !EMo25 zqfi_omp in kg/kghumidair?
+
+  call allocate_comm_wrf(klon,llm,nqtot)
+! Call physics package with required inputs/outputs
+  CALL physiq(klon,           & ! ngrid
+              llm,            & ! nlayer
+              nqtot,          & ! nq
+              noms,           & ! nametrac
+              debut_split,    & ! firstcall
+              lafin_split,    & ! lastcall
+              jD_cur,         & ! pday
+              jH_cur_split,   & ! ptime
+              zdt_split,      & ! ptimestep
+              zplev_omp,      & ! pplev
+              zplay_omp,      & ! pplay
+              zphi_omp,       & ! pphi
+              zufi_omp,       & ! pu
+              zvfi_omp,       & ! pv
+              ztfi_omp,       & ! pt
+              zqfi_omp,       & ! pq
+              flxwfi_omp,     & ! flxw
+              zdufi_omp,      & ! pdu
+              zdvfi_omp,      & ! pdv
+              zdtfi_omp,      & ! pdt
+              zdqfi_omp,      & ! pdq
+              zdpsrf_omp)       ! pdpsrf
+
+
+END SUBROUTINE call_physiq
+
+END MODULE callphysiq_mod
Index: trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/iniphysiq_mod.F
===================================================================
--- trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/iniphysiq_mod.F	(revision 3661)
+++ trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/iniphysiq_mod.F	(revision 3661)
@@ -0,0 +1,173 @@
+MODULE iniphysiq_mod
+
+CONTAINS
+
+subroutine iniphysiq(ngrid,nlayer,nq,piphysiq,&
+                     punjours, pdayref, &
+                     prad,pg,pr,pcpp,iflag_phys)
+
+!use control_mod, only: nday
+!use surf_heat_transp_mod, only: ini_surf_heat_transp
+!use infotrac, only : nqtot ! number of advected tracers
+!USE comvert_mod, ONLY: ap,bp,preff
+use inifis_mod, only: inifis
+use ioipsl_getin_p_mod, only: getin_p
+
+!use inigeomphy_mod, only: inigeomphy
+!use geometry_mod, only: cell_area, & ! physics grid area (m2)
+!                        longitude, & ! longitudes (rad)
+!                        latitude ! latitudes (rad)
+! necessary to get klon_omp
+!USE mod_phys_lmdz_para, ONLY: klon_omp ! number of columns (on local omp grid)
+USE mod_phys_lmdz_para, ONLY: Init_phys_lmdz_para
+USE dimphy, ONLY: init_dimphy
+USE phys_state_var_mod
+!use planete_mod, only: year_day, periastr, apoastr, peri_day,&
+!                       obliquit, z0, lmixmin, emin_turb
+!                       init_planete_mod
+use planete_mod
+use time_phylmdz_mod, only: dtphys, daysec,day_ini
+use planete_mod, only: year_day, periastr, apoastr, peri_day,&
+                   obliquit, z0, lmixmin, emin_turb
+use surfdat_h,  only: emissiv,iceradius, &
+                    emisice,dtemisice
+use comcstfi_mod, only: omeg,mugaz
+use tracer_h, only: nqtot_p
+!use comm_wrf, only : allocate_comm_wrf
+USE variables_mod, only: zdt_split
+use mod_grid_phy_lmdz, only: nbp_lev, klon_glo
+
+implicit none
+
+INCLUDE 'mpif.h'
+
+REAL,intent(in) :: prad
+REAL,intent(in) :: pg
+REAL,intent(in) :: pr
+REAL,intent(in) :: pcpp
+REAL,intent(in) :: punjours
+!DOUBLE PRECISION,intent(in) :: ptimestep
+
+!real,intent(in) :: prad ! radius of the planet (m)
+!real,intent(in) :: pg ! gravitational acceleration (m/s2)
+!real,intent(in) :: pr ! ! reduced gas constant R/mu
+!real,intent(in) :: pcpp ! specific heat Cp
+!real,intent(in) :: punjours ! length (in s) of a standard day [daysec]
+integer,intent(in) :: pdayref ! reference day of for the simulation [day_ini]
+integer,intent(in) :: iflag_phys ! type of physics to be called
+
+integer :: nday=0 ! this is dummy for mesoscale (in dyn3d/control_mod)
+
+integer,intent(in) :: ngrid ! number of physics columns for this MPI process
+integer,intent(in) :: nlayer ! number of atmospheric layers
+integer,intent(in) :: nq ! number of tracers
+!real,intent(in) :: phour_ini   ! start time (fraction of day) of the run
+!0=<phour_ini<1
+real,intent(in) :: piphysiq   ! call physics every piphysiq dynamical timesteps
+!real :: latitude(ngrid),longitude(ngrid),cell_area(ngrid)
+!  real,intent(in) :: prefff ! reference surface pressure (Pa)
+!  real,intent(in) :: apf(nlayer+1) ! hybrid coordinate at interfaces
+!  real,intent(in) :: bpf(nlayer+1) 
+logical :: ok_slab_ocean
+real*8 :: lat(ngrid),long(ngrid),cellarea(ngrid)
+REAL*8 :: pprad,ppg,ppr,ppcpp,ppunjours
+!REAL*8 :: dummy 
+  ! the common part for all planetary physics
+  !------------------------------------------
+  ! --> initialize physics distribution, global fields and geometry
+  ! (i.e. things in phy_common or dynphy_lonlat)
+
+  ! the distinct part for all planetary physics (ie. things in phystd)
+  !------------------------------------------
+
+nbp_lev = nlayer ! emoisan
+klon_glo = 1 !emoisan !we run the physics as if we were in 1D
+CALL Init_phys_lmdz_para(1,1,1,MPI_COMM_WORLD)
+
+!call phys_state_var_init
+print*,'ngrid',ngrid,'nlayer',nlayer
+call init_dimphy(ngrid,nlayer)
+call phys_state_var_init(nqtot_p)
+! copy over preff , ap() and bp()
+!call ini_planete_mod(nlayer,prefff,apf,bpf)
+
+! for slab ocean, copy over some arrays
+ok_slab_ocean=.false. ! default value
+!call getin_p("ok_slab_ocean",ok_slab_ocean)
+!if (ok_slab_ocean) then
+!  call ini_surf_heat_transp(ip1jm,ip1jmp1,unsairez,fext,unsaire, &
+!                            cu,cuvsurcv,cv,cvusurcu,aire,apoln,apols, &
+!                            aireu,airev)
+!endif
+
+!dummy=1. !used before instead of zdt_split (EMoi)
+lat(:)=0.
+long(:)=0.
+cellarea(:)=1.
+print*,'pg',pg
+!ppunjours=punjours
+ppunjours=1.
+pprad=prad
+ppg=pg
+ppr=pr
+ppcpp=pcpp
+call inifis(ngrid,nlayer,nq,pdayref,ppunjours,nday,zdt_split, &
+            lat,long,cellarea,pprad,ppg,ppr,ppcpp)
+
+     open(17,file='controle.txt',form='formatted',status='old')
+     rewind(17)
+     read(17,*)
+     read(17,*)
+     read(17,*) day_ini !(tab0+3)
+     read(17,*)
+     read(17,*) !tab0+5)
+     read(17,*) !omeg !(tab0+6)
+     read(17,*) !(tab0+7)
+     read(17,*) !mugaz
+     read(17,*)  !(tab0+9)
+     read(17,*) daysec
+     read(17,*) dtphys !tab0+11)
+     read(17,*)
+     read(17,*)
+     read(17,*) year_day !(tab0+14)
+     read(17,*) periastr !tab0+15)
+     read(17,*) apoastr !tab0+16)
+     read(17,*) peri_day !tab0+17)
+     read(17,*) obliquit !tab0+18)
+     read(17,*) z0
+     read(17,*)
+     read(17,*)
+     read(17,*)
+     read(17,*)
+     read(17,*) emisice(1)
+     read(17,*) emisice(2)
+     read(17,*) emissiv
+     read(17,*)
+     read(17,*)
+     read(17,*)
+     read(17,*)
+     read(17,*) iceradius(1)
+     read(17,*) iceradius(2)
+     read(17,*) dtemisice(1)
+     read(17,*) dtemisice(2)
+     close(17)
+     !print*,'g',g
+
+     !emissiv(:)=EMIS
+!    cloudfrac(:,:)=0.5
+!    totcloudfrac(:)=0.5
+!    hice(:)=0.
+!    rnat(:)=0.
+!    pctsrf_sic(:)=0.
+!    tsea_ice(:)=0.
+     !qsurf(:,:) = 0. 
+     print*,'check'
+     print*,'iceradius',iceradius,'dtemisice',dtemisice
+     print*,'apoastr,periastr,year_day,peri_day,obliq',apoastr,periastr,year_day,peri_day,obliquit
+     print*,'emissiv',emissiv
+     print*,'mugaz',mugaz
+     
+end subroutine iniphysiq
+
+
+END MODULE iniphysiq_mod
Index: trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/update_inputs_physiq_mod.F
===================================================================
--- trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/update_inputs_physiq_mod.F	(revision 3661)
+++ trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/update_inputs_physiq_mod.F	(revision 3661)
@@ -0,0 +1,574 @@
+MODULE update_inputs_physiq_mod
+
+CONTAINS
+
+!SUBROUTINE update_inputs_physiq_time
+!SUBROUTINE update_inputs_physiq_tracers
+!SUBROUTINE update_inputs_physiq_constants
+!SUBROUTINE update_inputs_physiq_geom
+!SUBROUTINE update_inputs_physiq_surf
+!SUBROUTINE update_inputs_physiq_soil
+!SUBROUTINE update_inputs_physiq_turb
+!SUBROUTINE update_inputs_physiq_rad
+!SUBROUTINE update_inputs_physiq_slope
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_time(&
+            JULYR,JULDAY,GMT,&
+            elaps,&
+            lct_input,lon_input,ls_input,&
+            MY)
+  USE variables_mod, only: JD_cur,JH_cur_split,phour_ini
+  use callkeys_mod, only : tlocked
+  INTEGER, INTENT(IN) :: JULDAY, JULYR
+  REAL, INTENT(IN) :: GMT,elaps,lon_input,ls_input,lct_input
+  REAL,INTENT(OUT) :: MY
+  REAL :: sec,nsec
+  !IF (JULYR .le. 8999) THEN
+    if (tlocked .eqv. .false.) THEN
+      JH_cur_split = (GMT + elaps/3600.) !! universal time (0<JH_cur_split<1): JH_cur_split=0.5 at 12:00 UT 
+      JH_cur_split = MODULO(JH_cur_split,24.)   !! the two arguments of MODULO must be of the same type 
+      JH_cur_split = JH_cur_split / 24.
+      JD_cur = (JULDAY - 1 + INT((3600.0*GMT+elaps)/86400))
+      JD_cur = MODULO(int(JD_cur),2)
+      MY = (JULYR-2000) + (86400*(JULDAY - 1)+3600.0*GMT+elaps)/31968000
+      MY = INT(MY)
+  !  ELSE
+  !    JH_cur_split = (GMT)! + elaps/420000.) !! universal time (0<JH_cur_split<1): JH_cur_split=0.5 at 12:00 UT 
+  !    JH_cur_split = MODULO(JH_cur_split,24.)   !! the two arguments of MODULO must be of the same type 
+  !    JH_cur_split = JH_cur_split / 24.
+  !    JD_cur = (JULDAY - 1 + INT((3600*GMT)/86400))!+elaps)/1.008e7))
+  !    JD_cur = MODULO(int(JD_cur),2)
+  !    MY = (JULYR-2000) + (86400*(JULDAY - 1)+3600*GMT+elaps)/31968000
+  !    MY = INT(MY)
+  !  ENDIF
+  !ELSE
+  !  if (tlocked .eqv. .false.) THEN
+  !    JH_cur_split = lct_input - lon_input / 15. + elaps/1500.0
+  !    JD_cur =  INT((sec*(lct_input - lon_input / 15.) + elaps)/36000)
+  !    !ptime = lct_input - lon_input / 15. + elaps/3600.
+  !    !pday =  INT((3600*(lct_input - lon_input / 15.) + elaps)/86400)
+  ELSE
+       JH_cur_split = 0.
+       JD_cur = 0.
+  !    !pday =  INT((sec*(lct_input - lon_input / 15.)+ elaps)/36000)
+  !    JD_cur =  INT((sec*(lct_input - lon_input / 15.))/3600)
+  !    !print*,'ptime',ptime
+  !    !print*,'pday',pday 
+  !  !pday =  INT((3600*(lct_input - lon_input / 15.) + elaps)/86400)
+  !    JH_cur_split = MODULO(ptime,24.)
+  !    JH_cur_split = JH_cur_split / 24.
+  !    JD_cur = MODULO(int(pday),365)
+  !    MY = 2024
+  !  ENDIF
+  ENDIF
+
+
+END SUBROUTINE update_inputs_physiq_time
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_tracers(TRACER_MODE,nq)
+
+  use tracer_h, only: noms,nqtot_p
+  INTEGER, INTENT(IN) :: TRACER_MODE
+  INTEGER, INTENT(OUT) :: nq
+  INTEGER :: i,k
+  logical :: end_of_file
+
+  !! TRACERS
+      
+                 !! tableau dans tracer_mod.F90
+  if ((TRACER_MODE .eq. 1) .or. ((TRACER_MODE .ge. 42) .and. (TRACER_MODE .le. 45))) THEN
+    nqtot_p=2
+    IF (.not.ALLOCATED(noms)) ALLOCATE(noms(nqtot_p)) !! est fait dans initracer normalement
+    noms(1)="h2o_vap"
+    noms(2)="h2o_ice"
+  else if (TRACER_MODE .eq. 61) THEN
+    nqtot_p=8
+    IF (.not.ALLOCATED(noms)) ALLOCATE(noms(nqtot_p)) !! est fait dans initracer normalement
+    noms(1)="mu_m0as"
+    noms(2)="mu_m3as"
+    noms(3)="mu_m0af"
+    noms(4)="mu_m3af"
+    noms(5)="mu_m0n"
+    noms(6)="mu_m3n"
+    noms(7)="mu_m3CH4"
+    noms(8)="CH4"
+  else
+    nq=1 ! why not nqtot_p?
+    IF (.not.ALLOCATED(noms)) ALLOCATE(noms(nqtot_p)) !! est fait dans initracer normalement
+    noms(:)="zolbxs"
+  endif
+  nq=nqtot_p
+
+END SUBROUTINE update_inputs_physiq_tracers
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_constants
+
+   use planete_mod, only: year_day, periastr, apoastr, peri_day,&
+                       obliquit, z0, lmixmin, emin_turb
+   use surfdat_h,  only: emissiv,iceradius, &
+                         emisice,dtemisice
+   !                       z0_default
+   use comcstfi_mod, only: rad, omeg, g, mugaz, rcp, cpp, r
+!  use phys_state_var_mod, only :cloudfrac,totcloudfrac,hice,rnat,pctsrf_sic,tsea_ice
+   !JL22 this routine does not do anything for the generic interface
+   ! The various use abave can surely be removed.
+END SUBROUTINE update_inputs_physiq_constants
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_geom( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            JULYR,ngrid,nlayer,&
+            DX,DY,MSFT,&
+            lat_input, lon_input,&
+            XLAT,XLONG)
+
+   ! in WRF (share)
+   USE module_model_constants, only: DEGRAD,p0
+   ! in LMD (phymars)
+   !use comgeomfi_h, only: ini_fillgeom
+   ! in LMD (phy_common)
+   USE mod_grid_phy_lmdz, ONLY: init_grid_phy_lmdz
+   USE geometry_mod, ONLY: latitude,latitude_deg,&
+                           longitude,longitude_deg,&
+                           cell_area
+   use comdiurn_h, only: sinlat, coslat, sinlon, coslon
+   !use planetwide_mod, only: planetwide_sumval
+   use comgeomfi_h, only: totarea, totarea_planet
+   use planete_mod, only: ini_planete_mod
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,JULYR,ngrid,nlayer
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN)  :: &
+     MSFT,XLAT,XLONG
+   REAL, INTENT(IN) :: dx,dy
+   REAL, INTENT(IN) :: lat_input, lon_input
+   INTEGER :: i,j,subs,ig,k
+   REAL,DIMENSION(ngrid) :: plon, plat, parea
+   REAL, DIMENSION(nlayer+1) :: znw
+   REAL*8, DIMENSION(nlayer+1) :: apdyn,bpdyn
+   REAL :: ptop
+   REAL*8 :: PP0
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+    !-----------------------------------!
+    ! 1D subscript for physics "cursor" !
+    !-----------------------------------!
+    subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+    !----------------------------------------!
+    ! Surface of each part of the grid (m^2) !  
+    !----------------------------------------!
+    !parea(subs) = dx*dy                           !! 1. idealized cases - computational grid
+    parea(subs) = (dx/msft(i,j))*(dy/msft(i,j))    !! 2. WRF map scale factors - assume that msfx=msfy (msf=covariance)
+    !parea(subs)=dx*dy/msfu(i,j)                   !! 3. special for Mercator GCM-like simulations
+
+    !---------------------------------------------!
+    ! Mass-point latitude and longitude (radians) !
+    !---------------------------------------------!
+    IF (JULYR .le. 8999) THEN
+     plat(subs) = XLAT(i,j)*DEGRAD
+     plon(subs) = XLONG(i,j)*DEGRAD
+    ELSE
+     !!! IDEALIZED CASE
+     IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION lat: ',lat_input
+     IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION lon: ',lon_input
+     plat(subs) = lat_input*DEGRAD
+     plon(subs) = lon_input*DEGRAD
+    ENDIF 
+
+   ENDDO
+   ENDDO
+
+   !! FILL GEOMETRICAL ARRAYS !!
+   !call ini_fillgeom(ngrid,plat,plon,parea)
+
+   !!! ----------------------------------------------------------
+   !!! --- initializing geometry in phy_common
+   !!! --- (this is quite planet-independent)
+   !!! ----------------------------------------------------------
+   ! initialize mod_grid_phy_lmdz
+   CALL init_grid_phy_lmdz(1,1,ipe-ips+1,jpe-jps+1,nlayer)
+   ! fill in geometry_mod variables
+   ! ... copy over local grid longitudes and latitudes
+   ! ... partly what is done in init_geometry
+   IF(.not.ALLOCATED(longitude)) ALLOCATE(longitude(ngrid))
+   IF(.not.ALLOCATED(longitude_deg)) ALLOCATE(longitude_deg(ngrid))
+   IF(.not.ALLOCATED(latitude)) ALLOCATE(latitude(ngrid))
+   IF(.not.ALLOCATED(latitude_deg)) ALLOCATE(latitude_deg(ngrid))
+   IF(.not.ALLOCATED(cell_area)) ALLOCATE(cell_area(ngrid))
+   longitude(:) = plon(:)
+   latitude(:) = plat(:)
+   longitude_deg(:) = plon(:)/DEGRAD
+   latitude_deg(:) = plat(:)/DEGRAD
+   cell_area(:) = parea(:)
+   totarea=ngrid*parea(1)
+   totarea_planet=ngrid*parea(1)
+
+   IF (.not.ALLOCATED(sinlat)) ALLOCATE(sinlat(ngrid))
+   IF (.not.ALLOCATED(coslat)) ALLOCATE(coslat(ngrid))
+   IF (.not.ALLOCATED(sinlon)) ALLOCATE(sinlon(ngrid))
+   IF (.not.ALLOCATED(coslon)) ALLOCATE(coslon(ngrid))
+   DO ig=1,ngrid
+     sinlat(ig)=sin(plat(ig))
+     coslat(ig)=cos(plat(ig))
+     sinlon(ig)=sin(plon(ig))
+     coslon(ig)=cos(plon(ig))
+   ENDDO
+   
+   open(unit=12,file='levels',form='formatted',status='old')
+   rewind(12)
+   DO k=1, nlayer
+   read(12,*) znw(k)
+   ENDDO
+   close(12)
+   
+   !! JL21 what is below is really weird. znw should be (p-ptop)/(ps-ptop).
+   !! and ap and bp should be used as p=ap+ps*bp. 
+   !! this works only if ptop is actually equal to ptop in wrf. This is not the case.
+   !! however the pressure in physiqu seems to be ok !!!!!!!!!!! So why are we doing that
+
+   ptop=0.5
+   apdyn=ptop*(1-znw)
+   bpdyn=znw
+   PP0=p0
+   CALL ini_planete_mod(nlayer,PP0,apdyn,bpdyn)
+   !!! ----------------------------------------------------------
+
+END SUBROUTINE update_inputs_physiq_geom
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_surf( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            JULYR,TRACER_MODE,&
+            P_ALBEDO,CST_AL,&
+            P_TSURF,P_EMISS,P_CO2ICE,&
+            P_GW,P_Z0,CST_Z0,&
+            P_H2OICE,&
+            phisfi_val)
+
+   use surfdat_h, only: phisfi, albedodat,  &
+                       zmea, zstd, zsig, zgam, zthe
+   use planete_mod, only: z0
+   use phys_state_var_mod, only : tsurf, emis, qsurf !,tslab
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,JULYR,TRACER_MODE
+   INTEGER :: i,j,subs,nlast,iq
+   REAL, INTENT(IN  ) :: CST_AL, phisfi_val, CST_Z0
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN)  :: &
+     P_ALBEDO,P_TSURF,P_EMISS,P_CO2ICE,P_H2OICE,P_Z0
+   REAL, DIMENSION( ims:ime, 5, jms:jme ), INTENT(IN   )  :: P_GW  
+
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     !---------------------!
+     ! Ground geopotential !
+     !---------------------!
+     phisfi(subs) = phisfi_val
+     !---------------!
+     ! Ground albedo !
+     !---------------!
+     IF (JULYR .le. 8999) THEN 
+      IF (CST_AL == 0) THEN
+       albedodat(subs)=P_ALBEDO(i,j)
+      ELSE 
+       albedodat(subs)=CST_AL
+       IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** SET CONSTANT ALBEDO ', albedodat
+      ENDIF
+     ELSE
+      IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION albedo: ', CST_AL
+      albedodat(subs)=CST_AL
+     ENDIF
+
+     !-----------------------------------------!
+     ! Gravity wave parametrization            !
+     ! NB: usually 0 in mesoscale applications !
+     !-----------------------------------------!
+     zmea(subs)=0.
+     zstd(subs)=0.
+     zsig(subs)=0.
+     zgam(subs)=0.
+     zthe(subs)=0.
+
+     !----------------------------!
+     ! Variable surface roughness !
+     !----------------------------!
+     z0 = CST_Z0
+     
+     !-----------------------------------------------!
+     ! Ground temperature, emissivity, CO2 ice cover !
+     !-----------------------------------------------!
+     tsurf(subs) = P_TSURF(i,j)
+     emis(subs) = P_EMISS(i,j)     
+     !do i=1,noceanmx
+!    tslab(subs,:)=tsurf(subs)
+     !enddo
+     !-------------------!
+     ! Tracer at surface !
+     !-------------------!
+     qsurf(subs,:)=0. ! default case
+     SELECT CASE (TRACER_MODE)
+       CASE(1)
+         qsurf(subs,2)=P_H2OICE(i,j)  !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
+                                      !! ----- retrocompatible ancienne physique
+                                      !! ----- [H2O ice is last tracer in qsurf in LMD physics]
+     END SELECT
+
+   ENDDO
+   ENDDO
+  
+   !!---------------------!!
+   !! OUTPUT FOR CHECKING !!
+   !!---------------------!!
+   nlast = (ipe-ips+1)*(jpe-jps+1)
+   print*,"check: phisfi",phisfi(1),phisfi(nlast)
+   print*,"check: albedodat",albedodat(1),albedodat(nlast)
+   print*,"check: zmea",zmea(1),zmea(nlast)
+   print*,"check: zstd",zstd(1),zstd(nlast)
+   print*,"check: zsig",zsig(1),zsig(nlast)
+   print*,"check: zgam",zgam(1),zgam(nlast)
+   print*,"check: zthe",zthe(1),zthe(nlast)
+   print*,"check: z0",z0
+   print*,"check: tsurf",tsurf(1),tsurf(nlast)
+   print*,"check: emis",emis(1),emis(nlast)
+   print*,"check: qsurf",qsurf(1,:),qsurf(nlast,:)
+
+END SUBROUTINE update_inputs_physiq_surf
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_soil( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            JULYR,nsoil,&
+            P_TI,CST_TI,&
+            P_ISOIL,P_DSOIL,&
+            P_TSOIL,P_TSURF)
+
+   use comsoil_h, only: inertiedat,mlayer,layer,volcapa
+   use phys_state_var_mod, only: tsoil
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,JULYR,nsoil
+   INTEGER :: i,j,subs,nlast
+   REAL, INTENT(IN  ) :: CST_TI 
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN)  :: &
+     P_TI, P_TSURF
+   REAL, DIMENSION( ims:ime, nsoil, jms:jme ), INTENT(IN)  :: &
+     P_TSOIL, P_ISOIL, P_DSOIL
+   REAL :: inertiedat_val
+   REAL :: lay1,alpha
+
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     !-----------------!
+     ! Thermal Inertia !
+     !-----------------!
+     IF (JULYR .le. 8999) THEN
+      IF (CST_TI == 0) THEN
+       inertiedat_val=P_TI(i,j)
+      ELSE
+       inertiedat_val=CST_TI
+       IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** SET CONSTANT THERMAL INERTIA ', inertiedat_val
+      ENDIF
+     ELSE
+      IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION inertia: ',CST_TI
+      inertiedat_val=CST_TI
+     ENDIF
+     !inertiedat(subs) = inertiedat_val
+     !--pb de dimensions???!!???
+     IF (JULYR .le. 8999) THEN
+       inertiedat(subs,:)=P_ISOIL(i,:,j) !! verifier que cest bien hires TI en surface
+       mlayer(0:nsoil-1)=P_DSOIL(i,:,j)
+     ELSE
+        IF ( nsoil .lt. 18 ) THEN
+            PRINT *,'** Mars ** WRONG NUMBER OF SOIL LAYERS. SHOULD BE 18 AND IT IS ',nsoil
+        ENDIF
+        IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION isoil and dsoil standard'
+        do k=1,nsoil
+         inertiedat(subs,k) = inertiedat_val
+         !mlayer(k-1) = sqrt(887.75/3.14)*((2.**(k-0.5))-1.) * inertiedat_val / wvolcapa    ! old setting
+         mlayer(k-1) = 2.E-4 * (2.**(k-0.5-1.))                                            ! new gcm settings
+        enddo
+     ENDIF
+     IF ( (i == ips) .AND. (j == jps) ) &
+         PRINT *,'** Mars ** TI and depth profiles are',inertiedat(subs,:)!,mlayer(0:nsoil-1)
+
+     !!!!!!!!!!!!!!!!! DONE in soil_setting.F 
+     ! 1.5 Build layer(); following the same law as mlayer()
+     ! Assuming layer distribution follows mid-layer law:
+     ! layer(k)=lay1*alpha**(k-1)
+     lay1=sqrt(mlayer(0)*mlayer(1))
+     alpha=mlayer(1)/mlayer(0)
+     do k=1,nsoil
+       layer(k)=lay1*(alpha**(k-1))
+     enddo
+
+     !------------------------!
+     ! Deep soil temperatures ! 
+     !------------------------!
+     IF (P_TSOIL(i,1,j) .gt. 0. .and. JULYR .le. 8999) THEN
+       tsoil(subs,:)=P_TSOIL(i,:,j)
+     ELSE
+       IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** no tsoil. set it to tsurf.'
+       do k=1,nsoil
+        tsoil(subs,k) = P_TSURF(i,j)
+       enddo
+     ENDIF
+
+   ENDDO
+   ENDDO
+
+   volcapa=1.e6   
+
+   print*,'zolbxs'
+   !!---------------------!!
+   !! OUTPUT FOR CHECKING !!
+   !!---------------------!!
+   nlast = (ipe-ips+1)*(jpe-jps+1)
+   print*,"check: inertiedat",inertiedat(1,:),inertiedat(nlast,:)
+   print*,"check: mlayer",mlayer(:)
+   print*,"check: layer",layer(:)
+   print*,"check: tsoil",tsoil(1,:),tsoil(nlast,:)
+
+END SUBROUTINE update_inputs_physiq_soil
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_turb( &
+            ims,ime,jms,jme,kms,kme,&
+            ips,ipe,jps,jpe,&
+            RESTART,isles,&
+            P_Q2,P_WSTAR)
+
+   use turb_mod, only: q2,wstar,turb_resolved
+   !use phys_state_var_mod, only : q2,
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe
+   INTEGER :: i,j,subs,nlast      
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN)  :: P_WSTAR
+   REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(IN) :: P_Q2
+   LOGICAL, INTENT(IN ) :: RESTART,isles
+
+   !! to know if this is turbulence-resolving run or not
+
+   turb_resolved = isles
+   print*,'isles',isles
+
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     !PBL wind variance
+     IF (.not. restart) THEN
+      q2(subs,:) = 1.E-6      
+      wstar(subs)=0.
+     ELSE
+      q2(subs,:)=P_Q2(i,:,j)!
+      !q2(subs,:) = 1.e-3
+      wstar(subs)=P_WSTAR(i,j)
+     ENDIF
+
+   ENDDO
+   ENDDO
+  
+   !!---------------------!!
+   !! OUTPUT FOR CHECKING !!
+   !!---------------------!!
+   nlast = (ipe-ips+1)*(jpe-jps+1)
+   print*,"check: q2",q2(1,1)!,q2(nlast,:)
+   print*,"check: wstar",wstar(1),wstar(nlast)
+
+END SUBROUTINE update_inputs_physiq_turb
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_rad( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            RESTART,&
+            P_FLUXRAD)
+
+   !use dimradmars_mod, only: fluxrad
+   use phys_state_var_mod, only : fluxrad
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe
+   INTEGER :: i,j,subs,nlast      
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN)  :: P_FLUXRAD
+   LOGICAL, INTENT(IN ) :: RESTART
+
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     ! fluxrad_save
+     IF (.not. restart) THEN
+      fluxrad(subs)=0.
+     ELSE
+      fluxrad(subs)=P_FLUXRAD(i,j)
+     ENDIF
+     !! et fluxrad_sky ???!???
+
+   ENDDO
+   ENDDO
+  
+   !!---------------------!!
+   !! OUTPUT FOR CHECKING !!
+   !!---------------------!!
+   nlast = (ipe-ips+1)*(jpe-jps+1)
+   print*,"check: fluxrad",fluxrad(1),fluxrad(nlast)
+
+END SUBROUTINE update_inputs_physiq_rad
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_slope( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            JULYR,&
+            SLPX,SLPY)
+
+   !USE module_model_constants, only: DEGRAD
+   !USE slope_mod, ONLY: theta_sl, psi_sl
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,JULYR
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN)  :: SLPX,SLPY
+   INTEGER :: i,j,subs,nlast
+
+END SUBROUTINE update_inputs_physiq_slope
+
+END MODULE update_inputs_physiq_mod
Index: trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/update_outputs_physiq_mod.F
===================================================================
--- trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/update_outputs_physiq_mod.F	(revision 3661)
+++ trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/update_outputs_physiq_mod.F	(revision 3661)
@@ -0,0 +1,226 @@
+MODULE update_outputs_physiq_mod
+
+CONTAINS
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_outputs_physiq_surf( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            TRACER_MODE,&
+            P_TSURF,P_CO2ICE,&
+            P_H2OICE)
+
+   !use surfdat_h, only: tsurf, co2ice, qsurf
+   use phys_state_var_mod, only : tsurf,qsurf
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe
+   INTEGER, INTENT(IN) :: TRACER_MODE
+   INTEGER :: i,j,subs
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: &
+     P_TSURF,P_CO2ICE,P_H2OICE
+
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     !-------------------------------------------------------!
+     ! Save key variables for restart and output and nesting !  
+     !-------------------------------------------------------!
+     P_TSURF(i,j) = tsurf(subs)
+
+   ENDDO
+   ENDDO
+
+END SUBROUTINE update_outputs_physiq_surf
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_outputs_physiq_soil( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            nsoil,&
+            P_TSOIL)
+
+   !use comsoil_h, only: tsoil
+    use phys_state_var_mod, only : tsoil
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,nsoil
+   INTEGER :: i,j,subs
+   REAL, DIMENSION( ims:ime, nsoil, jms:jme ), INTENT(INOUT)  :: &
+     P_TSOIL
+
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     !-------------------------------------------------------!
+     ! Save key variables for restart and output and nesting !  
+     !-------------------------------------------------------!
+     P_TSOIL(i,:,j) = tsoil(subs,:)
+
+   ENDDO
+   ENDDO
+
+END SUBROUTINE update_outputs_physiq_soil
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_outputs_physiq_rad( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            P_FLUXRAD)
+
+   !use dimradmars_mod, only: fluxrad
+   use phys_state_var_mod, only : fluxrad
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe
+   INTEGER :: i,j,subs
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: P_FLUXRAD
+
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     !-------------------------------------------------------!
+     ! Save key variables for restart and output and nesting !  
+     !-------------------------------------------------------!
+     P_FLUXRAD(i,j) = fluxrad(subs)
+
+   ENDDO
+   ENDDO
+
+END SUBROUTINE update_outputs_physiq_rad
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_outputs_physiq_turb( &
+            ims,ime,jms,jme,kms,kme,&
+            ips,ipe,jps,jpe,kps,kpe,&
+            P_Q2,P_WSTAR,&
+            HFMAX,ZMAX,USTM,HFX)
+
+   use turb_mod, only: q2,wstar,ustar,sensibFlux!,&
+                        !hfmax_th,zmax_th
+   !use phys_state_var_mod, only : q2,sensibFlux
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe
+   INTEGER :: i,j,subs    
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: &
+     P_WSTAR,HFMAX,ZMAX,USTM,HFX
+   REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT) :: P_Q2
+  
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     !-------------------------------------------------------!
+     ! Save key variables for restart and output and nesting !  
+     !-------------------------------------------------------!
+     P_Q2(i,kps:kpe+1,j) = q2(subs,:)
+     P_WSTAR(i,j) = wstar(subs)
+     !! output only (arrays already in phys modules)
+     !HFMAX(i,j) = HFMAX_TH(subs)
+     !ZMAX(i,j) = ZMAX_TH(subs)
+     USTM(i,j) = ustar(subs)
+     HFX(i,j) = sensibFlux(subs) ! *-1 ?????
+
+   ENDDO
+   ENDDO
+
+END SUBROUTINE update_outputs_physiq_turb
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_outputs_physiq_diag( &
+            ims,ime,jms,jme,kms,kme,&
+            ips,ipe,jps,jpe,kps,kpe,&
+            HR_SW,HR_LW,HR_DYN,&
+            DT_RAD,&
+            CLOUDFRAC,TOTCLOUDFRAC,&
+            RH,&
+            DQICE,DQVAP,&
+            REEVAP,SURFRAIN,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
+            FLUXSURF_LW,FLXGRD,&
+            DTLSC,DTRAIN,DT_MOIST,&
+            H2OICE_REFF,LATENT_HF,&
+            DT_COND)
+
+   USE comm_wrf !! to get fields to be written from physiq
+
+   INTEGER, INTENT(IN) :: ims,ime,jms,jme,kms,kme
+   INTEGER, INTENT(IN) :: ips,ipe,jps,jpe,kps,kpe
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT) :: &
+     TOTCLOUDFRAC,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
+     FLUXSURF_LW,FLXGRD,LATENT_HF,REEVAP,SURFRAIN
+   REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: &
+     HR_SW,HR_LW,CLOUDFRAC,HR_DYN,DT_RAD,RH,DQICE,DQVAP,&
+     DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF,DT_COND
+   INTEGER :: i,j,subs
+
+   DO j = jps,jpe
+   DO i = ips,ipe
+
+     !-----------------------------------!
+     ! 1D subscript for physics "cursor" !
+     !-----------------------------------!
+     subs = (j-jps)*(ipe-ips+1)+(i-ips+1)
+
+     !! get diagnostics from physics
+     HR_SW(i,kps:kpe,j) = comm_HR_SW(subs,kps:kpe)
+     HR_LW(i,kps:kpe,j) = comm_HR_LW(subs,kps:kpe)
+     DT_RAD(i,kps:kpe,j) = HR_LW(i,kps:kpe,j) + HR_SW(i,kps:kpe,j)
+!    CLOUDFRAC(i,kps:kpe,j) = comm_CLOUDFRAC(subs,kps:kpe)
+!    TOTCLOUDFRAC(i,j) = comm_TOTCLOUDFRAC(subs)
+!    RH(i,kps:kpe,j) = comm_RH(subs,kps:kpe)
+!    DQICE(i,kps:kpe,j) = comm_DQICE(subs,kps:kpe)
+!    DQVAP(i,kps:kpe,j) = comm_DQVAP(subs,kps:kpe)
+     HR_DYN(i,kps:kpe,j) = comm_HR_DYN(subs,kps:kpe)
+     ALBEQ(i,j)=comm_ALBEQ(subs)
+     FLUXTOP_DN(i,j) = comm_FLUXTOP_DN(subs)
+     FLUXABS_SW(i,j) = comm_FLUXABS_SW(subs)
+     FLUXTOP_LW(i,j) = comm_FLUXTOP_LW(subs)
+     FLUXSURF_SW(i,j) = comm_FLUXSURF_SW(subs)
+     FLUXSURF_LW(i,j) = comm_FLUXSURF_LW(subs)
+     FLXGRD(i,j) = comm_FLXGRD(subs)
+     DT_COND(i,kps:kpe,j) = comm_ZDTLC(subs,kps:kpe)
+!    DTLSC(i,kps:kpe,j) = comm_DTLSC(subs,kps:kpe)
+!    DTRAIN(i,kps:kpe,j) = comm_DTRAIN(subs,kps:kpe)
+!    DT_MOIST(i,kps:kpe,j) = DTRAIN(i,kps:kpe,j) + DTLSC(i,kps:kpe,j)
+!    H2OICE_REFF(i,kps:kpe,j) = comm_H2OICE_REFF(subs,kps:kpe)
+!    LATENT_HF(i,j) = comm_LATENT_HF(subs)
+!    REEVAP(i,j) = comm_REEVAP(subs)
+!    SURFRAIN(i,j) = comm_SURFRAIN(subs)
+
+
+   ENDDO
+   ENDDO
+
+   CALL deallocate_comm_wrf
+
+END SUBROUTINE update_outputs_physiq_diag
+
+END MODULE update_outputs_physiq_mod
+
+
+
Index: trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/variables_mod.F
===================================================================
--- trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/variables_mod.F	(revision 3661)
+++ trunk/WRF.COMMON/INTERFACES_V4/dynphy_wrf_titan_lmd/variables_mod.F	(revision 3661)
@@ -0,0 +1,77 @@
+MODULE variables_mod
+
+IMPLICIT NONE
+
+REAL*8 :: JD_cur !pday !JD_cur ! Julian day
+REAL*8 :: JH_cur_split !ptime !JH_cur_split ! Julian hour (fraction of day)
+REAL*8 :: zdt_split !ptimestep !zdt_split ! time step over which the physics are evaluated
+REAL*8 :: phour_ini ! start time (fraction of day) of the run 0=<phour_ini<1
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zplev_omp !pplev !zplev_omp(klon,llm+1) ! interlayer pressure (Pa)
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zplay_omp !pplay !zplay_omp(klon,llm) ! mid-layer pressure (Pa)
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zpk_omp!(klon,llm)
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zphi_omp !pphi !zphi_omp(klon,llm) ! geopotential at midlayer
+REAL*8,DIMENSION(:),ALLOCATABLE :: zphis_omp!(klon) ! surface geopotential
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zufi_omp !pu !zufi_omp(klon,llm) ! zonal wind (m/s)
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zvfi_omp !pv !zvfi_omp(klon,llm) ! meridional wind (m/s)
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zrfi_omp!(klon,llm) ! relative wind vorticity, in s-1
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: ztfi_omp !pt !ztfi_omp(klon,llm) ! temperature (K)
+REAL*8,DIMENSION(:,:,:),ALLOCATABLE :: zqfi_omp !pq !zqfi_omp(klon,llm,nqtot) ! tracers (*/kg of air)
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: flxwfi_omp !flxw !flxwfi_omp(klon,llm) ! Vertical mass flux on lower mesh interfaces (kg/s) 
+! tendencies (in */s) from the physics:
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zdufi_omp !pdu !zdufi_omp(klon,llm) ! tendency on zonal winds
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zdvfi_omp !pdv !zdvfi_omp(klon,llm) ! tendency on meridional winds
+REAL*8,DIMENSION(:,:),ALLOCATABLE :: zdtfi_omp !pdt !zdtfi_omp(klon,llm) ! tendency on temperature
+REAL*8,DIMENSION(:,:,:),ALLOCATABLE :: zdqfi_omp !pdq !zdqfi_omp(klon,llm,nqtot) ! tendency on tracers
+REAL*8,DIMENSION(:),ALLOCATABLE :: zdpsrf_omp !pdpsrf !zdpsrf_omp(klon) ! tendency on surface pressure
+
+CONTAINS
+
+SUBROUTINE allocate_interface(klon,llm,nqtot)
+
+  IMPLICIT NONE
+ 
+  INTEGER,INTENT(IN) :: klon ! (local) number of atmospheric columns
+  INTEGER,INTENT(IN) :: llm  ! number of atmospheric layers
+  INTEGER,INTENT(IN) :: nqtot ! number of tracers
+ 
+  IF (.NOT.ALLOCATED(zplev_omp)) ALLOCATE(zplev_omp(klon,llm+1))
+  IF (.NOT.ALLOCATED(zplay_omp)) ALLOCATE(zplay_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zpk_omp)) ALLOCATE(zpk_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zphi_omp)) ALLOCATE(zphi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zphis_omp)) ALLOCATE(zphis_omp(klon))
+  IF (.NOT.ALLOCATED(zufi_omp)) ALLOCATE(zufi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zvfi_omp)) ALLOCATE(zvfi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zrfi_omp)) ALLOCATE(zrfi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(ztfi_omp)) ALLOCATE(ztfi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zqfi_omp)) ALLOCATE(zqfi_omp(klon,llm,nqtot))
+  IF (.NOT.ALLOCATED(flxwfi_omp)) ALLOCATE(flxwfi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zdufi_omp)) ALLOCATE(zdufi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zdvfi_omp)) ALLOCATE(zdvfi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zdtfi_omp)) ALLOCATE(zdtfi_omp(klon,llm))
+  IF (.NOT.ALLOCATED(zdqfi_omp)) ALLOCATE(zdqfi_omp(klon,llm,nqtot))
+  IF (.NOT.ALLOCATED(zdpsrf_omp)) ALLOCATE(zdpsrf_omp(klon))
+
+END SUBROUTINE allocate_interface
+
+SUBROUTINE deallocate_interface
+
+  DEALLOCATE(zplev_omp)
+  DEALLOCATE(zplay_omp)
+  DEALLOCATE(zpk_omp)
+  DEALLOCATE(zphi_omp)
+  DEALLOCATE(zphis_omp)
+  DEALLOCATE(zufi_omp)
+  DEALLOCATE(zvfi_omp)
+  DEALLOCATE(zrfi_omp)
+  DEALLOCATE(ztfi_omp)
+  DEALLOCATE(zqfi_omp)
+  DEALLOCATE(flxwfi_omp)
+  DEALLOCATE(zdufi_omp)
+  DEALLOCATE(zdvfi_omp)
+  DEALLOCATE(zdtfi_omp)
+  DEALLOCATE(zdqfi_omp)
+  DEALLOCATE(zdpsrf_omp)
+
+END SUBROUTINE deallocate_interface
+
+END MODULE variables_mod
Index: trunk/WRF.COMMON/INTERFACES_V4/module_lmd_driver.F
===================================================================
--- trunk/WRF.COMMON/INTERFACES_V4/module_lmd_driver.F	(revision 3660)
+++ trunk/WRF.COMMON/INTERFACES_V4/module_lmd_driver.F	(revision 3661)
@@ -48,5 +48,6 @@
         HFMAX,ZMAX,&
         USTM,HFX,&
-        SLPX,SLPY,RESTART)
+        SLPX,SLPY,RESTART,&
+        DT_COND)
 ! NB: module_lmd_driver_output1.inc : output arguments generated from Registry
 
@@ -114,5 +115,6 @@
      RTHPLATEN,RUPLATEN,RVPLATEN, &
      HR_SW,HR_LW,HR_DYN,DT_RAD,&
-     CLOUDFRAC,RH,DQICE,DQVAP,DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF
+     CLOUDFRAC,RH,DQICE,DQVAP,DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF,&
+     DT_COND
 REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT ) :: &
      P_Q2
@@ -445,4 +447,14 @@
     q_prof(:,2) = moist(i,kps:kpe,j,P_QC) / (1.d0 + moist(i,kps:kpe,j,P_QV))
     ! conversion from mass mixing ratio in WRF to specific concentration in Physiq
+ELSE IF (TRACER_MODE == 61) THEN
+    ! to be clean we should have an automatized process that makes sure that moist is sent to igcm_h2o_vap and etc.
+    q_prof(:,1) = SCALAR(i,kps:kpe,j,P_mu_m0as) / (1.d0 + SCALAR(i,kps:kpe,j,P_CH4))
+    q_prof(:,2) = SCALAR(i,kps:kpe,j,P_mu_m3as) / (1.d0 + SCALAR(i,kps:kpe,j,P_CH4))
+    q_prof(:,3) = SCALAR(i,kps:kpe,j,P_mu_m0af) / (1.d0 + SCALAR(i,kps:kpe,j,P_CH4))
+    q_prof(:,4) = SCALAR(i,kps:kpe,j,P_mu_m3af) / (1.d0 + SCALAR(i,kps:kpe,j,P_CH4))
+    q_prof(:,5) = SCALAR(i,kps:kpe,j,P_mu_m0n) / (1.d0 + SCALAR(i,kps:kpe,j,P_CH4))
+    q_prof(:,6) = SCALAR(i,kps:kpe,j,P_mu_m3n) / (1.d0 + SCALAR(i,kps:kpe,j,P_CH4))
+    q_prof(:,7) = SCALAR(i,kps:kpe,j,P_mu_m3CH4) / (1.d0 + SCALAR(i,kps:kpe,j,P_CH4))
+    q_prof(:,8) = SCALAR(i,kps:kpe,j,P_CH4) / (1.d0 + SCALAR(i,kps:kpe,j,P_CH4))
 ELSE
     q_prof(:,1:nq) = SCALAR(i,kps:kpe,j,2:nq+1)  !! the names were set above !! one dummy tracer in WRF
@@ -651,5 +663,6 @@
             DQICE,DQVAP,REEVAP,SURFRAIN,&
             ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
-            FLUXSURF_LW,FLXGRD,DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF,LATENT_HF)
+            FLUXSURF_LW,FLXGRD,DTLSC,DTRAIN,DT_MOIST,H2OICE_REFF,LATENT_HF,&
+            DT_COND)
 !!!
 !print *, '** ',planet_type,'** OUTPUT PHYSICS DONE'
@@ -739,4 +752,21 @@
       SCALAR(i,kps:kpe,j,P_MARKER) = SCALAR(i,kps:kpe,j,P_MARKER)*exp(-dt/tau_decay)
       SCALAR(i,1,j,P_MARKER) = 1. !! this tracer is emitted in the surface layer
+    CASE(61) !emoisan tobechecked
+      scalar(i,kps:kpe,j,P_mu_m0as)=scalar(i,kps:kpe,j,P_mu_m0as) &
+           +zdqfi_omp(subs,kps:kpe,1)*dt * (1.d0+scalar(i,kps:kpe,j,P_CH4))
+      scalar(i,kps:kpe,j,P_mu_m3as)=scalar(i,kps:kpe,j,P_mu_m3as) &
+           +zdqfi_omp(subs,kps:kpe,2)*dt * (1.d0+scalar(i,kps:kpe,j,P_CH4))
+      scalar(i,kps:kpe,j,P_mu_m0af)=scalar(i,kps:kpe,j,P_mu_m0af) &
+           +zdqfi_omp(subs,kps:kpe,3)*dt * (1.d0+scalar(i,kps:kpe,j,P_CH4))
+      scalar(i,kps:kpe,j,P_mu_m3af)=scalar(i,kps:kpe,j,P_mu_m3af) &
+           +zdqfi_omp(subs,kps:kpe,4)*dt * (1.d0+scalar(i,kps:kpe,j,P_CH4))
+      scalar(i,kps:kpe,j,P_mu_m0n)=scalar(i,kps:kpe,j,P_mu_m0n) &
+           +zdqfi_omp(subs,kps:kpe,5)*dt * (1.d0+scalar(i,kps:kpe,j,P_CH4))
+      scalar(i,kps:kpe,j,P_mu_m3n)=scalar(i,kps:kpe,j,P_mu_m3n) &
+           +zdqfi_omp(subs,kps:kpe,6)*dt * (1.d0+scalar(i,kps:kpe,j,P_CH4))
+      scalar(i,kps:kpe,j,P_mu_m3CH4)=scalar(i,kps:kpe,j,P_mu_m3CH4) &
+           +zdqfi_omp(subs,kps:kpe,7)*dt * (1.d0+scalar(i,kps:kpe,j,P_CH4))
+      scalar(i,kps:kpe,j,P_CH4)=scalar(i,kps:kpe,j,P_CH4) &
+           +zdqfi_omp(subs,kps:kpe,8)*dt * (1.d0+scalar(i,kps:kpe,j,P_CH4))
     CASE DEFAULT
       !SCALAR(i,kps:kpe,j,2:nq+1)=SCALAR(i,kps:kpe,j,2:nq+1)+zdqfi_omp(subs,kps:kpe,1:nq)*dt !!! here dt is needed
Index: trunk/WRF.COMMON/INTERFACES_V4/module_model_constants.F
===================================================================
--- trunk/WRF.COMMON/INTERFACES_V4/module_model_constants.F	(revision 3660)
+++ trunk/WRF.COMMON/INTERFACES_V4/module_model_constants.F	(revision 3661)
@@ -26,12 +26,12 @@
    REAL :: cp !          = 7.*r_d/2.  ! 
 
-   REAL    , PARAMETER :: r_v          = 461.6      ! gas constant for water vapor (J deg^-1 kg^-1)
+   REAL :: r_v !         = 461.6      ! gas constant for water vapor (J deg^-1 kg^-1)
    REAL :: cv !          = cp-r_d     ! Specific heat of air at contant volume (J deg^-1 kg^-1)
    REAL :: cpv !         = 4.*r_v
    REAL :: cvv !         = cpv-r_v    ! 
    REAL :: cvpm !        = -cv/cp
-   REAL    , PARAMETER :: cliq         = 4190.      ! specific heat of liquid water at 0^oC
-   REAL    , PARAMETER :: cice         = 2106.      ! specific heat of ice at 0^oC
-   REAL    , PARAMETER :: psat         = 610.78
+   REAL :: cliq !        = 4190.      ! specific heat of liquid water at 0^oC
+   REAL :: cice !        = 2106.      ! specific heat of ice at 0^oC
+   REAL :: psat !        = 610.78
    REAL :: rcv !         = r_d/cv     ! 
    REAL :: rcp !         = r_d/cp
@@ -49,7 +49,7 @@
    REAL :: reradius !     = 1./6370.0e03  ! reciprocal of earth radius (m^-1) 
 
-   REAL    , PARAMETER :: asselin      = .025
+   REAL    , PARAMETER :: asselin      = .025 ! for asselin filter?
 !   REAL    , PARAMETER :: asselin      = .0
-   REAL    , PARAMETER :: cb           = 25.
+   REAL :: cb !          = 25.
 
    REAL    , PARAMETER :: XLV0         = 3.15E6       !  constant defined for calculation of latent heating 
@@ -266,4 +266,5 @@
      g            = 1.35
      r_d          = 298.734319568
+     r_v          = 518.          ! gas constant for methane vapor at Titan (J.K-1.kg-1)
      cp           = 1038.72627727
      t0           = 94. ! earth : 300
