Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/LMD_LES_MARS_install
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/LMD_LES_MARS_install	(revision 2294)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/LMD_LES_MARS_install	(revision 2295)
@@ -26,4 +26,5 @@
   ln -sf ../../WRFV2/venus_lmd_new .
   ln -sf ../../WRFV2/generic_lmd_new .
+  ln -sf ../../WRFV2/titan_lmd_new .
   ln -sf ../modif_mars .
   ln -sf ../../WRFV2/*.h .
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/dynphy_wrf_titan_lmd_new
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/dynphy_wrf_titan_lmd_new	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/LES/modif_mars/dynphy_wrf_titan_lmd_new	(revision 2295)
@@ -0,0 +1,1 @@
+link ../../WRFV2/phys/dynphy_wrf_titan_lmd_new/
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/SCRIPTS/copy_model
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/SCRIPTS/copy_model	(revision 2294)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/SCRIPTS/copy_model	(revision 2295)
@@ -210,4 +210,24 @@
     mkdir $laphysiq/libf/filtrez
     ln -sf $WRFSRC/WRFV2/$laphysiq/libf/filtrez/* $laphysiq/libf/filtrez/
+  elif [[ "${laphysiq}" == *"titan"* ]]
+  then
+    ln -sf $WRFSRC/WRFV2/$laphysiq/arch* $laphysiq/
+    ln -sf $WRFSRC/WRFV2/$laphysiq/build_gcm $laphysiq/
+    ln -sf $WRFSRC/WRFV2/$laphysiq/makelmdz* $laphysiq/
+    ln -sf $WRFSRC/WRFV2/$laphysiq/create_make_gcm $laphysiq/
+    mkdir $laphysiq/libf/phytitan
+    ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phytitan/* $laphysiq/libf/phytitan/
+    cp -r $WRFSRC/WRFV2/$laphysiq/libf/phytitan/bands $laphysiq/libf/phytitan/
+    cp -r $WRFSRC/WRFV2/$laphysiq/libf/phytitan/scatterers $laphysiq/libf/phytitan/
+    mkdir $laphysiq/libf/chimtitan
+    ln -sf $WRFSRC/WRFV2/$laphysiq/libf/chimtitan/* $laphysiq/libf/chimtitan/
+    mkdir $laphysiq/libf/muphytitan
+    ln -sf $WRFSRC/WRFV2/$laphysiq/libf/muphytitan/* $laphysiq/libf/muphytitan/
+    mkdir $laphysiq/libf/phy_common
+    ln -sf $WRFSRC/WRFV2/$laphysiq/libf/phy_common/* $laphysiq/libf/phy_common/
+    mkdir $laphysiq/libf/misc
+    ln -sf $WRFSRC/WRFV2/$laphysiq/libf/misc/* $laphysiq/libf/misc/
+    mkdir $laphysiq/libf/filtrez
+    ln -sf $WRFSRC/WRFV2/$laphysiq/libf/filtrez/* $laphysiq/libf/filtrez/
   fi
   mkdir $laphysiq/libo
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/callphysiq_mod.F
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/callphysiq_mod.F	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/callphysiq_mod.F	(revision 2295)
@@ -0,0 +1,70 @@
+!
+! $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."generic") THEN
+     PRINT*,"wrong planet_type for this physics package"
+     STOP
+    ENDIF
+  ENDIF
+
+  qsurf(:,:)=zqfi_omp(:,1,:)
+  print*,'zdt_split',zdt_split
+
+  call allocate_comm_wrf(klon,llm)
+
+! 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/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/iniphysiq_mod.F
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/iniphysiq_mod.F	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/iniphysiq_mod.F	(revision 2295)
@@ -0,0 +1,169 @@
+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
+!use comm_wrf, only : allocate_comm_wrf
+
+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)
+  !------------------------------------------
+
+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)
+! 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.
+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,dummy, &
+            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/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/update_inputs_physiq_mod.F
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/update_inputs_physiq_mod.F	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/update_inputs_physiq_mod.F	(revision 2295)
@@ -0,0 +1,650 @@
+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 .ne. 9999) THEN
+    JH_cur_split = (GMT + elaps/57420.) !! 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((57420.*GMT+elaps)/1378080.))
+    JD_cur = MODULO(int(JD_cur),2)
+    MY = (JULYR-2000) + (1378080*(JULDAY - 1)+57420.*GMT+elaps)/2756160.
+    MY = INT(MY)
+  ELSE
+    JH_cur_split = lct_input - lon_input / 15. + elaps/57420.0
+    JD_cur =  INT((57420.0*(lct_input - lon_input / 15.) + elaps)/1378080)
+    JH_cur_split = MODULO(ptime,24.)
+    JH_cur_split = JH_cur_split / 24.
+    JD_cur = MODULO(int(pday),365)
+    MY = 2024
+  ENDIF
+
+END SUBROUTINE update_inputs_physiq_time
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_tracers(nq,MARS_MODE)
+
+  use tracer_h, only: noms,nqtot
+  !use phys_state_var_mod , only : qsurf
+  !USE dimphy, only : klon,klev 
+  INTEGER, INTENT(IN) :: nq,MARS_MODE
+  INTEGER :: i,k
+!  CHARACTER(len=20), INTENT(INOUT) :: tname(nq) ! tracer names
+  logical :: end_of_file
+
+  !! TRACERS
+  IF (.not.ALLOCATED(noms)) ALLOCATE(noms(nq)) !! est fait dans initracer normalement
+      
+                 !! tableau dans tracer_mod.F90
+  print*,'nq',nq
+  print*,'MARS_MODE',MARS_MODE
+  nqtot=nq
+  noms(:)="zolbxs"
+  !noms(:)=tname(:)
+  print*,'noms',noms
+  !!---------------------!!
+  !! OUTPUT FOR CHECKING !!
+  !!---------------------!!
+
+END SUBROUTINE update_inputs_physiq_tracers
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_inputs_physiq_constants
+
+   !USE module_model_constants
+   !use comcstfi_h, only: omeg,mugaz
+   !use planete_h,  only: year_day,periheli,aphelie, &
+   !                       peri_day,obliquit,emin_turb, &
+   !                       lmixmin
+   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 comsoil_h, only: volcapa
+   use comcstfi_mod, only: rad, omeg, g, mugaz, rcp, cpp, r
+   !! comcstfi_h
+   use phys_state_var_mod, only :cloudfrac,totcloudfrac,hice,rnat,pctsrf_sic,tsea_ice
+   !use iniorbit
+   !use time_phylmdz_mod, only: dtphys, daysec,day_ini
+  
+  
+     !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,*)  !(tab0+8)
+     !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) 
+     !cpp=(8.314511/(mugaz/1000.0))/rcp
+     !print*,'cpp',cpp
+     !print*,'g',g
+
+     !emissiv(:)=EMIS
+     !cloudfrac(:,:)=0.5
+     !totcloudfrac(:)=0.5
+     !hice(:)=0.
+     !rnat(:)=0.
+     !pctsrf_sic(:)=0.
+     !tsea_ice(:)=0.
+     !qsurf(:,:) = 0. 
+     !print*,'iceradius',iceradius,'dtemisice',dtemisice
+     !print*,'apoastr,periastr,year_day,peri_day,obliq',apoastr,periastr,year_day,peri_day,obliquit
+     !print*,'emissiv',emissiv
+ 
+     ! SUBROUTINE iniorbit(apoastr,periastr,year_day,peri_day,obliq)
+
+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 .ne. 9999) 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(:)
+   !call planetwide_sumval(parea,totarea_planet)
+   !print*,'parea',parea(1)
+   !totarea=SSUM(ngrid,parea,1)
+   totarea=ngrid*parea(1)
+   !totarea_planet=SSUM(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)
+   !write(6,*) 'read level ', k,grid%znw(k)
+   ENDDO
+   close(12)
+   
+   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,MARS_MODE,&
+            M_ALBEDO,CST_AL,&
+            M_TSURF,M_EMISS,M_CO2ICE,&
+            M_GW,M_Z0,CST_Z0,&
+            M_H2OICE,&
+            phisfi_val)
+
+   use surfdat_h, only: phisfi, albedodat,  &
+                       zmea, zstd, zsig, zgam, zthe
+   use slab_ice_h, only: noceanmx
+   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,MARS_MODE
+   INTEGER :: i,j,subs,nlast,iq
+   REAL, INTENT(IN  ) :: CST_AL, phisfi_val, CST_Z0
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN)  :: &
+     M_ALBEDO,M_TSURF,M_EMISS,M_CO2ICE,M_H2OICE,M_Z0
+   REAL, DIMENSION( ims:ime, 5, jms:jme ), INTENT(IN   )  :: M_GW  
+
+   !print*,'ALLOCATED(phisfi)',ALLOCATED(phisfi)
+   !print*,'size phisfi',size(phisfi)
+   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
+!     print*,'size phisfi',size(phisfi)
+     !print*,'phisfi',phisfi(subs)
+     !---------------!
+     ! Ground albedo !
+     !---------------!
+     IF (JULYR .ne. 9999) THEN 
+      IF (CST_AL == 0) THEN
+       albedodat(subs)=M_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
+     !IF (JULYR .ne. 9999) THEN
+     ! IF (CST_Z0 == 0) THEN
+     !  z0(subs) = M_Z0(i,j)
+     ! ELSE
+     !  z0(subs) = CST_Z0
+     !  IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** SET CONSTANT SURF ROUGHNESS (m) ',CST_Z0
+     ! ENDIF
+     !ELSE
+     ! IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** IDEALIZED SIMULATION z0 (m) ', CST_Z0
+     ! z0(subs)=CST_Z0
+     !ENDIF
+     !!!!! ADDITIONAL SECURITY. THIS MIGHT HAPPEN WITH OLD INIT FILES.
+     !IF (z0(subs) == 0.) THEN
+     !  IF ( (i == ips) .AND. (j == jps) ) PRINT *, 'WELL, z0 is 0, this is no good. Setting to old defaults value 0.01 m'
+     !  z0(subs) = 0.01
+     !ENDIF
+     !!!!! ADDITIONAL SECURITY. INTERP+SMOOTH IN GEOGRID MIGHT YIELD NEGATIVE Z0 !!!
+     !IF (z0(subs) < 0.) THEN
+     !  PRINT *, 'WELL, z0 is NEGATIVE, this is impossible. better stop here.'
+     !  PRINT *, 'advice --> correct interpolation / smoothing of z0 in WPS'
+     !  PRINT *, '           -- or check the constant value set in namelist.input'
+     !  STOP
+     !ENDIF
+
+     !-----------------------------------------------!
+     ! Ground temperature, emissivity, CO2 ice cover !
+     !-----------------------------------------------!
+     tsurf(subs) = M_TSURF(i,j)
+     emis(subs) = M_EMISS(i,j)     
+     !do i=1,noceanmx
+     tslab(subs,:)=tsurf(subs)
+     !enddo
+     !-------------------!
+     ! Tracer at surface !
+     !-------------------!
+     qsurf(subs,:)=0. ! default case
+     SELECT CASE (MARS_MODE)
+       CASE(1)
+       qsurf(subs,2)=M_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]
+       CASE(2)   
+       qsurf(subs,1)=0.                !! not coupled with lifting for the moment [non remobilise]
+       !CASE(3)
+       !qsurf(subs,1)=q_prof(1,1)                !!! temporaire, a definir       
+       !qsurf(subs,2)=q_prof(1,2)     
+       CASE(11)
+       qsurf(subs,2)=M_H2OICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
+       qsurf(subs,3)=0.                !! not coupled with lifting for the moment [non remobilise]
+       CASE(12)
+       qsurf(subs,2)=M_H2OICE(i,j)    !! logique avec noms(2) = 'h2o_ice' defini ci-dessus
+       qsurf(subs,3)=0.                !! not coupled with lifting for the moment [non remobilise]
+     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,&
+            M_TI,CST_TI,&
+            M_ISOIL,M_DSOIL,&
+            M_TSOIL,M_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)  :: &
+     M_TI, M_TSURF
+   REAL, DIMENSION( ims:ime, nsoil, jms:jme ), INTENT(IN)  :: &
+     M_TSOIL, M_ISOIL, M_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 .ne. 9999) THEN
+      IF (CST_TI == 0) THEN
+       inertiedat_val=M_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 .ne. 9999) THEN
+       inertiedat(subs,:)=M_ISOIL(i,:,j) !! verifier que cest bien hires TI en surface
+       mlayer(0:nsoil-1)=M_DSOIL(i,:,j)
+     ELSE
+        IF ( nsoil .lt. 18 ) THEN
+            PRINT *,'** Mars ** WRONG NUMBER OF SOIL LAYERS. SHOULD BE 18 AND IT IS ',nsoil
+            STOP
+        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 (M_TSOIL(i,1,j) .gt. 0. .and. JULYR .ne. 9999) THEN
+       tsoil(subs,:)=M_TSOIL(i,:,j)
+     ELSE
+       IF ( (i == ips) .AND. (j == jps) ) PRINT *,'** Mars ** no tsoil. set it to tsurf.'
+       do k=1,nsoil
+        !print*,'M_TSURF(i,j)',M_TSURF(1,:)
+        !print*,'size M_TSURF',size(M_TSURF)
+        !print*,'size tsoil',size(tsoil)
+        tsoil(subs,k) = M_TSURF(i,j)
+        !print*,'tsoil(subs,k)',tsoil(subs,k)
+       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,&
+            M_Q2,M_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)  :: M_WSTAR
+   REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(IN) :: M_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,:)=M_Q2(i,:,j)!
+      !q2(subs,:) = 1.e-3
+      wstar(subs)=M_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,&
+            M_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)  :: M_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)=M_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/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/update_outputs_physiq_mod.F
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/update_outputs_physiq_mod.F	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/update_outputs_physiq_mod.F	(revision 2295)
@@ -0,0 +1,202 @@
+MODULE update_outputs_physiq_mod
+
+CONTAINS
+
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+SUBROUTINE update_outputs_physiq_surf( &
+            ims,ime,jms,jme,&
+            ips,ipe,jps,jpe,&
+            MARS_MODE,&
+            M_TSURF,M_CO2ICE,&
+            M_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) :: MARS_MODE
+   INTEGER :: i,j,subs
+   REAL, DIMENSION( ims:ime, jms:jme ), INTENT(INOUT)  :: &
+     M_TSURF,M_CO2ICE,M_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 !  
+     !-------------------------------------------------------!
+     M_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,&
+            M_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)  :: &
+     M_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 !  
+     !-------------------------------------------------------!
+     M_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,&
+            M_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)  :: M_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 !  
+     !-------------------------------------------------------!
+     M_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,&
+            M_Q2,M_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)  :: &
+     M_WSTAR,HFMAX,ZMAX,USTM,HFX
+   REAL, DIMENSION( ims:ime, kms:kme+1, jms:jme ), INTENT(INOUT) :: M_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 !  
+     !-------------------------------------------------------!
+     M_Q2(i,kps:kpe+1,j) = q2(subs,:)
+     M_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,&
+            SWDOWNZ,TAU_DUST,QSURFDUST,&
+            MTOT,ICETOT,TAU_ICE,&
+            HR_SW,HR_LW,HR_DYN,DT,DTRAD,&
+            RDUST,VMR_ICE,RICE,&
+            CLOUDFRAC,TOTCLOUDFRAC,&
+            RAIN,SNOW,REEVAP,SURFRAIN,ALBEQ,FLUXTOP_DN,FLUXABS_SW,FLUXTOP_LW,FLUXSURF_SW,&
+            FLUXSURF_LW,FLXGRD,LSCEZ,H2OICE_REFF,LATENT_HF)
+
+   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) :: &
+     SWDOWNZ,TAU_DUST,QSURFDUST,&
+     MTOT,ICETOT,TAU_ICE,&
+     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,RDUST,VMR_ICE,RICE,CLOUDFRAC,HR_DYN,DT,DTRAD,RAIN,SNOW,&
+     LSCEZ,H2OICE_REFF
+   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)
+
+   ENDDO
+   ENDDO
+
+   CALL deallocate_comm_wrf
+
+END SUBROUTINE update_outputs_physiq_diag
+
+END MODULE update_outputs_physiq_mod
+
+
+
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/variables_mod.F
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/variables_mod.F	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/phys/dynphy_wrf_titan_lmd_new/variables_mod.F	(revision 2295)
@@ -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/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/share/module_model_constants.F
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/share/module_model_constants.F	(revision 2294)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/share/module_model_constants.F	(revision 2295)
@@ -260,4 +260,21 @@
      TT00=460.
      nu=0.35
+    ELSE if ( planet == "titan") then
+     g            = 1.35
+     r_d          = 290.6
+     !cpp          = 1000.
+     cp           = 1051.
+     cliq         = 4190.
+     psat         = 610.78
+     t0           = 94. ! earth : 300
+     p0           = 1.45e5
+     p1000mb      = 1.45e5
+     reradius     = 1./2575500.0 ! Rayon de mars (m)  ~6051800 m
+     rad          = 2575500.0
+     wmugaz       = 28.6
+     womeg        = 0.2992549E-06 !!!!!!!!!!!!!!!!!!!
+     wdaysec      = 1377665.28
+     TT00=0.
+     nu=0.
     ELSE if (( planet == "prescribed").or.(planet == "generic")) then
      open(17,file='planet_constant',form='formatted',status='old')
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/arch
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/arch	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/arch	(revision 2295)
@@ -0,0 +1,1 @@
+link ../../../../../LMDZ.COMMON/arch/
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/build_gcm
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/build_gcm	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/build_gcm	(revision 2295)
@@ -0,0 +1,1 @@
+link ../../../../../LMDZ.COMMON/build_gcm
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/ioipsl
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/ioipsl	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/ioipsl	(revision 2295)
@@ -0,0 +1,1 @@
+link ../../../../../LMDZ.COMMON/ioipsl/
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/chimtitan
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/chimtitan	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/chimtitan	(revision 2295)
@@ -0,0 +1,1 @@
+link ../libf_gcm/chimtitan/
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/dyn3d
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/dyn3d	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/dyn3d	(revision 2295)
@@ -0,0 +1,1 @@
+link ../libf_gcm/dyn3d
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/filtrez
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/filtrez	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/filtrez	(revision 2295)
@@ -0,0 +1,1 @@
+link ../libf_gcm/filtrez/
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/grid
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/grid	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/grid	(revision 2295)
@@ -0,0 +1,1 @@
+link ../libf_gcm/grid/
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/phy_common
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/phy_common	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/phy_common	(revision 2295)
@@ -0,0 +1,1 @@
+link ../libf_gcm/phy_common/
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/phytitan
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/phytitan	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf/phytitan	(revision 2295)
@@ -0,0 +1,1 @@
+link ../libf_gcm/phytitan/
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf_gcm
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf_gcm	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/libf_gcm	(revision 2295)
@@ -0,0 +1,1 @@
+link ../../../../../LMDZ.COMMON/libf
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makegcm
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makegcm	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makegcm	(revision 2295)
@@ -0,0 +1,1 @@
+link ../../../../../LMDZ.COMMON/makegcm
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makelmdz
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makelmdz	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makelmdz	(revision 2295)
@@ -0,0 +1,1 @@
+link ../../../../../LMDZ.COMMON/makelmdz
Index: /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makelmdz_fcm
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makelmdz_fcm	(revision 2295)
+++ /trunk/MESOSCALE/LMD_MM_MARS/SRC/WRFV2/titan_lmd_new/makelmdz_fcm	(revision 2295)
@@ -0,0 +1,1 @@
+link ../../../../../LMDZ.COMMON/makelmdz_fcm
Index: /trunk/MESOSCALE/LMD_MM_MARS/makemeso
===================================================================
--- /trunk/MESOSCALE/LMD_MM_MARS/makemeso	(revision 2294)
+++ /trunk/MESOSCALE/LMD_MM_MARS/makemeso	(revision 2295)
@@ -76,4 +76,5 @@
 #             venus_lmd_new
 #             generic_lmd_new              
+#             titan_lmd_new
 #
 # makemeso -f                ## fresh start [clean -a]
@@ -695,4 +696,7 @@
   then
     cd libf/phystd
+  elif [[ "${phys}" == *"titan"* ]]
+  then
+    cd libf/phytitan
   fi
   \rm dimphys.h 2> /dev/null
@@ -749,4 +753,8 @@
       echo 'DEBUG DEBUG DEBUG DEBUG'
       nohup ./makelmdz -debug -t ${tra} -p std -b 36x32 -s 1 -d 25 rcm1d -arch X64_MESU -cpp MESOSCALE | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys #Proxb
+    elif [[ "${phys}" == *"titan"* ]]
+    then
+      echo 'DEBUG DEBUG DEBUG DEBUG'
+      nohup makelmdz -debug -full -t ${tra} -p titan -b 23x23 -d 25 rcm1d -cpp MESOSCALE | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
     fi
   else
@@ -769,4 +777,7 @@
       nohup ./makelmdz -t 1 -p std -b 38x36 -full -s 1 -d 25 rcm1d -arch mascaret_gfortran_para -cpp MESOSCALE | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys #Proxb
       nohup ./makelmdz -t 1 -p std -b 38x36 -s 1 -d 25 rcm1d -arch mascaret_gfortran_para -cpp MESOSCALE | tee libo/log_compile_phys2 | grep 'warnings' >> libo/log_compile_phys2 #Proxb
+    elif [[ "${phys}" == *"titan"* ]]
+    then
+      nohup makelmdz -full -t ${tra} -p titan -b 23x23 -d 25 rcm1d -cpp MESOSCALE | tee libo/log_compile_phys | grep 'warnings' >> libo/log_compile_phys
     fi
   fi
@@ -806,4 +817,11 @@
    then
    ar x libphystd.a
+   ar x libmisc.a
+   ar x libphy_common.a
+   ar x libioipsl.a
+  elif [[ "${phys}" == *"titan"* ]]
+  then
+   ar x libchimtitan.a
+   ar x libphytitan.a
    ar x libmisc.a
    ar x libphy_common.a
