Index: trunk/LMDZ.GENERIC/README
===================================================================
--- trunk/LMDZ.GENERIC/README	(revision 952)
+++ trunk/LMDZ.GENERIC/README	(revision 955)
@@ -933,2 +933,6 @@
   (particularly exchanges heat+momentum exchanges between surface and atmosphere)
 - added possibility to add an internal heat flux
+
+== 10/05/2013 == EM
+- moved the 'makbands' script from "grid" to (more appropriate) "phystd/bands"
+  subdirectory, and consequently adapted the makegcm_* scripts
Index: trunk/LMDZ.GENERIC/libf/grid/dimension/bands.2.4
===================================================================
--- trunk/LMDZ.GENERIC/libf/grid/dimension/bands.2.4	(revision 952)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!-----------------------------------------------------------------------
-!   INCLUDE 'bands.h'
-!
-!   bands.h contains the visible & infrared bands in the model
-!
-!   NBinfrared = L_NSPECTI in the model
-!   NBvisible  = L_NSPECTV in the model
-!-----------------------------------------------------------------------
-
-      INTEGER, parameter :: NBinfrared=2
-      INTEGER, parameter :: NBvisible=4
-
-
-!-----------------------------------------------------------------------
Index: trunk/LMDZ.GENERIC/libf/grid/dimension/bands.32.36
===================================================================
--- trunk/LMDZ.GENERIC/libf/grid/dimension/bands.32.36	(revision 952)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!-----------------------------------------------------------------------
-!   INCLUDE 'bands.h'
-!
-!   bands.h contains the visible & infrared bands in the model
-!
-!   NBinfrared = L_NSPECTI in the model
-!   NBvisible  = L_NSPECTV in the model
-!-----------------------------------------------------------------------
-
-      INTEGER, parameter :: NBinfrared=32
-      INTEGER, parameter :: NBvisible=36
-
-
-!-----------------------------------------------------------------------
Index: trunk/LMDZ.GENERIC/libf/grid/dimension/bands.38.36
===================================================================
--- trunk/LMDZ.GENERIC/libf/grid/dimension/bands.38.36	(revision 952)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!-----------------------------------------------------------------------
-!   INCLUDE 'bands.h'
-!
-!   bands.h contains the visible & infrared bands in the model
-!
-!   NBinfrared = L_NSPECTI in the model
-!   NBvisible  = L_NSPECTV in the model
-!-----------------------------------------------------------------------
-
-      INTEGER, parameter :: NBinfrared=38
-      INTEGER, parameter :: NBvisible=36
-
-
-!-----------------------------------------------------------------------
Index: trunk/LMDZ.GENERIC/libf/grid/dimension/bands.8.12
===================================================================
--- trunk/LMDZ.GENERIC/libf/grid/dimension/bands.8.12	(revision 952)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!-----------------------------------------------------------------------
-!   INCLUDE 'bands.h'
-!
-!   bands.h contains the visible & infrared bands in the model
-!
-!   NBinfrared = L_NSPECTI in the model
-!   NBvisible  = L_NSPECTV in the model
-!-----------------------------------------------------------------------
-
-      INTEGER, parameter :: NBinfrared=8
-      INTEGER, parameter :: NBvisible=12
-
-
-!-----------------------------------------------------------------------
Index: trunk/LMDZ.GENERIC/libf/grid/dimension/bands.8.7
===================================================================
--- trunk/LMDZ.GENERIC/libf/grid/dimension/bands.8.7	(revision 952)
+++ 	(revision )
@@ -1,14 +1,0 @@
-!-----------------------------------------------------------------------
-!   INCLUDE 'bands.h'
-!
-!   bands.h contains the visible & infrared bands in the model
-!
-!   NBinfrared = L_NSPECTI in the model
-!   NBvisible  = L_NSPECTV in the model
-!-----------------------------------------------------------------------
-
-      INTEGER, parameter :: NBinfrared=8
-      INTEGER, parameter :: NBvisible=7
-
-
-!-----------------------------------------------------------------------
Index: trunk/LMDZ.GENERIC/libf/grid/dimension/makbands
===================================================================
--- trunk/LMDZ.GENERIC/libf/grid/dimension/makbands	(revision 952)
+++ 	(revision )
@@ -1,41 +1,0 @@
-#!/bin/bash
-
-for i in $* ; do
-   list=$list.$i
-done
-fichdim=bands${list}
-
-if [ ! -f $fichdim ] ; then
-# if the file doesn't exist, we create it
-
- if [ $# -ge 2 ] ; then
-      NBinfrared=$1
-      NBvisible=$2
- else
-      echo "you need bands in IR and in the visible"
-      exit
- fi
-
-cat << EOF > $fichdim
-!-----------------------------------------------------------------------
-!   INCLUDE 'bands.h'
-!
-!   bands.h contains the visible & infrared bands in the model
-!
-!   NBinfrared = L_NSPECTI in the model
-!   NBvisible  = L_NSPECTV in the model
-!-----------------------------------------------------------------------
-
-      INTEGER, parameter :: NBinfrared=$NBinfrared
-      INTEGER, parameter :: NBvisible=$NBvisible
-
-
-!-----------------------------------------------------------------------
-EOF
-
-else
- echo "bands file already exists!"
-fi
-
-\rm ../bands.h
-tar cf - $fichdim | ( cd .. ; tar xf - ; mv $fichdim bands.h )
Index: trunk/LMDZ.GENERIC/libf/phystd/bands/makbands
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/bands/makbands	(revision 955)
+++ trunk/LMDZ.GENERIC/libf/phystd/bands/makbands	(revision 955)
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+for i in $* ; do
+   list=$list.$i
+done
+fichdim=bands${list}
+
+if [ ! -f $fichdim ] ; then
+# if the file doesn't exist, we create it
+
+ if [ $# -ge 2 ] ; then
+      NBinfrared=$1
+      NBvisible=$2
+ else
+      echo "you need bands in IR and in the visible"
+      exit
+ fi
+
+cat << EOF > $fichdim
+!-----------------------------------------------------------------------
+!   INCLUDE 'bands.h'
+!
+!   bands.h contains the visible & infrared bands in the model
+!
+!   NBinfrared = L_NSPECTI in the model
+!   NBvisible  = L_NSPECTV in the model
+!-----------------------------------------------------------------------
+
+      INTEGER, parameter :: NBinfrared=$NBinfrared
+      INTEGER, parameter :: NBvisible=$NBvisible
+
+
+!-----------------------------------------------------------------------
+EOF
+
+else
+ echo "bands file already exists!"
+fi
+
+\rm ../bands.h
+tar cf - $fichdim | ( cd .. ; tar xf - ; mv $fichdim bands.h )
Index: trunk/LMDZ.GENERIC/libf/phystd/physiq.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/physiq.F90	(revision 952)
+++ trunk/LMDZ.GENERIC/libf/phystd/physiq.F90	(revision 955)
@@ -529,5 +529,11 @@
          ice_update=.false.
          if(sourceevol)then
-            open(128,file='num_run',form='formatted')
+            open(128,file='num_run',form='formatted', &
+                     status="old",iostat=ierr)
+            if (ierr.ne.0) then
+              write(*,*) "physiq: Error! No num_run file!"
+              write(*,*) " (which is needed for sourceevol option)"
+              stop
+            endif
             read(128,*) num_run 
             close(128)
Index: trunk/LMDZ.GENERIC/makegcm_g95
===================================================================
--- trunk/LMDZ.GENERIC/makegcm_g95	(revision 952)
+++ trunk/LMDZ.GENERIC/makegcm_g95	(revision 955)
@@ -518,4 +518,5 @@
     \rm -f $libf/grid/dimensions.h
     \rm -f $libf/grid/bands.h
+    \rm -f $libf/phy${physique}/bands.h
     \rm -f $libf/phy${physique}/scatterers.h
   else
@@ -526,12 +527,13 @@
 # Build the appropriate 'dimensions.h' file
 cd dimension
-makdim $ntrac $dim
+./makdim $ntrac $dim
 # echo contents of dimensions.h to standard output
 cat $libf/grid/dimensions.h
 
 # Build the appropriate 'bands.h' file
-makbands $bands
+cd $libf/phy$physique/bands
+./makbands $bands
 # echo contents of bands.h to standard output
-cat $libf/grid/bands.h
+cat $libf/phy$physique/bands.h
 
 # Build the appropriate 'scatterers.h' file
@@ -777,3 +779,4 @@
 \rm -f $libf/grid/dimensions.h
 \rm -f $libf/grid/bands.h
+\rm -f $libf/phy${physique}/bands.h
 \rm -f $libf/phy$physique/scatterers.h
Index: trunk/LMDZ.GENERIC/makegcm_gfortran
===================================================================
--- trunk/LMDZ.GENERIC/makegcm_gfortran	(revision 952)
+++ trunk/LMDZ.GENERIC/makegcm_gfortran	(revision 955)
@@ -523,4 +523,5 @@
     \rm -f $libf/grid/dimensions.h
     \rm -f $libf/grid/bands.h
+    \rm -f $libf/phy${physique}/bands.h
     \rm -f $libf/phy${physique}/scatterers.h
   else
@@ -536,7 +537,8 @@
 
 # Build the appropriate 'bands.h' file
+cd $libf/phy$physique/bands
 ./makbands $bands
 # echo contents of bands.h to standard output
-cat $libf/grid/bands.h
+cat $libf/phy$physique/bands.h
 
 # Build the appropriate 'scatterers.h' file
@@ -790,3 +792,4 @@
 \rm -f $libf/grid/dimensions.h
 \rm -f $libf/grid/bands.h
+\rm -f $libf/phy$physique/bands.h
 \rm -f $libf/phy$physique/scatterers.h
Index: trunk/LMDZ.GENERIC/makegcm_ifort
===================================================================
--- trunk/LMDZ.GENERIC/makegcm_ifort	(revision 952)
+++ trunk/LMDZ.GENERIC/makegcm_ifort	(revision 955)
@@ -525,4 +525,5 @@
     \rm -f $libf/grid/dimensions.h
     \rm -f $libf/grid/bands.h
+    \rm -f $libf/phy${physique}/bands.h
     \rm -f $libf/phy${physique}/scatterers.h
   else
@@ -533,12 +534,13 @@
 # Build the appropriate 'dimensions.h' file
 cd dimension
-makdim $ntrac $dim
+./makdim $ntrac $dim
 # echo contents of dimensions.h to standard output
 cat $libf/grid/dimensions.h
 
 # Build the appropriate 'bands.h' file
-makbands $bands
+cd $libf/phy$physique/bands
+./makbands $bands
 # echo contents of bands.h to standard output
-cat $libf/grid/bands.h
+cat $libf/phy$physique/bands.h
 
 # Build the appropriate 'scatterers.h' file
@@ -790,3 +792,4 @@
 \rm -f $libf/grid/dimensions.h
 \rm -f $libf/grid/bands.h
+\rm -f $libf/phy${physique}/bands.h
 \rm -f $libf/phy$physique/scatterers.h
Index: trunk/LMDZ.GENERIC/makegcm_pgf90
===================================================================
--- trunk/LMDZ.GENERIC/makegcm_pgf90	(revision 952)
+++ trunk/LMDZ.GENERIC/makegcm_pgf90	(revision 955)
@@ -520,4 +520,5 @@
     \rm -f $libf/grid/dimensions.h
     \rm -f $libf/grid/bands.h
+    \rm -f $libf/phy${physique}/bands.h
     \rm -f $libf/phy${physique}/scatterers.h
   else
@@ -528,12 +529,13 @@
 # Build the appropriate 'dimensions.h' file
 cd dimension
-makdim $ntrac $dim
+./makdim $ntrac $dim
 # echo contents of dimensions.h to standard output
 cat $libf/grid/dimensions.h
 
 # Build the appropriate 'bands.h' file
-makbands $bands
+cd $libf/phy$physique/bands
+./makbands $bands
 # echo contents of bands.h to standard output
-cat $libf/grid/bands.h
+cat $libf/phy$physique/bands.h
 
 # Build the appropriate 'scatterers.h' file
@@ -787,3 +789,4 @@
 \rm -f $libf/grid/dimensions.h
 \rm -f $libf/grid/bands.h
+\rm -f $libf/phy$physique/bands.h
 \rm -f $libf/phy$physique/scatterers.h
