Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 2319)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/TRA/trabbc.F90	(revision 2325)
@@ -2,14 +2,12 @@
    !!==============================================================================
    !!                       ***  MODULE  trabbc  ***
-   !! Ocean active tracers:  bottom boundary condition
+   !! Ocean active tracers:  bottom boundary condition (geothermal heat flux)
    !!==============================================================================
-   !! History :  8.1  ! 99-10 (G. Madec)  original code
-   !!            8.5  ! 02-08 (G. Madec)  free form + modules
-   !!            8.5  ! 02-11 (A. Bozec)  tra_bbc_init: original code
+   !! History :  OPA  ! 1999-10 (G. Madec)  original code
+   !!   NEMO     1.0  ! 2002-08 (G. Madec)  free form + modules
+   !!             -   ! 2002-11 (A. Bozec)  tra_bbc_init: original code
+   !!            3.3  ! 2010-10 (G. Madec)  dynamical allocation + suppression of key_trabbc
    !!----------------------------------------------------------------------
-#if   defined key_trabbc   ||   defined key_esopa
-   !!----------------------------------------------------------------------
-   !!   'key_trabbc'                                  geothermal heat flux
-   !!----------------------------------------------------------------------
+
    !!   tra_bbc      : update the tracer trend at ocean bottom 
    !!   tra_bbc_init : initialization of geothermal heat flux trend
@@ -29,13 +27,11 @@
    PUBLIC tra_bbc_init     ! routine called by opa.F90
 
-   !! to be transfert in the namelist ???!   
-   LOGICAL, PUBLIC, PARAMETER ::   lk_trabbc = .TRUE.   !: bbc flag
+   !                                                !!* Namelist nambbc: bottom boundary condition *
+   LOGICAL, PUBLIC ::   ln_trabbc     = .FALSE.      !: Geothermal heat flux flag
+   INTEGER         ::   nn_geoflx     = 1            !  Geothermal flux (=1:constant flux, =2:read in file )
+   REAL(wp)        ::   rn_geoflx_cst = 86.4e-3_wp   !  Constant value of geothermal heat flux
 
-   !                                         !!* Namelist nambbc: bottom boundary condition *
-   INTEGER  ::   nn_geoflx     = 1            ! Geothermal flux (0:no flux, 1:constant flux, 2:read in file )
-   REAL(wp) ::   rn_geoflx_cst = 86.4e-3      ! Constant value of geothermal heat flux
-
-   INTEGER , DIMENSION(jpi,jpj)         ::   nbotlevt   ! ocean bottom level index at T-pt
-   REAL(wp), PUBLIC, DIMENSION(jpi,jpj) ::   qgh_trd0   ! geothermal heating trend
+   INTEGER , DIMENSION(:,:), ALLOCATABLE ::   nbotlevt   ! ocean bottom level index at T-pt
+   REAL(wp), DIMENSION(:,:), ALLOCATABLE ::   qgh_trd0   ! geothermal heating trend
  
    !! * Substitutions
@@ -43,8 +39,7 @@
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
-   !! $Id$ 
-   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !! $Id $ 
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
 
@@ -76,36 +71,29 @@
       INTEGER  ::   ji, jj, ik    ! dummy loop indices
       REAL(wp) ::   zqgh_trd  ! geothermal heat flux trend
-      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt, ztrds
+      REAL(wp), DIMENSION(:,:,:), ALLOCATABLE ::  ztrdt
       !!----------------------------------------------------------------------
 
       IF( l_trdtra )   THEN         ! Save ta and sa trends
          ALLOCATE( ztrdt(jpi,jpj,jpk) )     ;   ztrdt(:,:,:) = tsa(:,:,:,jp_tem)
-         ALLOCATE( ztrds(jpi,jpj,jpk) )     ;   ztrds(:,:,:) = 0.
       ENDIF
 
-      ! Add the geothermal heat flux trend on temperature
-
-      SELECT CASE ( nn_geoflx )
-      !
-      CASE ( 1:2 )                !  geothermal heat flux
+      !                             !  Add the geothermal heat flux trend on temperature
 #if defined key_vectopt_loop
-         DO jj = 1, 1
-            DO ji = jpi+2, jpij-jpi-1   ! vector opt. (forced unrolling)
+      DO jj = 1, 1
+         DO ji = jpi+2, jpij-jpi-1   ! vector opt. (forced unrolling)
 #else
-         DO jj = 2, jpjm1
-            DO ji = 2, jpim1
+      DO jj = 2, jpjm1
+         DO ji = 2, jpim1
 #endif
-               ik = nbotlevt(ji,jj)
-               zqgh_trd = ro0cpr * qgh_trd0(ji,jj) / fse3t(ji,jj,ik)
-               tsa(ji,jj,ik,jp_tem) = tsa(ji,jj,ik,jp_tem) + zqgh_trd
-            END DO
+            ik = nbotlevt(ji,jj)
+            zqgh_trd = qgh_trd0(ji,jj) / fse3t(ji,jj,ik)
+            tsa(ji,jj,ik,jp_tem) = tsa(ji,jj,ik,jp_tem) + zqgh_trd
          END DO
-      END SELECT
+      END DO
 
       IF( l_trdtra ) THEN        ! Save the geothermal heat flux trend for diagnostics
          ztrdt(:,:,:) = tsa(:,:,:,jp_tem) - ztrdt(:,:,:)
          CALL trd_tra( kt, 'TRA', jp_tem, jptra_trd_bbc, ztrdt )
-         CALL trd_tra( kt, 'TRA', jp_sal, jptra_trd_bbc, ztrds )
-         DEALLOCATE( ztrdt )   ;     DEALLOCATE( ztrds )
+         DEALLOCATE( ztrdt )
       ENDIF
       !
@@ -136,5 +124,5 @@
       INTEGER  ::   inum                ! temporary logical unit
       !!
-      NAMELIST/nambbc/nn_geoflx, rn_geoflx_cst 
+      NAMELIST/nambbc/ln_trabbc, nn_geoflx, rn_geoflx_cst 
       !!----------------------------------------------------------------------
 
@@ -142,60 +130,51 @@
       READ   ( numnam, nambbc )
 
-      IF(lwp) THEN                   ! Control print
+      IF(lwp) THEN                     ! Control print
          WRITE(numout,*)
-         WRITE(numout,*) 'tra_bbc : temperature Bottom Boundary Condition (bbc), Geothermal heatflux'
+         WRITE(numout,*) 'tra_bbc : Bottom Boundary Condition (bbc), apply a Geothermal heating'
          WRITE(numout,*) '~~~~~~~   '
          WRITE(numout,*) '   Namelist nambbc : set bbc parameters'
-         WRITE(numout,*) '      Geothermal flux            nn_geoflx     = ', nn_geoflx
-         WRITE(numout,*) '      Constant geothermal flux   rn_geoflx_cst = ', rn_geoflx_cst
+         WRITE(numout,*) '      Apply a geothermal heating at ocean bottom   ln_trabbc     = ', ln_trabbc
+         WRITE(numout,*) '      type of geothermal flux                      nn_geoflx     = ', nn_geoflx
+         WRITE(numout,*) '      Constant geothermal flux value               rn_geoflx_cst = ', rn_geoflx_cst
          WRITE(numout,*)
       ENDIF
 
-      !                              ! level of the ocean bottom at T-point
-      DO jj = 1, jpj
-         DO ji = 1, jpi
-            nbotlevt(ji,jj) = MAX( mbathy(ji,jj)-1, 1 )
+      IF( ln_trabbc ) THEN             !==  geothermal heating  ==!
+         !
+         ALLOCATE( nbotlevt(jpi,jpj) )    ! allocation
+         ALLOCATE( qgh_trd0(jpi,jpj) )     
+         !             
+         DO jj = 1, jpj                   ! level of the ocean bottom at T-point
+            DO ji = 1, jpi
+               nbotlevt(ji,jj) = MAX( mbathy(ji,jj)-1, 1 )
+            END DO
          END DO
-      END DO
-
-      SELECT CASE ( nn_geoflx )      ! initialization of geothermal heat flux
-      !
-      CASE ( 0 )                ! no geothermal heat flux
-         IF(lwp) WRITE(numout,*) '      *** no geothermal heat flux'
          !
-      CASE ( 1 )                ! constant flux
-         IF(lwp) WRITE(numout,*) '      *** constant heat flux  =   ', rn_geoflx_cst
+         SELECT CASE ( nn_geoflx )        ! geothermal heat flux / (rauO * Cp)
          !
-         qgh_trd0(:,:) = rn_geoflx_cst
+         CASE ( 1 )                          !* constant flux
+            IF(lwp) WRITE(numout,*) '      *** constant heat flux  =   ', rn_geoflx_cst
+            qgh_trd0(:,:) = ro0cpr * rn_geoflx_cst
+            !
+         CASE ( 2 )                          !* variable geothermal heat flux : read the geothermal fluxes in mW/m2
+            IF(lwp) WRITE(numout,*) '      *** variable geothermal heat flux'
+            CALL iom_open ( 'geothermal_heating.nc', inum )
+            CALL iom_get  ( inum, jpdom_data, 'heatflow', qgh_trd0 )
+            CALL iom_close( inum )
+            qgh_trd0(:,:) = ro0cpr * qgh_trd0(:,:) * 1.e-3     ! conversion in W/m2
+            !
+         CASE DEFAULT
+            WRITE(ctmp1,*) '     bad flag value for nn_geoflx = ', nn_geoflx
+            CALL ctl_stop( ctmp1 )
+            !
+         END SELECT
          !
-      CASE ( 2 )                ! variable geothermal heat flux : read the geothermal fluxes in mW/m2
-         IF(lwp) WRITE(numout,*) '      *** variable geothermal heat flux'
-         CALL iom_open ( 'geothermal_heating.nc', inum )
-         CALL iom_get  ( inum, jpdom_data, 'heatflow', qgh_trd0 )
-         CALL iom_close( inum )
-         !
-         qgh_trd0(:,:) = qgh_trd0(:,:) * 1.e-3 ! conversion in W/m2
-         !
-      CASE DEFAULT
-         WRITE(ctmp1,*) '     bad flag value for nn_geoflx = ', nn_geoflx
-         CALL ctl_stop( ctmp1 )
-         !
-      END SELECT
+      ELSE
+            IF(lwp) WRITE(numout,*) '      *** no geothermal heat flux'
+      ENDIF
       !
    END SUBROUTINE tra_bbc_init
 
-#else
-   !!----------------------------------------------------------------------
-   !!   Default option                                         Empty module
-   !!----------------------------------------------------------------------
-   LOGICAL, PUBLIC, PARAMETER ::   lk_trabbc = .FALSE.  !: bbc flag
-CONTAINS
-   SUBROUTINE tra_bbc( kt )           ! Empty routine
-      WRITE(*,*) 'tra_bbc: You should not have seen this print! error?', kt
-   END SUBROUTINE tra_bbc
-   SUBROUTINE tra_bbc_init           ! Empty routine
-   END SUBROUTINE tra_bbc_init
-#endif
-
    !!======================================================================
 END MODULE trabbc
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/opa.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/opa.F90	(revision 2319)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/opa.F90	(revision 2325)
@@ -288,5 +288,5 @@
       !                                     ! Active tracers
                             CALL tra_qsr_init   ! penetrative solar radiation qsr
-      IF( lk_trabbc     )   CALL tra_bbc_init   ! bottom heat flux
+                            CALL tra_bbc_init   ! bottom heat flux
       IF( lk_trabbl     )   CALL tra_bbl_init   ! advective (and/or diffusive) bottom boundary layer scheme
       IF( lk_tradmp     )   CALL tra_dmp_init   ! internal damping trends
Index: branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 2319)
+++ branches/nemo_v3_3_beta/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 2325)
@@ -191,5 +191,5 @@
                              CALL tra_sbc    ( kstp )       ! surface boundary condition
       IF( ln_traqsr      )   CALL tra_qsr    ( kstp )       ! penetrative solar radiation qsr
-      IF( lk_trabbc      )   CALL tra_bbc    ( kstp )       ! bottom heat flux
+      IF( ln_trabbc      )   CALL tra_bbc    ( kstp )       ! bottom heat flux
       IF( lk_trabbl      )   CALL tra_bbl    ( kstp )       ! advective (and/or diffusive) bottom boundary layer scheme
       IF( lk_tradmp      )   CALL tra_dmp    ( kstp )       ! internal damping trends
