Index: trunk/libf/dyn3d/comconst.h
===================================================================
--- trunk/libf/dyn3d/comconst.h	(revision 37)
+++ trunk/libf/dyn3d/comconst.h	(revision 53)
@@ -11,5 +11,5 @@
      &                   ,dissip_factz,dissip_deltaz,dissip_zref        &
      &                   ,tau_top_bound,                                &
-     & daylen,year_day,molmass
+     & daylen,year_day,molmass, ihf
       COMMON/cpdetvenus/nu_venus,t0_venus
 
@@ -36,4 +36,5 @@
 
       REAL nu_venus,t0_venus ! coeffs needed for Cp(T), Venus atmosphere
+      REAL ihf  ! (W/m2) intrinsic heat flux for giant planets
 
 
Index: trunk/libf/dyn3d/conf_planete.F90
===================================================================
--- trunk/libf/dyn3d/conf_planete.F90	(revision 37)
+++ trunk/libf/dyn3d/conf_planete.F90	(revision 53)
@@ -64,3 +64,11 @@
 CALL getin('omeg',omeg)
 
+! Intrinsic heat flux [default is none]
+! Aymeric -- for giant planets
+! [matters only if planet_type="giant"]
+ihf = 0.
+CALL getin('ihf',ihf)
+
+
+
 END SUBROUTINE conf_planete
Index: trunk/libf/dyn3d/iniacademic.F
===================================================================
--- trunk/libf/dyn3d/iniacademic.F	(revision 37)
+++ trunk/libf/dyn3d/iniacademic.F	(revision 53)
@@ -96,4 +96,7 @@
 ! --------------------------------------
 c
+
+        print *, 'This is iniacademic' 
+
         ! initialize planet radius, rotation rate,...
         call conf_planete
@@ -155,4 +158,6 @@
           teta0=315.     ! mean Teta (S.H. 315K)
           CALL getin('teta0',teta0)
+          print *, 'iniacademic - teta0 ', teta0
+          print *, 'iniacademic - rad ', rad
           ttp=200.       ! Tropopause temperature (S.H. 200K)
           CALL getin('ttp',ttp)
@@ -200,4 +205,14 @@
              tetajl(j,l)=teta0-delt_y*ddsin*ddsin+eps*ddsin
      &           -delt_z*(1.-ddsin*ddsin)*log(zsig)
+             !! Aymeric -- tests particuliers
+             if (planet_type=="giant") then
+             tetajl(j,l)=teta0+(delt_y*
+     &          ((sin(rlatu(j)*3.14159*eps+0.0001))**2)
+     &          / ((rlatu(j)*3.14159*eps+0.0001)**2))
+     &          -delt_z*log(zsig)
+!!!             ddsin=sin(2.5*3.14159*rlatu(j))
+!!!             tetajl(j,l)=teta0-delt_y*ddsin*ddsin
+!!!!     &           -delt_z*(1.-ddsin*ddsin)*log(zsig)
+             endif
              ! Profil stratospherique isotherme (+vortex)
              w_pv=(1.-tanh((rlatu(j)-phi_pv)/dphi_pv))/2.
@@ -217,4 +232,5 @@
             enddo
           enddo
+          PRINT *, 'iniacademic - check',tetajl(:,int(llm/2)),rlatu(:)
 
 
Index: trunk/libf/dyn3d/leapfrog.F
===================================================================
--- trunk/libf/dyn3d/leapfrog.F	(revision 37)
+++ trunk/libf/dyn3d/leapfrog.F	(revision 53)
@@ -472,5 +472,20 @@
         ENDDO ! of DO l=1,llm 
           call friction(ucov,vcov,dtvr)
-        
+    
+       if (planet_type.eq."giant") then
+          ! Intrinsic heat flux
+          ! Aymeric -- for giant planets
+          if (ihf .gt. 1.e-6) then
+          !print *, '**** INTRINSIC HEAT FLUX ****', ihf 
+            DO ij=1,ip1jmp1
+              teta(ij,1) = teta(ij,1)
+     &        + dtvr * aire(ij) * ihf / cpp / masse(ij,1)
+            ENDDO
+          !print *, '**** d teta ' 
+          !print *, dtvr * aire(ijb:ije) * ihf / cpp / masse(ijb:ije,1)
+          endif
+       endif
+
+    
         ! Sponge layer (if any)
         IF (ok_strato) THEN
