Index: trunk/LMDZ.GENERIC/README
===================================================================
--- trunk/LMDZ.GENERIC/README	(revision 542)
+++ trunk/LMDZ.GENERIC/README	(revision 543)
@@ -595,2 +595,6 @@
 - kcm1d no longer consistent with new code, but I haven't updated as I'm still working on it
   and as far as I know noone else uses it. If that changes let me know.
+
+== 27/02/2012 == AS
+- Temperature grid for Planck calculations can now be refined through the parameter NTfac in radinc_h. 
+  Default is NTfac = 1.0D-1, i.e. Delta T = 0.1 K
Index: trunk/LMDZ.GENERIC/libf/phystd/gfluxi.F
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/gfluxi.F	(revision 542)
+++ trunk/LMDZ.GENERIC/libf/phystd/gfluxi.F	(revision 543)
@@ -62,5 +62,5 @@
  
 
-      IF (NLL .GT. NLP) STOP 'PARAMETER NL TOO SMALL IN GFLUXV'
+      IF (NLL .GT. NLP) STOP 'PARAMETER NL TOO SMALL IN GFLUXI'
 
       NLAYER = L_NLAYRAD
@@ -72,6 +72,6 @@
         !NT2   = TLEV(2*L+2)*10.0D0-499
         !NT    = TLEV(2*L)*10.0D0-499
-        NT    = int(TLEV(2*L)*10.0D0)   - NTstar+1
-        NT2   = int(TLEV(2*L+2)*10.0D0) - NTstar+1
+        NT    = int(TLEV(2*L)*NTfac)   - NTstar+1
+        NT2   = int(TLEV(2*L+2)*NTfac) - NTstar+1
 
         B1(L) = (PLANCKIR(NW,NT2)-PLANCKIR(NW,NT))/DTAU(L)
@@ -87,6 +87,6 @@
       !NT    = TLEV(2*L+1)*10.0D0-499
       !NT2   = TLEV(2*L)*10.0D0-499
-      NT    = int(TLEV(2*L+1)*10.0D0) - NTstar+1
-      NT2   = int(TLEV(2*L)*10.0D0)   - NTstar+1
+      NT    = int(TLEV(2*L+1)*NTfac) - NTstar+1
+      NT2   = int(TLEV(2*L)*NTfac)   - NTstar+1
       B1(L) = (PLANCKIR(NW,NT)-PLANCKIR(NW,NT2))/DTAU(L)
       B0(L) = PLANCKIR(NW,NT2)
Index: trunk/LMDZ.GENERIC/libf/phystd/radinc_h.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/radinc_h.F90	(revision 542)
+++ trunk/LMDZ.GENERIC/libf/phystd/radinc_h.F90	(revision 543)
@@ -73,7 +73,14 @@
 
       ! For Planck function integration: 
-      ! equivalent temperatures are 1/10 of these values
+      ! equivalent temperatures are 1/NTfac of these values
       integer, parameter :: NTstar = 500
       integer, parameter :: NTstop = 9000 ! new default for all non hot Jupiter runs
+      real*8, parameter :: NTfac = 1.0D+1  
+      !integer, parameter :: NTstar = 1000
+      !integer, parameter :: NTstop = 25000
+      !real*8,parameter :: NTfac = 5.0D+1    
+      !integer, parameter :: NTstar = 2000
+      !integer, parameter :: NTstop = 50000
+      !real*8,parameter :: NTfac = 1.0D+2    
 
       ! Maximum number of grain size classes for aerosol convolution:
Index: trunk/LMDZ.GENERIC/libf/phystd/setspi.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/setspi.F90	(revision 542)
+++ trunk/LMDZ.GENERIC/libf/phystd/setspi.F90	(revision 543)
@@ -22,5 +22,5 @@
 !==================================================================
 
-      use radinc_h,    only: L_NSPECTI,corrkdir,banddir,NTstar,NTstop
+      use radinc_h,    only: L_NSPECTI,corrkdir,banddir,NTstar,NTstop,NTfac
       use radcommon_h, only: BWNI,BLAMI,WNOI,DWNI,WAVEI,planckir,sigma
       use datafile_mod, only: datadir
@@ -139,5 +139,5 @@
       print*,''
       print*,'setspi: Current Planck integration range:'
-      print*,'T = ',dble(NTstar)/1.0D+1, ' to ',dble(NTstop)/1.0D+1,' K.'
+      print*,'T = ',dble(NTstar)/NTfac, ' to ',dble(NTstop)/NTfac,' K.'
 
       do NW=1,L_NSPECTI
@@ -147,5 +147,5 @@
          bma = (b-a)/2.0
          do nt=NTstar,NTstop
-            T   = dble(NT)/1.0D+1
+            T   = dble(NT)/NTfac
             ans = 0.0D0
 
@@ -164,5 +164,5 @@
          do nt=NTstar,NTstop
             plancksum=0.0
-            T=dble(NT)/1.0D+1
+            T=dble(NT)/NTfac
        
             do NW=1,L_NSPECTI
@@ -174,5 +174,5 @@
                planckir(NW,nt-NTstar+1)=     &
                   planckir(NW,nt-NTstar+1)*  &
-                          sigma*(dble(nt)/1.0D+1)**4/plancksum
+                          sigma*(dble(nt)/NTfac)**4/plancksum
             end do
          end do
@@ -188,5 +188,5 @@
          print*,'setspi: At lower limit:'
          print*,'in model sig*T^4 = ',plancksum,' W m^-2'
-         print*,'actual sig*T^4   = ',sigma*(dble(nt)/1.0D+1)**4,' W m^-2'
+         print*,'actual sig*T^4   = ',sigma*(dble(nt)/NTfac)**4,' W m^-2'
          
          ! check energy conservation at upper temperature boundary
@@ -198,5 +198,5 @@
          print*,'setspi: At upper limit:'
          print*,'in model sig*T^4 = ',plancksum,' W m^-2'
-         print*,'actual sig*T^4   = ',sigma*(dble(nt)/1.0D+1)**4,' W m^-2'
+         print*,'actual sig*T^4   = ',sigma*(dble(nt)/NTfac)**4,' W m^-2'
          print*,''
       endif
Index: trunk/LMDZ.GENERIC/libf/phystd/sfluxi.F
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/sfluxi.F	(revision 542)
+++ trunk/LMDZ.GENERIC/libf/phystd/sfluxi.F	(revision 543)
@@ -67,6 +67,6 @@
       TSURF = TLEV(L_LEVELS)
 
-      NTS   = int(TSURF*10.0D0)-NTstar+1
-      NTT   = int(TTOP *10.0D0)-NTstar+1
+      NTS   = int(TSURF*NTfac)-NTstar+1
+      NTT   = int(TTOP *NTfac)-NTstar+1
 !      NTS   = TSURF*10.0D0-499
 !      NTT   = TTOP *10.0D0-499
